@lcas58/esmi-api-types 1.0.7 → 1.0.9

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 (36) hide show
  1. package/dist/src/routes/events/events.index.d.ts +4 -4
  2. package/dist/src/routes/leagues/leagues.handlers.js +2 -1
  3. package/dist/src/routes/marketing/marketing.index.d.ts +1 -1
  4. package/dist/src/routes/organizations/organizations.index.d.ts +6 -6
  5. package/dist/src/routes/webhooks/webhooks.handlers.d.ts +3 -0
  6. package/dist/src/routes/webhooks/webhooks.handlers.js +14 -0
  7. package/dist/src/routes/webhooks/webhooks.index.d.ts +32 -0
  8. package/dist/src/routes/webhooks/webhooks.index.js +6 -0
  9. package/dist/src/routes/webhooks/webhooks.routes.d.ts +64 -0
  10. package/dist/src/routes/webhooks/webhooks.routes.js +24 -0
  11. package/dist/src/shared/client-types.d.ts +2 -13
  12. package/dist/src/shared/client-types.js +0 -12
  13. package/package.json +25 -32
  14. package/dist/src/app.d.ts +0 -1158
  15. package/dist/src/app.js +0 -22
  16. package/dist/src/db/schema/event.d.ts +0 -264
  17. package/dist/src/db/schema/event.js +0 -38
  18. package/dist/src/db/schema/index.d.ts +0 -8
  19. package/dist/src/db/schema/index.js +0 -8
  20. package/dist/src/db/schema/league.d.ts +0 -261
  21. package/dist/src/db/schema/league.js +0 -27
  22. package/dist/src/db/schema/location.d.ts +0 -239
  23. package/dist/src/db/schema/location.js +0 -22
  24. package/dist/src/db/schema/marketing.d.ts +0 -77
  25. package/dist/src/db/schema/marketing.js +0 -16
  26. package/dist/src/db/schema/organization.d.ts +0 -882
  27. package/dist/src/db/schema/organization.js +0 -174
  28. package/dist/src/db/schema/pickup.d.ts +0 -417
  29. package/dist/src/db/schema/pickup.js +0 -42
  30. package/dist/src/db/schema/tag.d.ts +0 -261
  31. package/dist/src/db/schema/tag.js +0 -55
  32. package/dist/src/db/schema/user.d.ts +0 -597
  33. package/dist/src/db/schema/user.js +0 -45
  34. package/dist/src/lib/types.d.ts +0 -14
  35. package/dist/src/shared/index.d.ts +0 -7
  36. package/dist/src/shared/index.js +0 -28
@@ -87,7 +87,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
87
87
  issues: {
88
88
  code: string;
89
89
  path: (string | number)[];
90
- message?: string | undefined;
90
+ message?: string | undefined | undefined;
91
91
  }[];
92
92
  name: string;
93
93
  };
@@ -127,7 +127,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
127
127
  issues: {
128
128
  code: string;
129
129
  path: (string | number)[];
130
- message?: string | undefined;
130
+ message?: string | undefined | undefined;
131
131
  }[];
132
132
  name: string;
133
133
  };
@@ -311,7 +311,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
311
311
  issues: {
312
312
  code: string;
313
313
  path: (string | number)[];
314
- message?: string | undefined;
314
+ message?: string | undefined | undefined;
315
315
  }[];
316
316
  name: string;
317
317
  };
@@ -461,7 +461,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
461
461
  issues: {
462
462
  code: string;
463
463
  path: (string | number)[];
464
- message?: string | undefined;
464
+ message?: string | undefined | undefined;
465
465
  }[];
466
466
  name: string;
467
467
  };
@@ -33,13 +33,14 @@ export const list = async (c) => {
33
33
  tags: sql `array_agg(json_build_object('id', ${tags.id}, 'name', ${tags.name}))`.as("tags"),
34
34
  })
35
35
  .from(event)
36
+ .innerJoin(leagues, eq(leagues.eventId, event.id))
36
37
  .innerJoin(location, eq(event.locationId, location.id))
37
38
  .innerJoin(organization, eq(event.organizationId, organization.id))
38
39
  .innerJoin(user, eq(organization.ownerId, user.id))
39
40
  .innerJoin(eventTags, eq(event.id, eventTags.eventId))
40
41
  .innerJoin(tags, eq(eventTags.tagId, tags.id))
