@m5kdev/commons 0.38.11 → 0.38.12
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.
- package/dist/src/modules/billing/billing.schema.cjs +8 -2
- package/dist/src/modules/billing/billing.schema.cjs.map +1 -1
- package/dist/src/modules/billing/billing.schema.d.cts +13 -1
- package/dist/src/modules/billing/billing.schema.d.mts +13 -1
- package/dist/src/modules/billing/billing.schema.mjs +7 -3
- package/dist/src/modules/billing/billing.schema.mjs.map +1 -1
- package/dist/src/modules/billing/billing.types.d.cts +4 -1
- package/dist/src/modules/billing/billing.types.d.mts +4 -1
- package/dist/src/modules/recurrence/recurrence.schema.d.cts +2 -2
- package/dist/src/modules/recurrence/recurrence.schema.d.mts +2 -2
- package/package.json +2 -2
|
@@ -41,10 +41,13 @@ const billingCouponSchema = zod.z.object({
|
|
|
41
41
|
});
|
|
42
42
|
const billingCouponListOutputSchema = zod.z.array(billingCouponSchema);
|
|
43
43
|
const organizationIdInputSchema = zod.z.object({ organizationId: zod.z.string() });
|
|
44
|
+
const MAX_TRIAL_DAYS = 730;
|
|
45
|
+
const stripeEnvironmentSchema = zod.z.enum(["production", "sandbox"]);
|
|
44
46
|
const createAdminSubscriptionInputSchema = zod.z.object({
|
|
45
47
|
organizationId: zod.z.string(),
|
|
46
48
|
priceId: zod.z.string(),
|
|
47
|
-
couponId: zod.z.string().optional()
|
|
49
|
+
couponId: zod.z.string().optional(),
|
|
50
|
+
trialDays: zod.z.number().int().min(1).max(730).optional()
|
|
48
51
|
});
|
|
49
52
|
const applyAdminCouponInputSchema = zod.z.object({
|
|
50
53
|
organizationId: zod.z.string(),
|
|
@@ -64,13 +67,15 @@ const adminOrganizationBillingRowSchema = zod.z.object({
|
|
|
64
67
|
organizationName: zod.z.string(),
|
|
65
68
|
currency: zod.z.string().nullable(),
|
|
66
69
|
stripeCustomerId: zod.z.string().nullable(),
|
|
70
|
+
defaultTrialDays: zod.z.number().nullable(),
|
|
67
71
|
openSubscription: zod.z.boolean(),
|
|
68
72
|
subscription: billingSchema.nullable(),
|
|
69
73
|
coupon: billingCouponSchema.nullable()
|
|
70
74
|
});
|
|
71
75
|
const billingAdminListInputSchema = require_src_modules_schemas_query_schema.querySchema;
|
|
72
|
-
const billingAdminListOutputSchema = require_src_modules_schemas_query_schema.queryListOutput(adminOrganizationBillingRowSchema);
|
|
76
|
+
const billingAdminListOutputSchema = require_src_modules_schemas_query_schema.queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
|
|
73
77
|
//#endregion
|
|
78
|
+
exports.MAX_TRIAL_DAYS = MAX_TRIAL_DAYS;
|
|
74
79
|
exports.adminOrganizationBillingRowSchema = adminOrganizationBillingRowSchema;
|
|
75
80
|
exports.applyAdminCouponInputSchema = applyAdminCouponInputSchema;
|
|
76
81
|
exports.billingAdminListInputSchema = billingAdminListInputSchema;
|
|
@@ -82,5 +87,6 @@ exports.cancelAdminSubscriptionInputSchema = cancelAdminSubscriptionInputSchema;
|
|
|
82
87
|
exports.createAdminSubscriptionInputSchema = createAdminSubscriptionInputSchema;
|
|
83
88
|
exports.organizationIdInputSchema = organizationIdInputSchema;
|
|
84
89
|
exports.setOrganizationCurrencyInputSchema = setOrganizationCurrencyInputSchema;
|
|
90
|
+
exports.stripeEnvironmentSchema = stripeEnvironmentSchema;
|
|
85
91
|
|
|
86
92
|
//# sourceMappingURL=billing.schema.cjs.map
|
|
@@ -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 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});\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 createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().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 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 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(adminOrganizationBillingRowSchema);\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;;AAGA,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;CACzC,CAAC;AAIF,MAAa,sBAAsBA,IAAAA,EAAE,OAAO;CAC1C,IAAIA,IAAAA,EAAE,QAAQ;CACd,MAAMA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC3B,YAAYA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CACjC,WAAWA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAChC,UAAUA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC/B,UAAUA,IAAAA,EAAE,KAAK;EAAC;EAAW;EAAQ;EAAY,CAAC,CAAC,UAAU;CAC7D,kBAAkBA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CACvC,OAAOA,IAAAA,EAAE,SAAS;CACnB,CAAC;AAEF,MAAa,gCAAgCA,IAAAA,EAAE,MAAM,oBAAoB;AAEzE,MAAa,4BAA4BA,IAAAA,EAAE,OAAO,EAChD,gBAAgBA,IAAAA,EAAE,QAAQ,EAC3B,CAAC;AAEF,MAAa,qCAAqCA,IAAAA,EAAE,OAAO;CACzD,gBAAgBA,IAAAA,EAAE,QAAQ;CAC1B,SAASA,IAAAA,EAAE,QAAQ;CACnB,UAAUA,IAAAA,EAAE,QAAQ,CAAC,UAAU;
|
|
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 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});\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 stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\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 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 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 AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;;AAGA,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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C;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,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"}
|
|
@@ -56,10 +56,16 @@ declare const billingCouponListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
56
56
|
declare const organizationIdInputSchema: z.ZodObject<{
|
|
57
57
|
organizationId: z.ZodString;
|
|
58
58
|
}, z.core.$strip>;
|
|
59
|
+
declare const MAX_TRIAL_DAYS = 730;
|
|
60
|
+
declare const stripeEnvironmentSchema: z.ZodEnum<{
|
|
61
|
+
production: "production";
|
|
62
|
+
sandbox: "sandbox";
|
|
63
|
+
}>;
|
|
59
64
|
declare const createAdminSubscriptionInputSchema: z.ZodObject<{
|
|
60
65
|
organizationId: z.ZodString;
|
|
61
66
|
priceId: z.ZodString;
|
|
62
67
|
couponId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
trialDays: z.ZodOptional<z.ZodNumber>;
|
|
63
69
|
}, z.core.$strip>;
|
|
64
70
|
declare const applyAdminCouponInputSchema: z.ZodObject<{
|
|
65
71
|
organizationId: z.ZodString;
|
|
@@ -82,6 +88,7 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
|
|
|
82
88
|
organizationName: z.ZodString;
|
|
83
89
|
currency: z.ZodNullable<z.ZodString>;
|
|
84
90
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
91
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
85
92
|
openSubscription: z.ZodBoolean;
|
|
86
93
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
87
94
|
id: z.ZodString;
|
|
@@ -170,6 +177,7 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
170
177
|
organizationName: z.ZodString;
|
|
171
178
|
currency: z.ZodNullable<z.ZodString>;
|
|
172
179
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
180
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
173
181
|
openSubscription: z.ZodBoolean;
|
|
174
182
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
175
183
|
id: z.ZodString;
|
|
@@ -210,10 +218,14 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
210
218
|
}, z.core.$strip>>;
|
|
211
219
|
}, z.core.$strip>>;
|
|
212
220
|
total: z.ZodNumber;
|
|
221
|
+
environment: z.ZodEnum<{
|
|
222
|
+
production: "production";
|
|
223
|
+
sandbox: "sandbox";
|
|
224
|
+
}>;
|
|
213
225
|
}, z.core.$strip>;
|
|
214
226
|
type BillingCoupon = z.infer<typeof billingCouponSchema>;
|
|
215
227
|
type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
|
|
216
228
|
type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
|
|
217
229
|
//#endregion
|
|
218
|
-
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
230
|
+
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
219
231
|
//# sourceMappingURL=billing.schema.d.cts.map
|
|
@@ -56,10 +56,16 @@ declare const billingCouponListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
56
56
|
declare const organizationIdInputSchema: z.ZodObject<{
|
|
57
57
|
organizationId: z.ZodString;
|
|
58
58
|
}, z.core.$strip>;
|
|
59
|
+
declare const MAX_TRIAL_DAYS = 730;
|
|
60
|
+
declare const stripeEnvironmentSchema: z.ZodEnum<{
|
|
61
|
+
production: "production";
|
|
62
|
+
sandbox: "sandbox";
|
|
63
|
+
}>;
|
|
59
64
|
declare const createAdminSubscriptionInputSchema: z.ZodObject<{
|
|
60
65
|
organizationId: z.ZodString;
|
|
61
66
|
priceId: z.ZodString;
|
|
62
67
|
couponId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
trialDays: z.ZodOptional<z.ZodNumber>;
|
|
63
69
|
}, z.core.$strip>;
|
|
64
70
|
declare const applyAdminCouponInputSchema: z.ZodObject<{
|
|
65
71
|
organizationId: z.ZodString;
|
|
@@ -82,6 +88,7 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
|
|
|
82
88
|
organizationName: z.ZodString;
|
|
83
89
|
currency: z.ZodNullable<z.ZodString>;
|
|
84
90
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
91
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
85
92
|
openSubscription: z.ZodBoolean;
|
|
86
93
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
87
94
|
id: z.ZodString;
|
|
@@ -170,6 +177,7 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
170
177
|
organizationName: z.ZodString;
|
|
171
178
|
currency: z.ZodNullable<z.ZodString>;
|
|
172
179
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
180
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
173
181
|
openSubscription: z.ZodBoolean;
|
|
174
182
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
175
183
|
id: z.ZodString;
|
|
@@ -210,10 +218,14 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
210
218
|
}, z.core.$strip>>;
|
|
211
219
|
}, z.core.$strip>>;
|
|
212
220
|
total: z.ZodNumber;
|
|
221
|
+
environment: z.ZodEnum<{
|
|
222
|
+
production: "production";
|
|
223
|
+
sandbox: "sandbox";
|
|
224
|
+
}>;
|
|
213
225
|
}, z.core.$strip>;
|
|
214
226
|
type BillingCoupon = z.infer<typeof billingCouponSchema>;
|
|
215
227
|
type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
|
|
216
228
|
type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
|
|
217
229
|
//#endregion
|
|
218
|
-
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
230
|
+
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
219
231
|
//# sourceMappingURL=billing.schema.d.mts.map
|
|
@@ -40,10 +40,13 @@ const billingCouponSchema = z.object({
|
|
|
40
40
|
});
|
|
41
41
|
const billingCouponListOutputSchema = z.array(billingCouponSchema);
|
|
42
42
|
const organizationIdInputSchema = z.object({ organizationId: z.string() });
|
|
43
|
+
const MAX_TRIAL_DAYS = 730;
|
|
44
|
+
const stripeEnvironmentSchema = z.enum(["production", "sandbox"]);
|
|
43
45
|
const createAdminSubscriptionInputSchema = z.object({
|
|
44
46
|
organizationId: z.string(),
|
|
45
47
|
priceId: z.string(),
|
|
46
|
-
couponId: z.string().optional()
|
|
48
|
+
couponId: z.string().optional(),
|
|
49
|
+
trialDays: z.number().int().min(1).max(730).optional()
|
|
47
50
|
});
|
|
48
51
|
const applyAdminCouponInputSchema = z.object({
|
|
49
52
|
organizationId: z.string(),
|
|
@@ -63,13 +66,14 @@ const adminOrganizationBillingRowSchema = z.object({
|
|
|
63
66
|
organizationName: z.string(),
|
|
64
67
|
currency: z.string().nullable(),
|
|
65
68
|
stripeCustomerId: z.string().nullable(),
|
|
69
|
+
defaultTrialDays: z.number().nullable(),
|
|
66
70
|
openSubscription: z.boolean(),
|
|
67
71
|
subscription: billingSchema.nullable(),
|
|
68
72
|
coupon: billingCouponSchema.nullable()
|
|
69
73
|
});
|
|
70
74
|
const billingAdminListInputSchema = querySchema;
|
|
71
|
-
const billingAdminListOutputSchema = queryListOutput(adminOrganizationBillingRowSchema);
|
|
75
|
+
const billingAdminListOutputSchema = queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
|
|
72
76
|
//#endregion
|
|
73
|
-
export { adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
77
|
+
export { MAX_TRIAL_DAYS, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
74
78
|
|
|
75
79
|
//# 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 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});\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 createAdminSubscriptionInputSchema = z.object({\r\n organizationId: z.string(),\r\n priceId: z.string(),\r\n couponId: z.string().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 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 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(adminOrganizationBillingRowSchema);\r\n\r\nexport type BillingCoupon = z.infer<typeof billingCouponSchema>;\r\nexport type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;\r\nexport type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;AAGA,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;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querySchema } from \"../schemas/query.schema\";\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});\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 stripeEnvironmentSchema = z.enum([\"production\", \"sandbox\"]);\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 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 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 AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;\r\n"],"mappings":";;;AAGA,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,MAAM,CAAC,SAAS;CAC9B,OAAO,EAAE,QAAQ,CAAC,SAAS;CAC3B,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,YAAY,EAAE,MAAM,CAAC,SAAS;CAC9B,UAAU,EAAE,MAAM,CAAC,SAAS;CAC5B,SAAS,EAAE,QAAQ,CAAC,SAA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AAgB,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,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,3 +1,6 @@
|
|
|
1
|
+
import { stripeEnvironmentSchema } from "./billing.schema.cjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
1
4
|
//#region src/modules/billing/billing.types.d.ts
|
|
2
5
|
type StripePlanPrice = {
|
|
3
6
|
priceId: string;
|
|
@@ -27,7 +30,7 @@ type StripePlansConfig = {
|
|
|
27
30
|
production: StripePlan[];
|
|
28
31
|
sandbox: StripePlan[];
|
|
29
32
|
};
|
|
30
|
-
type StripeEnvironment =
|
|
33
|
+
type StripeEnvironment = z.infer<typeof stripeEnvironmentSchema>;
|
|
31
34
|
type ResolvedStripePlans = {
|
|
32
35
|
environment: StripeEnvironment;
|
|
33
36
|
plans: StripePlan[];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { stripeEnvironmentSchema } from "./billing.schema.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
1
4
|
//#region src/modules/billing/billing.types.d.ts
|
|
2
5
|
type StripePlanPrice = {
|
|
3
6
|
priceId: string;
|
|
@@ -27,7 +30,7 @@ type StripePlansConfig = {
|
|
|
27
30
|
production: StripePlan[];
|
|
28
31
|
sandbox: StripePlan[];
|
|
29
32
|
};
|
|
30
|
-
type StripeEnvironment =
|
|
33
|
+
type StripeEnvironment = z.infer<typeof stripeEnvironmentSchema>;
|
|
31
34
|
type ResolvedStripePlans = {
|
|
32
35
|
environment: StripeEnvironment;
|
|
33
36
|
plans: StripePlan[];
|
|
@@ -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>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m5kdev/commons",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.12",
|
|
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.
|
|
24
|
+
"@m5kdev/config": "0.38.12"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
"./utils/*": {
|