@m5kdev/backend 0.1.5 → 0.3.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 (115) hide show
  1. package/dist/src/modules/access/access.repository.d.ts +2 -2
  2. package/dist/src/modules/access/access.repository.js +2 -2
  3. package/dist/src/modules/access/access.service.d.ts +4 -4
  4. package/dist/src/modules/access/access.service.js +1 -1
  5. package/dist/src/modules/access/access.test.js +4 -4
  6. package/dist/src/modules/ai/ai.db.js +1 -1
  7. package/dist/src/modules/ai/ai.prompt.js +1 -1
  8. package/dist/src/modules/ai/ai.repository.d.ts +2 -2
  9. package/dist/src/modules/ai/ai.repository.js +2 -2
  10. package/dist/src/modules/ai/ai.service.d.ts +6 -6
  11. package/dist/src/modules/ai/ai.service.js +1 -1
  12. package/dist/src/modules/ai/ai.trpc.d.ts +6 -42
  13. package/dist/src/modules/ai/ai.trpc.js +5 -5
  14. package/dist/src/modules/ai/ideogram/ideogram.dto.js +1 -1
  15. package/dist/src/modules/ai/ideogram/ideogram.prompt.d.ts +1 -1
  16. package/dist/src/modules/ai/ideogram/ideogram.prompt.js +1 -1
  17. package/dist/src/modules/ai/ideogram/ideogram.repository.d.ts +3 -3
  18. package/dist/src/modules/ai/ideogram/ideogram.repository.js +1 -1
  19. package/dist/src/modules/ai/ideogram/ideogram.service.d.ts +4 -4
  20. package/dist/src/modules/ai/ideogram/ideogram.service.js +1 -1
  21. package/dist/src/modules/auth/auth.dto.d.ts +5 -5
  22. package/dist/src/modules/auth/auth.lib.d.ts +10 -10
  23. package/dist/src/modules/auth/auth.lib.js +4 -4
  24. package/dist/src/modules/auth/auth.middleware.d.ts +1 -1
  25. package/dist/src/modules/auth/auth.middleware.js +2 -2
  26. package/dist/src/modules/auth/auth.repository.d.ts +4 -4
  27. package/dist/src/modules/auth/auth.repository.js +2 -2
  28. package/dist/src/modules/auth/auth.service.d.ts +7 -7
  29. package/dist/src/modules/auth/auth.service.js +2 -2
  30. package/dist/src/modules/auth/auth.trpc.d.ts +45 -81
  31. package/dist/src/modules/auth/auth.trpc.js +57 -55
  32. package/dist/src/modules/auth/auth.utils.js +1 -1
  33. package/dist/src/modules/base/base.abstract.d.ts +4 -4
  34. package/dist/src/modules/base/base.abstract.js +2 -2
  35. package/dist/src/modules/base/base.dto.d.ts +3 -3
  36. package/dist/src/modules/base/base.grants.d.ts +2 -2
  37. package/dist/src/modules/base/base.grants.test.js +2 -2
  38. package/dist/src/modules/base/base.repository.d.ts +2 -2
  39. package/dist/src/modules/base/base.repository.js +5 -5
  40. package/dist/src/modules/base/base.service.d.ts +6 -7
  41. package/dist/src/modules/base/base.service.js +2 -2
  42. package/dist/src/modules/billing/billing.repository.d.ts +2 -2
  43. package/dist/src/modules/billing/billing.repository.js +4 -4
  44. package/dist/src/modules/billing/billing.router.d.ts +2 -2
  45. package/dist/src/modules/billing/billing.service.d.ts +4 -4
  46. package/dist/src/modules/billing/billing.service.js +2 -2
  47. package/dist/src/modules/billing/billing.trpc.d.ts +7 -43
  48. package/dist/src/modules/billing/billing.trpc.js +7 -7
  49. package/dist/src/modules/clay/clay.repository.d.ts +2 -2
  50. package/dist/src/modules/clay/clay.repository.js +1 -1
  51. package/dist/src/modules/clay/clay.service.d.ts +3 -3
  52. package/dist/src/modules/clay/clay.service.js +1 -1
  53. package/dist/src/modules/connect/connect.dto.d.ts +4 -4
  54. package/dist/src/modules/connect/connect.oauth.js +1 -1
  55. package/dist/src/modules/connect/connect.repository.d.ts +4 -4
  56. package/dist/src/modules/connect/connect.repository.js +2 -2
  57. package/dist/src/modules/connect/connect.router.d.ts +1 -1
  58. package/dist/src/modules/connect/connect.service.d.ts +12 -12
  59. package/dist/src/modules/connect/connect.service.js +1 -1
  60. package/dist/src/modules/connect/connect.trpc.d.ts +7 -43
  61. package/dist/src/modules/connect/connect.trpc.js +7 -7
  62. package/dist/src/modules/crypto/crypto.repository.d.ts +1 -1
  63. package/dist/src/modules/crypto/crypto.repository.js +2 -2
  64. package/dist/src/modules/crypto/crypto.service.d.ts +3 -3
  65. package/dist/src/modules/crypto/crypto.service.js +1 -1
  66. package/dist/src/modules/email/email.service.d.ts +1 -1
  67. package/dist/src/modules/email/email.service.js +1 -1
  68. package/dist/src/modules/file/file.repository.d.ts +2 -2
  69. package/dist/src/modules/file/file.repository.js +1 -1
  70. package/dist/src/modules/file/file.router.js +2 -2
  71. package/dist/src/modules/file/file.service.d.ts +3 -3
  72. package/dist/src/modules/file/file.service.js +1 -1
  73. package/dist/src/modules/recurrence/recurrence.db.js +1 -1
  74. package/dist/src/modules/recurrence/recurrence.repository.d.ts +2 -2
  75. package/dist/src/modules/recurrence/recurrence.repository.js +2 -2
  76. package/dist/src/modules/recurrence/recurrence.service.d.ts +4 -4
  77. package/dist/src/modules/recurrence/recurrence.service.js +1 -1
  78. package/dist/src/modules/recurrence/recurrence.trpc.d.ts +12 -48
  79. package/dist/src/modules/recurrence/recurrence.trpc.js +17 -17
  80. package/dist/src/modules/social/social.service.d.ts +5 -5
  81. package/dist/src/modules/social/social.service.js +1 -1
  82. package/dist/src/modules/social/social.types.d.ts +2 -2
  83. package/dist/src/modules/tag/tag.db.js +1 -1
  84. package/dist/src/modules/tag/tag.dto.d.ts +1 -1
  85. package/dist/src/modules/tag/tag.dto.js +2 -2
  86. package/dist/src/modules/tag/tag.repository.d.ts +3 -3
  87. package/dist/src/modules/tag/tag.repository.js +2 -2
  88. package/dist/src/modules/tag/tag.service.d.ts +6 -6
  89. package/dist/src/modules/tag/tag.service.js +1 -1
  90. package/dist/src/modules/tag/tag.trpc.d.ts +11 -47
  91. package/dist/src/modules/tag/tag.trpc.js +16 -16
  92. package/dist/src/modules/utils/getConditionsFromFilters.d.ts +1 -1
  93. package/dist/src/modules/video/video.service.d.ts +2 -2
  94. package/dist/src/modules/video/video.service.js +1 -1
  95. package/dist/src/modules/webhook/webhook.dto.js +1 -1
  96. package/dist/src/modules/webhook/webhook.repository.d.ts +2 -2
  97. package/dist/src/modules/webhook/webhook.repository.js +1 -1
  98. package/dist/src/modules/webhook/webhook.service.d.ts +2 -2
  99. package/dist/src/modules/webhook/webhook.service.js +1 -1
  100. package/dist/src/modules/workflow/workflow.db.js +1 -1
  101. package/dist/src/modules/workflow/workflow.repository.d.ts +2 -2
  102. package/dist/src/modules/workflow/workflow.repository.js +2 -2
  103. package/dist/src/modules/workflow/workflow.service.d.ts +4 -4
  104. package/dist/src/modules/workflow/workflow.service.js +1 -1
  105. package/dist/src/modules/workflow/workflow.trpc.d.ts +7 -43
  106. package/dist/src/modules/workflow/workflow.trpc.js +7 -7
  107. package/dist/src/modules/workflow/workflow.types.d.ts +2 -2
  108. package/dist/src/modules/workflow/workflow.utils.js +3 -3
  109. package/dist/src/types.d.ts +56 -203
  110. package/dist/src/types.js +7 -8
  111. package/dist/src/utils/errors.d.ts +1 -1
  112. package/dist/src/utils/trpc.d.ts +58 -0
  113. package/dist/src/utils/trpc.js +63 -0
  114. package/dist/tsconfig.tsbuildinfo +1 -1
  115. package/package.json +3 -30