41
42
  .where(eq(event.locationId, locationId))
42
- .groupBy(event.id, location.id, organization.id, user.id, leagues.id);
43
+ .groupBy(event.id, leagues.id, location.id, organization.id, user.id);
43
44
  if (data.length === 0) {
44
45
  return c.json({
45
46
  message: HttpStatusPhrases.NOT_FOUND,
@@ -31,7 +31,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
31
31
  issues: {
32
32
  code: string;
33
33
  path: (string | number)[];
34
- message?: string | undefined;
34
+ message?: string | undefined | undefined;
35
35
  }[];
36
36
  name: string;
37
37
  };
@@ -49,7 +49,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
49
49
  issues: {
50
50
  code: string;
51
51
  path: (string | number)[];
52
- message?: string | undefined;
52
+ message?: string | undefined | undefined;
53
53
  }[];
54
54
  name: string;
55
55
  };
@@ -124,7 +124,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
124
124
  issues: {
125
125
  code: string;
126
126
  path: (string | number)[];
127
- message?: string | undefined;
127
+ message?: string | undefined | undefined;
128
128
  }[];
129
129
  name: string;
130
130
  };
@@ -206,7 +206,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
206
206
  issues: {
207
207
  code: string;
208
208
  path: (string | number)[];
209
- message?: string | undefined;
209
+ message?: string | undefined | undefined;
210
210
  }[];
211
211
  name: string;
212
212
  };
@@ -358,7 +358,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
358
358
  issues: {
359
359
  code: string;
360
360
  path: (string | number)[];
361
- message?: string | undefined;
361
+ message?: string | undefined | undefined;
362
362
  }[];
363
363
  name: string;
364
364
  };
@@ -438,7 +438,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
438
438
  issues: {
439
439
  code: string;
440
440
  path: (string | number)[];
441
- message?: string | undefined;
441
+ message?: string | undefined | undefined;
442
442
  }[];
443
443
  name: string;
444
444
  };
@@ -481,7 +481,7 @@ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shar
481
481
  issues: {
482
482
  code: string;
483
483
  path: (string | number)[];
484
- message?: string | undefined;
484
+ message?: string | undefined | undefined;
485
485
  }[];
486
486
  name: string;
487
487
  };
