90 lines
1.8 KiB
TypeScript
90 lines
1.8 KiB
TypeScript
import { ExtEventsAggregateParamsSchema } from "@api/events/aggregate/eventsAggregateParams.js";
|
|
import {
|
|
EVENTS_AGGREGATE_EXAMPLE,
|
|
EventsAggregateResponseSchema,
|
|
} from "@api/events/aggregate/eventsAggregateResponse.js";
|
|
import { ApiEventsListParamsSchema } from "@api/events/list/eventsListParams.js";
|
|
import {
|
|
ApiEventsListResponseSchema,
|
|
EVENTS_LIST_EXAMPLE,
|
|
} from "@api/events/list/eventsListResponse.js";
|
|
import type { ZodOpenApiPathsObject } from "zod-openapi";
|
|
|
|
export const eventsOpenApi: ZodOpenApiPathsObject = {
|
|
"/events/list": {
|
|
post: {
|
|
summary: "List Events",
|
|
tags: ["events"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": {
|
|
schema: ApiEventsListParamsSchema,
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "",
|
|
content: {
|
|
"application/json": {
|
|
schema: ApiEventsListResponseSchema.meta({
|
|
example: EVENTS_LIST_EXAMPLE,
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/events/aggregate": {
|
|
post: {
|
|
summary: "Aggregate Events",
|
|
tags: ["events"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": {
|
|
schema: ExtEventsAggregateParamsSchema,
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "",
|
|
content: {
|
|
"application/json": {
|
|
schema: EventsAggregateResponseSchema.meta({
|
|
example: EVENTS_AGGREGATE_EXAMPLE,
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
// LEGACY
|
|
"/query": {
|
|
post: {
|
|
summary: "Query Analytics Aggregation",
|
|
tags: ["analytics"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": {
|
|
schema: ExtEventsAggregateParamsSchema,
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "Analytics aggregation results",
|
|
content: {
|
|
"application/json": {
|
|
schema: EventsAggregateResponseSchema,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|