@lcas58/esmi-api-types 1.0.25 → 1.0.27

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 (33) hide show
  1. package/dist/src/routes/events/events.handlers.js +21 -4
  2. package/dist/src/routes/events/events.index.d.ts +26 -21
  3. package/dist/src/routes/events/events.routes.d.ts +62 -47
  4. package/dist/src/routes/events/events.routes.js +3 -2
  5. package/dist/src/routes/events/schemas/event.schemas.d.ts +17 -8
  6. package/dist/src/routes/events/schemas/event.schemas.js +3 -0
  7. package/package.json +1 -1
  8. package/dist/src/routes/events/discover.handlers.d.ts +0 -3
  9. package/dist/src/routes/events/discover.handlers.js +0 -15
  10. package/dist/src/routes/events/discover.index.d.ts +0 -72
  11. package/dist/src/routes/events/discover.index.js +0 -6
  12. package/dist/src/routes/events/discover.routes.d.ts +0 -333
  13. package/dist/src/routes/events/discover.routes.js +0 -26
  14. package/dist/src/routes/leagues/leagues.handlers.d.ts +0 -3
  15. package/dist/src/routes/leagues/leagues.handlers.js +0 -50
  16. package/dist/src/routes/leagues/leagues.index.d.ts +0 -53
  17. package/dist/src/routes/leagues/leagues.index.js +0 -6
  18. package/dist/src/routes/leagues/leagues.routes.d.ts +0 -137
  19. package/dist/src/routes/leagues/leagues.routes.js +0 -47
  20. package/dist/src/routes/organizations/organizations.handlers.d.ts +0 -74
  21. package/dist/src/routes/organizations/organizations.handlers.js +0 -485
  22. package/dist/src/routes/organizations/organizations.index.d.ts +0 -517
  23. package/dist/src/routes/organizations/organizations.index.js +0 -12
  24. package/dist/src/routes/organizations/organizations.routes.d.ts +0 -1236
  25. package/dist/src/routes/organizations/organizations.routes.js +0 -137
  26. package/dist/src/routes/organizations/tasks.test.d.ts +0 -0
  27. package/dist/src/routes/organizations/tasks.test.js +0 -181
  28. package/dist/src/routes/tags/tags.handlers.d.ts +0 -3
  29. package/dist/src/routes/tags/tags.handlers.js +0 -15
  30. package/dist/src/routes/tags/tags.index.d.ts +0 -24
  31. package/dist/src/routes/tags/tags.index.js +0 -6
  32. package/dist/src/routes/tags/tags.routes.d.ts +0 -68
  33. package/dist/src/routes/tags/tags.routes.js +0 -25