@@ -0,0 +1,3 @@
1
+ import type { AppRouteHandler } from "../../lib/types.js";
2
+ import type { VerifyRoute } from "./webhooks.routes.js";
3
+ export declare const verify: AppRouteHandler<VerifyRoute>;
@@ -0,0 +1,14 @@
1
+ export const verify = async (c) => {
2
+ const { url, eventType } = c.req.valid("json");
3
+ // TODO: Implement actual URL verification logic
4
+ // This could include:
5
+ // - Sending a challenge request to the URL
6
+ // - Verifying the URL responds correctly
7
+ // - Checking for proper SSL/TLS
8
+ // - Validating response format
9
+ return c.json({
10
+ verified: true,
11
+ url,
12
+ message: "URL verification pending implementation",
13
+ });
14
+ };
@@ -0,0 +1,32 @@
1
+ declare const router: import("@hono/zod-openapi").OpenAPIHono<import("../../shared/index.js").AppBindings, {
2
+ "/webhooks/verify": {
3
+ $post: {
4
+ input: {
5
+ json: {
6
+ url: string;
7
+ eventType?: string | undefined;
8
+ };
9
+ };
10
+ output: {
11
+ message: string;
12
+ url: string;
13
+ verified: boolean;
14
+ };
15
+ outputFormat: "text" | "json";
16
+ status: 200;
17
+ } | {
18
+ input: {
19
+ json: {
20
+ url: string;
21
+ eventType?: string | undefined;
22
+ };
23
+ };
24
+ output: {
25
+ message: string;
26
+ };
27
+ outputFormat: "text" | "json";
28
+ status: 400;
29
+ };
30
+ };
31
+ }, "/">;
32
+ export default router;
@@ -0,0 +1,6 @@
1
+ import { createRouter } from "../../lib/create-app.js";
2
+ import * as handlers from "./webhooks.handlers.js";
3
+ import * as routes from "./webhooks.routes.js";
4
+ const router = createRouter()
5
+ .openapi(routes.verify, handlers.verify);
6
+ export default router;
@@ -0,0 +1,64 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ export declare const verify: {
3
+ method: "post";
4
+ path: "/webhooks/verify";
5
+ tags: string[];
6
+ request: {
7
+ body: {
8
+ content: {
9
+ "application/json": {
10
+ schema: z.ZodObject<{
11
+ url: z.ZodString;
12
+ eventType: z.ZodOptional<z.ZodString>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ url: string;
15
+ eventType?: string | undefined;
16
+ }, {
17
+ url: string;
18
+ eventType?: string | undefined;
19
+ }>;
20
+ };
21
+ };
22
+ description: string;
23
+ };
24
+ };
25
+ responses: {
26
+ 200: {
27
+ content: {
28
+ "application/json": {
29
+ schema: z.ZodObject<{
30
+ verified: z.ZodBoolean;
31
+ url: z.ZodString;
32
+ message: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ message: string;
35
+ url: string;
36
+ verified: boolean;
37
+ }, {
38
+ message: string;
39
+ url: string;
40
+ verified: boolean;
41
+ }>;
42
+ };
43
+ };
44
+ description: string;
45
+ };
46
+ 400: {
47
+ content: {
48
+ "application/json": {
49
+ schema: z.ZodObject<{
50
+ message: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ message: string;
53
+ }, {
54
+ message: string;
55
+ }>;
56
+ };
57
+ };
58
+ description: string;
59
+ };
60
+ };
61
+ } & {
62
+ getRoutingPath(): "/webhooks/verify";
63
+ };
64
+ export type VerifyRoute = typeof verify;
@@ -0,0 +1,24 @@
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
+ export const verify = createRoute({
5
+ method: "post",
6
+ path: "/webhooks/verify",
7
+ tags: ["Webhooks"],
8
+ request: {
9
+ body: jsonContent(z.object({
10
+ url: z.string().url(),
11
+ eventType: z.string().optional(),
12
+ }), "URL verification request"),
13
+ },
14
+ responses: {
15
+ [HttpStatusCodes.OK]: jsonContent(z.object({
16
+ verified: z.boolean(),
17
+ url: z.string(),
18
+ message: z.string(),
19
+ }), "URL verification result"),
20
+ [HttpStatusCodes.BAD_REQUEST]: jsonContent(z.object({
21
+ message: z.string(),
22
+ }), "Invalid request"),
23
+ },
24
+ });
@@ -1,19 +1,8 @@
1
- /**
2
- * Type exports for Hono RPC client usage
3
- *
4
- * Usage in frontend:
5
- * ```typescript
6
- * import { hc } from 'hono/client';
7
- * import type { AppType } from '@lcas58/esmi-api-types/client-types';
8
- *
9
- * const client = hc<AppType>('https://api.example.com');
10
- * const res = await client.events.$get();
11
- * ```
12
- */
13
1
  import type events from "../routes/events/events.index.js";
14
2
  import type index from "../routes/index.route.js";
15
3
  import type leagues from "../routes/leagues/leagues.index.js";
16
4
  import type marketing from "../routes/marketing/marketing.index.js";
17
5
  import type organizations from "../routes/organizations/organizations.index.js";
18
6
  import type tags from "../routes/tags/tags.index.js";
19
- export type AppType = typeof index | typeof organizations | typeof events | typeof leagues | typeof marketing | typeof tags;
7
+ import type webhooks from "../routes/webhooks/webhooks.index.js";
8
+ export type AppType = typeof index | typeof organizations | typeof events | typeof leagues | typeof marketing | typeof tags | typeof webhooks;
@@ -1,13 +1 @@
1
- /**
2
- * Type exports for Hono RPC client usage
3
- *
4
- * Usage in frontend:
5
- * ```typescript
6
- * import { hc } from 'hono/client';
7
- * import type { AppType } from '@lcas58/esmi-api-types/client-types';
8
- *
9
- * const client = hc<AppType>('https://api.example.com');
10
- * const res = await client.events.$get();
11
- * ```
12
- */
13
1
  export {};
