shred-api-client 2.4.14-rc.6 → 2.4.15
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 +67 -3
- package/dist/index.js +32 -1
- 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>;
|
|
@@ -2304,11 +2362,12 @@ declare const NotificationDetailSchema: z.ZodObject<Pick<{
|
|
|
2304
2362
|
}>>;
|
|
2305
2363
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
2306
2364
|
error: z.ZodOptional<z.ZodString>;
|
|
2307
|
-
}, "userId" | "title" | "body" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
|
|
2365
|
+
}, "userId" | "title" | "body" | "type" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
|
|
2308
2366
|
userId: string;
|
|
2309
2367
|
title: string;
|
|
2310
2368
|
body: string;
|
|
2311
2369
|
metadata: Record<string, string | number>;
|
|
2370
|
+
type?: NotificationType | undefined;
|
|
2312
2371
|
cta?: {
|
|
2313
2372
|
label: string;
|
|
2314
2373
|
url: string;
|
|
@@ -2318,6 +2377,7 @@ declare const NotificationDetailSchema: z.ZodObject<Pick<{
|
|
|
2318
2377
|
title: string;
|
|
2319
2378
|
body: string;
|
|
2320
2379
|
metadata: Record<string, string | number>;
|
|
2380
|
+
type?: NotificationType | undefined;
|
|
2321
2381
|
cta?: {
|
|
2322
2382
|
label: string;
|
|
2323
2383
|
url: string;
|
|
@@ -2443,11 +2503,12 @@ declare const TriggerSchema: z.ZodObject<{
|
|
|
2443
2503
|
}>>;
|
|
2444
2504
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
2445
2505
|
error: z.ZodOptional<z.ZodString>;
|
|
2446
|
-
}, "userId" | "title" | "body" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
|
|
2506
|
+
}, "userId" | "title" | "body" | "type" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
|
|
2447
2507
|
userId: string;
|
|
2448
2508
|
title: string;
|
|
2449
2509
|
body: string;
|
|
2450
2510
|
metadata: Record<string, string | number>;
|
|
2511
|
+
type?: NotificationType | undefined;
|
|
2451
2512
|
cta?: {
|
|
2452
2513
|
label: string;
|
|
2453
2514
|
url: string;
|
|
@@ -2457,6 +2518,7 @@ declare const TriggerSchema: z.ZodObject<{
|
|
|
2457
2518
|
title: string;
|
|
2458
2519
|
body: string;
|
|
2459
2520
|
metadata: Record<string, string | number>;
|
|
2521
|
+
type?: NotificationType | undefined;
|
|
2460
2522
|
cta?: {
|
|
2461
2523
|
label: string;
|
|
2462
2524
|
url: string;
|
|
@@ -2573,6 +2635,7 @@ declare const TriggerSchema: z.ZodObject<{
|
|
|
2573
2635
|
title: string;
|
|
2574
2636
|
body: string;
|
|
2575
2637
|
metadata: Record<string, string | number>;
|
|
2638
|
+
type?: NotificationType | undefined;
|
|
2576
2639
|
cta?: {
|
|
2577
2640
|
label: string;
|
|
2578
2641
|
url: string;
|
|
@@ -2624,6 +2687,7 @@ declare const TriggerSchema: z.ZodObject<{
|
|
|
2624
2687
|
title: string;
|
|
2625
2688
|
body: string;
|
|
2626
2689
|
metadata: Record<string, string | number>;
|
|
2690
|
+
type?: NotificationType | undefined;
|
|
2627
2691
|
cta?: {
|
|
2628
2692
|
label: string;
|
|
2629
2693
|
url: string;
|
package/dist/index.js
CHANGED
|
@@ -4249,7 +4249,8 @@ var NotificationDetailSchema = NotificationItemSchema.pick({
|
|
|
4249
4249
|
body: true,
|
|
4250
4250
|
userId: true,
|
|
4251
4251
|
metadata: true,
|
|
4252
|
-
cta: true
|
|
4252
|
+
cta: true,
|
|
4253
|
+
type: true
|
|
4253
4254
|
});
|
|
4254
4255
|
var CriteriaSchema = external_exports.object({
|
|
4255
4256
|
type: external_exports.nativeEnum(CriteriaType),
|
|
@@ -4539,6 +4540,17 @@ var SubscriptionAPI = class {
|
|
|
4539
4540
|
);
|
|
4540
4541
|
return data;
|
|
4541
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
|
+
}
|
|
4542
4554
|
async getSubscription(context, userId) {
|
|
4543
4555
|
const endpointInfo = subscription_exports.Endpoints.GetActiveSubscription;
|
|
4544
4556
|
let uri = endpointInfo.uri;
|
|
@@ -5918,6 +5930,16 @@ var PlanSchema = external_exports.object({
|
|
|
5918
5930
|
metadata: external_exports.record(external_exports.string(), external_exports.string()),
|
|
5919
5931
|
subscriptionItemId: external_exports.string()
|
|
5920
5932
|
});
|
|
5933
|
+
var SpecialOfferSchema = external_exports.object({
|
|
5934
|
+
id: external_exports.string(),
|
|
5935
|
+
freeProjectsAllowed: external_exports.number().default(15),
|
|
5936
|
+
windowHours: external_exports.number(),
|
|
5937
|
+
couponId: external_exports.string(),
|
|
5938
|
+
title: external_exports.string(),
|
|
5939
|
+
description: external_exports.string(),
|
|
5940
|
+
ctaLabel: external_exports.string(),
|
|
5941
|
+
enabled: external_exports.boolean().default(true)
|
|
5942
|
+
});
|
|
5921
5943
|
var DescriptionSchema = external_exports.object({
|
|
5922
5944
|
description: external_exports.string(),
|
|
5923
5945
|
subtitle: external_exports.string()
|
|
@@ -6092,6 +6114,11 @@ var UserSchema = external_exports.object({
|
|
|
6092
6114
|
tenantId: external_exports.string().optional(),
|
|
6093
6115
|
editorId: external_exports.string().optional(),
|
|
6094
6116
|
timezone: external_exports.string().optional(),
|
|
6117
|
+
offer: external_exports.object({
|
|
6118
|
+
expiresAt: external_exports.number().optional(),
|
|
6119
|
+
activatedAt: external_exports.number().optional(),
|
|
6120
|
+
promoCodeId: external_exports.string().optional()
|
|
6121
|
+
}).optional(),
|
|
6095
6122
|
experienceId: external_exports.string().optional(),
|
|
6096
6123
|
customerId: external_exports.string(),
|
|
6097
6124
|
role: external_exports.nativeEnum(Role)
|
|
@@ -6143,6 +6170,10 @@ var Endpoints10 = {
|
|
|
6143
6170
|
uri: "/subscriptions/active/",
|
|
6144
6171
|
method: "GET"
|
|
6145
6172
|
},
|
|
6173
|
+
GetSpecialOffer: {
|
|
6174
|
+
uri: "/subscriptions/specialOffer/",
|
|
6175
|
+
method: "GET"
|
|
6176
|
+
},
|
|
6146
6177
|
GetCharges: {
|
|
6147
6178
|
uri: "/subscriptions/payment/charge/list/",
|
|
6148
6179
|
method: "GET"
|