@vestcards/server-types 1.3.0 → 1.5.0

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 (94) hide show
  1. package/dist/apps/server/src/app.d.ts +382 -20
  2. package/dist/apps/server/src/config/env.d.ts +9 -1
  3. package/dist/apps/server/src/lib/metrics.d.ts +4 -0
  4. package/dist/apps/server/src/lib/posthog.d.ts +2 -0
  5. package/dist/apps/server/src/middleware/errorHandler.d.ts +1 -1
  6. package/dist/apps/server/src/middleware/logger.d.ts +14 -29
  7. package/dist/apps/server/src/middleware/logger.test.d.ts +1 -0
  8. package/dist/apps/server/src/modules/auth/index.d.ts +4 -4
  9. package/dist/apps/server/src/modules/auth/lib.d.ts +30 -3
  10. package/dist/apps/server/src/modules/auth/profile.d.ts +5 -0
  11. package/dist/apps/server/src/modules/auth/tracing.d.ts +18 -0
  12. package/dist/apps/server/src/modules/auth/tracing.test.d.ts +1 -0
  13. package/dist/apps/server/src/modules/auth/utils.d.ts +1 -0
  14. package/dist/apps/server/src/modules/card/index.d.ts +4 -4
  15. package/dist/apps/server/src/modules/cron/cron.test.d.ts +1 -0
  16. package/dist/apps/server/src/modules/cron/index.d.ts +53 -0
  17. package/dist/apps/server/src/modules/cron/jobs/expire-memberships.d.ts +1 -0
  18. package/dist/apps/server/src/modules/cron/jobs/payment-expiry-reminder.d.ts +1 -0
  19. package/dist/apps/server/src/modules/deck/access.d.ts +5 -0
  20. package/dist/apps/server/src/modules/deck/index.d.ts +23 -5
  21. package/dist/apps/server/src/modules/deck/model.d.ts +4 -0
  22. package/dist/apps/server/src/modules/deck/service.d.ts +5 -1
  23. package/dist/apps/server/src/modules/exam/exam.test.d.ts +1 -0
  24. package/dist/apps/server/src/modules/exam/index.d.ts +457 -0
  25. package/dist/apps/server/src/modules/exam/model.d.ts +18 -0
  26. package/dist/apps/server/src/modules/exam/service.d.ts +43 -0
  27. package/dist/apps/server/src/modules/library/index.d.ts +4 -4
  28. package/dist/apps/server/src/modules/ranking/cache.d.ts +6 -0
  29. package/dist/apps/server/src/modules/ranking/helpers.d.ts +9 -0
  30. package/dist/apps/server/src/modules/ranking/index.d.ts +412 -0
  31. package/dist/apps/server/src/modules/ranking/model.d.ts +28 -0
  32. package/dist/apps/server/src/modules/ranking/ranking.test.d.ts +1 -0
  33. package/dist/apps/server/src/modules/ranking/repository.d.ts +10 -0
  34. package/dist/apps/server/src/modules/ranking/service.d.ts +4 -0
  35. package/dist/apps/server/src/modules/stats/index.d.ts +446 -0
  36. package/dist/apps/server/src/modules/stats/model.d.ts +85 -0
  37. package/dist/apps/server/src/modules/stats/service.d.ts +27 -0
  38. package/dist/apps/server/src/modules/stats/stats.test.d.ts +1 -0
  39. package/dist/apps/server/src/modules/study/index.d.ts +4 -4
  40. package/dist/apps/server/src/modules/study/service.d.ts +4 -4
  41. package/dist/apps/server/src/modules/topic/index.d.ts +4 -4
  42. package/dist/apps/server/src/modules/user/index.d.ts +36 -19
  43. package/dist/apps/server/src/modules/user/model.d.ts +11 -1
  44. package/dist/apps/server/src/modules/user/service.d.ts +13 -29
  45. package/dist/apps/server/src/modules/vesty/index.d.ts +473 -0
  46. package/dist/apps/server/src/modules/vesty/model.d.ts +35 -0
  47. package/dist/apps/server/src/modules/vesty/resilience.d.ts +40 -0
  48. package/dist/apps/server/src/modules/vesty/resilience.test.d.ts +1 -0
  49. package/dist/apps/server/src/modules/vesty/service.d.ts +6 -0
  50. package/dist/apps/server/src/modules/vesty/services/generate-deck.d.ts +2 -0
  51. package/dist/apps/server/src/modules/vesty/services/insights.d.ts +3 -0
  52. package/dist/apps/server/src/modules/vesty/tools.d.ts +11 -0
  53. package/dist/apps/server/src/modules/vesty/utils.d.ts +62 -0
  54. package/dist/apps/server/src/modules/vesty/vesty.test.d.ts +1 -0
  55. package/dist/apps/server/src/server.d.ts +1 -0
  56. package/dist/apps/server/src/tests/helpers/fixtures.d.ts +8 -6
  57. package/dist/apps/server/src/tests/helpers/index.d.ts +1 -0
  58. package/dist/apps/server/src/tests/helpers/redis-mock.d.ts +33 -0
  59. package/dist/apps/server/src/tests/preload/redis-mock.d.ts +1 -0
  60. package/dist/apps/server/src/tests/preload/vesty-mock.d.ts +1 -0
  61. package/dist/packages/db-core/src/db.d.ts +1 -2
  62. package/dist/packages/db-core/src/index.d.ts +1 -1
  63. package/dist/packages/db-core/src/queries/decks.d.ts +2 -0
  64. package/dist/packages/db-core/src/queries/index.d.ts +1 -0
  65. package/dist/packages/db-core/src/schema/auth.d.ts +34 -0
  66. package/dist/packages/db-core/src/schema/exams.d.ts +721 -0
  67. package/dist/packages/db-core/src/schema/index.d.ts +1 -1
  68. package/dist/packages/db-core/src/schema/payment.d.ts +37 -1
  69. package/dist/packages/db-core/src/tracing.d.ts +2 -0
  70. package/dist/packages/email-core/src/templates/index.d.ts +2 -0
  71. package/dist/packages/email-core/src/templates/paymentExpiryReminder.d.ts +9 -0
  72. package/dist/packages/shared/src/constants.d.ts +2 -0
  73. package/dist/packages/shared/src/date/index.d.ts +1 -0
  74. package/dist/packages/shared/src/date/timezone.d.ts +29 -0
  75. package/dist/packages/shared/src/index.d.ts +1 -0
  76. package/dist/packages/shared/src/spaced-repetition/config.d.ts +17 -2
  77. package/dist/packages/shared/src/spaced-repetition/index.d.ts +1 -0
  78. package/dist/packages/shared/src/spaced-repetition/retention.d.ts +2 -0
  79. package/dist/packages/shared/src/spaced-repetition/session-manager.d.ts +3 -0
  80. package/dist/packages/shared/src/theme/tokens/colors.d.ts +27 -27
  81. package/dist/packages/shared/src/types/index.d.ts +1 -0
  82. package/dist/packages/shared/src/types/permissions.d.ts +6 -0
  83. package/dist/packages/shared/src/types/user.d.ts +20 -0
  84. package/dist/packages/shared/src/types/vesty.d.ts +7 -0
  85. package/dist/packages/utils/src/logger/config.d.ts +12 -0
  86. package/dist/packages/utils/src/logger/index.d.ts +5 -1
  87. package/dist/packages/utils/src/logger/pino.d.ts +7 -0
  88. package/dist/packages/utils/src/logger/posthog.d.ts +16 -0
  89. package/dist/packages/utils/src/logger/timeout.d.ts +4 -0
  90. package/dist/packages/utils/src/logger/tracing.d.ts +34 -0
  91. package/package.json +1 -1
  92. package/dist/apps/server/src/modules/study/constants.d.ts +0 -5
  93. package/dist/packages/db-core/src/views/deck.d.ts +0 -79
  94. /package/dist/apps/server/src/{libs → lib}/mappers.d.ts +0 -0
