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.

14.4 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: 'get',
  path: '/api/pixels/{pixelId}/shares',
  audience: 'public',
  auth: 'bearer-or-share',
  operation: {
    operationId: 'getPixelShares',
    summary: 'Get pixels pixel id shares',
    tags: ['Pixels'],
    parameters: [
      {
        name: 'pixelId',
        in: 'path',
        required: true,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'path',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'referrer',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'title',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'query',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'os',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'browser',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'device',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'country',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'region',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'city',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'tag',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'hostname',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'distinctId',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'language',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'event',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'utmSource',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'utmMedium',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'utmCampaign',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'utmContent',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'utmTerm',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'excludeBounce',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
        },
      },
      {
        name: 'segment',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
          format: 'uuid',
        },
      },
      {
        name: 'cohort',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
          format: 'uuid',
        },
      },
      {
        name: 'eventType',
        in: 'query',
        required: false,
        schema: {
          type: 'integer',
          minimum: 1,
        },
      },
      {
        name: 'match',
        in: 'query',
        required: false,
        schema: {
          type: 'string',
          enum: ['all', 'any'],
        },
      },
      {
        name: 'page',
        in: 'query',
        required: false,
        schema: {
          type: 'integer',
          minimum: 1,
        },
      },
      {
        name: 'pageSize',
        in: 'query',
        required: false,
        schema: {
          type: 'integer',
          minimum: 1,
        },
      },
      {
        name: 'maxResults',
        in: 'query',
        required: false,
        schema: {
          type: 'integer',
          minimum: 1,
        },
      },
    ],
    responses: {
      '200': {
        description: 'The operation completed successfully.',
        content: {
          'application/json': {
            schema: {
              type: 'object',
              properties: {
                data: {
                  type: 'array',
                  items: {
                    type: 'object',
                    properties: {
                      id: {
                        type: 'string',
                      },
                      createdAt: {
                        type: 'string',
                        format: 'date-time',
                      },
                      updatedAt: {
                        type: 'string',
                        format: 'date-time',
                      },
                      name: {
                        type: 'string',
                      },
                      slug: {
                        type: 'string',
                      },
                      parameters: {
                        anyOf: [
                          {
                            type: 'string',
                          },
                          {
                            type: 'number',
                          },
                          {
                            const: false,
                          },
                          {
                            const: true,
                          },
                          {
                            type: 'object',
                            properties: {},
                            additionalProperties: {
                              anyOf: [
                                {
                                  type: 'string',
                                },
                                {
                                  type: 'number',
                                },
                                {
                                  const: false,
                                },
                                {
                                  const: true,
                                },
                                {},
                                {
                                  type: 'object',
                                  properties: {
                                    length: {
                                      type: 'number',
                                    },
                                  },
                                  required: ['length'],
                                },
                              ],
                            },
                          },
                          {
                            type: 'object',
                            properties: {
                              length: {
                                type: 'number',
                              },
                            },
                            required: ['length'],
                          },
                        ],
                      },
                      entityId: {
                        type: 'string',
                      },
                      shareType: {
                        type: 'number',
                      },
                    },
                    required: [
                      'id',
                      'createdAt',
                      'updatedAt',
                      'name',
                      'slug',
                      'parameters',
                      'entityId',
                      'shareType',
                    ],
                  },
                },
                count: {
                  type: 'number',
                },
                page: {
                  type: 'number',
                },
                pageSize: {
                  type: 'number',
                },
                orderBy: {
                  type: 'string',
                },
                sortDescending: {
                  type: 'boolean',
                },
                search: {
                  type: 'string',
                },
                isCapped: {
                  type: 'boolean',
                },
              },
              required: ['data', 'count', 'page', 'pageSize'],
            },
          },
        },
      },
      '400': {
        description: 'Bad request.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Bad request.',
                code: 'bad-request',
                status: 400,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
      '401': {
        description: 'Unauthorized.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Unauthorized.',
                code: 'unauthorized',
                status: 401,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
    },
  } as ZodOpenApiOperationObject,
});

const operation2 = defineOperation({
  method: 'post',
  path: '/api/pixels/{pixelId}/shares',
  audience: 'public',
  auth: 'bearer',
  operation: {
    operationId: 'createPixelShare',
    summary: 'Create or update pixels pixel id shares',
    tags: ['Pixels'],
    parameters: [
      {
        name: 'pixelId',
        in: 'path',
        required: true,
        schema: {
          type: 'string',
        },
      },
    ],
    requestBody: {
      required: true,
      content: {
        'application/json': {
          schema: {
            type: 'object',
            properties: {
              name: {
                type: 'string',
                maxLength: 200,
              },
              parameters: {
                type: 'object',
                additionalProperties: true,
              },
            },
            required: ['name'],
          },
        },
      },
    },
    responses: {
      '200': {
        description: 'The operation completed successfully.',
        content: {
          'application/json': {
            schema: {
              type: 'object',
              properties: {
                id: {
                  type: 'string',
                },
                createdAt: {
                  type: 'string',
                  format: 'date-time',
                },
                updatedAt: {
                  type: 'string',
                  format: 'date-time',
                },
                name: {
                  type: 'string',
                },
                slug: {
                  type: 'string',
                },
                parameters: {
                  anyOf: [
                    {
                      type: 'string',
                    },
                    {
                      type: 'number',
                    },
                    {
                      const: false,
                    },
                    {
                      const: true,
                    },
                    {
                      type: 'object',
                      properties: {},
                      additionalProperties: {
                        anyOf: [
                          {
                            type: 'string',
                          },
                          {
                            type: 'number',
                          },
                          {
                            const: false,
                          },
                          {
                            const: true,
                          },
                          {},
                          {
                            type: 'object',
                            properties: {
                              length: {
                                type: 'number',
                              },
                            },
                            required: ['length'],
                          },
                        ],
                      },
                    },
                    {
                      type: 'object',
                      properties: {
                        length: {
                          type: 'number',
                        },
                      },
                      required: ['length'],
                    },
                  ],
                },
                entityId: {
                  type: 'string',
                },
                shareType: {
                  type: 'number',
                },
              },
              required: [
                'id',
                'createdAt',
                'updatedAt',
                'name',
                'slug',
                'parameters',
                'entityId',
                'shareType',
              ],
            },
          },
        },
      },
      '400': {
        description: 'Bad request.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Bad request.',
                code: 'bad-request',
                status: 400,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
      '401': {
        description: 'Unauthorized.',
        content: {
          'application/json': {
            example: {
              error: {
                message: 'Unauthorized.',
                code: 'unauthorized',
                status: 401,
              },
            },
            schema: {
              $ref: '#/components/schemas/ApiError',
            },
          },
        },
      },
    },
  } as ZodOpenApiOperationObject,
});

export const operations = [operation1, operation2] as const;