@m5kdev/backend 0.8.0 → 0.8.2

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.
@@ -5,6 +5,7 @@ import { AiUsageRepository, AiUsageRow } from "./ai.repository.mjs";
5
5
  import { IdeogramV3GenerateInput, IdeogramV3GenerateOutput } from "./ideogram/ideogram.dto.mjs";
6
6
  import { IdeogramService } from "./ideogram/ideogram.service.mjs";
7
7
  import { ZodType, z } from "zod";
8
+ import { arrayToPseudoXML } from "@m5kdev/commons/modules/ai/ai.utils";
8
9
  import { MDocument } from "@mastra/rag";
9
10
  import { ModelMessage, generateText } from "ai";
10
11
  import { Mastra } from "@mastra/core";
@@ -48,7 +49,7 @@ declare class AIService<MastraInstance extends Mastra> extends BaseService<{
48
49
  ideogram?: IdeogramService;
49
50
  }> {
50
51
  helpers: {
51
- arrayToPseudoXML: any;
52
+ arrayToPseudoXML: typeof arrayToPseudoXML;
52
53
  };
53
54
  mastra?: MastraInstance;
54
55
  openrouter?: OpenRouterProvider;
@@ -11,7 +11,7 @@ declare function createAITRPC<MastraInstance extends Mastra>({
11
11
  ctx: Context;
12
12
  meta: any;
13
13
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
14
- transformer: any;
14
+ transformer: true;
15
15
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
16
16
  getUserUsage: _$_trpc_server0.TRPCQueryProcedure<{
17
17
  input: {
@@ -36,8 +36,8 @@ declare const accountClaimOutputSchema: z.ZodObject<{
36
36
  id: z.ZodString;
37
37
  createdAt: z.ZodDate;
38
38
  updatedAt: z.ZodNullable<z.ZodDate>;
39
- expiresAt: z.ZodNullable<z.ZodDate>;
40
39
  status: z.ZodString;
40
+ expiresAt: z.ZodNullable<z.ZodDate>;
41
41
  claimUserId: z.ZodNullable<z.ZodString>;
42
42
  claimedAt: z.ZodNullable<z.ZodDate>;
43
43
  claimedEmail: z.ZodNullable<z.ZodString>;
@@ -58,8 +58,8 @@ declare const accountClaimMagicLinkOutputSchema: z.ZodObject<{
58
58
  id: z.ZodString;
59
59
  email: z.ZodString;
60
60
  createdAt: z.ZodDate;
61
- userId: z.ZodString;
62
61
  expiresAt: z.ZodNullable<z.ZodDate>;
62
+ userId: z.ZodString;
63
63
  claimId: z.ZodString;
64
64
  url: z.ZodString;
65
65
  }, z.core.$strip>;
@@ -4830,7 +4830,7 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
4830
4830
  } | undefined;
4831
4831
  verification?: {
4832
4832
  modelName?: string;
4833
- fields?: Partial<Record<"value" | "createdAt" | "updatedAt" | "expiresAt" | "identifier", string>>;
4833
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "expiresAt" | "value" | "identifier", string>>;
4834
4834
  additionalFields?: {
4835
4835
  [key: string]: _$better_auth0.DBFieldAttribute;
4836
4836
  };
@@ -12,7 +12,7 @@ declare function createAuthTRPC({
12
12
  ctx: Context;
13
13
  meta: any;
14
14
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
15
- transformer: any;
15
+ transformer: true;
16
16
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
17
17
  getUserWaitlistCount: _$_trpc_server0.TRPCQueryProcedure<{
18
18
  input: void;
@@ -59,8 +59,8 @@ declare function createAuthTRPC({
59
59
  id: string;
60
60
  createdAt: Date;
61
61
  updatedAt: Date | null;
62
- expiresAt: Date | null;
63
62
  status: string;
63
+ expiresAt: Date | null;
64
64
  claimUserId: string | null;
65
65
  claimedAt: Date | null;
66
66
  claimedEmail: string | null;
@@ -76,8 +76,8 @@ declare function createAuthTRPC({
76
76
  id: string;
77
77
  email: string;
78
78
  createdAt: Date;
79
- userId: string;
80
79
  expiresAt: Date | null;
80
+ userId: string;
81
81
  claimId: string;
82
82
  url: string;
83
83
  };
@@ -91,8 +91,8 @@ declare function createAuthTRPC({
91
91
  id: string;
92
92
  email: string;
93
93
  createdAt: Date;
94
- userId: string;
95
94
  expiresAt: Date | null;
95
+ userId: string;
96
96
  claimId: string;
97
97
  url: string;
98
98
  }[];
@@ -4,7 +4,7 @@ import { BillingSchema } from "@m5kdev/commons/modules/billing/billing.schema";
4
4
  import { InferSelectModel } from "drizzle-orm";
5
5
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
6
6
  import { LibSQLDatabase } from "drizzle-orm/libsql";
7
- import { Stripe } from "stripe";
7
+ import { Stripe as Stripe$1 } from "stripe";
8
8
  import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
9
9
 
10
10
  //#region src/modules/billing/billing.repository.d.ts
@@ -2713,7 +2713,7 @@ declare const schema: {
2713
2713
  type Schema = typeof schema;
2714
2714
  type Orm = LibSQLDatabase<Schema>;
2715
2715
  declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["subscriptions"]> {
2716
- stripe: Stripe;
2716
+ stripe: Stripe$1;
2717
2717
  plans: StripePlan[];
2718
2718
  trial?: StripePlan;
2719
2719
  constructor(options: {
@@ -2721,7 +2721,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2721
2721
  schema: Schema;
2722
2722
  table: Schema["subscriptions"];
2723
2723
  libs: {
2724
- stripe: Stripe;
2724
+ stripe: Stripe$1;
2725
2725
  };
2726
2726
  config: {
2727
2727
  trial?: StripePlan;
@@ -2730,7 +2730,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2730
2730
  });
2731
2731
  hasTrial(): boolean;
2732
2732
  getPlanByPriceId(priceId: string): StripePlan | undefined;
2733
- getCustomerByEmail(email: string): ServerResultAsync<Stripe.Customer | null>;
2733
+ getCustomerByEmail(email: string): ServerResultAsync<Stripe$1.Customer | null>;
2734
2734
  getUserByCustomerId(customerId: string): ServerResultAsync<InferSelectModel<Schema["users"]> | null>;
2735
2735
  createCustomer({
2736
2736
  email,
@@ -2740,8 +2740,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2740
2740
  email: string;
2741
2741
  name?: string;
2742
2742
  userId: string;
2743
- }): ServerResultAsync<Stripe.Customer>;
2744
- createTrialSubscription(customerId: string): ServerResultAsync<Stripe.Subscription>;
2743
+ }): ServerResultAsync<Stripe$1.Customer>;
2744
+ createTrialSubscription(customerId: string): ServerResultAsync<Stripe$1.Subscription>;
2745
2745
  createSubscription({
2746
2746
  customerId,
2747
2747
  priceId,
@@ -2752,7 +2752,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2752
2752
  priceId: string;
2753
2753
  quantity?: number;
2754
2754
  trialDays?: number;
2755
- }): ServerResultAsync<Stripe.Subscription>;
2755
+ }): ServerResultAsync<Stripe$1.Subscription>;
2756
2756
  updateUserCustomerId({
2757
2757
  userId,
2758
2758
  customerId
@@ -2762,7 +2762,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2762
2762
  }): ServerResultAsync<InferSelectModel<Schema["users"]>>;
2763
2763
  getLatestSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
2764
2764
  getActiveSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
2765
- listInvoices(customerId: string): ServerResultAsync<Stripe.Invoice[]>;
2765
+ listInvoices(customerId: string): ServerResultAsync<Stripe$1.Invoice[]>;
2766
2766
  createCheckoutSession({
2767
2767
  customerId,
2768
2768
  priceId,
@@ -2771,8 +2771,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2771
2771
  customerId: string;
2772
2772
  priceId: string;
2773
2773
  userId: string;
2774
- }): ServerResultAsync<Stripe.Checkout.Session>;
2775
- createBillingPortalSession(customerId: string): ServerResultAsync<Stripe.BillingPortal.Session>;
2774
+ }): ServerResultAsync<Stripe$1.Checkout.Session>;
2775
+ createBillingPortalSession(customerId: string): ServerResultAsync<Stripe$1.BillingPortal.Session>;
2776
2776
  syncStripeData({
2777
2777
  customerId,
2778
2778
  userId
@@ -2780,7 +2780,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
2780
2780
  customerId: string;
2781
2781
  userId: string;
2782
2782
  }): ServerResultAsync<boolean>;
2783
- constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe.Event>;
2783
+ constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe$1.Event>;
2784
2784
  }
2785
2785
  //#endregion
2786
2786
  export { BillingRepository };
@@ -4,7 +4,7 @@ import { BillingRepository } from "./billing.repository.mjs";
4
4
  import { User } from "../auth/auth.lib.mjs";
5
5
  import { BaseService } from "../base/base.service.mjs";
6
6
  import { BillingSchema } from "@m5kdev/commons/modules/billing/billing.schema";
7
- import Stripe$1 from "stripe";
7
+ import Stripe from "stripe";
8
8
 
9
9
  //#region src/modules/billing/billing.service.d.ts
10
10
  declare class BillingService extends BaseService<{
@@ -18,7 +18,7 @@ declare class BillingService extends BaseService<{
18
18
  email: string;
19
19
  name?: string;
20
20
  };
21
- }): ServerResultAsync<Stripe$1.Customer>;
21
+ }): ServerResultAsync<Stripe.Customer>;
22
22
  createUserHook({
23
23
  user
24
24
  }: {
@@ -29,7 +29,7 @@ declare class BillingService extends BaseService<{
29
29
  };
30
30
  }): ServerResultAsync<boolean>;
31
31
  getActiveSubscription(ctx: Context): ServerResultAsync<BillingSchema | null>;
32
- listInvoices(ctx: Context): ServerResultAsync<Stripe$1.Invoice[]>;
32
+ listInvoices(ctx: Context): ServerResultAsync<Stripe.Invoice[]>;
33
33
  createCheckoutSession({
34
34
  priceId
35
35
  }: {
@@ -38,15 +38,15 @@ declare class BillingService extends BaseService<{
38
38
  user
39
39
  }: {
40
40
  user: User;
41
- }): ServerResultAsync<Stripe$1.Checkout.Session>;
41
+ }): ServerResultAsync<Stripe.Checkout.Session>;
42
42
  createBillingPortalSession({
43
43
  user
44
44
  }: {
45
45
  user: User;
46
- }): ServerResultAsync<Stripe$1.BillingPortal.Session>;
47
- constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe$1.Event>;
46
+ }): ServerResultAsync<Stripe.BillingPortal.Session>;
47
+ constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe.Event>;
48
48
  syncStripeData(customerId: string, eventType?: string): ServerResultAsync<boolean>;
49
- processEvent(event: Stripe$1.Event): ServerResultAsync<boolean>;
49
+ processEvent(event: Stripe.Event): ServerResultAsync<boolean>;
50
50
  }
51
51
  //#endregion
52
52
  export { BillingService };
@@ -11,11 +11,30 @@ declare function createBillingTRPC({
11
11
  ctx: Context;
12
12
  meta: any;
13
13
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
14
- transformer: any;
14
+ transformer: true;
15
15
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
16
16
  getActiveSubscription: _$_trpc_server0.TRPCQueryProcedure<{
17
17
  input: void;
18
- output: any;
18
+ output: {
19
+ id: string;
20
+ plan: string;
21
+ referenceId: string;
22
+ status: string;
23
+ stripeCustomerId?: string | null | undefined;
24
+ stripeSubscriptionId?: string | null | undefined;
25
+ periodStart?: Date | null | undefined;
26
+ periodEnd?: Date | null | undefined;
27
+ cancelAtPeriodEnd?: boolean | null | undefined;
28
+ cancelAt?: Date | null | undefined;
29
+ canceledAt?: Date | null | undefined;
30
+ seats?: number | null | undefined;
31
+ trialStart?: Date | null | undefined;
32
+ trialEnd?: Date | null | undefined;
33
+ priceId?: string | null | undefined;
34
+ interval?: string | null | undefined;
35
+ unitAmount?: number | null | undefined;
36
+ discounts?: string[] | null | undefined;
37
+ } | null;
19
38
  meta: any;
20
39
  }>;
21
40
  listInvoices: _$_trpc_server0.TRPCQueryProcedure<{
@@ -27,10 +27,10 @@ declare const connectSelectOutputSchema: z.ZodObject<{
27
27
  id: z.ZodString;
28
28
  createdAt: z.ZodDate;
29
29
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
30
- userId: z.ZodString;
31
- provider: z.ZodString;
32
30
  expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
31
+ userId: z.ZodString;
33
32
  scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ provider: z.ZodString;
34
34
  accountType: z.ZodString;
35
35
  providerAccountId: z.ZodString;
36
36
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -51,10 +51,10 @@ declare const connectListOutputSchema: z.ZodArray<z.ZodObject<{
51
51
  id: z.ZodString;
52
52
  createdAt: z.ZodDate;
53
53
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
54
- userId: z.ZodString;
55
- provider: z.ZodString;
56
54
  expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
55
+ userId: z.ZodString;
57
56
  scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ provider: z.ZodString;
58
58
  accountType: z.ZodString;
59
59
  providerAccountId: z.ZodString;
60
60
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -396,12 +396,12 @@ declare class ConnectRepository extends BaseTableRepository<Orm, Schema, Record<
396
396
  id: string;
397
397
  createdAt: Date;
398
398
  updatedAt: Date | null;
399
- userId: string;
400
- provider: string;
401
399
  expiresAt: Date | null;
400
+ userId: string;
402
401
  accessToken: string;
403
402
  refreshToken: string | null;
404
403
  scope: string | null;
404
+ provider: string;
405
405
  accountType: string;
406
406
  providerAccountId: string;
407
407
  handle: string | null;
@@ -22,12 +22,12 @@ declare class ConnectService extends BaseService<{
22
22
  id: string;
23
23
  createdAt: Date;
24
24
  updatedAt: Date | null;
25
- userId: string;
26
- provider: string;
27
25
  expiresAt: Date | null;
26
+ userId: string;
28
27
  accessToken: string;
29
28
  refreshToken: string | null;
30
29
  scope: string | null;
30
+ provider: string;
31
31
  accountType: string;
32
32
  providerAccountId: string;
33
33
  handle: string | null;
@@ -43,12 +43,12 @@ declare class ConnectService extends BaseService<{
43
43
  id: string;
44
44
  createdAt: Date;
45
45
  updatedAt: Date | null;
46
- userId: string;
47
- provider: string;
48
46
  expiresAt: Date | null;
47
+ userId: string;
49
48
  accessToken: string;
50
49
  refreshToken: string | null;
51
50
  scope: string | null;
51
+ provider: string;
52
52
  accountType: string;
53
53
  providerAccountId: string;
54
54
  handle: string | null;
@@ -10,7 +10,7 @@ declare function createConnectTRPC({
10
10
  ctx: Context;
11
11
  meta: any;
12
12
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
13
- transformer: any;
13
+ transformer: true;
14
14
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
15
15
  list: _$_trpc_server0.TRPCQueryProcedure<{
16
16
  input: {
@@ -10,7 +10,20 @@ declare class RecurrenceService extends BaseService<{
10
10
  recurrence: RecurrenceRepository;
11
11
  recurrenceRules: RecurrenceRulesRepository;
12
12
  }, Record<string, never>> {
13
- readonly list: ServiceProcedure<any, {
13
+ readonly list: ServiceProcedure<{
14
+ page?: number | undefined;
15
+ limit?: number | undefined;
16
+ sort?: string | undefined;
17
+ order?: "asc" | "desc" | undefined;
18
+ filters?: {
19
+ columnId: string;
20
+ type: "string" | "number" | "boolean" | "date" | "enum";
21
+ method: "contains" | "starts_with" | "ends_with" | "intersect" | "on" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
22
+ value: string | number | boolean | string[];
23
+ valueTo?: string | undefined;
24
+ endColumnId?: string | undefined;
25
+ }[] | undefined;
26
+ }, {
14
27
  actor?: AuthenticatedActor | null;
15
28
  } & Record<string, unknown> & {
16
29
  actor: UserActor;
@@ -20,8 +33,8 @@ declare class RecurrenceService extends BaseService<{
20
33
  id: string;
21
34
  createdAt: Date;
22
35
  updatedAt: Date;
23
- metadata: Record<string, any> | null;
24
36
  userId: string | null;
37
+ metadata: Record<string, any> | null;
25
38
  organizationId: string | null;
26
39
  teamId: string | null;
27
40
  enabled: boolean;
@@ -29,7 +42,30 @@ declare class RecurrenceService extends BaseService<{
29
42
  }[];
30
43
  total: number;
31
44
  }>;
32
- readonly create: ServiceProcedure<CreateRecurrenceSchema, {
45
+ readonly create: ServiceProcedure<{
46
+ name: string;
47
+ kind: string;
48
+ enabled: boolean;
49
+ recurrenceRules: {
50
+ freq: number;
51
+ interval: number;
52
+ bysetpos?: number | number[] | null | undefined;
53
+ bymonth?: number | number[] | null | undefined;
54
+ bymonthday?: number | number[] | null | undefined;
55
+ byyearday?: number | number[] | null | undefined;
56
+ byweekno?: number | number[] | null | undefined;
57
+ byweekday?: number | number[] | null | undefined;
58
+ byhour?: number | number[] | null | undefined;
59
+ byminute?: number | number[] | null | undefined;
60
+ bysecond?: number | number[] | null | undefined;
61
+ dtstart?: Date | null | undefined;
62
+ wkst?: number | null | undefined;
63
+ count?: number | null | undefined;
64
+ until?: Date | null | undefined;
65
+ tzid?: string | null | undefined;
66
+ }[];
67
+ metadata?: Record<string, unknown> | null | undefined;
68
+ }, {
33
69
  actor?: AuthenticatedActor | null;
34
70
  } & Record<string, unknown> & {
35
71
  actor: UserActor;
@@ -10,21 +10,100 @@ declare function createRecurrenceTRPC({
10
10
  ctx: Context;
11
11
  meta: any;
12
12
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
13
- transformer: any;
13
+ transformer: true;
14
14
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
15
15
  list: _$_trpc_server0.TRPCQueryProcedure<{
16
- input: any;
16
+ input: {
17
+ page?: number | undefined;
18
+ limit?: number | undefined;
19
+ sort?: string | undefined;
20
+ order?: "asc" | "desc" | undefined;
21
+ filters?: {
22
+ columnId: string;
23
+ type: "string" | "number" | "boolean" | "date" | "enum";
24
+ method: "contains" | "starts_with" | "ends_with" | "intersect" | "on" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
25
+ value: string | number | boolean | string[];
26
+ valueTo?: string | undefined;
27
+ endColumnId?: string | undefined;
28
+ }[] | undefined;
29
+ } | undefined;
17
30
  output: {
18
- rows: any[];
31
+ rows: {
32
+ id: string;
33
+ enabled: boolean;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ userId?: string | null | undefined;
37
+ organizationId?: string | null | undefined;
38
+ teamId?: string | null | undefined;
39
+ name?: string | null | undefined;
40
+ kind?: string | null | undefined;
41
+ metadata?: Record<string, unknown> | null | undefined;
42
+ }[];
19
43
  total: number;
20
44
  };
21
45
  meta: any;
22
46
  }>;
23
47
  create: _$_trpc_server0.TRPCMutationProcedure<{
24
- input: any;
48
+ input: {
49
+ name: string;
50
+ kind: string;
51
+ enabled: boolean;
52
+ recurrenceRules: {
53
+ freq: number;
54
+ interval: number;
55
+ bysetpos?: number | number[] | null | undefined;
56
+ bymonth?: number | number[] | null | undefined;
57
+ bymonthday?: number | number[] | null | undefined;
58
+ byyearday?: number | number[] | null | undefined;
59
+ byweekno?: number | number[] | null | undefined;
60
+ byweekday?: number | number[] | null | undefined;
61
+ byhour?: number | number[] | null | undefined;
62
+ byminute?: number | number[] | null | undefined;
63
+ bysecond?: number | number[] | null | undefined;
64
+ dtstart?: Date | null | undefined;
65
+ wkst?: number | null | undefined;
66
+ count?: number | null | undefined;
67
+ until?: Date | null | undefined;
68
+ tzid?: string | null | undefined;
69
+ }[];
70
+ metadata?: Record<string, unknown> | null | undefined;
71
+ };
25
72
  output: {
26
- [x: string]: any;
27
- rules: any[];
73
+ recurrence: {
74
+ id: string;
75
+ enabled: boolean;
76
+ createdAt: Date;
77
+ updatedAt: Date;
78
+ userId?: string | null | undefined;
79
+ organizationId?: string | null | undefined;
80
+ teamId?: string | null | undefined;
81
+ name?: string | null | undefined;
82
+ kind?: string | null | undefined;
83
+ metadata?: Record<string, unknown> | null | undefined;
84
+ };
85
+ rules: {
86
+ id: string;
87
+ createdAt: Date;
88
+ updatedAt: Date;
89
+ freq: number;
90
+ interval: number;
91
+ recurrenceId?: string | null | undefined;
92
+ dtstart?: Date | null | undefined;
93
+ wkst?: number | null | undefined;
94
+ count?: number | null | undefined;
95
+ until?: Date | null | undefined;
96
+ tzid?: string | null | undefined;
97
+ bysetpos?: number | number[] | null | undefined;
98
+ bymonth?: number | number[] | null | undefined;
99
+ bymonthday?: number | number[] | null | undefined;
100
+ byyearday?: number | number[] | null | undefined;
101
+ byweekno?: number | number[] | null | undefined;
102
+ byweekday?: number | number[] | null | undefined;
103
+ byhour?: number | number[] | null | undefined;
104
+ byminute?: number | number[] | null | undefined;
105
+ bysecond?: number | number[] | null | undefined;
106
+ }[];
28
107
  };
29
108
  meta: any;
30
109
  }>;
@@ -32,28 +111,99 @@ declare function createRecurrenceTRPC({
32
111
  input: {
33
112
  id: string;
34
113
  };
35
- output: any;
114
+ output: {
115
+ id: string;
116
+ enabled: boolean;
117
+ createdAt: Date;
118
+ updatedAt: Date;
119
+ userId?: string | null | undefined;
120
+ organizationId?: string | null | undefined;
121
+ teamId?: string | null | undefined;
122
+ name?: string | null | undefined;
123
+ kind?: string | null | undefined;
124
+ metadata?: Record<string, unknown> | null | undefined;
125
+ } | null;
36
126
  meta: any;
37
127
  }>;
38
128
  update: _$_trpc_server0.TRPCMutationProcedure<{
39
- input: any;
40
- output: any;
129
+ input: {
130
+ id: string;
131
+ name?: string | undefined;
132
+ kind?: string | undefined;
133
+ enabled?: boolean | undefined;
134
+ metadata?: Record<string, unknown> | null | undefined;
135
+ };
136
+ output: {
137
+ id: string;
138
+ enabled: boolean;
139
+ createdAt: Date;
140
+ updatedAt: Date;
141
+ userId?: string | null | undefined;
142
+ organizationId?: string | null | undefined;
143
+ teamId?: string | null | undefined;
144
+ name?: string | null | undefined;
145
+ kind?: string | null | undefined;
146
+ metadata?: Record<string, unknown> | null | undefined;
147
+ };
41
148
  meta: any;
42
149
  }>;
43
150
  updateRule: _$_trpc_server0.TRPCMutationProcedure<{
44
- input: any;
45
- output: any;
151
+ input: {
152
+ id: string;
153
+ freq: number;
154
+ interval: number;
155
+ bysetpos?: number | number[] | null | undefined;
156
+ bymonth?: number | number[] | null | undefined;
157
+ bymonthday?: number | number[] | null | undefined;
158
+ byyearday?: number | number[] | null | undefined;
159
+ byweekno?: number | number[] | null | undefined;
160
+ byweekday?: number | number[] | null | undefined;
161
+ byhour?: number | number[] | null | undefined;
162
+ byminute?: number | number[] | null | undefined;
163
+ bysecond?: number | number[] | null | undefined;
164
+ dtstart?: Date | null | undefined;
165
+ wkst?: number | null | undefined;
166
+ count?: number | null | undefined;
167
+ until?: Date | null | undefined;
168
+ tzid?: string | null | undefined;
169
+ };
170
+ output: {
171
+ id: string;
172
+ createdAt: Date;
173
+ updatedAt: Date;
174
+ freq: number;
175
+ interval: number;
176
+ recurrenceId?: string | null | undefined;
177
+ dtstart?: Date | null | undefined;
178
+ wkst?: number | null | undefined;
179
+ count?: number | null | undefined;
180
+ until?: Date | null | undefined;
181
+ tzid?: string | null | undefined;
182
+ bysetpos?: number | number[] | null | undefined;
183
+ bymonth?: number | number[] | null | undefined;
184
+ bymonthday?: number | number[] | null | undefined;
185
+ byyearday?: number | number[] | null | undefined;
186
+ byweekno?: number | number[] | null | undefined;
187
+ byweekday?: number | number[] | null | undefined;
188
+ byhour?: number | number[] | null | undefined;
189
+ byminute?: number | number[] | null | undefined;
190
+ bysecond?: number | number[] | null | undefined;
191
+ };
46
192
  meta: any;
47
193
  }>;
48
194
  delete: _$_trpc_server0.TRPCMutationProcedure<{
49
- input: any;
195
+ input: {
196
+ id: string;
197
+ };
50
198
  output: {
51
199
  id: string;
52
200
  };
53
201
  meta: any;
54
202
  }>;
55
203
  deleteRule: _$_trpc_server0.TRPCMutationProcedure<{
56
- input: any;
204
+ input: {
205
+ id: string;
206
+ };
57
207
  output: {
58
208
  id: string;
59
209
  };
@@ -13,8 +13,22 @@ declare class TagService extends BaseService<{
13
13
  listTaggings(input: {
14
14
  resourceType: string;
15
15
  resourceIds?: readonly string[];
16
- }): Promise<ServerResult<TaggingSchema[]>>;
17
- readonly create: ServiceProcedure<TagCreateSchema, {
16
+ }): Promise<ServerResult<{
17
+ id: string;
18
+ createdAt: Date;
19
+ tagId: string;
20
+ resourceType: string;
21
+ resourceId: string;
22
+ }[]>>;
23
+ readonly create: ServiceProcedure<{
24
+ name: string;
25
+ color: string;
26
+ assignableTo: string[];
27
+ organizationId?: string | undefined;
28
+ teamId?: string | undefined;
29
+ resourceType?: string | undefined;
30
+ resourceId?: string | undefined;
31
+ }, {
18
32
  actor?: AuthenticatedActor | null;
19
33
  } & Record<string, unknown> & {
20
34
  actor: UserActor;
@@ -33,7 +47,12 @@ declare class TagService extends BaseService<{
33
47
  parentId: string | null;
34
48
  assignableTo: string[];
35
49
  }>;
36
- readonly update: ServiceProcedure<TagUpdateSchema, {
50
+ readonly update: ServiceProcedure<{
51
+ id: string;
52
+ name?: string | undefined;
53
+ color?: string | undefined;
54
+ assignableTo?: string[] | undefined;
55
+ }, {
37
56
  actor?: AuthenticatedActor | null;
38
57
  } & Record<string, unknown> & {
39
58
  actor: UserActor;
@@ -52,7 +71,11 @@ declare class TagService extends BaseService<{
52
71
  parentId: string | null;
53
72
  assignableTo: string[];
54
73
  }>;
55
- readonly link: ServiceProcedure<TagLinkSchema, {
74
+ readonly link: ServiceProcedure<{
75
+ tagId: string;
76
+ resourceType: string;
77
+ resourceId: string;
78
+ }, {
56
79
  actor?: AuthenticatedActor | null;
57
80
  } & Record<string, unknown> & {
58
81
  actor: UserActor;
@@ -65,7 +88,11 @@ declare class TagService extends BaseService<{
65
88
  }>;
66
89
  linkBulk(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]>;
67
90
  set(data: TagLinkSchema[]): ServerResultAsync<TagSchema[]>;
68
- readonly unlink: ServiceProcedure<TagLinkSchema, {
91
+ readonly unlink: ServiceProcedure<{
92
+ tagId: string;
93
+ resourceType: string;
94
+ resourceId: string;
95
+ }, {
69
96
  actor?: AuthenticatedActor | null;
70
97
  } & Record<string, unknown> & {
71
98
  actor: UserActor;
@@ -10,15 +10,56 @@ declare function createTagTRPC({
10
10
  ctx: Context;
11
11
  meta: any;
12
12
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
13
- transformer: any;
13
+ transformer: true;
14
14
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
15
15
  list: _$_trpc_server0.TRPCQueryProcedure<{
16
- input: any;
17
- output: any;
16
+ input: {
17
+ page?: number | undefined;
18
+ limit?: number | undefined;
19
+ sort?: string | undefined;
20
+ order?: "asc" | "desc" | undefined;
21
+ filters?: {
22
+ columnId: string;
23
+ type: "string" | "number" | "boolean" | "date" | "enum";
24
+ method: "contains" | "starts_with" | "ends_with" | "intersect" | "on" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
25
+ value: string | number | boolean | string[];
26
+ valueTo?: string | undefined;
27
+ endColumnId?: string | undefined;
28
+ }[] | undefined;
29
+ assignableTo?: string | undefined;
30
+ };
31
+ output: {
32
+ rows: {
33
+ id: string;
34
+ createdAt: Date;
35
+ userId: string;
36
+ name: string;
37
+ isEnabled: boolean;
38
+ assignableTo: string[] | null;
39
+ organizationId?: string | null | undefined;
40
+ teamId?: string | null | undefined;
41
+ updatedAt?: Date | null | undefined;
42
+ deletedAt?: Date | null | undefined;
43
+ color?: string | null | undefined;
44
+ type?: string | null | undefined;
45
+ parentId?: string | null | undefined;
46
+ }[];
47
+ total: number;
48
+ };
18
49
  meta: any;
19
50
  }>;
20
51
  listTaggings: _$_trpc_server0.TRPCQueryProcedure<{
21
- input: any;
52
+ input: {
53
+ resourceType: string;
54
+ resourceIds?: {
55
+ columnId: string;
56
+ type: "string" | "number" | "boolean" | "date" | "enum";
57
+ method: "contains" | "starts_with" | "ends_with" | "intersect" | "on" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
58
+ value: string | number | boolean | string[];
59
+ valueTo?: string | undefined;
60
+ endColumnId?: string | undefined;
61
+ }[] | undefined;
62
+ };
22
63
  output: {
23
64
  id: string;
24
65
  createdAt: Date;
@@ -29,7 +70,15 @@ declare function createTagTRPC({
29
70
  meta: any;
30
71
  }>;
31
72
  create: _$_trpc_server0.TRPCMutationProcedure<{
32
- input: any;
73
+ input: {
74
+ name: string;
75
+ color: string;
76
+ organizationId?: string | undefined;
77
+ teamId?: string | undefined;
78
+ assignableTo?: string[] | undefined;
79
+ resourceType?: string | undefined;
80
+ resourceId?: string | undefined;
81
+ };
33
82
  output: {
34
83
  id: string;
35
84
  createdAt: Date;
@@ -48,7 +97,12 @@ declare function createTagTRPC({
48
97
  meta: any;
49
98
  }>;
50
99
  update: _$_trpc_server0.TRPCMutationProcedure<{
51
- input: any;
100
+ input: {
101
+ id: string;
102
+ name?: string | undefined;
103
+ color?: string | undefined;
104
+ assignableTo?: string[] | undefined;
105
+ };
52
106
  output: {
53
107
  id: string;
54
108
  createdAt: Date;
@@ -67,7 +121,11 @@ declare function createTagTRPC({
67
121
  meta: any;
68
122
  }>;
69
123
  link: _$_trpc_server0.TRPCMutationProcedure<{
70
- input: any;
124
+ input: {
125
+ tagId: string;
126
+ resourceType: string;
127
+ resourceId: string;
128
+ };
71
129
  output: {
72
130
  id: string;
73
131
  createdAt: Date;
@@ -78,7 +136,11 @@ declare function createTagTRPC({
78
136
  meta: any;
79
137
  }>;
80
138
  unlink: _$_trpc_server0.TRPCMutationProcedure<{
81
- input: any;
139
+ input: {
140
+ tagId: string;
141
+ resourceType: string;
142
+ resourceId: string;
143
+ };
82
144
  output: {
83
145
  id: string;
84
146
  createdAt: Date;
@@ -97,7 +159,9 @@ declare function createTagTRPC({
97
159
  meta: any;
98
160
  }>;
99
161
  delete: _$_trpc_server0.TRPCMutationProcedure<{
100
- input: any;
162
+ input: {
163
+ id: string;
164
+ };
101
165
  output: {
102
166
  id: string;
103
167
  };
@@ -175,7 +175,7 @@ declare const workflows: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
175
175
  tableName: "workflows";
176
176
  dataType: "string";
177
177
  columnType: "SQLiteText";
178
- data: WorkflowStatus;
178
+ data: "queued" | "running" | "completed" | "failed";
179
179
  driverParam: string;
180
180
  notNull: true;
181
181
  hasDefault: false;
@@ -188,7 +188,7 @@ declare const workflows: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
188
188
  generated: undefined;
189
189
  }, {}, {
190
190
  length: number | undefined;
191
- $type: WorkflowStatus;
191
+ $type: "queued" | "running" | "completed" | "failed";
192
192
  }>;
193
193
  error: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
194
194
  name: "error";
@@ -180,7 +180,7 @@ declare const schema: {
180
180
  tableName: "workflows";
181
181
  dataType: "string";
182
182
  columnType: "SQLiteText";
183
- data: WorkflowStatus;
183
+ data: "queued" | "running" | "completed" | "failed";
184
184
  driverParam: string;
185
185
  notNull: true;
186
186
  hasDefault: false;
@@ -193,7 +193,7 @@ declare const schema: {
193
193
  generated: undefined;
194
194
  }, {}, {
195
195
  length: number | undefined;
196
- $type: WorkflowStatus;
196
+ $type: "queued" | "running" | "completed" | "failed";
197
197
  }>;
198
198
  error: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
199
199
  name: "error";
@@ -10,16 +10,53 @@ import { Job } from "bullmq";
10
10
  declare class WorkflowService extends BaseService<{
11
11
  workflow: WorkflowRepository;
12
12
  }, never> {
13
- readonly read: ServiceProcedure<WorkflowReadInputSchema, {
13
+ readonly read: ServiceProcedure<{
14
+ jobId: string;
15
+ }, {
14
16
  actor?: AuthenticatedActor | null;
15
17
  } & Record<string, unknown> & {
16
18
  actor: UserActor;
17
- }, WorkflowReadOutputSchema>;
18
- readonly list: ServiceProcedure<WorkflowListInputSchema, {
19
+ }, {
20
+ id: string;
21
+ userId: string | null;
22
+ jobId: string;
23
+ jobName: string;
24
+ queueName: string;
25
+ tags: string[] | null;
26
+ input: unknown;
27
+ output: unknown;
28
+ status: "queued" | "running" | "completed" | "failed";
29
+ error: string | null;
30
+ retries: number;
31
+ finishedAt: Date | null;
32
+ processedAt: Date | null;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ }>;
36
+ readonly list: ServiceProcedure<{
37
+ status?: ("queued" | "running" | "completed" | "failed")[] | undefined;
38
+ jobName?: string | undefined;
39
+ }, {
19
40
  actor?: AuthenticatedActor | null;
20
41
  } & Record<string, unknown> & {
21
42
  actor: UserActor;
22
- }, WorkflowListOutputSchema>;
43
+ }, {
44
+ id: string;
45
+ userId: string | null;
46
+ jobId: string;
47
+ jobName: string;
48
+ queueName: string;
49
+ tags: string[] | null;
50
+ input: unknown;
51
+ output: unknown;
52
+ status: "queued" | "running" | "completed" | "failed";
53
+ error: string | null;
54
+ retries: number;
55
+ finishedAt: Date | null;
56
+ processedAt: Date | null;
57
+ createdAt: Date;
58
+ updatedAt: Date;
59
+ }[]>;
23
60
  added(params: Parameters<WorkflowRepository["added"]>[0]): ServerResultAsync<WorkflowReadOutputSchema>;
24
61
  addedMany(params: Parameters<WorkflowRepository["addedMany"]>[0]): ServerResultAsync<WorkflowReadOutputSchema[]>;
25
62
  started(job: Job): ServerResultAsync<WorkflowReadOutputSchema>;
@@ -10,16 +10,53 @@ declare function createWorkflowTRPC({
10
10
  ctx: Context;
11
11
  meta: any;
12
12
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
13
- transformer: any;
13
+ transformer: true;
14
14
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
15
15
  read: _$_trpc_server0.TRPCQueryProcedure<{
16
- input: any;
17
- output: any;
16
+ input: {
17
+ jobId: string;
18
+ };
19
+ output: {
20
+ id: string;
21
+ userId: string | null;
22
+ jobId: string;
23
+ jobName: string;
24
+ queueName: string;
25
+ tags: string[] | null;
26
+ input: unknown;
27
+ output: unknown;
28
+ status: "queued" | "running" | "completed" | "failed";
29
+ error: string | null;
30
+ retries: number;
31
+ finishedAt: Date | null;
32
+ processedAt: Date | null;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ };
18
36
  meta: any;
19
37
  }>;
20
38
  list: _$_trpc_server0.TRPCQueryProcedure<{
21
- input: any;
22
- output: any;
39
+ input: {
40
+ status?: ("queued" | "running" | "completed" | "failed")[] | undefined;
41
+ jobName?: string | undefined;
42
+ };
43
+ output: {
44
+ id: string;
45
+ userId: string | null;
46
+ jobId: string;
47
+ jobName: string;
48
+ queueName: string;
49
+ tags: string[] | null;
50
+ input: unknown;
51
+ output: unknown;
52
+ status: "queued" | "running" | "completed" | "failed";
53
+ error: string | null;
54
+ retries: number;
55
+ finishedAt: Date | null;
56
+ processedAt: Date | null;
57
+ createdAt: Date;
58
+ updatedAt: Date;
59
+ }[];
23
60
  meta: any;
24
61
  }>;
25
62
  }>>;
@@ -1,23 +1,21 @@
1
1
  import { Context, TRPCMethods } from "./utils/trpc.mjs";
2
2
  import { BillingService } from "./modules/billing/billing.service.mjs";
3
- import { AIService } from "./modules/ai/ai.service.mjs";
4
3
  import { AuthService } from "./modules/auth/auth.service.mjs";
5
4
  import * as _$_trpc_server0 from "@trpc/server";
6
5
  import * as _$stripe from "stripe";
7
- import { Mastra } from "@mastra/core";
8
6
 
9
7
  //#region src/types.d.ts
10
- declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods: TRPCMethods, authService: AuthService, aiService: AIService<MastraInstance>, billingService: BillingService) => _$_trpc_server0.TRPCBuiltRouter<{
8
+ declare const createAuthTRPCRouter: (trpcMethods: TRPCMethods, authService: AuthService, billingService: BillingService) => _$_trpc_server0.TRPCBuiltRouter<{
11
9
  ctx: Context;
12
10
  meta: any;
13
11
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
14
- transformer: any;
12
+ transformer: true;
15
13
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
16
14
  auth: _$_trpc_server0.TRPCBuiltRouter<{
17
15
  ctx: Context;
18
16
  meta: any;
19
17
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
20
- transformer: any;
18
+ transformer: true;
21
19
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
22
20
  getUserWaitlistCount: _$_trpc_server0.TRPCQueryProcedure<{
23
21
  input: void;
@@ -64,8 +62,8 @@ declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods:
64
62
  id: string;
65
63
  createdAt: Date;
66
64
  updatedAt: Date | null;
67
- expiresAt: Date | null;
68
65
  status: string;
66
+ expiresAt: Date | null;
69
67
  claimUserId: string | null;
70
68
  claimedAt: Date | null;
71
69
  claimedEmail: string | null;
@@ -81,8 +79,8 @@ declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods:
81
79
  id: string;
82
80
  email: string;
83
81
  createdAt: Date;
84
- userId: string;
85
82
  expiresAt: Date | null;
83
+ userId: string;
86
84
  claimId: string;
87
85
  url: string;
88
86
  };
@@ -96,8 +94,8 @@ declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods:
96
94
  id: string;
97
95
  email: string;
98
96
  createdAt: Date;
99
- userId: string;
100
97
  expiresAt: Date | null;
98
+ userId: string;
101
99
  claimId: string;
102
100
  url: string;
103
101
  }[];
@@ -303,34 +301,34 @@ declare const createAuthTRPCRouter: <MastraInstance extends Mastra>(trpcMethods:
303
301
  meta: any;
304
302
  }>;
305
303
  }>>;
306
- ai: _$_trpc_server0.TRPCBuiltRouter<{
307
- ctx: Context;
308
- meta: any;
309
- errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
310
- transformer: any;
311
- }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
312
- getUserUsage: _$_trpc_server0.TRPCQueryProcedure<{
313
- input: {
314
- userId: string;
315
- };
316
- output: {
317
- inputTokens: number | null;
318
- outputTokens: number | null;
319
- totalTokens: number | null;
320
- cost: number | null;
321
- };
322
- meta: any;
323
- }>;
324
- }>>;
325
304
  billing: _$_trpc_server0.TRPCBuiltRouter<{
326
305
  ctx: Context;
327
306
  meta: any;
328
307
  errorShape: _$_trpc_server0.TRPCDefaultErrorShape;
329
- transformer: any;
308
+ transformer: true;
330
309
  }, _$_trpc_server0.TRPCDecorateCreateRouterOptions<{
331
310
  getActiveSubscription: _$_trpc_server0.TRPCQueryProcedure<{
332
311
  input: void;
333
- output: any;
312
+ output: {
313
+ id: string;
314
+ plan: string;
315
+ referenceId: string;
316
+ status: string;
317
+ stripeCustomerId?: string | null | undefined;
318
+ stripeSubscriptionId?: string | null | undefined;
319
+ periodStart?: Date | null | undefined;
320
+ periodEnd?: Date | null | undefined;
321
+ cancelAtPeriodEnd?: boolean | null | undefined;
322
+ cancelAt?: Date | null | undefined;
323
+ canceledAt?: Date | null | undefined;
324
+ seats?: number | null | undefined;
325
+ trialStart?: Date | null | undefined;
326
+ trialEnd?: Date | null | undefined;
327
+ priceId?: string | null | undefined;
328
+ interval?: string | null | undefined;
329
+ unitAmount?: number | null | undefined;
330
+ discounts?: string[] | null | undefined;
331
+ } | null;
334
332
  meta: any;
335
333
  }>;
336
334
  listInvoices: _$_trpc_server0.TRPCQueryProcedure<{
@@ -1,10 +1,8 @@
1
- import { createAITRPC } from "./modules/ai/ai.trpc.mjs";
2
1
  import { createAuthTRPC } from "./modules/auth/auth.trpc.mjs";
3
2
  import { createBillingTRPC } from "./modules/billing/billing.trpc.mjs";
4
3
  //#region src/types.ts
5
- const createAuthTRPCRouter = (trpcMethods, authService, aiService, billingService) => trpcMethods.router({
4
+ const createAuthTRPCRouter = (trpcMethods, authService, billingService) => trpcMethods.router({
6
5
  auth: createAuthTRPC(trpcMethods, authService),
7
- ai: createAITRPC(trpcMethods, aiService),
8
6
  billing: createBillingTRPC(trpcMethods, billingService)
9
7
  });
10
8
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Create a faux router that includes the auth router for use in the web-ui types\r\nimport type { Mastra } from \"@mastra/core\";\r\nimport type { AIService } from \"./modules/ai/ai.service\";\r\nimport { createAITRPC } from \"./modules/ai/ai.trpc\";\r\nimport type { AuthService } from \"./modules/auth/auth.service\";\r\nimport { createAuthTRPC } from \"./modules/auth/auth.trpc\";\r\nimport type { BillingService } from \"./modules/billing/billing.service\";\r\nimport { createBillingTRPC } from \"./modules/billing/billing.trpc\";\r\nimport type { TRPCMethods } from \"./utils/trpc\";\r\n\r\nexport const createAuthTRPCRouter = <MastraInstance extends Mastra>(\r\n trpcMethods: TRPCMethods,\r\n authService: AuthService,\r\n aiService: AIService<MastraInstance>,\r\n billingService: BillingService\r\n) =>\r\n trpcMethods.router({\r\n auth: createAuthTRPC(trpcMethods, authService),\r\n ai: createAITRPC(trpcMethods, aiService),\r\n billing: createBillingTRPC(trpcMethods, billingService),\r\n });\r\n\r\nexport type BackendTRPCRouter = ReturnType<typeof createAuthTRPCRouter>;\r\n"],"mappings":";;;;AAUA,MAAa,wBACX,aACA,aACA,WACA,mBAEA,YAAY,OAAO;CACjB,MAAM,eAAe,aAAa,YAAY;CAC9C,IAAI,aAAa,aAAa,UAAU;CACxC,SAAS,kBAAkB,aAAa,eAAe;CACxD,CAAC"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type { AuthService } from \"./modules/auth/auth.service\";\r\nimport { createAuthTRPC } from \"./modules/auth/auth.trpc\";\r\nimport type { BillingService } from \"./modules/billing/billing.service\";\r\nimport { createBillingTRPC } from \"./modules/billing/billing.trpc\";\r\nimport type { TRPCMethods } from \"./utils/trpc\";\r\n\r\nexport const createAuthTRPCRouter = (\r\n trpcMethods: TRPCMethods,\r\n authService: AuthService,\r\n billingService: BillingService\r\n) =>\r\n trpcMethods.router({\r\n auth: createAuthTRPC(trpcMethods, authService),\r\n billing: createBillingTRPC(trpcMethods, billingService),\r\n });\r\n\r\nexport type BackendTRPCRouter = ReturnType<typeof createAuthTRPCRouter>;\r\n"],"mappings":";;;AAMA,MAAa,wBACX,aACA,aACA,mBAEA,YAAY,OAAO;CACjB,MAAM,eAAe,aAAa,YAAY;CAC9C,SAAS,kBAAkB,aAAa,eAAe;CACxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m5kdev/backend",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Composable Express server stack with Drizzle ORM and tRPC.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -59,8 +59,8 @@
59
59
  "trpc-to-openapi": "2.3.0",
60
60
  "uuid": "11.0.5",
61
61
  "zod": "4.2.1",
62
- "@m5kdev/commons": "0.8.0",
63
- "@m5kdev/config": "0.8.0"
62
+ "@m5kdev/config": "0.8.2",
63
+ "@m5kdev/commons": "0.8.2"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@jest/globals": "30.2.0",
@@ -85,88 +85,88 @@
85
85
  },
86
86
  "exports": {
87
87
  "./modules/ai/*": {
88
- "types": "./dist/src/modules/ai/*.d.ts",
89
- "default": "./dist/src/modules/ai/*.js"
88
+ "types": "./dist/src/modules/ai/*.d.mts",
89
+ "default": "./dist/src/modules/ai/*.mjs"
90
90
  },
91
91
  "./modules/utils/*": {
92
- "types": "./dist/src/modules/utils/*.d.ts",
93
- "default": "./dist/src/modules/utils/*.js"
92
+ "types": "./dist/src/modules/utils/*.d.mts",
93
+ "default": "./dist/src/modules/utils/*.mjs"
94
94
  },
95
95
  "./modules/base/*": {
96
- "types": "./dist/src/modules/base/*.d.ts",
97
- "default": "./dist/src/modules/base/*.js"
96
+ "types": "./dist/src/modules/base/*.d.mts",
97
+ "default": "./dist/src/modules/base/*.mjs"
98
98
  },
99
99
  "./modules/billing/*": {
100
- "types": "./dist/src/modules/billing/*.d.ts",
101
- "default": "./dist/src/modules/billing/*.js"
100
+ "types": "./dist/src/modules/billing/*.d.mts",
101
+ "default": "./dist/src/modules/billing/*.mjs"
102
102
  },
103
103
  "./modules/crypto/*": {
104
- "types": "./dist/src/modules/crypto/*.d.ts",
105
- "default": "./dist/src/modules/crypto/*.js"
104
+ "types": "./dist/src/modules/crypto/*.d.mts",
105
+ "default": "./dist/src/modules/crypto/*.mjs"
106
106
  },
107
107
  "./modules/auth/*": {
108
- "types": "./dist/src/modules/auth/*.d.ts",
109
- "default": "./dist/src/modules/auth/*.js"
108
+ "types": "./dist/src/modules/auth/*.d.mts",
109
+ "default": "./dist/src/modules/auth/*.mjs"
110
110
  },
111
111
  "./modules/tag/*": {
112
- "types": "./dist/src/modules/tag/*.d.ts",
113
- "default": "./dist/src/modules/tag/*.js"
112
+ "types": "./dist/src/modules/tag/*.d.mts",
113
+ "default": "./dist/src/modules/tag/*.mjs"
114
114
  },
115
115
  "./modules/connect/*": {
116
- "types": "./dist/src/modules/connect/*.d.ts",
117
- "default": "./dist/src/modules/connect/*.js"
116
+ "types": "./dist/src/modules/connect/*.d.mts",
117
+ "default": "./dist/src/modules/connect/*.mjs"
118
118
  },
119
119
  "./modules/workflow/*": {
120
- "types": "./dist/src/modules/workflow/*.d.ts",
121
- "default": "./dist/src/modules/workflow/*.js"
120
+ "types": "./dist/src/modules/workflow/*.d.mts",
121
+ "default": "./dist/src/modules/workflow/*.mjs"
122
122
  },
123
123
  "./modules/file/*": {
124
- "types": "./dist/src/modules/file/*.d.ts",
125
- "default": "./dist/src/modules/file/*.js"
124
+ "types": "./dist/src/modules/file/*.d.mts",
125
+ "default": "./dist/src/modules/file/*.mjs"
126
126
  },
127
127
  "./modules/recurrence/*": {
128
- "types": "./dist/src/modules/recurrence/*.d.ts",
129
- "default": "./dist/src/modules/recurrence/*.js"
128
+ "types": "./dist/src/modules/recurrence/*.d.mts",
129
+ "default": "./dist/src/modules/recurrence/*.mjs"
130
130
  },
131
131
  "./modules/video/*": {
132
- "types": "./dist/src/modules/video/*.d.ts",
133
- "default": "./dist/src/modules/video/*.js"
132
+ "types": "./dist/src/modules/video/*.d.mts",
133
+ "default": "./dist/src/modules/video/*.mjs"
134
134
  },
135
135
  "./modules/posthog/*": {
136
- "types": "./dist/src/modules/posthog/*.d.ts",
137
- "default": "./dist/src/modules/posthog/*.js"
136
+ "types": "./dist/src/modules/posthog/*.d.mts",
137
+ "default": "./dist/src/modules/posthog/*.mjs"
138
138
  },
139
139
  "./modules/access/*": {
140
- "types": "./dist/src/modules/access/*.d.ts",
141
- "default": "./dist/src/modules/access/*.js"
140
+ "types": "./dist/src/modules/access/*.d.mts",
141
+ "default": "./dist/src/modules/access/*.mjs"
142
142
  },
143
143
  "./modules/social/*": {
144
- "types": "./dist/src/modules/social/*.d.ts",
145
- "default": "./dist/src/modules/social/*.js"
144
+ "types": "./dist/src/modules/social/*.d.mts",
145
+ "default": "./dist/src/modules/social/*.mjs"
146
146
  },
147
147
  "./modules/clay/*": {
148
- "types": "./dist/src/modules/clay/*.d.ts",
149
- "default": "./dist/src/modules/clay/*.js"
148
+ "types": "./dist/src/modules/clay/*.d.mts",
149
+ "default": "./dist/src/modules/clay/*.mjs"
150
150
  },
151
151
  "./modules/webhook/*": {
152
- "types": "./dist/src/modules/webhook/*.d.ts",
153
- "default": "./dist/src/modules/webhook/*.js"
152
+ "types": "./dist/src/modules/webhook/*.d.mts",
153
+ "default": "./dist/src/modules/webhook/*.mjs"
154
154
  },
155
155
  "./modules/email/*": {
156
- "types": "./dist/src/modules/email/*.d.ts",
157
- "default": "./dist/src/modules/email/*.js"
156
+ "types": "./dist/src/modules/email/*.d.mts",
157
+ "default": "./dist/src/modules/email/*.mjs"
158
158
  },
159
159
  "./lib/*": {
160
- "types": "./dist/src/lib/*.d.ts",
161
- "default": "./dist/src/lib/*.js"
160
+ "types": "./dist/src/lib/*.d.mts",
161
+ "default": "./dist/src/lib/*.mjs"
162
162
  },
163
163
  "./utils/*": {
164
- "types": "./dist/src/utils/*.d.ts",
165
- "default": "./dist/src/utils/*.js"
164
+ "types": "./dist/src/utils/*.d.mts",
165
+ "default": "./dist/src/utils/*.mjs"
166
166
  },
167
167
  "./types": {
168
- "types": "./dist/src/types.d.ts",
169
- "default": "./dist/src/types.js"
168
+ "types": "./dist/src/types.d.mts",
169
+ "default": "./dist/src/types.mjs"
170
170
  }
171
171
  },
172
172
  "scripts": {