@m5kdev/backend 0.1.5 → 0.2.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.
@@ -1,44 +1,8 @@
1
1
  import type { BillingService } from "#modules/billing/billing.service";
2
- export declare function createBillingTRPC(billingService: BillingService): 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;
2
+ import { type TRPCMethods } from "#utils/trpc";
3
+ export declare function createBillingTRPC({ router, privateProcedure: procedure }: TRPCMethods, billingService: BillingService): 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<{
@@ -64,11 +28,11 @@ export declare function createBillingTRPC(billingService: BillingService): impor
64
28
  unitAmount?: number | null | undefined;
65
29
  discounts?: string[] | null | undefined;
66
30
  } | null;
67
- meta: import("trpc-to-openapi").OpenApiMeta;
31
+ meta: any;
68
32
  }>;
69
33
  listInvoices: import("@trpc/server").TRPCQueryProcedure<{
70
34
  input: void;
71
35
  output: import("stripe").Stripe.Invoice[];
72
- meta: import("trpc-to-openapi").OpenApiMeta;
36
+ meta: any;
73
37
  }>;
74
38
  }>>;
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createBillingTRPC = createBillingTRPC;
4
4
  const billing_schema_1 = require("@m5kdev/commons/modules/billing/billing.schema");
5
- const _trpc_1 = require("#trpc");
6
- function createBillingTRPC(billingService) {
7
- return (0, _trpc_1.router)({
8
- getActiveSubscription: _trpc_1.procedure
5
+ const trpc_1 = require("#utils/trpc");
6
+ function createBillingTRPC({ router, privateProcedure: procedure }, billingService) {
7
+ return router({
8
+ getActiveSubscription: procedure
9
9
  .output(billing_schema_1.billingSchema.nullable())
10
10
  .query(async ({ ctx: { user } }) => {
11
- return (0, _trpc_1.handleTRPCResult)(await billingService.getActiveSubscription({ user }));
11
+ return (0, trpc_1.handleTRPCResult)(await billingService.getActiveSubscription({ user }));
12
12
  }),
13
- listInvoices: _trpc_1.procedure.query(async ({ ctx: { user } }) => {
14
- return (0, _trpc_1.handleTRPCResult)(await billingService.listInvoices({ user }));
13
+ listInvoices: procedure.query(async ({ ctx: { user } }) => {
14
+ return (0, trpc_1.handleTRPCResult)(await billingService.listInvoices({ user }));
15
15
  }),
16
16
  });
17
17
  }
@@ -1,44 +1,8 @@
1
+ import { type TRPCMethods } from "#utils/trpc";
1
2
  import type { ConnectService } from "./connect.service";
2
- export declare function createConnectTRPC(connectService: ConnectService): 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;
3
+ export declare function createConnectTRPC({ router, privateProcedure: procedure }: TRPCMethods, connectService: ConnectService): 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<{
@@ -48,14 +12,14 @@ export declare function createConnectTRPC(connectService: ConnectService): impor
48
12
  inactive?: boolean | undefined;
49
13
  };
50
14
  output: {
15
+ provider: string;
51
16
  id: string;
52
- createdAt: Date;
53
17
  userId: string;
54
- provider: string;
18
+ createdAt: Date;
55
19
  accountType: string;
56
20
  providerAccountId: string;
57
- updatedAt?: Date | null | undefined;
58
21
  expiresAt?: Date | null | undefined;
22
+ updatedAt?: Date | null | undefined;
59
23
  scope?: string | null | undefined;
60
24
  handle?: string | null | undefined;
61
25
  displayName?: string | null | undefined;
@@ -66,7 +30,7 @@ export declare function createConnectTRPC(connectService: ConnectService): impor
66
30
  revokedAt?: Date | null | undefined;
67
31
  lastRefreshedAt?: Date | null | undefined;
68
32
  }[];
69
- meta: import("trpc-to-openapi").OpenApiMeta;
33
+ meta: any;
70
34
  }>;
71
35
  delete: import("@trpc/server").TRPCMutationProcedure<{
72
36
  input: {
@@ -75,6 +39,6 @@ export declare function createConnectTRPC(connectService: ConnectService): impor
75
39
  output: {
76
40
  id: string;
77
41
  };
78
- meta: import("trpc-to-openapi").OpenApiMeta;
42
+ meta: any;
79
43
  }>;
80
44
  }>>;
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createConnectTRPC = createConnectTRPC;
4
- const _trpc_1 = require("#trpc");
4
+ const trpc_1 = require("#utils/trpc");
5
5
  const connect_dto_1 = require("./connect.dto");
6
- function createConnectTRPC(connectService) {
7
- return (0, _trpc_1.router)({
8
- list: _trpc_1.procedure
6
+ function createConnectTRPC({ router, privateProcedure: procedure }, connectService) {
7
+ return router({
8
+ list: procedure
9
9
  .input(connect_dto_1.connectListInputSchema)
10
10
  .output(connect_dto_1.connectListOutputSchema)
11
11
  .query(async ({ ctx, input }) => {
12
- return (0, _trpc_1.handleTRPCResult)(await connectService.list(input, ctx));
12
+ return (0, trpc_1.handleTRPCResult)(await connectService.list(input, ctx));
13
13
  }),
14
- delete: _trpc_1.procedure
14
+ delete: procedure
15
15
  .input(connect_dto_1.connectDeleteInputSchema)
16
16
  .output(connect_dto_1.connectDeleteOutputSchema)
17
17
  .mutation(async ({ ctx, input }) => {
18
- return (0, _trpc_1.handleTRPCResult)(await connectService.delete(input, ctx));
18
+ return (0, trpc_1.handleTRPCResult)(await connectService.delete(input, ctx));
19
19
  }),
20
20
  });
21
21
  }
@@ -1,44 +1,8 @@
1
1
  import type { RecurrenceService } from "#modules/recurrence/recurrence.service";
2
- export declare function createRecurrenceTRPC(recurrenceService: RecurrenceService): 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;
2
+ import { type TRPCMethods } from "#utils/trpc";
3
+ export declare function createRecurrenceTRPC({ router, privateProcedure: procedure }: TRPCMethods, recurrenceService: RecurrenceService): 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<{
@@ -51,7 +15,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
51
15
  filters?: {
52
16
  columnId: string;
53
17
  type: "string" | "number" | "boolean" | "date" | "enum";
54
- method: "on" | "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
18
+ method: "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
55
19
  value: string | number | boolean | string[];
56
20
  valueTo?: string | undefined;
57
21
  endColumnId?: string | undefined;
@@ -72,7 +36,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
72
36
  }[];
73
37
  total: number;
74
38
  };
75
- meta: import("trpc-to-openapi").OpenApiMeta;
39
+ meta: any;
76
40
  }>;
77
41
  create: import("@trpc/server").TRPCMutationProcedure<{
78
42
  input: {
@@ -135,7 +99,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
135
99
  bysecond?: number | number[] | null | undefined;
136
100
  }[];
137
101
  };
138
- meta: import("trpc-to-openapi").OpenApiMeta;
102
+ meta: any;
139
103
  }>;
140
104
  findById: import("@trpc/server").TRPCQueryProcedure<{
141
105
  input: {
@@ -153,7 +117,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
153
117
  kind?: string | null | undefined;
154
118
  metadata?: Record<string, unknown> | null | undefined;
155
119
  } | null;
156
- meta: import("trpc-to-openapi").OpenApiMeta;
120
+ meta: any;
157
121
  }>;
158
122
  update: import("@trpc/server").TRPCMutationProcedure<{
159
123
  input: {
@@ -175,7 +139,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
175
139
  kind?: string | null | undefined;
176
140
  metadata?: Record<string, unknown> | null | undefined;
177
141
  };
178
- meta: import("trpc-to-openapi").OpenApiMeta;
142
+ meta: any;
179
143
  }>;
180
144
  updateRule: import("@trpc/server").TRPCMutationProcedure<{
181
145
  input: {
@@ -219,7 +183,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
219
183
  byminute?: number | number[] | null | undefined;
220
184
  bysecond?: number | number[] | null | undefined;
221
185
  };
222
- meta: import("trpc-to-openapi").OpenApiMeta;
186
+ meta: any;
223
187
  }>;
224
188
  delete: import("@trpc/server").TRPCMutationProcedure<{
225
189
  input: {
@@ -228,7 +192,7 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
228
192
  output: {
229
193
  id: string;
230
194
  };
231
- meta: import("trpc-to-openapi").OpenApiMeta;
195
+ meta: any;
232
196
  }>;
233
197
  deleteRule: import("@trpc/server").TRPCMutationProcedure<{
234
198
  input: {
@@ -237,6 +201,6 @@ export declare function createRecurrenceTRPC(recurrenceService: RecurrenceServic
237
201
  output: {
238
202
  id: string;
239
203
  };
240
- meta: import("trpc-to-openapi").OpenApiMeta;
204
+ meta: any;
241
205
  }>;
242
206
  }>>;
@@ -4,7 +4,7 @@ exports.createRecurrenceTRPC = createRecurrenceTRPC;
4
4
  const recurrence_schema_1 = require("@m5kdev/commons/modules/recurrence/recurrence.schema");
5
5
  const query_schema_1 = require("@m5kdev/commons/modules/schemas/query.schema");
6
6
  const zod_1 = require("zod");
7
- const _trpc_1 = require("#trpc");
7
+ const trpc_1 = require("#utils/trpc");
8
8
  const createRecurrenceOutputSchema = zod_1.z.object({
9
9
  recurrence: recurrence_schema_1.recurrenceSchema,
10
10
  rules: zod_1.z.array(recurrence_schema_1.recurrenceRulesSchema),
@@ -17,49 +17,49 @@ const updateRecurrenceInputSchema = recurrence_schema_1.updateRecurrenceSchema.e
17
17
  id: zod_1.z.string(),
18
18
  });
19
19
  const deleteRecurrenceOutputSchema = zod_1.z.object({ id: zod_1.z.string() });
20
- function createRecurrenceTRPC(recurrenceService) {
21
- return (0, _trpc_1.router)({
22
- list: _trpc_1.procedure
20
+ function createRecurrenceTRPC({ router, privateProcedure: procedure }, recurrenceService) {
21
+ return router({
22
+ list: procedure
23
23
  .input(query_schema_1.querySchema.optional())
24
24
  .output(listRecurrenceOutputSchema)
25
25
  .query(async ({ ctx, input }) => {
26
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.list(input, ctx));
26
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.list(input, ctx));
27
27
  }),
28
- create: _trpc_1.procedure
28
+ create: procedure
29
29
  .input(recurrence_schema_1.createRecurrenceSchema)
30
30
  .output(createRecurrenceOutputSchema)
31
31
  .mutation(async ({ ctx, input }) => {
32
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.create(input, ctx));
32
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.create(input, ctx));
33
33
  }),
34
- findById: _trpc_1.procedure
34
+ findById: procedure
35
35
  .input(zod_1.z.object({ id: zod_1.z.string() }))
36
36
  .output(recurrence_schema_1.recurrenceSchema.nullable())
37
37
  .query(async ({ input }) => {
38
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.findById(input.id));
38
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.findById(input.id));
39
39
  }),
40
- update: _trpc_1.procedure
40
+ update: procedure
41
41
  .input(updateRecurrenceInputSchema)
42
42
  .output(recurrence_schema_1.recurrenceSchema)
43
43
  .mutation(async ({ input }) => {
44
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.update(input));
44
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.update(input));
45
45
  }),
46
- updateRule: _trpc_1.procedure
46
+ updateRule: procedure
47
47
  .input(recurrence_schema_1.updateRecurrenceRulesSchema)
48
48
  .output(recurrence_schema_1.recurrenceRulesSchema)
49
49
  .mutation(async ({ input }) => {
50
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.updateRule(input));
50
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.updateRule(input));
51
51
  }),
52
- delete: _trpc_1.procedure
52
+ delete: procedure
53
53
  .input(recurrence_schema_1.deleteRecurrenceSchema)
54
54
  .output(deleteRecurrenceOutputSchema)
55
55
  .mutation(async ({ input }) => {
56
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.delete(input));
56
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.delete(input));
57
57
  }),
58
- deleteRule: _trpc_1.procedure
58
+ deleteRule: procedure
59
59
  .input(recurrence_schema_1.deleteRecurrenceRulesSchema)
60
60
  .output(deleteRecurrenceOutputSchema)
61
61
  .mutation(async ({ input }) => {
62
- return (0, _trpc_1.handleTRPCResult)(await recurrenceService.deleteRule(input));
62
+ return (0, trpc_1.handleTRPCResult)(await recurrenceService.deleteRule(input));
63
63
  }),
64
64
  });
