@lcas58/esmi-api-types 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/routes/events/events.handlers.d.ts +2 -18
- package/dist/src/routes/events/events.handlers.js +24 -154
- package/dist/src/routes/events/events.index.d.ts +47 -442
- package/dist/src/routes/events/events.index.js +1 -3
- package/dist/src/routes/events/events.routes.d.ts +347 -1194
- package/dist/src/routes/events/events.routes.js +11 -53
- package/dist/src/routes/events/schemas/event.schemas.d.ts +173 -824
- package/dist/src/routes/events/schemas/event.schemas.js +26 -46
- package/dist/src/routes/events/schemas/index.d.ts +1 -1
- package/dist/src/routes/events/schemas/index.js +1 -1
- package/dist/src/routes/marketing/marketing.index.d.ts +14 -14
- package/dist/src/routes/marketing/marketing.routes.d.ts +5 -5
- package/dist/src/routes/sports/sports.handlers.d.ts +4 -0
- package/dist/src/routes/sports/sports.handlers.js +23 -0
- package/dist/src/routes/sports/sports.index.d.ts +45 -0
- package/dist/src/routes/sports/sports.index.js +7 -0
- package/dist/src/routes/sports/sports.routes.d.ts +90 -0
- package/dist/src/routes/sports/sports.routes.js +27 -0
- package/dist/src/routes/webhooks/webhooks.routes.d.ts +1 -0
- package/dist/src/routes/webhooks/webhooks.routes.js +2 -0
- package/dist/src/shared/client-types.d.ts +2 -4
- package/package.json +1 -1
|
@@ -1,72 +1,30 @@
|
|
|
1
1
|
import { createRoute, z } from "@hono/zod-openapi";
|
|
2
2
|
import * as HttpStatusCodes from "stoker/http-status-codes";
|
|
3
|
-
import { jsonContent
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { uuidParamsSchema } from "../../lib/openapi-schemas.js";
|
|
7
|
-
import { isAuth } from "../../middlewares/is-auth.js";
|
|
8
|
-
import { createEventSchema, eventResponseSchema, eventsListResponseSchema, listEventsQuerySchema, patchEventSchema, } from "./schemas/index.js";
|
|
9
|
-
import { countStatsResponseSchema } from "./schemas/event.schemas.js";
|
|
10
|
-
const tags = ["Events"];
|
|
3
|
+
import { jsonContent } from "stoker/openapi/helpers";
|
|
4
|
+
import { notFoundSchema } from "../../lib/constants.js";
|
|
5
|
+
import { eventWithRelationsSchema, listEventsQuerySchema } from "./schemas/index.js";
|
|
11
6
|
export const list = createRoute({
|
|
12
7
|
path: "/events",
|
|
13
8
|
method: "get",
|
|
14
|
-
tags,
|
|
9
|
+
tags: ["Events"],
|
|
15
10
|
request: {
|
|
16
11
|
query: listEventsQuerySchema,
|
|
17
12
|
},
|
|
18
13
|
responses: {
|
|
19
|
-
[HttpStatusCodes.OK]: jsonContent(
|
|
20
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(notFoundSchema, "No events found"),
|
|
21
|
-
[HttpStatusCodes.UNPROCESSABLE_ENTITY]: jsonContent(createErrorSchema(listEventsQuerySchema), "Invalid query parameters error"),
|
|
14
|
+
[HttpStatusCodes.OK]: jsonContent(z.array(eventWithRelationsSchema), "List of events"),
|
|
22
15
|
},
|
|
23
16
|
});
|
|
24
|
-
export const
|
|
25
|
-
path: "/events",
|
|
26
|
-
method: "post",
|
|
27
|
-
tags,
|
|
28
|
-
middleware: [isAuth()],
|
|
29
|
-
request: {
|
|
30
|
-
body: jsonContentRequired(createEventSchema, "The event to create"),
|
|
31
|
-
},
|
|
32
|
-
responses: {
|
|
33
|
-
[HttpStatusCodes.CREATED]: jsonContent(eventResponseSchema, "The created event"),
|
|
34
|
-
[HttpStatusCodes.UNPROCESSABLE_ENTITY]: jsonContent(createErrorSchema(createEventSchema), "The validation error(s)"),
|
|
35
|
-
[HttpStatusCodes.UNAUTHORIZED]: jsonContent(unauthorizedSchema, "Unauthorized"),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
export const patch = createRoute({
|
|
17
|
+
export const getOne = createRoute({
|
|
39
18
|
path: "/events/{id}",
|
|
40
|
-
method: "patch",
|
|
41
|
-
tags,
|
|
42
|
-
middleware: [isAuth()],
|
|
43
|
-
request: {
|
|
44
|
-
params: uuidParamsSchema("id"),
|
|
45
|
-
body: jsonContentRequired(patchEventSchema, "The event to update"),
|
|
46
|
-
},
|
|
47
|
-
responses: {
|
|
48
|
-
[HttpStatusCodes.OK]: jsonContent(eventResponseSchema, "The updated event"),
|
|
49
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(notFoundSchema, "Event not found"),
|
|
50
|
-
[HttpStatusCodes.UNPROCESSABLE_ENTITY]: jsonContent(createErrorSchema(uuidParamsSchema("id"))
|
|
51
|
-
.or(createErrorSchema(patchEventSchema)), "The validation error(s)"),
|
|
52
|
-
[HttpStatusCodes.UNAUTHORIZED]: jsonContent(unauthorizedSchema, "Unauthorized"),
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
export const getCountStats = createRoute({
|
|
56
|
-
path: "/events/count-stats",
|
|
57
19
|
method: "get",
|
|
58
|
-
tags,
|
|
20
|
+
tags: ["Events"],
|
|
59
21
|
request: {
|
|
60
|
-
|
|
61
|
-
|
|
22
|
+
params: z.object({
|
|
23
|
+
id: z.string(),
|
|
62
24
|
}),
|
|
63
25
|
},
|
|
64
26
|
responses: {
|
|
65
|
-
[HttpStatusCodes.OK]: jsonContent(
|
|
66
|
-
[HttpStatusCodes.
|
|
67
|
-
organizationId: z.string(),
|
|
68
|
-
})), "Invalid organizationId error"),
|
|
69
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(notFoundSchema, "No count stats found for the given organization"),
|
|
70
|
-
[HttpStatusCodes.UNAUTHORIZED]: jsonContent(unauthorizedSchema, "Unauthorized"),
|
|
27
|
+
[HttpStatusCodes.OK]: jsonContent(eventWithRelationsSchema, "Event details"),
|
|
28
|
+
[HttpStatusCodes.NOT_FOUND]: jsonContent(notFoundSchema, "Event not found"),
|
|
71
29
|
},
|
|
72
30
|
});
|