@@ -1,137 +0,0 @@
1
- import { z } from "@hono/zod-openapi";
2
- export declare const list: {
3
- path: "/leagues/{locationId}";
4
- method: "get";
5
- tags: string[];
6
- request: {
7
- params: z.ZodObject<{
8
- [x: string]: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- [x: string]: string;
11
- }, {
12
- [x: string]: string;
13
- }>;
14
- };
15
- responses: {
16
- 200: {
17
- content: {
18
- "application/json": {
19
- schema: z.ZodArray<z.ZodObject<{
20
- name: z.ZodString;
21
- description: z.ZodNullable<z.ZodString>;
22
- formattedAddress: z.ZodString;
23
- type: z.ZodString;
24
- organization: z.ZodObject<{
25
- name: z.ZodString;
26
- description: z.ZodString;
27
- ownerName: z.ZodString;
28
- }, "strip", z.ZodTypeAny, {
29
- description: string;
30
- name: string;
31
- ownerName: string;
32
- }, {
33
- description: string;
34
- name: string;
35
- ownerName: string;
36
- }>;
37
- mode: z.ZodString;
38
- ageGroup: z.ZodString;
39
- gender: z.ZodString;
40
- status: z.ZodString;
41
- numberOfTeams: z.ZodNumber;
42
- scheduleDays: z.ZodNullable<z.ZodString>;
43
- scheduleTimes: z.ZodNullable<z.ZodString>;
44
- startDate: z.ZodDate;
45
- endDate: z.ZodDate;
46
- season: z.ZodNullable<z.ZodString>;
47
- registrationStart: z.ZodNullable<z.ZodDate>;
48
- registrationEnd: z.ZodNullable<z.ZodDate>;
49
- teamFee: z.ZodNullable<z.ZodNumber>;
50
- tags: z.ZodArray<z.ZodObject<{
51
- id: z.ZodString;
52
- name: z.ZodString;
53
- }, "strip", z.ZodTypeAny, {
54
- id: string;
55
- name: string;
56
- }, {
57
- id: string;
58
- name: string;
59
- }>, "many">;
60
- }, "strip", z.ZodTypeAny, {
61
- status: string;
62
- type: string;
63
- description: string | null;
64
- name: string;
65
- formattedAddress: string;
66
- organization: {
67
- description: string;
68
- name: string;
69
- ownerName: string;
70
- };
71
- mode: string;
72
- ageGroup: string;
73
- gender: string;
74
- tags: {
75
- id: string;
76
- name: string;
77
- }[];
78
- numberOfTeams: number;
79
- scheduleDays: string | null;
80
- scheduleTimes: string | null;
81
- startDate: Date;
82
- endDate: Date;
83
- season: string | null;
84
- registrationStart: Date | null;
85
- registrationEnd: Date | null;
86
- teamFee: number | null;
87
- }, {
88
- status: string;
89
- type: string;
90
- description: string | null;
91
- name: string;
92
- formattedAddress: string;
93
- organization: {
94
- description: string;
95
- name: string;
96
- ownerName: string;
97
- };
98
- mode: string;
99
- ageGroup: string;
100
- gender: string;
101
- tags: {
102
- id: string;
103
- name: string;
104
- }[];
105
- numberOfTeams: number;
106
- scheduleDays: string | null;
107
- scheduleTimes: string | null;
108
- startDate: Date;
109
- endDate: Date;
110
- season: string | null;
111
- registrationStart: Date | null;
112
- registrationEnd: Date | null;
113
- teamFee: number | null;
114
- }>, "many">;
115
- };
116
- };
117
- description: string;
118
- };
119
- 404: {
120
- content: {
121
- "application/json": {
122
- schema: z.ZodObject<{
123
- message: z.ZodString;
124
- }, "strip", z.ZodTypeAny, {
125
- message: string;
126
- }, {
127
- message: string;
128
- }>;
129
- };
130
- };
131
- description: string;
132
- };
133
- };
134
- } & {
135
- getRoutingPath(): "/leagues/:locationId";
136
- };
137
- export type ListRoute = typeof list;
@@ -1,47 +0,0 @@
1
- import { createRoute, z } from "@hono/zod-openapi";
2
- import * as HttpStatusCodes from "stoker/http-status-codes";
3
- import { jsonContent } from "stoker/openapi/helpers";
4
- import { selectEventSchema, selectLeaguesSchema, selectLocationSchema, selectOrganizationSchema, selectTagsSchema, selectUserSchema } from "../../db/schema/index.js";
5
- import { notFoundSchema } from "../../lib/constants.js";
6
- import { uuidParamsSchema } from "../../lib/openapi-schemas.js";
7
- const tags = ["Leagues"];
8
- const leagueSchema = z.object({
9
- name: selectEventSchema.shape.name,
10
- description: selectEventSchema.shape.description,
11
- formattedAddress: selectLocationSchema.shape.formattedAddress,
12
- type: selectEventSchema.shape.type,
13
- organization: z.object({
14
- name: selectOrganizationSchema.shape.name,
15
- description: selectOrganizationSchema.shape.description,
16
- ownerName: selectUserSchema.shape.name,
17
- }),
18
- mode: selectEventSchema.shape.mode,
19
- ageGroup: selectEventSchema.shape.ageGroup,
20
- gender: selectEventSchema.shape.gender,
21
- status: selectEventSchema.shape.status,
22
- numberOfTeams: selectLeaguesSchema.shape.numberOfTeams,
23
- scheduleDays: selectLeaguesSchema.shape.scheduleDays,
24
- scheduleTimes: selectLeaguesSchema.shape.scheduleTimes,
25
- startDate: selectLeaguesSchema.shape.startDate,
26
- endDate: selectLeaguesSchema.shape.endDate,
27
- season: selectLeaguesSchema.shape.season,
28
- registrationStart: selectLeaguesSchema.shape.registrationStart,
29
- registrationEnd: selectLeaguesSchema.shape.registrationEnd,
30
- teamFee: selectLeaguesSchema.shape.teamFee,
31
- tags: z.array(z.object({
32
- id: selectTagsSchema.shape.id,
33
- name: selectTagsSchema.shape.name,
34
- })),
35
- });
36
- export const list = createRoute({
37
- path: "/leagues/{locationId}",
38
- method: "get",
39
- tags,
40
- request: {
41
- params: uuidParamsSchema("locationId"),
42
- },
43
- responses: {
44
- [HttpStatusCodes.OK]: jsonContent(z.array(leagueSchema), "The list of leagues for the given location"),
45
- [HttpStatusCodes.NOT_FOUND]: jsonContent(notFoundSchema, "No leagues found for the given location"),
46
- },
47
- });
@@ -1,74 +0,0 @@
1
- import type { AppRouteHandler } from "../../lib/types.js";
2
- import type { CheckOrganizationNameRoute, CheckOwnershipRoute, CreateRoute, GetOneRoute, ListRoute, PatchRoute, RemoveRoute } from "./organizations.routes.js";
3
- /**
4
- * Retrieves a single organization by ID
5
- *
6
- * @description Fetches an organization with all related data (tags, websites, social media).
7
- * Only the organization owner can access the full details.
8
- *
9
- * @param c - Hono context containing request data and environment
10
- * @returns Organization data with related entities or error response
11
- */
12
- export declare const getOne: AppRouteHandler<GetOneRoute>;
13
- /**
14
- * Lists organizations with optional filtering
15
- *
16
- * @description Retrieves a list of organizations with support for filtering by:
17
- * - ownerId: Filter by organization owner
18
- * - city, state, country: Filter by location (case-insensitive partial match)
19
- *
20
- * @param c - Hono context containing query parameters
21
- * @returns Array of organizations with related data
22
- */
23
- export declare const list: AppRouteHandler<ListRoute>;
24
- /**
25
- * Creates a new organization with related data
26
- *
27
- * @description Creates an organization along with optional tags, websites, and social media.
28
- * Uses a database transaction to ensure data consistency.
29
- *
30
- * @param c - Hono context containing organization data and authenticated user
31
- * @returns Created organization data or error response
32
- */
33
- export declare const create: AppRouteHandler<CreateRoute>;
34
- /**
35
- * Updates an existing organization and its related data
36
- *
37
- * @description Performs partial updates to an organization including related entities.
38
- * Uses replace strategy for tags, websites, and social media (delete all, insert new).
39
- *
40
- * @param c - Hono context containing organization ID and update data
41
- * @returns Updated organization data or error response
42
- */
43
- export declare const patch: AppRouteHandler<PatchRoute>;
44
- /**
45
- * Deletes an organization and all related data
46
- *
47
- * @description Removes an organization from the database. Due to CASCADE constraints,
48
- * all related data (websites, social media, tags) will be automatically deleted.
49
- *
50
- * @param c - Hono context containing organization ID
51
- * @returns 204 No Content on success or 404 Not Found if organization doesn't exist
52
- */
53
- export declare const remove: AppRouteHandler<RemoveRoute>;
54
- /**
55
- * Checks if the authenticated user owns the specified organization
56
- *
57
- * @description Verifies ownership without returning organization data.
58
- * Used for authorization checks in the frontend.
59
- *
60
- * @param c - Hono context containing organization ID and authenticated user
61
- * @returns Ownership status (true/false) or 404 if organization doesn't exist
62
- */
63
- export declare const checkOwnership: AppRouteHandler<CheckOwnershipRoute>;
64
- /**
65
- * Checks if an organization name is available
66
- *
67
- * @description Verifies if the provided name is unique in the database.
68
- * When taken, returns similar available slugs using pg_trgm similarity.
69
- * Used for name validation in the frontend.
70
- *
71
- * @param c - Hono context containing organization name
72
- * @returns Availability status and suggestions if taken
73
- */
74
- export declare const checkOrganizationName: AppRouteHandler<CheckOrganizationNameRoute>;