Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

2.3 KB
Raw Blame
// Generated by `pnpm openapi:contracts`. Do not edit directly.

import type { ZodOpenApiOperationObject } from 'zod-openapi';
import { defineOperation } from '@/openapi/operation';

const operation1 = defineOperation({
  method: 'post',
  path: '/api/batch',
  audience: 'collect',
  auth: 'none',
  operation: {
    operationId: 'batch',
    summary: 'Create or update batch',
    tags: ['Collection'],
    requestBody: {
      required: true,
      content: {
        'application/json': {
          schema: {
            type: 'array',
            items: {
              type: 'object',
              additionalProperties: true,
            },
            maxItems: 500,
          },
        },
      },
    },
    responses: {
      '200': {
        description: 'The operation completed successfully.',
        content: {
          'application/json': {
            schema: {
              type: 'object',
              properties: {
                size: {},
                processed: {
                  type: 'number',
                },
                errors: {
                  type: 'number',
                },
                details: {
                  type: 'array',
                  items: {},
                },
                cache: {},
              },
              required: ['size', 'processed', 'errors', 'details', 'cache'],
            },
          },
        },
      },
      '400': {
        description: 'Bad request.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Bad request.',
                code: 'bad-request',
                status: 400,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
      '500': {
        description: 'Server error.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Server error.',
                code: 'server-error',
                status: 500,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
    },
  } as ZodOpenApiOperationObject,
});

export const operations = [operation1] as const;