package/package.json CHANGED
@@ -1,38 +1,30 @@
1
1
  {
2
2
  "name": "@lcas58/esmi-api-types",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "license": "MIT",
6
6
  "exports": {
7
7
  ".": {
8
- "types": "./dist/src/shared/index.d.ts",
9
- "default": "./dist/src/shared/index.js"
10
- },
11
- "./client-types": {
12
8
  "types": "./dist/src/shared/client-types.d.ts",
13
9
  "default": "./dist/src/shared/client-types.js"
14
10
  }
15
11
  },
16
- "main": "./dist/src/shared/index.js",
17
- "types": "./dist/src/shared/index.d.ts",
12
+ "main": "./dist/src/shared/client-types.js",
13
+ "types": "./dist/src/shared/client-types.d.ts",
18
14
  "files": [
19
- "dist/src/app.d.ts",
20
- "dist/src/app.js",
21
- "dist/src/db/schema",
22
- "dist/src/lib/types.d.ts",
23
15
  "dist/src/routes",
24
- "dist/src/shared"
16
+ "dist/src/shared/client-types.d.ts",
17
+ "dist/src/shared/client-types.js"
25
18
  ],
26
19
  "scripts": {
27
20
  "dev": "wrangler dev",
28
21
  "deploy": "wrangler deploy --minify",
29
- "start": "node ./dist/src/index.js",
22
+ "start": "node ./dist/src/app.js",
30
23
  "typecheck": "tsc --noEmit",
31
24
  "lint": "eslint .",
32
25
  "lint:fix": "npm run lint --fix",
33
26
  "test": "cross-env NODE_ENV=test vitest",
34
27
  "build": "tsc && tsc-alias",
35
- "prepublishOnly": "bun run build",
36
28
  "db:studio": "bunx drizzle-kit studio",
37
29
  "db:generate": "bunx drizzle-kit generate",
38
30
  "db:migrate": "bunx drizzle-kit migrate",
@@ -42,37 +34,38 @@
42
34
  "zod": "^3.23.8"
43
35
  },
44
36
  "dependencies": {
45
- "@auth/core": "^0.37.0",
46
- "@auth/drizzle-adapter": "^1.7.0",
37
+ "@auth/core": "^0.37.4",
38
+ "@auth/drizzle-adapter": "^1.11.0",
39
+ "@better-auth/expo": "^1.4.10",
47
40
  "@hono/zod-openapi": "^0.16.4",
48
- "@neondatabase/serverless": "^0.10.1",
49
- "@scalar/hono-api-reference": "^0.5.150",
50
- "better-auth": "^1.1.9",
51
- "dotenv": "^16.4.5",
52
- "dotenv-expand": "^11.0.6",
41
+ "@neondatabase/serverless": "^0.10.4",
42
+ "@scalar/hono-api-reference": "^0.5.184",
43
+ "better-auth": "^1.3.27",
44
+ "dotenv": "^16.6.1",
45
+ "dotenv-expand": "^11.0.7",
53
46
  "drizzle-orm": "^0.33.0",
54
47
  "drizzle-zod": "^0.5.1",
55
- "hono": "4.6.16",
48
+ "hono": "^4.11.3",
56
49
  "hono-pino": "^0.3.0",
57
- "next-auth": "^4.24.8",
58
- "pino": "^9.4.0",
59
- "pino-pretty": "^11.2.2",
60
- "stoker": "^1.0.9"
50
+ "next-auth": "^4.24.11",
51
+ "pino": "^9.13.1",
52
+ "pino-pretty": "^11.3.0",
53
+ "stoker": "^1.4.3"
61
54
  },
62
55
  "devDependencies": {
63
- "@antfu/eslint-config": "^3.7.3",
56
+ "@antfu/eslint-config": "^3.16.0",
64
57
  "@cloudflare/workers-types": "^4.20241018.0",
65
58
  "@hono/node-server": "^*",
66
- "@types/node": "^22.7.4",
59
+ "@types/node": "^22.19.3",
67
60
  "cross-env": "^7.0.3",
68
61
  "drizzle-kit": "^0.24.2",
69
- "eslint": "^9.12.0",
70
- "eslint-plugin-format": "^0.1.2",
62
+ "eslint": "^9.39.2",
63
+ "eslint-plugin-format": "^0.1.3",
71
64
  "tsc-alias": "^1.8.10",
72
65
  "tsx": "^4.19.1",
73
- "typescript": "^5.6.2",
66
+ "typescript": "^5.9.3",
74
67
  "vitest": "^2.1.2",
75
68
  "wrangler": "^4.34.0",
76
- "zod": "^3.23.8"
69
+ "zod": "^3.25.76"
77
70
  }
78
71
  }