@@ -1,7 +1,7 @@
1
1
  import type { WorkflowListInputSchema, WorkflowListOutputSchema, WorkflowReadOutputSchema } from "@m5kdev/commons/modules/workflow/workflow.schema";
2
2
  import type { LibSQLDatabase } from "drizzle-orm/libsql";
3
- import type { ServerResultAsync } from "#modules/base/base.dto";
4
- import { BaseRepository } from "#modules/base/base.repository";
3
+ import type { ServerResultAsync } from "../base/base.dto";
4
+ import { BaseRepository } from "../base/base.repository";
5
5
  declare const schema: {
6
6
  workflows: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
7
7
  name: "workflows";
@@ -4,8 +4,8 @@ exports.WorkflowRepository = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const drizzle_orm_1 = require("drizzle-orm");
6
6
  const neverthrow_1 = require("neverthrow");
7
- const base_repository_1 = require("#modules/base/base.repository");
8
- const workflow = tslib_1.__importStar(require("#modules/workflow/workflow.db"));
7
+ const base_repository_1 = require("../base/base.repository");
8
+ const workflow = tslib_1.__importStar(require("./workflow.db"));
9
9
  const schema = { ...workflow };
10
10
  class WorkflowRepository extends base_repository_1.BaseRepository {
11
11
  async read({ jobId, userId, }) {
@@ -1,9 +1,9 @@
1
1
  import type { WorkflowListInputSchema, WorkflowListOutputSchema, WorkflowReadInputSchema, WorkflowReadOutputSchema } from "@m5kdev/commons/modules/workflow/workflow.schema";
2
2
  import type { Job } from "bullmq";
3
- import type { User } from "#modules/auth/auth.lib";
4
- import type { ServerResultAsync } from "#modules/base/base.dto";
5
- import { BaseService } from "#modules/base/base.service";
6
- import type { WorkflowRepository } from "#modules/workflow/workflow.repository";
3
+ import type { User } from "../auth/auth.lib";
4
+ import type { ServerResultAsync } from "../base/base.dto";
5
+ import { BaseService } from "../base/base.service";
6
+ import type { WorkflowRepository } from "./workflow.repository";
7
7
  export declare class WorkflowService extends BaseService<{
8
8
  workflow: WorkflowRepository;
9
9
  }, never> {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkflowService = void 0;
4
- const base_service_1 = require("#modules/base/base.service");
4
+ const base_service_1 = require("../base/base.service");
5
5
  class WorkflowService extends base_service_1.BaseService {
6
6
  async read(input, { user }) {
7
7
  return await this.repository.workflow.read({ ...input, userId: user.id });
@@ -1,44 +1,8 @@
1
- import type { WorkflowService } from "#modules/workflow/workflow.service";
2
- export declare function createWorkflowTRPC(workflowService: WorkflowService): import("@trpc/server").TRPCBuiltRouter<{
3
- ctx: {
4
- session: {
5
- id: string;
6
- createdAt: Date;
7
- updatedAt: Date;
8
- expiresAt: Date;
9
- token: string;
10
- ipAddress: string | null;
11
- userAgent: string | null;
12
- userId: string;
13
- impersonatedBy: string | null;
14
- activeOrganizationId: string | null;
15
- activeOrganizationRole: string | null;
16
- activeTeamId: string | null;
17
- activeTeamRole: string | null;
18
- };
19
- user: {
20
- id: string;
21
- name: string;
22
- email: string;
23
- emailVerified: boolean;
24
- image: string | null;
25
- createdAt: Date;
26
- updatedAt: Date;
27
- role: string | null;
28
- banned: boolean | null;
29
- banReason: string | null;
30
- banExpires: Date | null;
31
- stripeCustomerId: string | null;
32
- paymentCustomerId: string | null;
33
- paymentPlanTier: string | null;
34
- paymentPlanExpiresAt: Date | null;
35
- preferences: string | null;
36
- metadata: Record<string, unknown>;
37
- onboarding: number | null;
38
- flags: string | null;
39
- };
40
- };
41
- meta: import("trpc-to-openapi").OpenApiMeta;
1
+ import type { WorkflowService } from "./workflow.service";
2
+ import { type TRPCMethods } from "../../utils/trpc";
3
+ export declare function createWorkflowTRPC({ router, privateProcedure: procedure }: TRPCMethods, workflowService: WorkflowService): import("@trpc/server").TRPCBuiltRouter<{
4
+ ctx: import("../auth/auth.lib").Context;
5
+ meta: any;
42
6
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
43
7
  transformer: true;
44
8
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
@@ -63,7 +27,7 @@ export declare function createWorkflowTRPC(workflowService: WorkflowService): im
63
27
  createdAt: Date;
64
28
  updatedAt: Date;
65
29
  };
66
- meta: import("trpc-to-openapi").OpenApiMeta;
30
+ meta: any;
67
31
  }>;
68
32
  list: import("@trpc/server").TRPCQueryProcedure<{
69
33
  input: {
@@ -87,6 +51,6 @@ export declare function createWorkflowTRPC(workflowService: WorkflowService): im
87
51
  createdAt: Date;
88
52
  updatedAt: Date;
89
53
  }[];
90
- meta: import("trpc-to-openapi").OpenApiMeta;
54
+ meta: any;
91
55
  }>;
92
56
  }>>;
@@ -2,20 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createWorkflowTRPC = createWorkflowTRPC;
4
4
  const workflow_schema_1 = require("@m5kdev/commons/modules/workflow/workflow.schema");
5
- const _trpc_1 = require("#trpc");
6
- function createWorkflowTRPC(workflowService) {
7
- return (0, _trpc_1.router)({
8
- read: _trpc_1.procedure
5
+ const trpc_1 = require("../../utils/trpc");
6
+ function createWorkflowTRPC({ router, privateProcedure: procedure }, workflowService) {
7
+ return router({
8
+ read: procedure
9
9
  .input(workflow_schema_1.workflowReadInputSchema)
10
10
  .output(workflow_schema_1.workflowReadOutputSchema)
11
11
  .query(async ({ ctx, input }) => {
12
- return (0, _trpc_1.handleTRPCResult)(await workflowService.read(input, ctx));
12
+ return (0, trpc_1.handleTRPCResult)(await workflowService.read(input, ctx));
13
13
  }),
14
- list: _trpc_1.procedure
14
+ list: procedure
15
15
  .input(workflow_schema_1.workflowListInputSchema)
16
16
  .output(workflow_schema_1.workflowListOutputSchema)
17
17
  .query(async ({ ctx, input }) => {
18
- return (0, _trpc_1.handleTRPCResult)(await workflowService.list(input, ctx));
18
+ return (0, trpc_1.handleTRPCResult)(await workflowService.list(input, ctx));
19
19
  }),
20
20
  });
21
21
  }
@@ -1,6 +1,6 @@
1
1
  import type { Job, JobsOptions } from "bullmq";
2
- import type { ServerResultAsync } from "#modules/base/base.dto";
3
- import type { ServerError } from "#utils/errors";
2
+ import type { ServerResultAsync } from "../base/base.dto";
3
+ import type { ServerError } from "../../utils/errors";
4
4
  export type WorkflowMeta = {
5
5
  queue?: string;
6
6
  userId?: string;
@@ -5,9 +5,9 @@ exports.createWorkflowWorker = createWorkflowWorker;
5
5
  exports.createWorkflowWorkers = createWorkflowWorkers;
6
6
  const bullmq_1 = require("bullmq");
7
7
  const neverthrow_1 = require("neverthrow");
8
- const errors_1 = require("#utils/errors");
9
- const logger_1 = require("#utils/logger");
10
- const posthog_1 = require("#utils/posthog");
8
+ const errors_1 = require("../../utils/errors");
9
+ const logger_1 = require("../../utils/logger");
10
+ const posthog_1 = require("../../utils/posthog");
11
11
  const errorOptions = {
12
12
  layer: "workflow",
13
13
  layerName: "WorkflowTrigger",
@@ -1,97 +1,24 @@
1
1
  import type { Mastra } from "@mastra/core";
2
- import type { AIService } from "#modules/ai/ai.service";
3
- import type { AuthService } from "#modules/auth/auth.service";
4
- import type { BillingService } from "#modules/billing/billing.service";
5
- export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authService: AuthService, aiService: AIService<MastraInstance>, billingService: BillingService) => import("@trpc/server").TRPCBuiltRouter<{
6
- ctx: {
7
- session: {
8
- id: string;
9
- createdAt: Date;
10
- updatedAt: Date;
11
- expiresAt: Date;
12
- token: string;
13
- ipAddress: string | null;
14
- userAgent: string | null;
15
- userId: string;
16
- impersonatedBy: string | null;
17
- activeOrganizationId: string | null;
18
- activeOrganizationRole: string | null;
19
- activeTeamId: string | null;
20
- activeTeamRole: string | null;
21
- };
22
- user: {
23
- id: string;
24
- name: string;
25
- email: string;
26
- emailVerified: boolean;
27
- image: string | null;
28
- createdAt: Date;
29
- updatedAt: Date;
30
- role: string | null;
31
- banned: boolean | null;
32
- banReason: string | null;
33
- banExpires: Date | null;
34
- stripeCustomerId: string | null;
35
- paymentCustomerId: string | null;
36
- paymentPlanTier: string | null;
37
- paymentPlanExpiresAt: Date | null;
38
- preferences: string | null;
39
- metadata: Record<string, unknown>;
40
- onboarding: number | null;
41
- flags: string | null;
42
- };
43
- };
44
- meta: import("trpc-to-openapi").OpenApiMeta;
2
+ import type { AIService } from "./modules/ai/ai.service";
3
+ import type { AuthService } from "./modules/auth/auth.service";
4
+ import type { BillingService } from "./modules/billing/billing.service";
5
+ import type { TRPCMethods } from "./utils/trpc";
6
+ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods: TRPCMethods, authService: AuthService, aiService: AIService<MastraInstance>, billingService: BillingService) => import("@trpc/server").TRPCBuiltRouter<{
7
+ ctx: import("./modules/auth/auth.lib").Context;
8
+ meta: any;
45
9
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
46
10
  transformer: true;
47
11
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
48
12
  auth: import("@trpc/server").TRPCBuiltRouter<{
49
- ctx: {
50
- session: {
51
- id: string;
52
- createdAt: Date;
53
- updatedAt: Date;
54
- expiresAt: Date;
55
- token: string;
56
- ipAddress: string | null;
57
- userAgent: string | null;
58
- userId: string;
59
- impersonatedBy: string | null;
60
- activeOrganizationId: string | null;
61
- activeOrganizationRole: string | null;
62
- activeTeamId: string | null;
63
- activeTeamRole: string | null;
64
- };
65
- user: {
66
- id: string;
67
- name: string;
68
- email: string;
69
- emailVerified: boolean;
70
- image: string | null;
71
- createdAt: Date;
72
- updatedAt: Date;
73
- role: string | null;
74
- banned: boolean | null;
75
- banReason: string | null;
76
- banExpires: Date | null;
77
- stripeCustomerId: string | null;
78
- paymentCustomerId: string | null;
79
- paymentPlanTier: string | null;
80
- paymentPlanExpiresAt: Date | null;
81
- preferences: string | null;
82
- metadata: Record<string, unknown>;
83
- onboarding: number | null;
84
- flags: string | null;
85
- };
86
- };
87
- meta: import("trpc-to-openapi").OpenApiMeta;
13
+ ctx: import("./modules/auth/auth.lib").Context;
14
+ meta: any;
88
15
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
89
16
  transformer: true;
90
17
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
91
18
  getUserWaitlistCount: import("@trpc/server").TRPCQueryProcedure<{
92
19
  input: void;
93
20
  output: number;
94
- meta: import("trpc-to-openapi").OpenApiMeta;
21
+ meta: any;
95
22
  }>;
96
23
  createInvitationCode: import("@trpc/server").TRPCMutationProcedure<{
97
24
  input: {
@@ -107,7 +34,7 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
107
34
  code: string | null;
108
35
  expiresAt: Date | null;
109
36
  };
110
- meta: import("trpc-to-openapi").OpenApiMeta;
37
+ meta: any;
111
38
  }>;
112
39
  createAccountClaimCode: import("@trpc/server").TRPCMutationProcedure<{
113
40
  input: {
@@ -125,21 +52,21 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
125
52
  createdAt: Date;
126
53
  updatedAt: Date | null;
127
54
  };
128
- meta: import("trpc-to-openapi").OpenApiMeta;
55
+ meta: any;
129
56
  }>;
130
57
  listAccountClaims: import("@trpc/server").TRPCQueryProcedure<{
131
58
  input: void;
132
59
  output: {
133
60
  id: string;
61
+ status: string;
134
62
  createdAt: Date;
135
63
  updatedAt: Date | null;
136
64
  expiresAt: Date | null;
137
- status: string;
138
65
  claimUserId: string | null;
139
66
  claimedAt: Date | null;
140
67
  claimedEmail: string | null;
141
68
  }[];
142
- meta: import("trpc-to-openapi").OpenApiMeta;
69
+ meta: any;
143
70
  }>;
144
71
  generateAccountClaimMagicLink: import("@trpc/server").TRPCMutationProcedure<{
145
72
  input: {
@@ -147,30 +74,30 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
147
74
  email?: string | undefined;
148
75
  };
149
76
  output: {
77
+ url: string;
150
78
  id: string;
151
79
  email: string;
152
80
  createdAt: Date;
153
- expiresAt: Date | null;
154
81
  userId: string;
82
+ expiresAt: Date | null;
155
83
  claimId: string;
156
- url: string;
157
84
  };
158
- meta: import("trpc-to-openapi").OpenApiMeta;
85
+ meta: any;
159
86
  }>;
160
87
  listAccountClaimMagicLinks: import("@trpc/server").TRPCQueryProcedure<{
161
88
  input: {
162
89
  claimId: string;
163
90
  };
164
91
  output: {
92
+ url: string;
165
93
  id: string;
166
94
  email: string;
167
95
  createdAt: Date;
168
- expiresAt: Date | null;
169
96
  userId: string;
97
+ expiresAt: Date | null;
170
98
  claimId: string;
171
- url: string;
172
99
  }[];
173
- meta: import("trpc-to-openapi").OpenApiMeta;
100
+ meta: any;
174
101
  }>;
175
102
  getMyAccountClaimStatus: import("@trpc/server").TRPCQueryProcedure<{
176
103
  input: void;
@@ -185,7 +112,7 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
185
112
  createdAt: Date;
186
113
  updatedAt: Date | null;
187
114
  } | null;
188
- meta: import("trpc-to-openapi").OpenApiMeta;
115
+ meta: any;
189
116
  }>;
190
117
  setMyAccountClaimEmail: import("@trpc/server").TRPCMutationProcedure<{
191
118
  input: {
@@ -194,14 +121,14 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
194
121
  output: {
195
122
  status: boolean;
196
123
  };
197
- meta: import("trpc-to-openapi").OpenApiMeta;
124
+ meta: any;
198
125
  }>;
199
126
  acceptMyAccountClaim: import("@trpc/server").TRPCMutationProcedure<{
200
127
  input: void;
201
128
  output: {
202
129
  status: boolean;
203
130
  };
204
- meta: import("trpc-to-openapi").OpenApiMeta;
131
+ meta: any;
205
132
  }>;
206
133
  listWaitlist: import("@trpc/server").TRPCQueryProcedure<{
207
134
  input: void;
@@ -215,33 +142,33 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
215
142
  code: string | null;
216
143
  expiresAt: Date | null;
217
144
  }[];
218
- meta: import("trpc-to-openapi").OpenApiMeta;
145
+ meta: any;
219
146
  }>;
220
147
  listAdminWaitlist: import("@trpc/server").TRPCQueryProcedure<{
221
148
  input: void;
222
149
  output: {
223
- id: string;
224
150
  name: string | null;
151
+ id: string;
225
152
  email: string | null;
153
+ status: string;
226
154
  createdAt: Date;
227
155
  updatedAt: Date | null;
228
- status: string;
229
156
  }[];
230
- meta: import("trpc-to-openapi").OpenApiMeta;
157
+ meta: any;
231
158
  }>;
232
159
  addToWaitlist: import("@trpc/server").TRPCMutationProcedure<{
233
160
  input: {
234
161
  email: string;
235
162
  };
236
163
  output: {
237
- id: string;
238
164
  name: string | null;
165
+ id: string;
239
166
  email: string | null;
167
+ status: string;
240
168
  createdAt: Date;
241
169
  updatedAt: Date | null;
242
- status: string;
243
170
  };
244
- meta: import("trpc-to-openapi").OpenApiMeta;
171
+ meta: any;
245
172
  }>;
246
173
  inviteToWaitlist: import("@trpc/server").TRPCMutationProcedure<{
247
174
  input: {
@@ -258,89 +185,89 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
258
185
  code: string | null;
259
186
  expiresAt: Date | null;
260
187
  };
261
- meta: import("trpc-to-openapi").OpenApiMeta;
188
+ meta: any;
262
189
  }>;
263
190
  inviteFromWaitlist: import("@trpc/server").TRPCMutationProcedure<{
264
191
  input: {
265
192
  id: string;
266
193
  };
267
194
  output: {
268
- id: string;
269
195
  name: string | null;
196
+ id: string;
270
197
  email: string | null;
198
+ status: string;
271
199
  createdAt: Date;
272
200
  updatedAt: Date | null;
273
- status: string;
274
201
  };
275
- meta: import("trpc-to-openapi").OpenApiMeta;
202
+ meta: any;
276
203
  }>;
277
204
  removeFromWaitlist: import("@trpc/server").TRPCMutationProcedure<{
278
205
  input: {
279
206
  id: string;
280
207
  };
281
208
  output: {
282
- id: string;
283
209
  name: string | null;
210
+ id: string;
284
211
  email: string | null;
212
+ status: string;
285
213
  createdAt: Date;
286
214
  updatedAt: Date | null;
287
- status: string;
288
215
  };
289
- meta: import("trpc-to-openapi").OpenApiMeta;
216
+ meta: any;
290
217
  }>;
291
218
  joinWaitlist: import("@trpc/server").TRPCMutationProcedure<{
292
219
  input: {
293
220
  email: string;
294
221
  };
295
222
  output: {
296
- id: string;
297
223
  name: string | null;
224
+ id: string;
298
225
  email: string | null;
226
+ status: string;
299
227
  createdAt: Date;
300
228
  updatedAt: Date | null;
301
- status: string;
302
229
  };
303
- meta: import("trpc-to-openapi").OpenApiMeta;
230
+ meta: any;
304
231
  }>;
305
232
  getOnboarding: import("@trpc/server").TRPCQueryProcedure<{
306
233
  input: void;
307
234
  output: number;
308
- meta: import("trpc-to-openapi").OpenApiMeta;
235
+ meta: any;
309
236
  }>;
310
237
  setOnboarding: import("@trpc/server").TRPCMutationProcedure<{
311
238
  input: number;
312
239
  output: number;
313
- meta: import("trpc-to-openapi").OpenApiMeta;
240
+ meta: any;
314
241
  }>;
315
242
  getPreferences: import("@trpc/server").TRPCQueryProcedure<{
316
243
  input: void;
317
244
  output: Record<string, unknown>;
318
- meta: import("trpc-to-openapi").OpenApiMeta;
245
+ meta: any;
319
246
  }>;
320
247
  setPreferences: import("@trpc/server").TRPCMutationProcedure<{
321
248
  input: Record<string, unknown>;
322
249
  output: Record<string, unknown>;
323
- meta: import("trpc-to-openapi").OpenApiMeta;
250
+ meta: any;
324
251
  }>;
325
252
  getMetadata: import("@trpc/server").TRPCQueryProcedure<{
326
253
  input: void;
327
254
  output: Record<string, unknown>;
328
- meta: import("trpc-to-openapi").OpenApiMeta;
255
+ meta: any;
329
256
  }>;
330
257
  setMetadata: import("@trpc/server").TRPCMutationProcedure<{
331
258
  input: Record<string, unknown>;
332
259
  output: Record<string, unknown>;
333
- meta: import("trpc-to-openapi").OpenApiMeta;
260
+ meta: any;
334
261
  }>;
335
262
  getFlags: import("@trpc/server").TRPCQueryProcedure<{
336
263
  input: void;
337
264
  output: string[];
338
- meta: import("trpc-to-openapi").OpenApiMeta;
265
+ meta: any;
339
266
  }>;
340
267
  setFlags: import("@trpc/server").TRPCMutationProcedure<{
341
268
  input: string[];
342
269
  output: string[];
343
- meta: import("trpc-to-openapi").OpenApiMeta;
270
+ meta: any;
344
271
  }>;
345
272
  validateWaitlistCode: import("@trpc/server").TRPCQueryProcedure<{
346
273
  input: {
@@ -349,49 +276,12 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
349
276
  output: {
350
277
  status: string;
351
278
  };
352
- meta: import("trpc-to-openapi").OpenApiMeta;
279
+ meta: any;
353
280
  }>;
354
281
  }>>;
355
282
  ai: import("@trpc/server").TRPCBuiltRouter<{
356
- ctx: {
357
- session: {
358
- id: string;
359
- createdAt: Date;
360
- updatedAt: Date;
361
- expiresAt: Date;
362
- token: string;
363
- ipAddress: string | null;
364
- userAgent: string | null;
365
- userId: string;
366
- impersonatedBy: string | null;
367
- activeOrganizationId: string | null;
368
- activeOrganizationRole: string | null;
369
- activeTeamId: string | null;
370
- activeTeamRole: string | null;
371
- };
372
- user: {
373
- id: string;
374
- name: string;
375
- email: string;
376
- emailVerified: boolean;
377
- image: string | null;
378
- createdAt: Date;
379
- updatedAt: Date;
380
- role: string | null;
381
- banned: boolean | null;
382
- banReason: string | null;
383
- banExpires: Date | null;
384
- stripeCustomerId: string | null;
385
- paymentCustomerId: string | null;
386
- paymentPlanTier: string | null;
387
- paymentPlanExpiresAt: Date | null;
388
- preferences: string | null;
389
- metadata: Record<string, unknown>;
390
- onboarding: number | null;
391
- flags: string | null;
392
- };
393
- };
394
- meta: import("trpc-to-openapi").OpenApiMeta;
283
+ ctx: import("./modules/auth/auth.lib").Context;
284
+ meta: any;
395
285
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
396
286
  transformer: true;
397
287
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
@@ -405,49 +295,12 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
405
295
  totalTokens: number | null;
406
296
  cost: number | null;
407
297
  };
408
- meta: import("trpc-to-openapi").OpenApiMeta;
298
+ meta: any;
409
299
  }>;
410
300
  }>>;
411
301
  billing: import("@trpc/server").TRPCBuiltRouter<{
412
- ctx: {
413
- session: {
414
- id: string;
415
- createdAt: Date;
416
- updatedAt: Date;
417
- expiresAt: Date;
418
- token: string;
419
- ipAddress: string | null;
420
- userAgent: string | null;
421
- userId: string;
422
- impersonatedBy: string | null;
423
- activeOrganizationId: string | null;
424
- activeOrganizationRole: string | null;
425
- activeTeamId: string | null;
426
- activeTeamRole: string | null;
427
- };
428
- user: {
429
- id: string;
430
- name: string;
431
- email: string;
432
- emailVerified: boolean;
433
- image: string | null;
434
- createdAt: Date;
435
- updatedAt: Date;
436
- role: string | null;
437
- banned: boolean | null;
438
- banReason: string | null;
439
- banExpires: Date | null;
440
- stripeCustomerId: string | null;
441
- paymentCustomerId: string | null;
442
- paymentPlanTier: string | null;
443
- paymentPlanExpiresAt: Date | null;
444
- preferences: string | null;
445
- metadata: Record<string, unknown>;
446
- onboarding: number | null;
447
- flags: string | null;
448
- };
449
- };
450
- meta: import("trpc-to-openapi").OpenApiMeta;
302
+ ctx: import("./modules/auth/auth.lib").Context;
303
+ meta: any;
451
304
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
452
305
  transformer: true;
453
306
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
@@ -473,12 +326,12 @@ export declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(authS
473
326
  unitAmount?: number | null | undefined;
474
327
  discounts?: string[] | null | undefined;
475
328
  } | null;
476
- meta: import("trpc-to-openapi").OpenApiMeta;
329
+ meta: any;
477
330
  }>;
478
331
  listInvoices: import("@trpc/server").TRPCQueryProcedure<{
479
332
  input: void;
480
333
  output: import("stripe").Stripe.Invoice[];
481
- meta: import("trpc-to-openapi").OpenApiMeta;
334
+ meta: any;
482
335
  }>;
483
336
  }>>;
484
337
  }>>;
package/dist/src/types.js CHANGED
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAuthTRPCRouter = void 0;
4
- const ai_trpc_1 = require("#modules/ai/ai.trpc");
5
- const auth_trpc_1 = require("#modules/auth/auth.trpc");
6
- const billing_trpc_1 = require("#modules/billing/billing.trpc");
7
- const _trpc_1 = require("#trpc");
8
- const createAuthTRPCRouter = (authService, aiService, billingService) => (0, _trpc_1.router)({
9
- auth: (0, auth_trpc_1.createAuthTRPC)(authService),
10
- ai: (0, ai_trpc_1.createAITRPC)(aiService),
11
- billing: (0, billing_trpc_1.createBillingTRPC)(billingService),
4
+ const ai_trpc_1 = require("./modules/ai/ai.trpc");
5
+ const auth_trpc_1 = require("./modules/auth/auth.trpc");
6
+ const billing_trpc_1 = require("./modules/billing/billing.trpc");
7
+ const createAuthTRPCRouter = (trpcMethods, authService, aiService, billingService) => trpcMethods.router({
8
+ auth: (0, auth_trpc_1.createAuthTRPC)(trpcMethods, authService),
9
+ ai: (0, ai_trpc_1.createAITRPC)(trpcMethods, aiService),
10
+ billing: (0, billing_trpc_1.createBillingTRPC)(trpcMethods, billingService),
12
11
  });
13
12
  exports.createAuthTRPCRouter = createAuthTRPCRouter;
@@ -1,6 +1,6 @@
1
1
  import type { captureException } from "@sentry/node";
2
2
  import { type TRPC_ERROR_CODE_KEY, TRPCError } from "@trpc/server";
3
- import type { ServerErrorLayer } from "#modules/base/base.types";
3
+ import type { ServerErrorLayer } from "../modules/base/base.types";
4
4
  export type { ServerErrorLayer };
5
5
  export declare class ServerError extends Error {
6
6
  readonly code: TRPC_ERROR_CODE_KEY;