@@ -47,7 +47,7 @@ declare const app: Elysia<"", {
47
47
  }>;
48
48
  macroFn: {
49
49
  readonly auth: {
50
- readonly resolve: ({ request: { headers } }: {
50
+ readonly resolve: ({ request: { headers }, store }: {
51
51
  body: unknown;
52
52
  query: Record<string, string>;
53
53
  params: {};
@@ -65,7 +65,7 @@ declare const app: Elysia<"", {
65
65
  route: string;
66
66
  request: Request;
67
67
  store: {};
68
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
68
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 500 | 400 | 401 | 403 | 404 | 409 | 429 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
69
69
  readonly 100: "Continue";
70
70
  readonly 101: "Switching Protocols";
71
71
  readonly 102: "Processing";
@@ -221,7 +221,7 @@ declare const app: Elysia<"", {
221
221
  };
222
222
  } & {
223
223
  readonly permission: (permission?: import("@vestcards/shared").Permission) => {
224
- readonly resolve: ({ request: { headers } }: {
224
+ readonly resolve: ({ request: { headers }, store }: {
225
225
  body: unknown;
226
226
  query: Record<string, string>;
227
227
  params: {};
@@ -239,7 +239,7 @@ declare const app: Elysia<"", {
239
239
  route: string;
240
240
  request: Request;
241
241
  store: {};
242
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
242
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 500 | 400 | 401 | 403 | 404 | 409 | 429 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
243
243
  readonly 100: "Continue";
244
244
  readonly 101: "Switching Protocols";
245
245
  readonly 102: "Processing";
@@ -663,6 +663,22 @@ declare const app: Elysia<"", {
663
663
  };
664
664
  };
665
665
  };
666
+ } & {
667
+ v1: {
668
+ decks: {
669
+ recommended: {
670
+ get: {
671
+ body: {};
672
+ params: {};
673
+ query: {};
674
+ headers: {};
675
+ response: {
676
+ 200: import("@vestcards/shared").IDeck[];
677
+ };
678
+ };
679
+ };
680
+ };
681
+ };
666
682
  } & {
667
683
  v1: {
668
684
  decks: {
@@ -672,7 +688,9 @@ declare const app: Elysia<"", {
672
688
  params: {
673
689
  deckId: string;
674
690
  };
675
- query: {};
691
+ query: {
692
+ preview?: boolean | undefined;
693
+ };
676
694
  headers: {};
677
695
  response: {
678
696
  200: import("@vestcards/shared").IDeckDetail;
@@ -690,6 +708,98 @@ declare const app: Elysia<"", {
690
708
  };
691
709
  };
692
710
  };
711
+ } & {
712
+ v1: {
713
+ exam: {
714
+ v1: {
715
+ auth: {
716
+ "validate-reset-token": {
717
+ get: {
718
+ body: unknown;
719
+ params: {};
720
+ query: {
721
+ token: string;
722
+ };
723
+ headers: unknown;
724
+ response: {
725
+ 200: {
726
+ valid: boolean;
727
+ };
728
+ 422: {
729
+ type: "validation";
730
+ on: string;
731
+ summary?: string;
732
+ message?: string;
733
+ found?: unknown;
734
+ property?: string;
735
+ expected?: string;
736
+ };
737
+ };
738
+ };
739
+ };
740
+ };
741
+ };
742
+ };
743
+ };
744
+ } & {
745
+ v1: {
746
+ exam: {
747
+ filters: {
748
+ get: {
749
+ body: {};
750
+ params: {};
751
+ query: {};
752
+ headers: {};
753
+ response: {
754
+ 200: {
755
+ vestibulares: string[];
756
+ topics: {
757
+ id: string;
758
+ name: string;
759
+ subject: "matemática" | "geografia" | "física" | "biologia" | "história" | "literatura" | "gramática" | "sociologia" | "química" | "filosofia" | "redação" | "artes" | "inglês";
760
+ }[];
761
+ };
762
+ };
763
+ };
764
+ };
765
+ };
766
+ };
767
+ } & {
768
+ v1: {
769
+ exam: {
770
+ questions: {
771
+ get: {
772
+ body: {};
773
+ params: {};
774
+ query: {
775
+ q?: string | undefined;
776
+ topicIds?: string[] | undefined;
777
+ subjects?: ("matemática" | "geografia" | "física" | "biologia" | "história" | "literatura" | "gramática" | "sociologia" | "química" | "filosofia" | "redação" | "artes" | "inglês")[] | undefined;
778
+ vestibular?: string | undefined;
779
+ size: number;
780
+ page: number;
781
+ };
782
+ headers: {};
783
+ response: {
784
+ 200: {
785
+ data: import("./modules/exam/service").ExamQuestionListItem[];
786
+ pageCount: number;
787
+ total: number;
788
+ };
789
+ 422: {
790
+ type: "validation";
791
+ on: string;
792
+ summary?: string;
793
+ message?: string;
794
+ found?: unknown;
795
+ property?: string;
796
+ expected?: string;
797
+ };
798
+ };
799
+ };
800
+ };
801
+ };
802
+ };
693
803
  } & {
694
804
  v1: {
695
805
  topics: {
@@ -1143,6 +1253,134 @@ declare const app: Elysia<"", {
1143
1253
  };
1144
1254
  };
1145
1255
  };
1256
+ } & {
1257
+ v1: {
1258
+ ranking: {
1259
+ v1: {
1260
+ auth: {
1261
+ "validate-reset-token": {
1262
+ get: {
1263
+ body: unknown;
1264
+ params: {};
1265
+ query: {
1266
+ token: string;
1267
+ };
1268
+ headers: unknown;
1269
+ response: {
1270
+ 200: {
1271
+ valid: boolean;
1272
+ };
1273
+ 422: {
1274
+ type: "validation";
1275
+ on: string;
1276
+ summary?: string;
1277
+ message?: string;
1278
+ found?: unknown;
1279
+ property?: string;
1280
+ expected?: string;
1281
+ };
1282
+ };
1283
+ };
1284
+ };
1285
+ };
1286
+ };
1287
+ };
1288
+ };
1289
+ } & {
1290
+ v1: {
1291
+ ranking: {
1292
+ get: {
1293
+ body: {};
1294
+ params: {};
1295
+ query: {};
1296
+ headers: {};
1297
+ response: {
1298
+ 200: import("./modules/ranking/model").RankingData;
1299
+ };
1300
+ };
1301
+ };
1302
+ };
1303
+ } & {
1304
+ v1: {
1305
+ stats: {
1306
+ v1: {
1307
+ auth: {
1308
+ "validate-reset-token": {
1309
+ get: {
1310
+ body: unknown;
1311
+ params: {};
1312
+ query: {
1313
+ token: string;
1314
+ };
1315
+ headers: unknown;
1316
+ response: {
1317
+ 200: {
1318
+ valid: boolean;
1319
+ };
1320
+ 422: {
1321
+ type: "validation";
1322
+ on: string;
1323
+ summary?: string;
1324
+ message?: string;
1325
+ found?: unknown;
1326
+ property?: string;
1327
+ expected?: string;
1328
+ };
1329
+ };
1330
+ };
1331
+ };
1332
+ };
1333
+ };
1334
+ };
1335
+ };
1336
+ } & {
1337
+ v1: {
1338
+ stats: {
1339
+ home: {
1340
+ get: {
1341
+ body: {};
1342
+ params: {};
1343
+ query: {};
1344
+ headers: {};
1345
+ response: {
1346
+ 200: import("./modules/stats/model").StatsModel.HomePageStats;
1347
+ };
1348
+ };
1349
+ };
1350
+ };
1351
+ };
1352
+ } & {
1353
+ v1: {
1354
+ stats: {
1355
+ streak: {
1356
+ get: {
1357
+ body: {};
1358
+ params: {};
1359
+ query: {};
1360
+ headers: {};
1361
+ response: {
1362
+ 200: import("./modules/stats/model").StatsModel.StreakResult;
1363
+ };
1364
+ };
1365
+ };
1366
+ };
1367
+ };
1368
+ } & {
1369
+ v1: {
1370
+ stats: {
1371
+ dashboard: {
1372
+ get: {
1373
+ body: {};
1374
+ params: {};
1375
+ query: {};
1376
+ headers: {};
1377
+ response: {
1378
+ 200: import("./modules/stats/model").StatsModel.DashboardStats;
1379
+ };
1380
+ };
1381
+ };
1382
+ };
1383
+ };
1146
1384
  } & {
1147
1385
  v1: {
1148
1386
  user: {
@@ -1186,20 +1424,7 @@ declare const app: Elysia<"", {
1186
1424
  query: {};
1187
1425
  headers: {};
1188
1426
  response: {
1189
- 200: {
1190
- id: string;
1191
- name: string;
1192
- surname: string;
1193
- email: string;
1194
- image: string | null;
1195
- role: import("@vestcards/shared").UserRole;
1196
- goal: string | null;
1197
- learnDailyLimit: number | null;
1198
- universityId: number | null;
1199
- universityName: string | null;
1200
- courseId: number | null;
1201
- courseName: string | null;
1202
- };
1427
+ 200: import("@vestcards/shared").IUserProfile | null;
1203
1428
  };
1204
1429
  };
1205
1430
  };
@@ -1212,8 +1437,10 @@ declare const app: Elysia<"", {
1212
1437
  patch: {
1213
1438
  body: {
1214
1439
  university?: number | null | undefined;
1440
+ timezone?: string | undefined;
1215
1441
  course?: number | null | undefined;
1216
- learnDailyLimit?: number | undefined;
1442
+ learnDailyLimit?: number | null | undefined;
1443
+ newCardsPerDeckDailyLimit?: number | null | undefined;
1217
1444
  };
1218
1445
  params: {};
1219
1446
  query: {};
@@ -1335,6 +1562,33 @@ declare const app: Elysia<"", {
1335
1562
  };
1336
1563
  };
1337
1564
  };
1565
+ } & {
1566
+ v1: {
1567
+ user: {
1568
+ password: {
1569
+ post: {
1570
+ body: {
1571
+ newPassword: string;
1572
+ currentPassword: string;
1573
+ };
1574
+ params: {};
1575
+ query: {};
1576
+ headers: {};
1577
+ response: {
1578
+ 422: {
1579
+ type: "validation";
1580
+ on: string;
1581
+ summary?: string;
1582
+ message?: string;
1583
+ found?: unknown;
1584
+ property?: string;
1585
+ expected?: string;
1586
+ };
1587
+ };
1588
+ };
1589
+ };
1590
+ };
1591
+ };
1338
1592
  } & {
1339
1593
  v1: {
1340
1594
  user: {
@@ -1343,6 +1597,7 @@ declare const app: Elysia<"", {
1343
1597
  body: {
1344
1598
  university?: number | undefined;
1345
1599
  dayTimeReminder?: string | undefined;
1600
+ timezone?: string | undefined;
1346
1601
  course?: number | undefined;
1347
1602
  goal: string;
1348
1603
  hoursStudied: string;
@@ -1430,6 +1685,113 @@ declare const app: Elysia<"", {
1430
1685
  };
1431
1686
  };
1432
1687
  };
1688
+ } & {
1689
+ v1: {
1690
+ vesty: {
1691
+ v1: {
1692
+ auth: {
1693
+ "validate-reset-token": {
1694
+ get: {
1695
+ body: unknown;
1696
+ params: {};
1697
+ query: {
1698
+ token: string;
1699
+ };
1700
+ headers: unknown;
1701
+ response: {
1702
+ 200: {
1703
+ valid: boolean;
1704
+ };
1705
+ 422: {
1706
+ type: "validation";
1707
+ on: string;
1708
+ summary?: string;
1709
+ message?: string;
1710
+ found?: unknown;
1711
+ property?: string;
1712
+ expected?: string;
1713
+ };
1714
+ };
1715
+ };
1716
+ };
1717
+ };
1718
+ };
1719
+ };
1720
+ };
1721
+ } & {
1722
+ v1: {
1723
+ vesty: {
1724
+ chat: {
1725
+ post: {
1726
+ body: {
1727
+ data?: {} | undefined;
1728
+ messages: {
1729
+ role: "user" | "assistant";
1730
+ parts: any[];
1731
+ }[];
1732
+ };
1733
+ params: {};
1734
+ query: {};
1735
+ headers: {};
1736
+ response: {
1737
+ 200: Response;
1738
+ 422: {
1739
+ type: "validation";
1740
+ on: string;
1741
+ summary?: string;
1742
+ message?: string;
1743
+ found?: unknown;
1744
+ property?: string;
1745
+ expected?: string;
1746
+ };
1747
+ };
1748
+ };
1749
+ };
1750
+ };
1751
+ };
1752
+ } & {
1753
+ v1: {
1754
+ vesty: {
1755
+ "generate-deck": {
1756
+ post: {
1757
+ body: {
1758
+ prompt: string;
1759
+ };
1760
+ params: {};
1761
+ query: {};
1762
+ headers: {};
1763
+ response: {
1764
+ 200: import("./modules/vesty/model").VestyModel.GeneratedDeck;
1765
+ 422: {
1766
+ type: "validation";
1767
+ on: string;
1768
+ summary?: string;
1769
+ message?: string;
1770
+ found?: unknown;
1771
+ property?: string;
1772
+ expected?: string;
1773
+ };
1774
+ };
1775
+ };
1776
+ };
1777
+ };
1778
+ };
1779
+ } & {
1780
+ v1: {
1781
+ vesty: {
1782
+ insights: {
1783
+ get: {
1784
+ body: {};
1785
+ params: {};
1786
+ query: {};
1787
+ headers: {};
1788
+ response: {
1789
+ 200: import("./modules/vesty/model").VestyModel.InsightsResult;
1790
+ };
1791
+ };
1792
+ };
1793
+ };
1794
+ };
1433
1795
  } & {
1434
1796
  health: {
1435
1797
  get: {
@@ -8,9 +8,17 @@ export declare const config: {
8
8
  googleClientId: string;
9
9
  googleClientSecret: string;
10
10
  appleClientId: string;
11
- appleClientSecret: string;
11
+ appleTeamId: string;
12
+ appleKeyId: string;
13
+ applePrivateKey: string;
14
+ appleAppBundleIdentifier: string;
15
+ geminiApiKey: string;
16
+ geminiModel: "gemini-3.1-pro-preview" | "gemini-3-pro-preview" | "gemini-3-flash-preview" | "gemini-3.1-flash-lite-preview" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-flash-preview-09-2025" | "gemini-2.5-flash-lite" | "gemini-2.5-flash-lite-preview-09-2025" | "gemini-2.0-flash" | "gemini-2.0-flash-lite";
17
+ geminiFallbackModel: "gemini-3.1-pro-preview" | "gemini-3-pro-preview" | "gemini-3-flash-preview" | "gemini-3.1-flash-lite-preview" | "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-2.5-flash-preview-09-2025" | "gemini-2.5-flash-lite" | "gemini-2.5-flash-lite-preview-09-2025" | "gemini-2.0-flash" | "gemini-2.0-flash-lite";
12
18
  port: number;
13
19
  nodeEnv: string;
14
20
  corsOrigins: string | undefined;
15
21
  debug: boolean;
22
+ posthogApiKey: string;
23
+ posthogHost: string;
16
24
  };
@@ -0,0 +1,4 @@
1
+ import { Counter, Histogram, register } from 'prom-client';
2
+ export declare const httpRequestDuration: Histogram<"route" | "method" | "status_code">;
3
+ export declare const httpRequestTotal: Counter<"route" | "method" | "status_code">;
4
+ export { register };
@@ -0,0 +1,2 @@
1
+ import { PostHog } from 'posthog-node';
2
+ export declare const posthog: PostHog;
@@ -1,4 +1,4 @@
1
- import type { ErrorHandler } from 'elysia';
1
+ import { type ErrorHandler } from 'elysia';
2
2
  /**
3
3
  * Global error handler returning Response.json() so the return type
4
4
  * is NOT merged into Eden treaty's success union — errors stay in
@@ -1,29 +1,14 @@
1
- import { Elysia } from 'elysia';
2
- export declare const requestLogger: Elysia<"", {
3
- decorator: {};
4
- store: {};
5
- derive: {};
6
- resolve: {};
7
- }, {
8
- typebox: {};
9
- error: {};
10
- }, {
11
- schema: {};
12
- standaloneSchema: {};
13
- macro: {};
14
- macroFn: {};
15
- parser: {};
16
- response: {};
17
- }, {}, {
18
- derive: {};
19
- resolve: {};
20
- schema: {};
21
- standaloneSchema: {};
22
- response: {};
23
- }, {
24
- derive: {};
25
- resolve: {};
26
- schema: {};
27
- standaloneSchema: {};
28
- response: {};
29
- }>;
1
+ export declare function normalizeRoute(path: string): string;
2
+ export declare function traceRequest<T>(request: Request, callback: () => T): T;
3
+ export declare function onRequest({ request, store }: {
4
+ request: Request;
5
+ store: Record<string, unknown>;
6
+ }): Promise<void>;
7
+ export declare function onAfterResponse({ request, responseValue, set, store, }: {
8
+ request: Request;
9
+ responseValue: unknown;
10
+ set: {
11
+ status?: number | string;
12
+ };
13
+ store: Record<string, unknown>;
14
+ }): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -23,7 +23,7 @@ export declare const authModule: Elysia<"/v1", {
23
23
  }>;
24
24
  macroFn: {
25
25
  readonly auth: {
26
- readonly resolve: ({ request: { headers } }: {
26
+ readonly resolve: ({ request: { headers }, store }: {
27
27
  body: unknown;
28
28
  query: Record<string, string>;
29
29
  params: {};
@@ -41,7 +41,7 @@ export declare const authModule: Elysia<"/v1", {
41
41
  route: string;
42
42
  request: Request;
43
43
  store: {};
44
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
44
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 500 | 400 | 401 | 403 | 404 | 409 | 429 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
45
  readonly 100: "Continue";
46
46
  readonly 101: "Switching Protocols";
47
47
  readonly 102: "Processing";
@@ -197,7 +197,7 @@ export declare const authModule: Elysia<"/v1", {
197
197
  };
198
198
  } & {
199
199
  readonly permission: (permission?: Permission) => {
200
- readonly resolve: ({ request: { headers } }: {
200
+ readonly resolve: ({ request: { headers }, store }: {
201
201
  body: unknown;
202
202
  query: Record<string, string>;
203
203
  params: {};
@@ -215,7 +215,7 @@ export declare const authModule: Elysia<"/v1", {
215
215
  route: string;
216
216
  request: Request;
217
217
  store: {};
218
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 500 | 400 | 401 | 403 | 404 | 409 | 429 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
219
219
  readonly 100: "Continue";
220
220
  readonly 101: "Switching Protocols";
221
221
  readonly 102: "Processing";