shred-api-client 2.4.13 → 2.4.14
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/index.d.ts +59 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -270,6 +270,34 @@ declare const PlanSchema: z.ZodObject<{
|
|
|
270
270
|
currency: string;
|
|
271
271
|
subscriptionItemId: string;
|
|
272
272
|
}>;
|
|
273
|
+
declare const SpecialOfferSchema: z.ZodObject<{
|
|
274
|
+
id: z.ZodString;
|
|
275
|
+
freeProjectsAllowed: z.ZodDefault<z.ZodNumber>;
|
|
276
|
+
windowHours: z.ZodNumber;
|
|
277
|
+
couponId: z.ZodString;
|
|
278
|
+
title: z.ZodString;
|
|
279
|
+
description: z.ZodString;
|
|
280
|
+
ctaLabel: z.ZodString;
|
|
281
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
id: string;
|
|
284
|
+
title: string;
|
|
285
|
+
description: string;
|
|
286
|
+
freeProjectsAllowed: number;
|
|
287
|
+
windowHours: number;
|
|
288
|
+
couponId: string;
|
|
289
|
+
ctaLabel: string;
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
}, {
|
|
292
|
+
id: string;
|
|
293
|
+
title: string;
|
|
294
|
+
description: string;
|
|
295
|
+
windowHours: number;
|
|
296
|
+
couponId: string;
|
|
297
|
+
ctaLabel: string;
|
|
298
|
+
freeProjectsAllowed?: number | undefined;
|
|
299
|
+
enabled?: boolean | undefined;
|
|
300
|
+
}>;
|
|
273
301
|
declare const ProductSchema: z.ZodObject<{
|
|
274
302
|
id: z.ZodString;
|
|
275
303
|
name: z.ZodString;
|
|
@@ -567,6 +595,7 @@ declare const SubscriptionSummarySchema: z.ZodObject<{
|
|
|
567
595
|
productName: string;
|
|
568
596
|
}>;
|
|
569
597
|
type Subscription = z.infer<typeof SubscriptionSchema>;
|
|
598
|
+
type SpecialOffer = z.infer<typeof SpecialOfferSchema>;
|
|
570
599
|
type SubscriptionSummary = z.infer<typeof SubscriptionSummarySchema>;
|
|
571
600
|
type Charge = z.infer<typeof ChargeSchema>;
|
|
572
601
|
type Plan = z.infer<typeof PlanSchema>;
|
|
@@ -584,6 +613,7 @@ interface IAPI$9 {
|
|
|
584
613
|
updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
|
|
585
614
|
createCheckout: (planId: string | null, ctx: Context, callbackUrl?: string) => Promise<string>;
|
|
586
615
|
getSubscriptionsSummary: (ctx: Context) => Promise<SubscriptionSummary[]>;
|
|
616
|
+
getSpecialOffer: (ctx: Context) => Promise<SpecialOffer | null>;
|
|
587
617
|
}
|
|
588
618
|
declare const Endpoints$8: {
|
|
589
619
|
GetPortal: {
|
|
@@ -598,6 +628,10 @@ declare const Endpoints$8: {
|
|
|
598
628
|
uri: string;
|
|
599
629
|
method: string;
|
|
600
630
|
};
|
|
631
|
+
GetSpecialOffer: {
|
|
632
|
+
uri: string;
|
|
633
|
+
method: string;
|
|
634
|
+
};
|
|
601
635
|
GetCharges: {
|
|
602
636
|
uri: string;
|
|
603
637
|
method: string;
|
|
@@ -646,12 +680,13 @@ type index$b_Plan = Plan;
|
|
|
646
680
|
declare const index$b_PlanSchema: typeof PlanSchema;
|
|
647
681
|
type index$b_Product = Product;
|
|
648
682
|
declare const index$b_ProductSchema: typeof ProductSchema;
|
|
683
|
+
type index$b_SpecialOffer = SpecialOffer;
|
|
649
684
|
declare const index$b_SubscriptionSchema: typeof SubscriptionSchema;
|
|
650
685
|
declare const index$b_SubscriptionTypeSchema: typeof SubscriptionTypeSchema;
|
|
651
686
|
type index$b_Type = Type;
|
|
652
687
|
declare const index$b_Type: typeof Type;
|
|
653
688
|
declare namespace index$b {
|
|
654
|
-
export { type index$b_Charge as Charge, index$b_ChargeSchema as ChargeSchema, Endpoints$8 as Endpoints, type Subscription as Entity, type IAPI$9 as IAPI, type index$b_Plan as Plan, index$b_PlanSchema as PlanSchema, type index$b_Product as Product, index$b_ProductSchema as ProductSchema, index$b_SubscriptionSchema as SubscriptionSchema, index$b_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$b_Type as Type };
|
|
689
|
+
export { type index$b_Charge as Charge, index$b_ChargeSchema as ChargeSchema, Endpoints$8 as Endpoints, type Subscription as Entity, type IAPI$9 as IAPI, type index$b_Plan as Plan, index$b_PlanSchema as PlanSchema, type index$b_Product as Product, index$b_ProductSchema as ProductSchema, type index$b_SpecialOffer as SpecialOffer, index$b_SubscriptionSchema as SubscriptionSchema, index$b_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$b_Type as Type };
|
|
655
690
|
}
|
|
656
691
|
|
|
657
692
|
declare enum Role {
|
|
@@ -733,6 +768,19 @@ declare const UserSchema: z.ZodObject<{
|
|
|
733
768
|
tenantId: z.ZodOptional<z.ZodString>;
|
|
734
769
|
editorId: z.ZodOptional<z.ZodString>;
|
|
735
770
|
timezone: z.ZodOptional<z.ZodString>;
|
|
771
|
+
offer: z.ZodOptional<z.ZodObject<{
|
|
772
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
773
|
+
activatedAt: z.ZodOptional<z.ZodNumber>;
|
|
774
|
+
promoCodeId: z.ZodOptional<z.ZodString>;
|
|
775
|
+
}, "strip", z.ZodTypeAny, {
|
|
776
|
+
expiresAt?: number | undefined;
|
|
777
|
+
activatedAt?: number | undefined;
|
|
778
|
+
promoCodeId?: string | undefined;
|
|
779
|
+
}, {
|
|
780
|
+
expiresAt?: number | undefined;
|
|
781
|
+
activatedAt?: number | undefined;
|
|
782
|
+
promoCodeId?: string | undefined;
|
|
783
|
+
}>>;
|
|
736
784
|
experienceId: z.ZodOptional<z.ZodString>;
|
|
737
785
|
customerId: z.ZodString;
|
|
738
786
|
role: z.ZodNativeEnum<typeof Role>;
|
|
@@ -758,6 +806,11 @@ declare const UserSchema: z.ZodObject<{
|
|
|
758
806
|
profession?: string | undefined;
|
|
759
807
|
photoUrl?: string | undefined;
|
|
760
808
|
editorId?: string | undefined;
|
|
809
|
+
offer?: {
|
|
810
|
+
expiresAt?: number | undefined;
|
|
811
|
+
activatedAt?: number | undefined;
|
|
812
|
+
promoCodeId?: string | undefined;
|
|
813
|
+
} | undefined;
|
|
761
814
|
experienceId?: string | undefined;
|
|
762
815
|
}, {
|
|
763
816
|
email: string;
|
|
@@ -781,6 +834,11 @@ declare const UserSchema: z.ZodObject<{
|
|
|
781
834
|
profession?: string | undefined;
|
|
782
835
|
photoUrl?: string | undefined;
|
|
783
836
|
editorId?: string | undefined;
|
|
837
|
+
offer?: {
|
|
838
|
+
expiresAt?: number | undefined;
|
|
839
|
+
activatedAt?: number | undefined;
|
|
840
|
+
promoCodeId?: string | undefined;
|
|
841
|
+
} | undefined;
|
|
784
842
|
experienceId?: string | undefined;
|
|
785
843
|
}>;
|
|
786
844
|
type User = z.infer<typeof UserSchema>;
|
package/dist/index.js
CHANGED
|
@@ -4540,6 +4540,17 @@ var SubscriptionAPI = class {
|
|
|
4540
4540
|
);
|
|
4541
4541
|
return data;
|
|
4542
4542
|
}
|
|
4543
|
+
async getSpecialOffer(ctx) {
|
|
4544
|
+
const endpointInfo = subscription_exports.Endpoints.GetSpecialOffer;
|
|
4545
|
+
const data = await this.clientHTTP.makeRequest(
|
|
4546
|
+
this.env,
|
|
4547
|
+
endpointInfo.uri,
|
|
4548
|
+
endpointInfo.method,
|
|
4549
|
+
null,
|
|
4550
|
+
ctx
|
|
4551
|
+
);
|
|
4552
|
+
return data;
|
|
4553
|
+
}
|
|
4543
4554
|
async getSubscription(context, userId) {
|
|
4544
4555
|
const endpointInfo = subscription_exports.Endpoints.GetActiveSubscription;
|
|
4545
4556
|
let uri = endpointInfo.uri;
|
|
@@ -5904,6 +5915,16 @@ var PlanSchema = external_exports.object({
|
|
|
5904
5915
|
metadata: external_exports.record(external_exports.string(), external_exports.string()),
|
|
5905
5916
|
subscriptionItemId: external_exports.string()
|
|
5906
5917
|
});
|
|
5918
|
+
var SpecialOfferSchema = external_exports.object({
|
|
5919
|
+
id: external_exports.string(),
|
|
5920
|
+
freeProjectsAllowed: external_exports.number().default(15),
|
|
5921
|
+
windowHours: external_exports.number(),
|
|
5922
|
+
couponId: external_exports.string(),
|
|
5923
|
+
title: external_exports.string(),
|
|
5924
|
+
description: external_exports.string(),
|
|
5925
|
+
ctaLabel: external_exports.string(),
|
|
5926
|
+
enabled: external_exports.boolean().default(true)
|
|
5927
|
+
});
|
|
5907
5928
|
var DescriptionSchema = external_exports.object({
|
|
5908
5929
|
description: external_exports.string(),
|
|
5909
5930
|
subtitle: external_exports.string()
|
|
@@ -6063,6 +6084,11 @@ var UserSchema = external_exports.object({
|
|
|
6063
6084
|
tenantId: external_exports.string().optional(),
|
|
6064
6085
|
editorId: external_exports.string().optional(),
|
|
6065
6086
|
timezone: external_exports.string().optional(),
|
|
6087
|
+
offer: external_exports.object({
|
|
6088
|
+
expiresAt: external_exports.number().optional(),
|
|
6089
|
+
activatedAt: external_exports.number().optional(),
|
|
6090
|
+
promoCodeId: external_exports.string().optional()
|
|
6091
|
+
}).optional(),
|
|
6066
6092
|
experienceId: external_exports.string().optional(),
|
|
6067
6093
|
customerId: external_exports.string(),
|
|
6068
6094
|
role: external_exports.nativeEnum(Role)
|
|
@@ -6114,6 +6140,10 @@ var Endpoints10 = {
|
|
|
6114
6140
|
uri: "/subscriptions/active/",
|
|
6115
6141
|
method: "GET"
|
|
6116
6142
|
},
|
|
6143
|
+
GetSpecialOffer: {
|
|
6144
|
+
uri: "/subscriptions/specialOffer/",
|
|
6145
|
+
method: "GET"
|
|
6146
|
+
},
|
|
6117
6147
|
GetCharges: {
|
|
6118
6148
|
uri: "/subscriptions/payment/charge/list/",
|
|
6119
6149
|
method: "GET"
|