mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02:00
https://linear.app/unleash/issue/2-2439/create-new-integration-events-endpoint https://linear.app/unleash/issue/2-2436/create-new-integration-event-openapi-schemas This adds a new `/events` endpoint to the Addons API, allowing us to fetch integration events for a specific integration configuration id.  Also includes: - `IntegrationEventsSchema`: New schema to represent the response object of the list of integration events; - `yarn schema:update`: New `package.json` script to update the OpenAPI spec file; - `BasePaginationParameters`: This is copied from Enterprise. After merging this we should be able to refactor Enterprise to use this one instead of the one it has, so we don't repeat ourselves; We're also now correctly representing the BIGSERIAL as BigInt (string + pattern) in our OpenAPI schema. Otherwise our validation would complain, since we're saying it's a number in the schema but in fact returning a string.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { FromSchema } from 'json-schema-to-ts';
|
|
import { eventSchema } from './event-schema';
|
|
import { tagSchema } from './tag-schema';
|
|
import { variantSchema } from './variant-schema';
|
|
import { integrationEventSchema } from './integration-event-schema';
|
|
|
|
export const integrationEventsSchema = {
|
|
$id: '#/components/schemas/integrationEventsSchema',
|
|
description: 'A response model with a list of integration events.',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['integrationEvents'],
|
|
properties: {
|
|
integrationEvents: {
|
|
type: 'array',
|
|
description: 'A list of integration events.',
|
|
items: {
|
|
$ref: integrationEventSchema.$id,
|
|
},
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
integrationEventSchema,
|
|
eventSchema,
|
|
tagSchema,
|
|
variantSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type IntegrationEventsSchema = FromSchema<
|
|
typeof integrationEventsSchema
|
|
>;
|