@lcas58/esmi-api-types 1.0.8 → 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.
Files changed (52) hide show
  1. package/dist/src/routes/events/events.handlers.d.ts +2 -18
  2. package/dist/src/routes/events/events.handlers.js +24 -154
  3. package/dist/src/routes/events/events.index.d.ts +47 -442
  4. package/dist/src/routes/events/events.index.js +1 -3
  5. package/dist/src/routes/events/events.routes.d.ts +347 -1194
  6. package/dist/src/routes/events/events.routes.js +11 -53
  7. package/dist/src/routes/events/schemas/event.schemas.d.ts +173 -824
  8. package/dist/src/routes/events/schemas/event.schemas.js +26 -46
  9. package/dist/src/routes/events/schemas/index.d.ts +1 -1
  10. package/dist/src/routes/events/schemas/index.js +1 -1
  11. package/dist/src/routes/leagues/leagues.handlers.js +2 -1
  12. package/dist/src/routes/marketing/marketing.index.d.ts +15 -15
  13. package/dist/src/routes/marketing/marketing.routes.d.ts +5 -5
  14. package/dist/src/routes/organizations/organizations.index.d.ts +6 -6
  15. package/dist/src/routes/sports/sports.handlers.d.ts +4 -0
  16. package/dist/src/routes/sports/sports.handlers.js +23 -0
  17. package/dist/src/routes/sports/sports.index.d.ts +45 -0
  18. package/dist/src/routes/sports/sports.index.js +7 -0
  19. package/dist/src/routes/sports/sports.routes.d.ts +90 -0
  20. package/dist/src/routes/sports/sports.routes.js +27 -0
  21. package/dist/src/routes/webhooks/webhooks.handlers.d.ts +3 -0
  22. package/dist/src/routes/webhooks/webhooks.handlers.js +14 -0
  23. package/dist/src/routes/webhooks/webhooks.index.d.ts +32 -0
  24. package/dist/src/routes/webhooks/webhooks.index.js +6 -0
  25. package/dist/src/routes/webhooks/webhooks.routes.d.ts +65 -0
  26. package/dist/src/routes/webhooks/webhooks.routes.js +26 -0
  27. package/dist/src/shared/client-types.d.ts +3 -16
  28. package/dist/src/shared/client-types.js +0 -12
  29. package/package.json +25 -32
  30. package/dist/src/app.d.ts +0 -2
  31. package/dist/src/app.js +0 -22
  32. package/dist/src/db/schema/event.d.ts +0 -264
  33. package/dist/src/db/schema/event.js +0 -38
  34. package/dist/src/db/schema/index.d.ts +0 -8
  35. package/dist/src/db/schema/index.js +0 -8
  36. package/dist/src/db/schema/league.d.ts +0 -261
  37. package/dist/src/db/schema/league.js +0 -27
  38. package/dist/src/db/schema/location.d.ts +0 -239
  39. package/dist/src/db/schema/location.js +0 -22
  40. package/dist/src/db/schema/marketing.d.ts +0 -77
  41. package/dist/src/db/schema/marketing.js +0 -16
  42. package/dist/src/db/schema/organization.d.ts +0 -882
  43. package/dist/src/db/schema/organization.js +0 -174
  44. package/dist/src/db/schema/pickup.d.ts +0 -417
  45. package/dist/src/db/schema/pickup.js +0 -42
  46. package/dist/src/db/schema/tag.d.ts +0 -261
  47. package/dist/src/db/schema/tag.js +0 -55
  48. package/dist/src/db/schema/user.d.ts +0 -597
  49. package/dist/src/db/schema/user.js +0 -45
  50. package/dist/src/lib/types.d.ts +0 -14
  51. package/dist/src/shared/index.d.ts +0 -7
  52. package/dist/src/shared/index.js +0 -28
@@ -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, jsonContentRequired } from "stoker/openapi/helpers";
4
- import { createErrorSchema } from "stoker/openapi/schemas";
5
- import { notFoundSchema, unauthorizedSchema } from "../../lib/constants.js";
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(eventsListResponseSchema, "The list of events"),
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 create = createRoute({
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
- query: z.object({
61
- organizationId: z.string(),
22
+ params: z.object({
23
+ id: z.string(),
62
24
  }),
63
25
  },
64
26
  responses: {
65
- [HttpStatusCodes.OK]: jsonContent(countStatsResponseSchema, "The count stats"),
66
- [HttpStatusCodes.UNPROCESSABLE_ENTITY]: jsonContent(createErrorSchema(z.object({
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
  });