@m5kdev/commons 0.38.11 → 0.38.13
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 +14 -2
- package/dist/src/modules/billing/billing.schema.cjs.map +1 -1
- package/dist/src/modules/billing/billing.schema.d.cts +23 -4
- package/dist/src/modules/billing/billing.schema.d.mts +23 -4
- package/dist/src/modules/billing/billing.schema.mjs +12 -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/schemas/query.schema.d.cts +9 -9
- package/dist/src/modules/schemas/query.schema.d.mts +9 -9
- package/dist/src/modules/tag/tag.schema.d.cts +3 -3
- package/dist/src/modules/tag/tag.schema.d.mts +3 -3
- 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(),
|
|
@@ -54,6 +57,10 @@ const setOrganizationCurrencyInputSchema = zod.z.object({
|
|
|
54
57
|
organizationId: zod.z.string(),
|
|
55
58
|
currency: zod.z.string()
|
|
56
59
|
});
|
|
60
|
+
const setAdminBillingExemptInputSchema = zod.z.object({
|
|
61
|
+
organizationId: zod.z.string(),
|
|
62
|
+
billingExempt: zod.z.boolean()
|
|
63
|
+
});
|
|
57
64
|
const cancelAdminSubscriptionInputSchema = zod.z.object({
|
|
58
65
|
organizationId: zod.z.string(),
|
|
59
66
|
when: zod.z.enum(["immediate", "period_end"])
|
|
@@ -64,13 +71,16 @@ const adminOrganizationBillingRowSchema = zod.z.object({
|
|
|
64
71
|
organizationName: zod.z.string(),
|
|
65
72
|
currency: zod.z.string().nullable(),
|
|
66
73
|
stripeCustomerId: zod.z.string().nullable(),
|
|
74
|
+
defaultTrialDays: zod.z.number().nullable(),
|
|
75
|
+
billingExempt: zod.z.boolean(),
|
|
67
76
|
openSubscription: zod.z.boolean(),
|
|
68
77
|
subscription: billingSchema.nullable(),
|
|
69
78
|
coupon: billingCouponSchema.nullable()
|
|
70
79
|
});
|
|
71
80
|
const billingAdminListInputSchema = require_src_modules_schemas_query_schema.querySchema;
|
|
72
|
-
const billingAdminListOutputSchema = require_src_modules_schemas_query_schema.queryListOutput(adminOrganizationBillingRowSchema);
|
|
81
|
+
const billingAdminListOutputSchema = require_src_modules_schemas_query_schema.queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
|
|
73
82
|
//#endregion
|
|
83
|
+
exports.MAX_TRIAL_DAYS = MAX_TRIAL_DAYS;
|
|
74
84
|
exports.adminOrganizationBillingRowSchema = adminOrganizationBillingRowSchema;
|
|
75
85
|
exports.applyAdminCouponInputSchema = applyAdminCouponInputSchema;
|
|
76
86
|
exports.billingAdminListInputSchema = billingAdminListInputSchema;
|
|
@@ -81,6 +91,8 @@ exports.billingSchema = billingSchema;
|
|
|
81
91
|
exports.cancelAdminSubscriptionInputSchema = cancelAdminSubscriptionInputSchema;
|
|
82
92
|
exports.createAdminSubscriptionInputSchema = createAdminSubscriptionInputSchema;
|
|
83
93
|
exports.organizationIdInputSchema = organizationIdInputSchema;
|
|
94
|
+
exports.setAdminBillingExemptInputSchema = setAdminBillingExemptInputSchema;
|
|
84
95
|
exports.setOrganizationCurrencyInputSchema = setOrganizationCurrencyInputSchema;
|
|
96
|
+
exports.stripeEnvironmentSchema = stripeEnvironmentSchema;
|
|
85
97
|
|
|
86
98
|
//# 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,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,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 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,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,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,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"}
|
|
@@ -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
|
+
sandbox: "sandbox";
|
|
62
|
+
production: "production";
|
|
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;
|
|
@@ -69,6 +75,10 @@ declare const setOrganizationCurrencyInputSchema: z.ZodObject<{
|
|
|
69
75
|
organizationId: z.ZodString;
|
|
70
76
|
currency: z.ZodString;
|
|
71
77
|
}, z.core.$strip>;
|
|
78
|
+
declare const setAdminBillingExemptInputSchema: z.ZodObject<{
|
|
79
|
+
organizationId: z.ZodString;
|
|
80
|
+
billingExempt: z.ZodBoolean;
|
|
81
|
+
}, z.core.$strip>;
|
|
72
82
|
declare const cancelAdminSubscriptionInputSchema: z.ZodObject<{
|
|
73
83
|
organizationId: z.ZodString;
|
|
74
84
|
when: z.ZodEnum<{
|
|
@@ -82,6 +92,8 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
|
|
|
82
92
|
organizationName: z.ZodString;
|
|
83
93
|
currency: z.ZodNullable<z.ZodString>;
|
|
84
94
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
95
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
billingExempt: z.ZodBoolean;
|
|
85
97
|
openSubscription: z.ZodBoolean;
|
|
86
98
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
87
99
|
id: z.ZodString;
|
|
@@ -135,15 +147,15 @@ declare const billingAdminListInputSchema: z.ZodObject<{
|
|
|
135
147
|
string: "string";
|
|
136
148
|
number: "number";
|
|
137
149
|
boolean: "boolean";
|
|
138
|
-
enum: "enum";
|
|
139
150
|
date: "date";
|
|
151
|
+
enum: "enum";
|
|
140
152
|
jsonArray: "jsonArray";
|
|
141
153
|
}>;
|
|
142
154
|
method: z.ZodEnum<{
|
|
143
|
-
starts_with: "starts_with";
|
|
144
|
-
ends_with: "ends_with";
|
|
145
155
|
contains: "contains";
|
|
146
156
|
equals: "equals";
|
|
157
|
+
starts_with: "starts_with";
|
|
158
|
+
ends_with: "ends_with";
|
|
147
159
|
greater_than: "greater_than";
|
|
148
160
|
less_than: "less_than";
|
|
149
161
|
on: "on";
|
|
@@ -170,6 +182,8 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
170
182
|
organizationName: z.ZodString;
|
|
171
183
|
currency: z.ZodNullable<z.ZodString>;
|
|
172
184
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
185
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
186
|
+
billingExempt: z.ZodBoolean;
|
|
173
187
|
openSubscription: z.ZodBoolean;
|
|
174
188
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
175
189
|
id: z.ZodString;
|
|
@@ -210,10 +224,15 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
210
224
|
}, z.core.$strip>>;
|
|
211
225
|
}, z.core.$strip>>;
|
|
212
226
|
total: z.ZodNumber;
|
|
227
|
+
environment: z.ZodEnum<{
|
|
228
|
+
sandbox: "sandbox";
|
|
229
|
+
production: "production";
|
|
230
|
+
}>;
|
|
213
231
|
}, z.core.$strip>;
|
|
214
232
|
type BillingCoupon = z.infer<typeof billingCouponSchema>;
|
|
215
233
|
type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
|
|
234
|
+
type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;
|
|
216
235
|
type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
|
|
217
236
|
//#endregion
|
|
218
|
-
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
237
|
+
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminBillingExemptInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
219
238
|
//# 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
|
+
sandbox: "sandbox";
|
|
62
|
+
production: "production";
|
|
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;
|
|
@@ -69,6 +75,10 @@ declare const setOrganizationCurrencyInputSchema: z.ZodObject<{
|
|
|
69
75
|
organizationId: z.ZodString;
|
|
70
76
|
currency: z.ZodString;
|
|
71
77
|
}, z.core.$strip>;
|
|
78
|
+
declare const setAdminBillingExemptInputSchema: z.ZodObject<{
|
|
79
|
+
organizationId: z.ZodString;
|
|
80
|
+
billingExempt: z.ZodBoolean;
|
|
81
|
+
}, z.core.$strip>;
|
|
72
82
|
declare const cancelAdminSubscriptionInputSchema: z.ZodObject<{
|
|
73
83
|
organizationId: z.ZodString;
|
|
74
84
|
when: z.ZodEnum<{
|
|
@@ -82,6 +92,8 @@ declare const adminOrganizationBillingRowSchema: z.ZodObject<{
|
|
|
82
92
|
organizationName: z.ZodString;
|
|
83
93
|
currency: z.ZodNullable<z.ZodString>;
|
|
84
94
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
95
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
billingExempt: z.ZodBoolean;
|
|
85
97
|
openSubscription: z.ZodBoolean;
|
|
86
98
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
87
99
|
id: z.ZodString;
|
|
@@ -135,15 +147,15 @@ declare const billingAdminListInputSchema: z.ZodObject<{
|
|
|
135
147
|
string: "string";
|
|
136
148
|
number: "number";
|
|
137
149
|
boolean: "boolean";
|
|
138
|
-
enum: "enum";
|
|
139
150
|
date: "date";
|
|
151
|
+
enum: "enum";
|
|
140
152
|
jsonArray: "jsonArray";
|
|
141
153
|
}>;
|
|
142
154
|
method: z.ZodEnum<{
|
|
143
|
-
starts_with: "starts_with";
|
|
144
|
-
ends_with: "ends_with";
|
|
145
155
|
contains: "contains";
|
|
146
156
|
equals: "equals";
|
|
157
|
+
starts_with: "starts_with";
|
|
158
|
+
ends_with: "ends_with";
|
|
147
159
|
greater_than: "greater_than";
|
|
148
160
|
less_than: "less_than";
|
|
149
161
|
on: "on";
|
|
@@ -170,6 +182,8 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
170
182
|
organizationName: z.ZodString;
|
|
171
183
|
currency: z.ZodNullable<z.ZodString>;
|
|
172
184
|
stripeCustomerId: z.ZodNullable<z.ZodString>;
|
|
185
|
+
defaultTrialDays: z.ZodNullable<z.ZodNumber>;
|
|
186
|
+
billingExempt: z.ZodBoolean;
|
|
173
187
|
openSubscription: z.ZodBoolean;
|
|
174
188
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
175
189
|
id: z.ZodString;
|
|
@@ -210,10 +224,15 @@ declare const billingAdminListOutputSchema: z.ZodObject<{
|
|
|
210
224
|
}, z.core.$strip>>;
|
|
211
225
|
}, z.core.$strip>>;
|
|
212
226
|
total: z.ZodNumber;
|
|
227
|
+
environment: z.ZodEnum<{
|
|
228
|
+
sandbox: "sandbox";
|
|
229
|
+
production: "production";
|
|
230
|
+
}>;
|
|
213
231
|
}, z.core.$strip>;
|
|
214
232
|
type BillingCoupon = z.infer<typeof billingCouponSchema>;
|
|
215
233
|
type CreateAdminSubscriptionInput = z.infer<typeof createAdminSubscriptionInputSchema>;
|
|
234
|
+
type SetAdminBillingExemptInput = z.infer<typeof setAdminBillingExemptInputSchema>;
|
|
216
235
|
type AdminOrganizationBillingRow = z.infer<typeof adminOrganizationBillingRowSchema>;
|
|
217
236
|
//#endregion
|
|
218
|
-
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
237
|
+
export { AdminOrganizationBillingRow, BillingCoupon, BillingSchema, CreateAdminSubscriptionInput, MAX_TRIAL_DAYS, SetAdminBillingExemptInput, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
219
238
|
//# 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(),
|
|
@@ -53,6 +56,10 @@ const setOrganizationCurrencyInputSchema = z.object({
|
|
|
53
56
|
organizationId: z.string(),
|
|
54
57
|
currency: z.string()
|
|
55
58
|
});
|
|
59
|
+
const setAdminBillingExemptInputSchema = z.object({
|
|
60
|
+
organizationId: z.string(),
|
|
61
|
+
billingExempt: z.boolean()
|
|
62
|
+
});
|
|
56
63
|
const cancelAdminSubscriptionInputSchema = z.object({
|
|
57
64
|
organizationId: z.string(),
|
|
58
65
|
when: z.enum(["immediate", "period_end"])
|
|
@@ -63,13 +70,15 @@ const adminOrganizationBillingRowSchema = z.object({
|
|
|
63
70
|
organizationName: z.string(),
|
|
64
71
|
currency: z.string().nullable(),
|
|
65
72
|
stripeCustomerId: z.string().nullable(),
|
|
73
|
+
defaultTrialDays: z.number().nullable(),
|
|
74
|
+
billingExempt: z.boolean(),
|
|
66
75
|
openSubscription: z.boolean(),
|
|
67
76
|
subscription: billingSchema.nullable(),
|
|
68
77
|
coupon: billingCouponSchema.nullable()
|
|
69
78
|
});
|
|
70
79
|
const billingAdminListInputSchema = querySchema;
|
|
71
|
-
const billingAdminListOutputSchema = queryListOutput(adminOrganizationBillingRowSchema);
|
|
80
|
+
const billingAdminListOutputSchema = queryListOutput(adminOrganizationBillingRowSchema).extend({ environment: stripeEnvironmentSchema });
|
|
72
81
|
//#endregion
|
|
73
|
-
export { adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setOrganizationCurrencyInputSchema };
|
|
82
|
+
export { MAX_TRIAL_DAYS, adminOrganizationBillingRowSchema, applyAdminCouponInputSchema, billingAdminListInputSchema, billingAdminListOutputSchema, billingCouponListOutputSchema, billingCouponSchema, billingSchema, cancelAdminSubscriptionInputSchema, createAdminSubscriptionInputSchema, organizationIdInputSchema, setAdminBillingExemptInputSchema, setOrganizationCurrencyInputSchema, stripeEnvironmentSchema };
|
|
74
83
|
|
|
75
84
|
//# 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;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,SAAS;CAC7B,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,eAAe,EAAE,QAAQ,CAAC,SAAS;CACnC,gBAAgB,EAAE,SAAS,CAAC,SAAS;CACrC,YAAY,EAAE,QAAQ,CAAC,SAAS;CAChC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS;CACzC,CAAC;AAIF,MAAa,sBAAsB,EAAE,OAAO;CAC1C,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,UAAU,EAAE,KAAK;EAAC;EAAW;EAAQ;EAAY,CAAC,CAAC,UAAU;CAC7D,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAa,gCAAgC,EAAE,MAAM,oBAAoB;AAEzE,MAAa,4BAA4B,EAAE,OAAO,EAChD,gBAAgB,EAAE,QAAQ,EAC3B,CAAC;AAEF,MAAa,qCAAqC,EAAE,OAAO;CACzD,gBAAgB,EAAE,QAAQ;CAC1B,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,QAAQ,CAAC,UAAU;
|
|
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 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 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,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,SAAS;CAC7B,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,eAAe,EAAE,QAAQ,CAAC,SAAS;CACnC,gBAAgB,EAAE,SAAS,CAAC,SAAS;CACrC,YAAY,EAAE,QAAQ,CAAC,SAAS;CAChC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS;CACzC,CAAC;AAIF,MAAa,sBAAsB,EAAE,OAAO;CAC1C,IAAI,EAAE,QAAQ;CACd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,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,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[];
|
|
@@ -7,15 +7,15 @@ declare const filterSchema: z.ZodObject<{
|
|
|
7
7
|
string: "string";
|
|
8
8
|
number: "number";
|
|
9
9
|
boolean: "boolean";
|
|
10
|
-
enum: "enum";
|
|
11
10
|
date: "date";
|
|
11
|
+
enum: "enum";
|
|
12
12
|
jsonArray: "jsonArray";
|
|
13
13
|
}>;
|
|
14
14
|
method: z.ZodEnum<{
|
|
15
|
-
starts_with: "starts_with";
|
|
16
|
-
ends_with: "ends_with";
|
|
17
15
|
contains: "contains";
|
|
18
16
|
equals: "equals";
|
|
17
|
+
starts_with: "starts_with";
|
|
18
|
+
ends_with: "ends_with";
|
|
19
19
|
greater_than: "greater_than";
|
|
20
20
|
less_than: "less_than";
|
|
21
21
|
on: "on";
|
|
@@ -39,15 +39,15 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
|
|
|
39
39
|
string: "string";
|
|
40
40
|
number: "number";
|
|
41
41
|
boolean: "boolean";
|
|
42
|
-
enum: "enum";
|
|
43
42
|
date: "date";
|
|
43
|
+
enum: "enum";
|
|
44
44
|
jsonArray: "jsonArray";
|
|
45
45
|
}>;
|
|
46
46
|
method: z.ZodEnum<{
|
|
47
|
-
starts_with: "starts_with";
|
|
48
|
-
ends_with: "ends_with";
|
|
49
47
|
contains: "contains";
|
|
50
48
|
equals: "equals";
|
|
49
|
+
starts_with: "starts_with";
|
|
50
|
+
ends_with: "ends_with";
|
|
51
51
|
greater_than: "greater_than";
|
|
52
52
|
less_than: "less_than";
|
|
53
53
|
on: "on";
|
|
@@ -79,15 +79,15 @@ declare const querySchema: z.ZodObject<{
|
|
|
79
79
|
string: "string";
|
|
80
80
|
number: "number";
|
|
81
81
|
boolean: "boolean";
|
|
82
|
-
enum: "enum";
|
|
83
82
|
date: "date";
|
|
83
|
+
enum: "enum";
|
|
84
84
|
jsonArray: "jsonArray";
|
|
85
85
|
}>;
|
|
86
86
|
method: z.ZodEnum<{
|
|
87
|
-
starts_with: "starts_with";
|
|
88
|
-
ends_with: "ends_with";
|
|
89
87
|
contains: "contains";
|
|
90
88
|
equals: "equals";
|
|
89
|
+
starts_with: "starts_with";
|
|
90
|
+
ends_with: "ends_with";
|
|
91
91
|
greater_than: "greater_than";
|
|
92
92
|
less_than: "less_than";
|
|
93
93
|
on: "on";
|
|
@@ -7,15 +7,15 @@ declare const filterSchema: z.ZodObject<{
|
|
|
7
7
|
string: "string";
|
|
8
8
|
number: "number";
|
|
9
9
|
boolean: "boolean";
|
|
10
|
-
enum: "enum";
|
|
11
10
|
date: "date";
|
|
11
|
+
enum: "enum";
|
|
12
12
|
jsonArray: "jsonArray";
|
|
13
13
|
}>;
|
|
14
14
|
method: z.ZodEnum<{
|
|
15
|
-
starts_with: "starts_with";
|
|
16
|
-
ends_with: "ends_with";
|
|
17
15
|
contains: "contains";
|
|
18
16
|
equals: "equals";
|
|
17
|
+
starts_with: "starts_with";
|
|
18
|
+
ends_with: "ends_with";
|
|
19
19
|
greater_than: "greater_than";
|
|
20
20
|
less_than: "less_than";
|
|
21
21
|
on: "on";
|
|
@@ -39,15 +39,15 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
|
|
|
39
39
|
string: "string";
|
|
40
40
|
number: "number";
|
|
41
41
|
boolean: "boolean";
|
|
42
|
-
enum: "enum";
|
|
43
42
|
date: "date";
|
|
43
|
+
enum: "enum";
|
|
44
44
|
jsonArray: "jsonArray";
|
|
45
45
|
}>;
|
|
46
46
|
method: z.ZodEnum<{
|
|
47
|
-
starts_with: "starts_with";
|
|
48
|
-
ends_with: "ends_with";
|
|
49
47
|
contains: "contains";
|
|
50
48
|
equals: "equals";
|
|
49
|
+
starts_with: "starts_with";
|
|
50
|
+
ends_with: "ends_with";
|
|
51
51
|
greater_than: "greater_than";
|
|
52
52
|
less_than: "less_than";
|
|
53
53
|
on: "on";
|
|
@@ -79,15 +79,15 @@ declare const querySchema: z.ZodObject<{
|
|
|
79
79
|
string: "string";
|
|
80
80
|
number: "number";
|
|
81
81
|
boolean: "boolean";
|
|
82
|
-
enum: "enum";
|
|
83
82
|
date: "date";
|
|
83
|
+
enum: "enum";
|
|
84
84
|
jsonArray: "jsonArray";
|
|
85
85
|
}>;
|
|
86
86
|
method: z.ZodEnum<{
|
|
87
|
-
starts_with: "starts_with";
|
|
88
|
-
ends_with: "ends_with";
|
|
89
87
|
contains: "contains";
|
|
90
88
|
equals: "equals";
|
|
89
|
+
starts_with: "starts_with";
|
|
90
|
+
ends_with: "ends_with";
|
|
91
91
|
greater_than: "greater_than";
|
|
92
92
|
less_than: "less_than";
|
|
93
93
|
on: "on";
|
|
@@ -37,15 +37,15 @@ declare const tagListInputSchema: z.ZodObject<{
|
|
|
37
37
|
string: "string";
|
|
38
38
|
number: "number";
|
|
39
39
|
boolean: "boolean";
|
|
40
|
-
enum: "enum";
|
|
41
40
|
date: "date";
|
|
41
|
+
enum: "enum";
|
|
42
42
|
jsonArray: "jsonArray";
|
|
43
43
|
}>;
|
|
44
44
|
method: z.ZodEnum<{
|
|
45
|
-
starts_with: "starts_with";
|
|
46
|
-
ends_with: "ends_with";
|
|
47
45
|
contains: "contains";
|
|
48
46
|
equals: "equals";
|
|
47
|
+
starts_with: "starts_with";
|
|
48
|
+
ends_with: "ends_with";
|
|
49
49
|
greater_than: "greater_than";
|
|
50
50
|
less_than: "less_than";
|
|
51
51
|
on: "on";
|
|
@@ -37,15 +37,15 @@ declare const tagListInputSchema: z.ZodObject<{
|
|
|
37
37
|
string: "string";
|
|
38
38
|
number: "number";
|
|
39
39
|
boolean: "boolean";
|
|
40
|
-
enum: "enum";
|
|
41
40
|
date: "date";
|
|
41
|
+
enum: "enum";
|
|
42
42
|
jsonArray: "jsonArray";
|
|
43
43
|
}>;
|
|
44
44
|
method: z.ZodEnum<{
|
|
45
|
-
starts_with: "starts_with";
|
|
46
|
-
ends_with: "ends_with";
|
|
47
45
|
contains: "contains";
|
|
48
46
|
equals: "equals";
|
|
47
|
+
starts_with: "starts_with";
|
|
48
|
+
ends_with: "ends_with";
|
|
49
49
|
greater_than: "greater_than";
|
|
50
50
|
less_than: "less_than";
|
|
51
51
|
on: "on";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m5kdev/commons",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.13",
|
|
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.13"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
"./utils/*": {
|