65
65
  }
@@ -1,44 +1,8 @@
1
1
  import type { TagService } from "#modules/tag/tag.service";
2
- export declare function createTagTRPC(tagService: TagService): 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;
2
+ import { type TRPCMethods } from "#utils/trpc";
3
+ export declare function createTagTRPC({ router, privateProcedure: procedure }: TRPCMethods, tagService: TagService): 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<{
@@ -51,7 +15,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
51
15
  filters?: {
52
16
  columnId: string;
53
17
  type: "string" | "number" | "boolean" | "date" | "enum";
54
- method: "on" | "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
18
+ method: "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
55
19
  value: string | number | boolean | string[];
56
20
  valueTo?: string | undefined;
57
21
  endColumnId?: string | undefined;
@@ -76,7 +40,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
76
40
  }[];
77
41
  total: number;
78
42
  };
79
- meta: import("trpc-to-openapi").OpenApiMeta;
43
+ meta: any;
80
44
  }>;
81
45
  listTaggings: import("@trpc/server").TRPCQueryProcedure<{
82
46
  input: {
@@ -84,7 +48,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
84
48
  resourceIds?: {
85
49
  columnId: string;
86
50
  type: "string" | "number" | "boolean" | "date" | "enum";
87
- method: "on" | "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
51
+ method: "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
88
52
  value: string | number | boolean | string[];
89
53
  valueTo?: string | undefined;
90
54
  endColumnId?: string | undefined;
@@ -97,7 +61,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
97
61
  resourceType: string;
98
62
  resourceId: string;
99
63
  }[];
100
- meta: import("trpc-to-openapi").OpenApiMeta;
64
+ meta: any;
101
65
  }>;
102
66
  create: import("@trpc/server").TRPCMutationProcedure<{
103
67
  input: {
@@ -124,7 +88,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
124
88
  parentId: string | null;
125
89
  assignableTo: string[];
126
90
  };
127
- meta: import("trpc-to-openapi").OpenApiMeta;
91
+ meta: any;
128
92
  }>;
129
93
  update: import("@trpc/server").TRPCMutationProcedure<{
130
94
  input: {
@@ -147,7 +111,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
147
111
  parentId: string | null;
148
112
  assignableTo: string[];
149
113
  };
150
- meta: import("trpc-to-openapi").OpenApiMeta;
114
+ meta: any;
151
115
  }>;
152
116
  link: import("@trpc/server").TRPCMutationProcedure<{
153
117
  input: {
@@ -162,7 +126,7 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
162
126
  resourceType: string;
163
127
  resourceId: string;
164
128
  };
165
- meta: import("trpc-to-openapi").OpenApiMeta;
129
+ meta: any;
166
130
  }>;
167
131
  unlink: import("@trpc/server").TRPCMutationProcedure<{
168
132
  input: {
@@ -185,6 +149,6 @@ export declare function createTagTRPC(tagService: TagService): import("@trpc/ser
185
149
  parentId: string | null;
186
150
  assignableTo: string[];
187
151
  };
188
- meta: import("trpc-to-openapi").OpenApiMeta;
152
+ meta: any;
189
153
  }>;
190
154
  }>>;
@@ -3,45 +3,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTagTRPC = createTagTRPC;
4
4
  const tag_schema_1 = require("@m5kdev/commons/modules/tag/tag.schema");
5
5
  const tag_dto_1 = require("#modules/tag/tag.dto");
6
- const _trpc_1 = require("#trpc");
7
- function createTagTRPC(tagService) {
6
+ const trpc_1 = require("#utils/trpc");
7
+ function createTagTRPC({ router, privateProcedure: procedure }, tagService) {
8
8
  const tagListInput = tag_schema_1.tagListInputSchema.extend({
9
9
  assignableTo: tag_schema_1.tagListSchema.shape.assignableTo,
10
10
  });
11
- return (0, _trpc_1.router)({
12
- list: _trpc_1.procedure
11
+ return router({
12
+ list: procedure
13
13
  .input(tagListInput)
14
14
  .output(tag_schema_1.tagListOutputSchema)
15
- .query(async ({ input }) => (0, _trpc_1.handleTRPCResult)(await tagService.list(input))),
16
- listTaggings: _trpc_1.procedure
15
+ .query(async ({ input }) => (0, trpc_1.handleTRPCResult)(await tagService.list(input))),
16
+ listTaggings: procedure
17
17
  .input(tag_schema_1.taggingSchema
18
18
  .pick({ resourceType: true })
19
19
  .extend({ resourceIds: tag_schema_1.tagListInputSchema.shape.filters.optional() }))
20
20
  .output(tag_dto_1.taggingsSelectOutput.array())
21
- .query(async ({ input }) => (0, _trpc_1.handleTRPCResult)(await tagService.listTaggings(input))),
22
- create: _trpc_1.procedure
21
+ .query(async ({ input }) => (0, trpc_1.handleTRPCResult)(await tagService.listTaggings(input))),
22
+ create: procedure
23
23
  .input(tag_schema_1.tagCreateSchema)
24
24
  .output(tag_dto_1.tagsSelectOutput)
25
25
  .mutation(async ({ ctx, input }) => {
26
- return (0, _trpc_1.handleTRPCResult)(await tagService.create(input, ctx));
26
+ return (0, trpc_1.handleTRPCResult)(await tagService.create(input, ctx));
27
27
  }),
28
- update: _trpc_1.procedure
28
+ update: procedure
29
29
  .input(tag_schema_1.tagUpdateSchema)
30
30
  .output(tag_dto_1.tagsSelectOutput)
31
31
  .mutation(async ({ ctx, input }) => {
32
- return (0, _trpc_1.handleTRPCResult)(await tagService.update(input, ctx));
32
+ return (0, trpc_1.handleTRPCResult)(await tagService.update(input, ctx));
33
33
  }),
34
- link: _trpc_1.procedure
34
+ link: procedure
35
35
  .input(tag_schema_1.tagLinkSchema)
36
36
  .output(tag_dto_1.taggingsSelectOutput)
37
37
  .mutation(async ({ ctx, input }) => {
38
- return (0, _trpc_1.handleTRPCResult)(await tagService.link(input, ctx));
38
+ return (0, trpc_1.handleTRPCResult)(await tagService.link(input, ctx));
39
39
  }),
40
- unlink: _trpc_1.procedure
40
+ unlink: procedure
41
41
  .input(tag_schema_1.tagLinkSchema)
42
42
  .output(tag_dto_1.tagsSelectOutput)
43
43
  .mutation(async ({ ctx, input }) => {
44
- return (0, _trpc_1.handleTRPCResult)(await tagService.unlink(input, ctx));
44
+ return (0, trpc_1.handleTRPCResult)(await tagService.unlink(input, ctx));
45
45
  }),
46
46
  });
47
47
  }
@@ -1,44 +1,8 @@
1
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;
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
  }>>;