@m5kdev/commons 0.38.20 → 0.38.22

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.
@@ -27,6 +27,7 @@ const billingSchema = zod.z.object({
27
27
  discounts: zod.z.array(zod.z.string()).nullish(),
28
28
  environment: stripeEnvironmentSchema.nullish()
29
29
  });
30
+ const activeSubscriptionSchema = billingSchema.extend({ ownerMustAddPaymentMethod: zod.z.boolean() });
30
31
  const billingCouponSchema = zod.z.object({
31
32
  id: zod.z.string(),
32
33
  name: zod.z.string().nullable(),
@@ -62,6 +63,10 @@ const setAdminBillingExemptInputSchema = zod.z.object({
62
63
  organizationId: zod.z.string(),
63
64
  billingExempt: zod.z.boolean()
64
65
  });
66
+ const setAdminAllowCardlessTrialInputSchema = zod.z.object({
67
+ organizationId: zod.z.string(),
68
+ allowCardlessTrial: zod.z.boolean()
69
+ });
65
70
  const cancelAdminSubscriptionInputSchema = zod.z.object({
66
71
  organizationId: zod.z.string(),
67
72
  when: zod.z.enum(["immediate", "period_end"])
@@ -74,6 +79,7 @@ const adminOrganizationBillingRowSchema = zod.z.object({
74
79
  stripeCustomerId: zod.z.string().nullable(),
75
80
  defaultTrialDays: zod.z.number().nullable(),
76
81
  billingExempt: zod.z.boolean(),
82
+ allowCardlessTrial: zod.z.boolean(),
77
83
  openSubscription: zod.z.boolean(),
78
84
  subscription: billingSchema.nullable(),
79
85
  coupon: billingCouponSchema.nullable()
@@ -82,6 +88,7 @@ const billingAdminListInputSchema = require_src_modules_schemas_query_schema.que
82
88
  const billingAdminListOutputSchema = require_src_modules_schemas_query_schema.queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
83
89
  //#endregion
84
90
  exports.MAX_TRIAL_DAYS = MAX_TRIAL_DAYS;
91
+ exports.activeSubscriptionSchema = activeSubscriptionSchema;
85
92
  exports.adminOrganizationBillingRowSchema = adminOrganizationBillingRowSchema;
86
93
  exports.applyAdminCouponInputSchema = applyAdminCouponInputSchema;
87
94
  exports.billingAdminListInputSchema = billingAdminListInputSchema;
@@ -92,6 +99,7 @@ exports.billingSchema = billingSchema;
92
99
  exports.cancelAdminSubscriptionInputSchema = cancelAdminSubscriptionInputSchema;
93
100
  exports.createAdminSubscriptionInputSchema = createAdminSubscriptionInputSchema;
94
101
  exports.organizationIdInputSchema = organizationIdInputSchema;
102
+ exports.setAdminAllowCardlessTrialInputSchema = setAdminAllowCardlessTrialInputSchema;
95
103
  exports.setAdminBillingExemptInputSchema = setAdminBillingExemptInputSchema;
96
104
  exports.setOrganizationCurrencyInputSchema = setOrganizationCurrencyInputSchema;
97
105
  exports.stripeEnvironmentSchema = stripeEnvironmentSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"billing.schema.cjs","names":["z","querySchema","queryListOutput"],"sources":["../../../../src/modules/billing/billing.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { queryListOutput, querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\r\n\r\nexport const billingSchema = z.object({\r\n id: z.string(),\r\n plan: z.string(),\r\n referenceId: z.string(),\r\n stripeCustomerId: z.string().nullish(),\r\n stripeSubscriptionId: z.string().nullish(),\r\n status: z.string(),\r\n periodStart: z.date().nullish(),\r\n periodEnd: z.date().nullish(),\r\n cancelAtPeriodEnd: z.boolean().nullish(),\r\n cancelAt: z.date().nullish(),\r\n canceledAt: z.date().nullish(),\r\n seats: z.number().nullish(),\r\n memberId: z.string().nullish(),\r\n trialStart: z.date().nullish(),\r\n trialEnd: z.date().nullish(),\r\n priceId: z.string().nullish(),\r\n interval: z.string().nullish(),\r\n intervalCount: z.number().nullish(),\r\n intervalPicked: z.boolean().nullish(),\r\n unitAmount: z.number().nullish(),\r\n discounts: z.array(z.string()).nullish(),\r\n environment: stripeEnvironmentSchema.nullish(),\r\n});\r\n\r\nexport type BillingSchema = z.infer<typeof billingSchema>;\r\n\r\nexport const billingCouponSchema = z.object({\r\n id: z.string(),\r\n name: z.string().nullable(),\r\n percentOff: z.number().nullable(),\r\n amountOff: z.number().nullable(),\r\n currency: z.string().nullable(),\r\n duration: z.enum([\"forever\", \"once\", \"repeating\"]).nullable(),\r\n durationInMonths: z.number().nullable(),\r\n valid: z.boolean(),\r\n});\r\n\r\nexport const billingCouponListOutputSchema = z.array(billingCouponSchema);\r\n\r\nexport const organizationIdInputSchema = z.object({\r\n organizationId: z.string(),\r\n});\r\n\r\nexport const MAX_TRIAL_DAYS = 730;\r\n\r\nexport const createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().optional(),\r\n trialDays: z.number().int().min(1).max(MAX_TRIAL_DAYS).optional(),\r\n});\r\n\r\nexport const applyAdminCouponInputSchema = z.object({\r\n organizationId: z.string(),\r\n couponId: z.string(),\r\n});\r\n\r\nexport const setOrganizationCurrencyInputSchema = z.object({\r\n organizationId: z.string(),\r\n currency: z.string(),\r\n});\r\n\r\nexport const setAdminBillingExemptInputSchema = z.object({\r\n organizationId: z.string(),\r\n billingExempt: z.boolean(),\r\n});\r\n\r\nexport const cancelAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n when: z.enum([\"immediate\", \"period_end\"]),\r\n});\r\n\r\nexport const adminOrganizationBillingRowSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string(),\r\n organizationName: z.string(),\r\n currency: z.string().nullable(),\r\n stripeCustomerId: z.string().nullable(),\r\n defaultTrialDays: z.number().nullable(),\r\n billingExempt: z.boolean(),\r\n openSubscription: z.boolean(),\r\n subscription: billingSchema.nullable(),\r\n coupon: billingCouponSchema.nullable(),\r\n});\r\n\r\nexport const billingAdminListInputSchema = querySchema;\r\nexport const billingAdminListOutputSchema = queryListOutput(\r\n adminOrganizationBillingRowSchema\r\n).extend({\r\n environment: stripeEnvironmentSchema,\r\n});\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;;AAGA,MAAa,0BAA0BA,IAAAA,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC;AAExE,MAAa,gBAAgBA,IAAAA,EAAE,OAAO;CACpC,IAAIA,IAAAA,EAAE,QAAQ;CACd,MAAMA,IAAAA,EAAE,QAAQ;CAChB,aAAaA,IAAAA,EAAE,QAAQ;CACvB,kBAAkBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CACtC,sBAAsBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC1C,QAAQA,IAAAA,EAAE,QAAQ;CAClB,aAAaA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC/B,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,mBAAmBA,IAAAA,EAAE,SAAS,CAAC,SAAS;CACxC,UAAUA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC5B,YAAYA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC9B,OAAOA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC3B,UAAUA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC9B,YAAYA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC9B,UAAUA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC5B,SAASA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC7B,UAAUA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC9B,eAAeA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CACnC,gBAAgBA,IAAAA,EAAE,SAAS,CAAC,SAAS;CACrC,YAAYA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAChC,WAAWA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS;C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A,IAAAA,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAa,qCAAqCA,IAAAA,EAAE,OAAO;CACzD,gBAAgBA,IAAAA,EAAE,QAAQ;CAC1B,MAAMA,IAAAA,EAAE,KAAK,CAAC,aAAa,aAAa,CAAC;CAC1C,CAAC;AAEF,MAAa,oCAAoCA,IAAAA,EAAE,OAAO;CACxD,IAAIA,IAAAA,EAAE,QAAQ;CACd,gBAAgBA,IAAAA,EAAE,QAAQ;CAC1B,kBAAkBA,IAAAA,EAAE,QAAQ;CAC5B,UAAUA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC/B,kBAAkBA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CACvC,kBAAkBA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CACvC,eAAeA,IAAAA,EAAE,SAAS;CAC1B,kBAAkBA,IAAAA,EAAE,SAAS;CAC7B,cAAc,cAAc,UAAU;CACtC,QAAQ,oBAAoB,UAAU;CACvC,CAAC;AAEF,MAAa,8BAA8BC,yCAAAA;AAC3C,MAAa,+BAA+BC,yCAAAA,gBAC1C,kCACD,CAAC,OAAO,EACP,aAAa,yBACd,CAAC"}
1
+ {"version":3,"file":"billing.schema.cjs","names":["z","querySchema","queryListOutput"],"sources":["../../../../src/modules/billing/billing.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { queryListOutput, querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\r\n\r\nexport const billingSchema = z.object({\r\n id: z.string(),\r\n plan: z.string(),\r\n referenceId: z.string(),\r\n stripeCustomerId: z.string().nullish(),\r\n stripeSubscriptionId: z.string().nullish(),\r\n status: z.string(),\r\n periodStart: z.date().nullish(),\r\n periodEnd: z.date().nullish(),\r\n cancelAtPeriodEnd: z.boolean().nullish(),\r\n cancelAt: z.date().nullish(),\r\n canceledAt: z.date().nullish(),\r\n seats: z.number().nullish(),\r\n memberId: z.string().nullish(),\r\n trialStart: z.date().nullish(),\r\n trialEnd: z.date().nullish(),\r\n priceId: z.string().nullish(),\r\n interval: z.string().nullish(),\r\n intervalCount: z.number().nullish(),\r\n intervalPicked: z.boolean().nullish(),\r\n unitAmount: z.number().nullish(),\r\n discounts: z.array(z.string()).nullish(),\r\n environment: stripeEnvironmentSchema.nullish(),\r\n});\r\n\r\nexport type BillingSchema = z.infer<typeof billingSchema>;\r\n\r\nexport const activeSubscriptionSchema = billingSchema.extend({\r\n ownerMustAddPaymentMethod: z.boolean(),\r\n});\r\n\r\nexport type ActiveSubscription = z.infer<typeof activeSubscriptionSchema>;\r\n\r\nexport const billingCouponSchema = z.object({\r\n id: z.string(),\r\n name: z.string().nullable(),\r\n percentOff: z.number().nullable(),\r\n amountOff: z.number().nullable(),\r\n currency: z.string().nullable(),\r\n duration: z.enum([\"forever\", \"once\", \"repeating\"]).nullable(),\r\n durationInMonths: z.number().nullable(),\r\n valid: z.boolean(),\r\n});\r\n\r\nexport const billingCouponListOutputSchema = z.array(billingCouponSchema);\r\n\r\nexport const organizationIdInputSchema = z.object({\r\n organizationId: z.string(),\r\n});\r\n\r\nexport const MAX_TRIAL_DAYS = 730;\r\n\r\nexport const createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().optional(),\r\n trialDays: z.number().int().min(1).max(MAX_TRIAL_DAYS).optional(),\r\n});\r\n\r\nexport const applyAdminCouponInputSchema = z.object({\r\n organizationId: z.string(),\r\n couponId: z.string(),\r\n});\r\n\r\nexport const setOrganizationCurrencyInputSchema = z.object({\r\n organizationId: z.string(),\r\n currency: z.string(),\r\n});\r\n\r\nexport const setAdminBillingExemptInputSchema = z.object({\r\n organizationId: z.string(),\r\n billingExempt: z.boolean(),\r\n});\r\n\r\nexport const setAdminAllowCardlessTrialInputSchema = z.object({\r\n organizationId: z.string(),\r\n allowCardlessTrial: z.boolean(),\r\n});\r\n\r\nexport const cancelAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n when: z.enum([\"immediate\", \"period_end\"]),\r\n});\r\n\r\nexport const adminOrganizationBillingRowSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string(),\r\n organizationName: z.string(),\r\n currency: z.string().nullable(),\r\n stripeCustomerId: z.string().nullable(),\r\n defaultTrialDays: z.number().nullable(),\r\n billingExempt: z.boolean(),\r\n allowCardlessTrial: z.boolean(),\r\n openSubscription: z.boolean(),\r\n subscription: billingSchema.nullable(),\r\n coupon: billingCouponSchema.nullable(),\r\n});\r\n\r\nexport const billingAdminListInputSchema = querySchema;\r\nexport const billingAdminListOutputSchema = queryListOutput(\r\n adminOrganizationBillingRowSchema\r\n).extend({\r\n environment: stripeEnvironmentSchema,\r\n});\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;\r\nexport type SetAdminAllowCardlessTrialInput = z.infer<typeof setAdminAllowCardlessTrialInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;;AAGA,MAAa,0BAA0BA,IAAAA,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC;AAExE,MAAa,gBAAgBA,IAAAA,EAAE,OAAO;CACpC,IAAIA,IAAAA,EAAE,QAAQ;CACd,MAAMA,IAAAA,EAAE,QAAQ;CAChB,aAAaA,IAAAA,EAAE,QAAQ;CACvB,kBAAkBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CACtC,sBAAsBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC1C,QAAQA,IAAAA,EAAE,QAAQ;CAClB,aAAaA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC/B,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,mBAAmBA,IAAAA,EAAE,SAAS,CAAC,SAAS;CACxC,U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AE,QAAQ,CAAC,UAAU;CACvC,eAAeA,IAAAA,EAAE,SAAS;CAC1B,oBAAoBA,IAAAA,EAAE,SAAS;CAC/B,kBAAkBA,IAAAA,EAAE,SAAS;CAC7B,cAAc,cAAc,UAAU;CACtC,QAAQ,oBAAoB,UAAU;CACvC,CAAC;AAEF,MAAa,8BAA8BC,yCAAAA;AAC3C,MAAa,+BAA+BC,yCAAAA,gBAC1C,kCACD,CAAC,OAAO,EACP,aAAa,yBACd,CAAC"}
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
 
3
3
  //#region src/modules/billing/billing.schema.d.ts
4
4
  declare const stripeEnvironmentSchema: z.ZodEnum<{
5
- sandbox: "sandbox";
6
5
  production: "production";
6
+ sandbox: "sandbox";
7
7
  }>;
8
8
  declare const billingSchema: z.ZodObject<{
9
9
  id: z.ZodString;
@@ -28,11 +28,40 @@ declare const billingSchema: z.ZodObject<{
28
28
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
29
29
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
30
30
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
31
- sandbox: "sandbox";
32
31
  production: "production";
32
+ sandbox: "sandbox";
33
33
  }>>>;
34
34
  }, z.core.$strip>;
35
35
  type BillingSchema = z.infer<typeof billingSchema>;
36
+ declare const activeSubscriptionSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ plan: z.ZodString;
39
+ referenceId: z.ZodString;
40
+ stripeCustomerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ stripeSubscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ status: z.ZodString;
43
+ periodStart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
44
+ periodEnd: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
45
+ cancelAtPeriodEnd: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
46
+ cancelAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
47
+ canceledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
48
+ seats: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
49
+ memberId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ trialStart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
51
+ trialEnd: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
+ priceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ interval: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ intervalCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
+ intervalPicked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
56
+ unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
57
+ discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
58
+ environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
59
+ production: "production";
60
+ sandbox: "sandbox";
61
+ }>>>;
62
+ ownerMustAddPaymentMethod: z.ZodBoolean;
63
+ }, z.core.$strip>;
64
+ type ActiveSubscription = z.infer<typeof activeSubscriptionSchema>;
36
65
  declare const billingCouponSchema: z.ZodObject<{
37
66
  id: z.ZodString;
38
67
  name: z.ZodNullable<z.ZodString>;
@@ -83,6 +112,10 @@ declare const setAdminBillingExemptInputSchema: z.ZodObject<{
83
112
  organizationId: z.ZodString;
84
113
  billingExempt: z.ZodBoolean;
85
114
  }, z.core.$strip>;
115
+ declare const setAdminAllowCardlessTrialInputSchema: z.ZodObject<{
116
+ organizationId: z.ZodString;
117
+ allowCardlessTrial: z.ZodBoolean;
118
+ }, z.core.$strip>;
86
119
  declare const cancelAdminSubscriptionInputSchema: z.ZodObject<{
87
120
  organizationId: z.ZodString;
88
121
  when: z.ZodEnum<{
@@ -98,6 +131,7 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
98
131
  stripeCustomerId: z.ZodNullable<z.ZodString>;
99
132
  defaultTrialDays: z.ZodNullable<z.ZodNumber>;
100
133
  billingExempt: z.ZodBoolean;
134
+ allowCardlessTrial: z.ZodBoolean;
101
135
  openSubscription: z.ZodBoolean;
102
136
  subscription: z.ZodNullable<z.ZodObject<{
103
137
  id: z.ZodString;
@@ -122,8 +156,8 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
122
156
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
123
157
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
124
158
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
125
- sandbox: "sandbox";
126
159
  production: "production";
160
+ sandbox: "sandbox";
127
161
  }>>>;
128
162
  }, z.core.$strip>>;
129
163
  coupon: z.ZodNullable<z.ZodObject<{
@@ -155,8 +189,8 @@ declare const billingAdminListInputSchema: z.ZodObject<{
155
189
  string: "string";
156
190
  number: "number";
157
191
  boolean: "boolean";
158
- date: "date";
159
192
  enum: "enum";
193
+ date: "date";
160
194
  jsonArray: "jsonArray";
161
195
  }>;
162
196
  method: z.ZodEnum<{
@@ -192,6 +226,7 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
192
226
  stripeCustomerId: z.ZodNullable<z.ZodString>;
193
227
  defaultTrialDays: z.ZodNullable<z.ZodNumber>;
194
228
  billingExempt: z.ZodBoolean;
229
+ allowCardlessTrial: z.ZodBoolean;
195
230
  openSubscription: z.ZodBoolean;
196
231
  subscription: z.ZodNullable<z.ZodObject<{
197
232
  id: z.ZodString;
@@ -216,8 +251,8 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
216
251
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
217
252
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
218
253
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
219
- sandbox: "sandbox";
220
254
  production: "production";
255
+ sandbox: "sandbox";
221
256
  }>>>;
222
257
  }, z.core.$strip>>;
223
258
  coupon: z.ZodNullable<z.ZodObject<{
@@ -237,14 +272,15 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
237
272
  }, z.core.$strip>>;
238
273
  total: z.ZodNumber;
239
274
  environment: z.ZodEnum<{
240
- sandbox: "sandbox";
241
275
  production: "production";
276
+ sandbox: "sandbox";
242
277
  }>;
243
278
  }, z.core.$strip>;
244
279
  type BillingCoupon = z.infer<typeof billingCouponSchema>;
245
280
  type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
246
281
  type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;
282
+ type SetAdminAllowCardlessTrialInput = z.infer<typeof setAdminAllowCardlessTrialInputSchema>;
247
283
  type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
248
284
  //#endregion
249
- export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminBillingExemptInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
285
+ export { ActiveSubscription, AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminAllowCardlessTrialInput, SetAdminBillingExemptInput, activeSubscriptionSchema, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminAllowCardlessTrialInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
250
286
  //# sourceMappingURL=billing.schema.d.cts.map
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
 
3
3
  //#region src/modules/billing/billing.schema.d.ts
4
4
  declare const stripeEnvironmentSchema: z.ZodEnum<{
5
- sandbox: "sandbox";
6
5
  production: "production";
6
+ sandbox: "sandbox";
7
7
  }>;
8
8
  declare const billingSchema: z.ZodObject<{
9
9
  id: z.ZodString;
@@ -28,11 +28,40 @@ declare const billingSchema: z.ZodObject<{
28
28
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
29
29
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
30
30
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
31
- sandbox: "sandbox";
32
31
  production: "production";
32
+ sandbox: "sandbox";
33
33
  }>>>;
34
34
  }, z.core.$strip>;
35
35
  type BillingSchema = z.infer<typeof billingSchema>;
36
+ declare const activeSubscriptionSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ plan: z.ZodString;
39
+ referenceId: z.ZodString;
40
+ stripeCustomerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ stripeSubscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ status: z.ZodString;
43
+ periodStart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
44
+ periodEnd: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
45
+ cancelAtPeriodEnd: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
46
+ cancelAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
47
+ canceledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
48
+ seats: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
49
+ memberId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ trialStart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
51
+ trialEnd: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
+ priceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ interval: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ intervalCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
+ intervalPicked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
56
+ unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
57
+ discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
58
+ environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
59
+ production: "production";
60
+ sandbox: "sandbox";
61
+ }>>>;
62
+ ownerMustAddPaymentMethod: z.ZodBoolean;
63
+ }, z.core.$strip>;
64
+ type ActiveSubscription = z.infer<typeof activeSubscriptionSchema>;
36
65
  declare const billingCouponSchema: z.ZodObject<{
37
66
  id: z.ZodString;
38
67
  name: z.ZodNullable<z.ZodString>;
@@ -83,6 +112,10 @@ declare const setAdminBillingExemptInputSchema: z.ZodObject<{
83
112
  organizationId: z.ZodString;
84
113
  billingExempt: z.ZodBoolean;
85
114
  }, z.core.$strip>;
115
+ declare const setAdminAllowCardlessTrialInputSchema: z.ZodObject<{
116
+ organizationId: z.ZodString;
117
+ allowCardlessTrial: z.ZodBoolean;
118
+ }, z.core.$strip>;
86
119
  declare const cancelAdminSubscriptionInputSchema: z.ZodObject<{
87
120
  organizationId: z.ZodString;
88
121
  when: z.ZodEnum<{
@@ -98,6 +131,7 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
98
131
  stripeCustomerId: z.ZodNullable<z.ZodString>;
99
132
  defaultTrialDays: z.ZodNullable<z.ZodNumber>;
100
133
  billingExempt: z.ZodBoolean;
134
+ allowCardlessTrial: z.ZodBoolean;
101
135
  openSubscription: z.ZodBoolean;
102
136
  subscription: z.ZodNullable<z.ZodObject<{
103
137
  id: z.ZodString;
@@ -122,8 +156,8 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
122
156
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
123
157
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
124
158
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
125
- sandbox: "sandbox";
126
159
  production: "production";
160
+ sandbox: "sandbox";
127
161
  }>>>;
128
162
  }, z.core.$strip>>;
129
163
  coupon: z.ZodNullable<z.ZodObject<{
@@ -155,8 +189,8 @@ declare const billingAdminListInputSchema: z.ZodObject<{
155
189
  string: "string";
156
190
  number: "number";
157
191
  boolean: "boolean";
158
- date: "date";
159
192
  enum: "enum";
193
+ date: "date";
160
194
  jsonArray: "jsonArray";
161
195
  }>;
162
196
  method: z.ZodEnum<{
@@ -192,6 +226,7 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
192
226
  stripeCustomerId: z.ZodNullable<z.ZodString>;
193
227
  defaultTrialDays: z.ZodNullable<z.ZodNumber>;
194
228
  billingExempt: z.ZodBoolean;
229
+ allowCardlessTrial: z.ZodBoolean;
195
230
  openSubscription: z.ZodBoolean;
196
231
  subscription: z.ZodNullable<z.ZodObject<{
197
232
  id: z.ZodString;
@@ -216,8 +251,8 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
216
251
  unitAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
217
252
  discounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
218
253
  environment: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
219
- sandbox: "sandbox";
220
254
  production: "production";
255
+ sandbox: "sandbox";
221
256
  }>>>;
222
257
  }, z.core.$strip>>;
223
258
  coupon: z.ZodNullable<z.ZodObject<{
@@ -237,14 +272,15 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
237
272
  }, z.core.$strip>>;
238
273
  total: z.ZodNumber;
239
274
  environment: z.ZodEnum<{
240
- sandbox: "sandbox";
241
275
  production: "production";
276
+ sandbox: "sandbox";
242
277
  }>;
243
278
  }, z.core.$strip>;
244
279
  type BillingCoupon = z.infer<typeof billingCouponSchema>;
245
280
  type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
246
281
  type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;
282
+ type SetAdminAllowCardlessTrialInput = z.infer<typeof setAdminAllowCardlessTrialInputSchema>;
247
283
  type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
248
284
  //#endregion
249
- export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminBillingExemptInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
285
+ export { ActiveSubscription, AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminAllowCardlessTrialInput, SetAdminBillingExemptInput, activeSubscriptionSchema, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminAllowCardlessTrialInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
250
286
  //# sourceMappingURL=billing.schema.d.mts.map
@@ -26,6 +26,7 @@ const billingSchema = z.object({
26
26
  discounts: z.array(z.string()).nullish(),
27
27
  environment: stripeEnvironmentSchema.nullish()
28
28
  });
29
+ const activeSubscriptionSchema = billingSchema.extend({ ownerMustAddPaymentMethod: z.boolean() });
29
30
  const billingCouponSchema = z.object({
30
31
  id: z.string(),
31
32
  name: z.string().nullable(),
@@ -61,6 +62,10 @@ const setAdminBillingExemptInputSchema = z.object({
61
62
  organizationId: z.string(),
62
63
  billingExempt: z.boolean()
63
64
  });
65
+ const setAdminAllowCardlessTrialInputSchema = z.object({
66
+ organizationId: z.string(),
67
+ allowCardlessTrial: z.boolean()
68
+ });
64
69
  const cancelAdminSubscriptionInputSchema = z.object({
65
70
  organizationId: z.string(),
66
71
  when: z.enum(["immediate", "period_end"])
@@ -73,6 +78,7 @@ const adminOrganizationBillingRowSchema = z.object({
73
78
  stripeCustomerId: z.string().nullable(),
74
79
  defaultTrialDays: z.number().nullable(),
75
80
  billingExempt: z.boolean(),
81
+ allowCardlessTrial: z.boolean(),
76
82
  openSubscription: z.boolean(),
77
83
  subscription: billingSchema.nullable(),
78
84
  coupon: billingCouponSchema.nullable()
@@ -80,6 +86,6 @@ const adminOrganizationBillingRowSchema = z.object({
80
86
  const billingAdminListInputSchema = querySchema;
81
87
  const billingAdminListOutputSchema = queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
82
88
  //#endregion
83
- export { MAX_TRIAL_DAYS, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
89
+ export { MAX_TRIAL_DAYS, activeSubscriptionSchema, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminAllowCardlessTrialInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
84
90
 
85
91
  //# sourceMappingURL=billing.schema.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.schema.mjs","names":[],"sources":["../../../../src/modules/billing/billing.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { queryListOutput, querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\r\n\r\nexport const billingSchema = z.object({\r\n id: z.string(),\r\n plan: z.string(),\r\n referenceId: z.string(),\r\n stripeCustomerId: z.string().nullish(),\r\n stripeSubscriptionId: z.string().nullish(),\r\n status: z.string(),\r\n periodStart: z.date().nullish(),\r\n periodEnd: z.date().nullish(),\r\n cancelAtPeriodEnd: z.boolean().nullish(),\r\n cancelAt: z.date().nullish(),\r\n canceledAt: z.date().nullish(),\r\n seats: z.number().nullish(),\r\n memberId: z.string().nullish(),\r\n trialStart: z.date().nullish(),\r\n trialEnd: z.date().nullish(),\r\n priceId: z.string().nullish(),\r\n interval: z.string().nullish(),\r\n intervalCount: z.number().nullish(),\r\n intervalPicked: z.boolean().nullish(),\r\n unitAmount: z.number().nullish(),\r\n discounts: z.array(z.string()).nullish(),\r\n environment: stripeEnvironmentSchema.nullish(),\r\n});\r\n\r\nexport type BillingSchema = z.infer<typeof billingSchema>;\r\n\r\nexport const billingCouponSchema = z.object({\r\n id: z.string(),\r\n name: z.string().nullable(),\r\n percentOff: z.number().nullable(),\r\n amountOff: z.number().nullable(),\r\n currency: z.string().nullable(),\r\n duration: z.enum([\"forever\", \"once\", \"repeating\"]).nullable(),\r\n durationInMonths: z.number().nullable(),\r\n valid: z.boolean(),\r\n});\r\n\r\nexport const billingCouponListOutputSchema = z.array(billingCouponSchema);\r\n\r\nexport const organizationIdInputSchema = z.object({\r\n organizationId: z.string(),\r\n});\r\n\r\nexport const MAX_TRIAL_DAYS = 730;\r\n\r\nexport const createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().optional(),\r\n trialDays: z.number().int().min(1).max(MAX_TRIAL_DAYS).optional(),\r\n});\r\n\r\nexport const applyAdminCouponInputSchema = z.object({\r\n organizationId: z.string(),\r\n couponId: z.string(),\r\n});\r\n\r\nexport const setOrganizationCurrencyInputSchema = z.object({\r\n organizationId: z.string(),\r\n currency: z.string(),\r\n});\r\n\r\nexport const setAdminBillingExemptInputSchema = z.object({\r\n organizationId: z.string(),\r\n billingExempt: z.boolean(),\r\n});\r\n\r\nexport const cancelAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n when: z.enum([\"immediate\", \"period_end\"]),\r\n});\r\n\r\nexport const adminOrganizationBillingRowSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string(),\r\n organizationName: z.string(),\r\n currency: z.string().nullable(),\r\n stripeCustomerId: z.string().nullable(),\r\n defaultTrialDays: z.number().nullable(),\r\n billingExempt: z.boolean(),\r\n openSubscription: z.boolean(),\r\n subscription: billingSchema.nullable(),\r\n coupon: billingCouponSchema.nullable(),\r\n});\r\n\r\nexport const billingAdminListInputSchema = querySchema;\r\nexport const billingAdminListOutputSchema = queryListOutput(\r\n adminOrganizationBillingRowSchema\r\n).extend({\r\n environment: stripeEnvironmentSchema,\r\n});\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC;AAExE,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CAChB,aAAa,EAAE,QAAQ;CACvB,kBAAkB,EAAE,QAAQ,CAAC,SAAS;CACtC,sBAAsB,EAAE,QAAQ,CAAC,SAAS;CAC1C,QAAQ,EAAE,QAAQ;CAClB,aAAa,EAAE,MAAM,CAAC,SAAS;CAC/B,WAAW,EAAE,MAAM,CAAC,SAAS;CAC7B,mBAAmB,EAAE,SAAS,CAAC,SAAS;CACxC,UAAU,EAAE,MAAM,CAAC,SAAS;CAC5B,YAAY,EAAE,MAA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B,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF,MAAa,qCAAqC,EAAE,OAAO;CACzD,gBAAgB,EAAE,QAAQ;CAC1B,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF,MAAa,mCAAmC,EAAE,OAAO;CACvD,gBAAgB,EAAE,QAAQ;CAC1B,eAAe,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAa,qCAAqC,EAAE,OAAO;CACzD,gBAAgB,EAAE,QAAQ;CAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,aAAa,CAAC;CAC1C,CAAC;AAEF,MAAa,oCAAoC,EAAE,OAAO;CACxD,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,kBAAkB,EAAE,QAAQ;CAC5B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,eAAe,EAAE,SAAS;CAC1B,kBAAkB,EAAE,SAAS;CAC7B,cAAc,cAAc,UAAU;CACtC,QAAQ,oBAAoB,UAAU;CACvC,CAAC;AAEF,MAAa,8BAA8B;AAC3C,MAAa,+BAA+B,gBAC1C,kCACD,CAAC,OAAO,EACP,aAAa,yBACd,CAAC"}
1
+ {"version":3,"file":"billing.schema.mjs","names":[],"sources":["../../../../src/modules/billing/billing.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { queryListOutput, querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\r\n\r\nexport const billingSchema = z.object({\r\n id: z.string(),\r\n plan: z.string(),\r\n referenceId: z.string(),\r\n stripeCustomerId: z.string().nullish(),\r\n stripeSubscriptionId: z.string().nullish(),\r\n status: z.string(),\r\n periodStart: z.date().nullish(),\r\n periodEnd: z.date().nullish(),\r\n cancelAtPeriodEnd: z.boolean().nullish(),\r\n cancelAt: z.date().nullish(),\r\n canceledAt: z.date().nullish(),\r\n seats: z.number().nullish(),\r\n memberId: z.string().nullish(),\r\n trialStart: z.date().nullish(),\r\n trialEnd: z.date().nullish(),\r\n priceId: z.string().nullish(),\r\n interval: z.string().nullish(),\r\n intervalCount: z.number().nullish(),\r\n intervalPicked: z.boolean().nullish(),\r\n unitAmount: z.number().nullish(),\r\n discounts: z.array(z.string()).nullish(),\r\n environment: stripeEnvironmentSchema.nullish(),\r\n});\r\n\r\nexport type BillingSchema = z.infer<typeof billingSchema>;\r\n\r\nexport const activeSubscriptionSchema = billingSchema.extend({\r\n ownerMustAddPaymentMethod: z.boolean(),\r\n});\r\n\r\nexport type ActiveSubscription = z.infer<typeof activeSubscriptionSchema>;\r\n\r\nexport const billingCouponSchema = z.object({\r\n id: z.string(),\r\n name: z.string().nullable(),\r\n percentOff: z.number().nullable(),\r\n amountOff: z.number().nullable(),\r\n currency: z.string().nullable(),\r\n duration: z.enum([\"forever\", \"once\", \"repeating\"]).nullable(),\r\n durationInMonths: z.number().nullable(),\r\n valid: z.boolean(),\r\n});\r\n\r\nexport const billingCouponListOutputSchema = z.array(billingCouponSchema);\r\n\r\nexport const organizationIdInputSchema = z.object({\r\n organizationId: z.string(),\r\n});\r\n\r\nexport const MAX_TRIAL_DAYS = 730;\r\n\r\nexport const createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().optional(),\r\n trialDays: z.number().int().min(1).max(MAX_TRIAL_DAYS).optional(),\r\n});\r\n\r\nexport const applyAdminCouponInputSchema = z.object({\r\n organizationId: z.string(),\r\n couponId: z.string(),\r\n});\r\n\r\nexport const setOrganizationCurrencyInputSchema = z.object({\r\n organizationId: z.string(),\r\n currency: z.string(),\r\n});\r\n\r\nexport const setAdminBillingExemptInputSchema = z.object({\r\n organizationId: z.string(),\r\n billingExempt: z.boolean(),\r\n});\r\n\r\nexport const setAdminAllowCardlessTrialInputSchema = z.object({\r\n organizationId: z.string(),\r\n allowCardlessTrial: z.boolean(),\r\n});\r\n\r\nexport const cancelAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n when: z.enum([\"immediate\", \"period_end\"]),\r\n});\r\n\r\nexport const adminOrganizationBillingRowSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string(),\r\n organizationName: z.string(),\r\n currency: z.string().nullable(),\r\n stripeCustomerId: z.string().nullable(),\r\n defaultTrialDays: z.number().nullable(),\r\n billingExempt: z.boolean(),\r\n allowCardlessTrial: z.boolean(),\r\n openSubscription: z.boolean(),\r\n subscription: billingSchema.nullable(),\r\n coupon: billingCouponSchema.nullable(),\r\n});\r\n\r\nexport const billingAdminListInputSchema = querySchema;\r\nexport const billingAdminListOutputSchema = queryListOutput(\r\n adminOrganizationBillingRowSchema\r\n).extend({\r\n environment: stripeEnvironmentSchema,\r\n});\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;\r\nexport type SetAdminAllowCardlessTrialInput = z.infer<typeof setAdminAllowCardlessTrialInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC;AAExE,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CAChB,aAAa,EAAE,QAAQ;CACvB,kBAAkB,EAAE,QAAQ,CAAC,SAAS;CACtC,sBAAsB,EAAE,QAAQ,CAAC,SAAS;CAC1C,QAAQ,EAAE,QAAQ;CAClB,aAAa,EAAE,MAAM,CAAC,SAAS;CAC/B,WAAW,EAAE,MAAM,CAAC,SAAS;CAC7B,mBAAmB,EAAE,SAAS,CAAC,SAAS;CACxC,UAAU,EAAE,MAAM,CAAC,SAAS;CAC5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,CAAC,UAAU;CAClE,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO;CAClD,gBAAgB,EAAE,QAAQ;CAC1B,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF,MAAa,qCAAqC,EAAE,OAAO;CACzD,gBAAgB,EAAE,QAAQ;CAC1B,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF,MAAa,mCAAmC,EAAE,OAAO;CACvD,gBAAgB,EAAE,QAAQ;CAC1B,eAAe,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAa,wCAAwC,EAAE,OAAO;CAC5D,gBAAgB,EAAE,QAAQ;CAC1B,oBAAoB,EAAE,SAAS;CAChC,CAAC;AAEF,MAAa,qCAAqC,EAAE,OAAO;CACzD,gBAAgB,EAAE,QAAQ;CAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,aAAa,CAAC;CAC1C,CAAC;AAEF,MAAa,oCAAoC,EAAE,OAAO;CACxD,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,kBAAkB,EAAE,QAAQ;CAC5B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,eAAe,EAAE,SAAS;CAC1B,oBAAoB,EAAE,SAAS;CAC/B,kBAAkB,EAAE,SAAS;CAC7B,cAAc,cAAc,UAAU;CACtC,QAAQ,oBAAoB,UAAU;CACvC,CAAC;AAEF,MAAa,8BAA8B;AAC3C,MAAa,+BAA+B,gBAC1C,kCACD,CAAC,OAAO,EACP,aAAa,yBACd,CAAC"}
@@ -12,9 +12,9 @@ declare const notificationProviderSchema: z.ZodEnum<{
12
12
  fcm: "fcm";
13
13
  }>;
14
14
  declare const notificationSendStatusSchema: z.ZodEnum<{
15
+ failed: "failed";
15
16
  pending: "pending";
16
17
  sent: "sent";
17
- failed: "failed";
18
18
  }>;
19
19
  /** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */
20
20
  declare const pushSubscriptionJsonSchema: z.ZodObject<{
@@ -87,10 +87,10 @@ declare const notificationVapidPublicKeyOutputSchema: z.ZodObject<{
87
87
  publicKey: z.ZodString;
88
88
  }, z.core.$strip>;
89
89
  declare const notificationChannelSchema: z.ZodEnum<{
90
+ email: "email";
90
91
  "in-app": "in-app";
91
92
  "web-push": "web-push";
92
93
  "mobile-push": "mobile-push";
93
- email: "email";
94
94
  }>;
95
95
  declare const notificationSendLogSelectSchema: z.ZodObject<{
96
96
  id: z.ZodString;
@@ -99,10 +99,10 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
99
99
  userId: z.ZodString;
100
100
  deviceId: z.ZodNullable<z.ZodString>;
101
101
  channel: z.ZodEnum<{
102
+ email: "email";
102
103
  "in-app": "in-app";
103
104
  "web-push": "web-push";
104
105
  "mobile-push": "mobile-push";
105
- email: "email";
106
106
  }>;
107
107
  provider: z.ZodNullable<z.ZodEnum<{
108
108
  web: "web";
@@ -113,9 +113,9 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
113
113
  body: z.ZodString;
114
114
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
115
115
  status: z.ZodEnum<{
116
+ failed: "failed";
116
117
  pending: "pending";
117
118
  sent: "sent";
118
- failed: "failed";
119
119
  }>;
120
120
  error: z.ZodNullable<z.ZodString>;
121
121
  jobId: z.ZodNullable<z.ZodString>;
@@ -133,10 +133,10 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
133
133
  userId: z.ZodString;
134
134
  deviceId: z.ZodNullable<z.ZodString>;
135
135
  channel: z.ZodEnum<{
136
+ email: "email";
136
137
  "in-app": "in-app";
137
138
  "web-push": "web-push";
138
139
  "mobile-push": "mobile-push";
139
- email: "email";
140
140
  }>;
141
141
  provider: z.ZodNullable<z.ZodEnum<{
142
142
  web: "web";
@@ -147,9 +147,9 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
147
147
  body: z.ZodString;
148
148
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
149
  status: z.ZodEnum<{
150
+ failed: "failed";
150
151
  pending: "pending";
151
152
  sent: "sent";
152
- failed: "failed";
153
153
  }>;
154
154
  error: z.ZodNullable<z.ZodString>;
155
155
  jobId: z.ZodNullable<z.ZodString>;
@@ -203,10 +203,10 @@ declare const notificationSendTestOutputSchema: z.ZodObject<{
203
203
  }, z.core.$strip>;
204
204
  declare const notificationKindPreferenceChannelSchema: z.ZodObject<{
205
205
  channel: z.ZodEnum<{
206
+ email: "email";
206
207
  "in-app": "in-app";
207
208
  "web-push": "web-push";
208
209
  "mobile-push": "mobile-push";
209
- email: "email";
210
210
  }>;
211
211
  enabled: z.ZodBoolean;
212
212
  }, z.core.$strip>;
@@ -214,10 +214,10 @@ declare const notificationKindPreferenceSchema: z.ZodObject<{
214
214
  kind: z.ZodString;
215
215
  channels: z.ZodArray<z.ZodObject<{
216
216
  channel: z.ZodEnum<{
217
+ email: "email";
217
218
  "in-app": "in-app";
218
219
  "web-push": "web-push";
219
220
  "mobile-push": "mobile-push";
220
- email: "email";
221
221
  }>;
222
222
  enabled: z.ZodBoolean;
223
223
  }, z.core.$strip>>;
@@ -226,10 +226,10 @@ declare const notificationListPreferencesOutputSchema: z.ZodArray<z.ZodObject<{
226
226
  kind: z.ZodString;
227
227
  channels: z.ZodArray<z.ZodObject<{
228
228
  channel: z.ZodEnum<{
229
+ email: "email";
229
230
  "in-app": "in-app";
230
231
  "web-push": "web-push";
231
232
  "mobile-push": "mobile-push";
232
- email: "email";
233
233
  }>;
234
234
  enabled: z.ZodBoolean;
235
235
  }, z.core.$strip>>;
@@ -237,10 +237,10 @@ declare const notificationListPreferencesOutputSchema: z.ZodArray<z.ZodObject<{
237
237
  declare const notificationSetPreferenceInputSchema: z.ZodObject<{
238
238
  kind: z.ZodString;
239
239
  channel: z.ZodEnum<{
240
+ email: "email";
240
241
  "in-app": "in-app";
241
242
  "web-push": "web-push";
242
243
  "mobile-push": "mobile-push";
243
- email: "email";
244
244
  }>;
245
245
  enabled: z.ZodBoolean;
246
246
  }, z.core.$strip>;
@@ -248,10 +248,10 @@ declare const notificationSetPreferenceOutputSchema: z.ZodObject<{
248
248
  kind: z.ZodString;
249
249
  channels: z.ZodArray<z.ZodObject<{
250
250
  channel: z.ZodEnum<{
251
+ email: "email";
251
252
  "in-app": "in-app";
252
253
  "web-push": "web-push";
253
254
  "mobile-push": "mobile-push";
254
- email: "email";
255
255
  }>;
256
256
  enabled: z.ZodBoolean;
257
257
  }, z.core.$strip>>;
@@ -12,9 +12,9 @@ declare const notificationProviderSchema: z.ZodEnum<{
12
12
  fcm: "fcm";
13
13
  }>;
14
14
  declare const notificationSendStatusSchema: z.ZodEnum<{
15
+ failed: "failed";
15
16
  pending: "pending";
16
17
  sent: "sent";
17
- failed: "failed";
18
18
  }>;
19
19
  /** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */
20
20
  declare const pushSubscriptionJsonSchema: z.ZodObject<{
@@ -87,10 +87,10 @@ declare const notificationVapidPublicKeyOutputSchema: z.ZodObject<{
87
87
  publicKey: z.ZodString;
88
88
  }, z.core.$strip>;
89
89
  declare const notificationChannelSchema: z.ZodEnum<{
90
+ email: "email";
90
91
  "in-app": "in-app";
91
92
  "web-push": "web-push";
92
93
  "mobile-push": "mobile-push";
93
- email: "email";
94
94
  }>;
95
95
  declare const notificationSendLogSelectSchema: z.ZodObject<{
96
96
  id: z.ZodString;
@@ -99,10 +99,10 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
99
99
  userId: z.ZodString;
100
100
  deviceId: z.ZodNullable<z.ZodString>;
101
101
  channel: z.ZodEnum<{
102
+ email: "email";
102
103
  "in-app": "in-app";
103
104
  "web-push": "web-push";
104
105
  "mobile-push": "mobile-push";
105
- email: "email";
106
106
  }>;
107
107
  provider: z.ZodNullable<z.ZodEnum<{
108
108
  web: "web";
@@ -113,9 +113,9 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
113
113
  body: z.ZodString;
114
114
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
115
115
  status: z.ZodEnum<{
116
+ failed: "failed";
116
117
  pending: "pending";
117
118
  sent: "sent";
118
- failed: "failed";
119
119
  }>;
120
120
  error: z.ZodNullable<z.ZodString>;
121
121
  jobId: z.ZodNullable<z.ZodString>;
@@ -133,10 +133,10 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
133
133
  userId: z.ZodString;
134
134
  deviceId: z.ZodNullable<z.ZodString>;
135
135
  channel: z.ZodEnum<{
136
+ email: "email";
136
137
  "in-app": "in-app";
137
138
  "web-push": "web-push";
138
139
  "mobile-push": "mobile-push";
139
- email: "email";
140
140
  }>;
141
141
  provider: z.ZodNullable<z.ZodEnum<{
142
142
  web: "web";
@@ -147,9 +147,9 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
147
147
  body: z.ZodString;
148
148
  data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
149
  status: z.ZodEnum<{
150
+ failed: "failed";
150
151
  pending: "pending";
151
152
  sent: "sent";
152
- failed: "failed";
153
153
  }>;
154
154
  error: z.ZodNullable<z.ZodString>;
155
155
  jobId: z.ZodNullable<z.ZodString>;
@@ -203,10 +203,10 @@ declare const notificationSendTestOutputSchema: z.ZodObject<{
203
203
  }, z.core.$strip>;
204
204
  declare const notificationKindPreferenceChannelSchema: z.ZodObject<{
205
205
  channel: z.ZodEnum<{
206
+ email: "email";
206
207
  "in-app": "in-app";
207
208
  "web-push": "web-push";
208
209
  "mobile-push": "mobile-push";
209
- email: "email";
210
210
  }>;
211
211
  enabled: z.ZodBoolean;
212
212
  }, z.core.$strip>;
@@ -214,10 +214,10 @@ declare const notificationKindPreferenceSchema: z.ZodObject<{
214
214
  kind: z.ZodString;
215
215
  channels: z.ZodArray<z.ZodObject<{
216
216
  channel: z.ZodEnum<{
217
+ email: "email";
217
218
  "in-app": "in-app";
218
219
  "web-push": "web-push";
219
220
  "mobile-push": "mobile-push";
220
- email: "email";
221
221
  }>;
222
222
  enabled: z.ZodBoolean;
223
223
  }, z.core.$strip>>;
@@ -226,10 +226,10 @@ declare const notificationListPreferencesOutputSchema: z.ZodArray<z.ZodObject<{
226
226
  kind: z.ZodString;
227
227
  channels: z.ZodArray<z.ZodObject<{
228
228
  channel: z.ZodEnum<{
229
+ email: "email";
229
230
  "in-app": "in-app";
230
231
  "web-push": "web-push";
231
232
  "mobile-push": "mobile-push";
232
- email: "email";
233
233
  }>;
234
234
  enabled: z.ZodBoolean;
235
235
  }, z.core.$strip>>;
@@ -237,10 +237,10 @@ declare const notificationListPreferencesOutputSchema: z.ZodArray<z.ZodObject<{
237
237
  declare const notificationSetPreferenceInputSchema: z.ZodObject<{
238
238
  kind: z.ZodString;
239
239
  channel: z.ZodEnum<{
240
+ email: "email";
240
241
  "in-app": "in-app";
241
242
  "web-push": "web-push";
242
243
  "mobile-push": "mobile-push";
243
- email: "email";
244
244
  }>;
245
245
  enabled: z.ZodBoolean;
246
246
  }, z.core.$strip>;
@@ -248,10 +248,10 @@ declare const notificationSetPreferenceOutputSchema: z.ZodObject<{
248
248
  kind: z.ZodString;
249
249
  channels: z.ZodArray<z.ZodObject<{
250
250
  channel: z.ZodEnum<{
251
+ email: "email";
251
252
  "in-app": "in-app";
252
253
  "web-push": "web-push";
253
254
  "mobile-push": "mobile-push";
254
- email: "email";
255
255
  }>;
256
256
  enabled: z.ZodBoolean;
257
257
  }, z.core.$strip>>;
@@ -38,6 +38,7 @@ declare const recurrenceRulesSchema: z.ZodObject<{
38
38
  }, z.core.$strip>;
39
39
  declare const updateRecurrenceRulesSchema: z.ZodObject<{
40
40
  id: z.ZodString;
41
+ interval: z.ZodNumber;
41
42
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
42
43
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
43
44
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -49,7 +50,6 @@ declare const updateRecurrenceRulesSchema: z.ZodObject<{
49
50
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
50
51
  freq: z.ZodNumber;
51
52
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
- interval: z.ZodNumber;
53
53
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
54
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
55
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -61,6 +61,7 @@ declare const createRecurrenceSchema: z.ZodObject<{
61
61
  enabled: z.ZodBoolean;
62
62
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
63
63
  recurrenceRules: z.ZodArray<z.ZodObject<{
64
+ interval: z.ZodNumber;
64
65
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
65
66
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
66
67
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -72,7 +73,6 @@ declare const createRecurrenceSchema: z.ZodObject<{
72
73
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
73
74
  freq: z.ZodNumber;
74
75
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
- interval: z.ZodNumber;
76
76
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
77
77
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
78
78
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -38,6 +38,7 @@ declare const recurrenceRulesSchema: z.ZodObject<{
38
38
  }, z.core.$strip>;
39
39
  declare const updateRecurrenceRulesSchema: z.ZodObject<{
40
40
  id: z.ZodString;
41
+ interval: z.ZodNumber;
41
42
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
42
43
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
43
44
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -49,7 +50,6 @@ declare const updateRecurrenceRulesSchema: z.ZodObject<{
49
50
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
50
51
  freq: z.ZodNumber;
51
52
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
- interval: z.ZodNumber;
53
53
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
54
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
55
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -61,6 +61,7 @@ declare const createRecurrenceSchema: z.ZodObject<{
61
61
  enabled: z.ZodBoolean;
62
62
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
63
63
  recurrenceRules: z.ZodArray<z.ZodObject<{
64
+ interval: z.ZodNumber;
64
65
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
65
66
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
66
67
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -72,7 +73,6 @@ declare const createRecurrenceSchema: z.ZodObject<{
72
73
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
73
74
  freq: z.ZodNumber;
74
75
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
- interval: z.ZodNumber;
76
76
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
77
77
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
78
78
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -7,8 +7,8 @@ declare const filterSchema: z.ZodObject<{
7
7
  string: "string";
8
8
  number: "number";
9
9
  boolean: "boolean";
10
- date: "date";
11
10
  enum: "enum";
11
+ date: "date";
12
12
  jsonArray: "jsonArray";
13
13
  }>;
14
14
  method: z.ZodEnum<{
@@ -39,8 +39,8 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
39
39
  string: "string";
40
40
  number: "number";
41
41
  boolean: "boolean";
42
- date: "date";
43
42
  enum: "enum";
43
+ date: "date";
44
44
  jsonArray: "jsonArray";
45
45
  }>;
46
46
  method: z.ZodEnum<{
@@ -79,8 +79,8 @@ declare const querySchema: z.ZodObject<{
79
79
  string: "string";
80
80
  number: "number";
81
81
  boolean: "boolean";
82
- date: "date";
83
82
  enum: "enum";
83
+ date: "date";
84
84
  jsonArray: "jsonArray";
85
85
  }>;
86
86
  method: z.ZodEnum<{
@@ -7,8 +7,8 @@ declare const filterSchema: z.ZodObject<{
7
7
  string: "string";
8
8
  number: "number";
9
9
  boolean: "boolean";
10
- date: "date";
11
10
  enum: "enum";
11
+ date: "date";
12
12
  jsonArray: "jsonArray";
13
13
  }>;
14
14
  method: z.ZodEnum<{
@@ -39,8 +39,8 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
39
39
  string: "string";
40
40
  number: "number";
41
41
  boolean: "boolean";
42
- date: "date";
43
42
  enum: "enum";
43
+ date: "date";
44
44
  jsonArray: "jsonArray";
45
45
  }>;
46
46
  method: z.ZodEnum<{
@@ -79,8 +79,8 @@ declare const querySchema: z.ZodObject<{
79
79
  string: "string";
80
80
  number: "number";
81
81
  boolean: "boolean";
82
- date: "date";
83
82
  enum: "enum";
83
+ date: "date";
84
84
  jsonArray: "jsonArray";
85
85
  }>;
86
86
  method: z.ZodEnum<{
@@ -37,8 +37,8 @@ declare const tagListInputSchema: z.ZodObject<{
37
37
  string: "string";
38
38
  number: "number";
39
39
  boolean: "boolean";
40
- date: "date";
41
40
  enum: "enum";
41
+ date: "date";
42
42
  jsonArray: "jsonArray";
43
43
  }>;
44
44
  method: z.ZodEnum<{
@@ -37,8 +37,8 @@ declare const tagListInputSchema: z.ZodObject<{
37
37
  string: "string";
38
38
  number: "number";
39
39
  boolean: "boolean";
40
- date: "date";
41
40
  enum: "enum";
41
+ date: "date";
42
42
  jsonArray: "jsonArray";
43
43
  }>;
44
44
  method: z.ZodEnum<{
@@ -11,10 +11,10 @@ declare const workflowSelectSchema: z.ZodObject<{
11
11
  input: z.ZodUnknown;
12
12
  output: z.ZodUnknown;
13
13
  status: z.ZodEnum<{
14
- failed: "failed";
15
14
  queued: "queued";
16
15
  running: "running";
17
16
  completed: "completed";
17
+ failed: "failed";
18
18
  }>;
19
19
  error: z.ZodNullable<z.ZodString>;
20
20
  retries: z.ZodNumber;
@@ -28,10 +28,10 @@ declare const workflowReadInputSchema: z.ZodObject<{
28
28
  }, z.core.$strip>;
29
29
  declare const workflowListInputSchema: z.ZodObject<{
30
30
  status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
31
- failed: "failed";
32
31
  queued: "queued";
33
32
  running: "running";
34
33
  completed: "completed";
34
+ failed: "failed";
35
35
  }>>>;
36
36
  jobName: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>;
@@ -51,10 +51,10 @@ declare const workflowReadOutputSchema: z.ZodObject<{
51
51
  input: z.ZodUnknown;
52
52
  output: z.ZodUnknown;
53
53
  status: z.ZodEnum<{
54
- failed: "failed";
55
54
  queued: "queued";
56
55
  running: "running";
57
56
  completed: "completed";
57
+ failed: "failed";
58
58
  }>;
59
59
  error: z.ZodNullable<z.ZodString>;
60
60
  retries: z.ZodNumber;
@@ -73,10 +73,10 @@ declare const workflowListOutputSchema: z.ZodArray<z.ZodObject<{
73
73
  input: z.ZodUnknown;
74
74
  output: z.ZodUnknown;
75
75
  status: z.ZodEnum<{
76
- failed: "failed";
77
76
  queued: "queued";
78
77
  running: "running";
79
78
  completed: "completed";
79
+ failed: "failed";
80
80
  }>;
81
81
  error: z.ZodNullable<z.ZodString>;
82
82
  retries: z.ZodNumber;
@@ -11,10 +11,10 @@ declare const workflowSelectSchema: z.ZodObject<{
11
11
  input: z.ZodUnknown;
12
12
  output: z.ZodUnknown;
13
13
  status: z.ZodEnum<{
14
- failed: "failed";
15
14
  queued: "queued";
16
15
  running: "running";
17
16
  completed: "completed";
17
+ failed: "failed";
18
18
  }>;
19
19
  error: z.ZodNullable<z.ZodString>;
20
20
  retries: z.ZodNumber;
@@ -28,10 +28,10 @@ declare const workflowReadInputSchema: z.ZodObject<{
28
28
  }, z.core.$strip>;
29
29
  declare const workflowListInputSchema: z.ZodObject<{
30
30
  status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
31
- failed: "failed";
32
31
  queued: "queued";
33
32
  running: "running";
34
33
  completed: "completed";
34
+ failed: "failed";
35
35
  }>>>;
36
36
  jobName: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>;
@@ -51,10 +51,10 @@ declare const workflowReadOutputSchema: z.ZodObject<{
51
51
  input: z.ZodUnknown;
52
52
  output: z.ZodUnknown;
53
53
  status: z.ZodEnum<{
54
- failed: "failed";
55
54
  queued: "queued";
56
55
  running: "running";
57
56
  completed: "completed";
57
+ failed: "failed";
58
58
  }>;
59
59
  error: z.ZodNullable<z.ZodString>;
60
60
  retries: z.ZodNumber;
@@ -73,10 +73,10 @@ declare const workflowListOutputSchema: z.ZodArray<z.ZodObject<{
73
73
  input: z.ZodUnknown;
74
74
  output: z.ZodUnknown;
75
75
  status: z.ZodEnum<{
76
- failed: "failed";
77
76
  queued: "queued";
78
77
  running: "running";
79
78
  completed: "completed";
79
+ failed: "failed";
80
80
  }>;
81
81
  error: z.ZodNullable<z.ZodString>;
82
82
  retries: z.ZodNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m5kdev/commons",
3
- "version": "0.38.20",
3
+ "version": "0.38.22",
4
4
  "license": "GPL-3.0-only",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "tsdown": "0.21.7",
22
22
  "typescript": "6.0.3",
23
23
  "zod": "4.4.3",
24
- "@m5kdev/config": "0.38.20"
24
+ "@m5kdev/config": "0.38.22"
25
25
  },
26
26
  "exports": {
27
27
  "./utils/*": {