shred-api-client 2.4.0 → 2.4.1
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 +23 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -550,7 +550,24 @@ declare const SubscriptionSchema: z.ZodObject<{
|
|
|
550
550
|
subscriptionItemId: string;
|
|
551
551
|
} | undefined;
|
|
552
552
|
}>;
|
|
553
|
+
declare const SubscriptionSummarySchema: z.ZodObject<{
|
|
554
|
+
tenantId: z.ZodBoolean;
|
|
555
|
+
productId: z.ZodString;
|
|
556
|
+
productName: z.ZodString;
|
|
557
|
+
email: z.ZodString;
|
|
558
|
+
}, "strip", z.ZodTypeAny, {
|
|
559
|
+
email: string;
|
|
560
|
+
tenantId: boolean;
|
|
561
|
+
productId: string;
|
|
562
|
+
productName: string;
|
|
563
|
+
}, {
|
|
564
|
+
email: string;
|
|
565
|
+
tenantId: boolean;
|
|
566
|
+
productId: string;
|
|
567
|
+
productName: string;
|
|
568
|
+
}>;
|
|
553
569
|
type Subscription = z.infer<typeof SubscriptionSchema>;
|
|
570
|
+
type SubscriptionSummary = z.infer<typeof SubscriptionSummarySchema>;
|
|
554
571
|
type Charge = z.infer<typeof ChargeSchema>;
|
|
555
572
|
type Plan = z.infer<typeof PlanSchema>;
|
|
556
573
|
type Product = z.infer<typeof ProductSchema>;
|
|
@@ -566,6 +583,7 @@ interface IAPI$9 {
|
|
|
566
583
|
resume: (ctx: Context) => Promise<boolean>;
|
|
567
584
|
updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
|
|
568
585
|
createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
|
|
586
|
+
getSubscriptionsSummary: (ctx: Context) => Promise<SubscriptionSummary[]>;
|
|
569
587
|
}
|
|
570
588
|
declare const Endpoints$8: {
|
|
571
589
|
GetPortal: {
|
|
@@ -616,6 +634,10 @@ declare const Endpoints$8: {
|
|
|
616
634
|
uri: string;
|
|
617
635
|
method: string;
|
|
618
636
|
};
|
|
637
|
+
GetSubscriptionSummary: {
|
|
638
|
+
uri: string;
|
|
639
|
+
method: string;
|
|
640
|
+
};
|
|
619
641
|
};
|
|
620
642
|
|
|
621
643
|
type index$b_Charge = Charge;
|
|
@@ -629,7 +651,7 @@ declare const index$b_SubscriptionTypeSchema: typeof SubscriptionTypeSchema;
|
|
|
629
651
|
type index$b_Type = Type;
|
|
630
652
|
declare const index$b_Type: typeof Type;
|
|
631
653
|
declare namespace index$b {
|
|
632
|
-
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, index$b_Type as Type };
|
|
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 };
|
|
633
655
|
}
|
|
634
656
|
|
|
635
657
|
declare enum Role {
|
package/dist/index.js
CHANGED
|
@@ -4589,6 +4589,17 @@ var SubscriptionAPI = class {
|
|
|
4589
4589
|
);
|
|
4590
4590
|
return data;
|
|
4591
4591
|
}
|
|
4592
|
+
async getSubscriptionsSummary(ctx) {
|
|
4593
|
+
const endpointInfo = subscription_exports.Endpoints.GetSubscriptionSummary;
|
|
4594
|
+
const data = await this.clientHTTP.makeRequest(
|
|
4595
|
+
this.env,
|
|
4596
|
+
endpointInfo.uri,
|
|
4597
|
+
endpointInfo.method,
|
|
4598
|
+
null,
|
|
4599
|
+
ctx
|
|
4600
|
+
);
|
|
4601
|
+
return data.url;
|
|
4602
|
+
}
|
|
4592
4603
|
async createCheckout(planId, ctx) {
|
|
4593
4604
|
const endpointInfo = subscription_exports.Endpoints.Checkout;
|
|
4594
4605
|
const data = await this.clientHTTP.makeRequest(
|
|
@@ -5885,6 +5896,12 @@ var SubscriptionSchema = external_exports.object({
|
|
|
5885
5896
|
type: external_exports.nativeEnum(Type).optional(),
|
|
5886
5897
|
plan: PlanSchema.optional()
|
|
5887
5898
|
});
|
|
5899
|
+
var SubscriptionSummarySchema = external_exports.object({
|
|
5900
|
+
tenantId: external_exports.boolean(),
|
|
5901
|
+
productId: external_exports.string(),
|
|
5902
|
+
productName: external_exports.string(),
|
|
5903
|
+
email: external_exports.string()
|
|
5904
|
+
});
|
|
5888
5905
|
|
|
5889
5906
|
// src/model/tenant/Tenant.schema.ts
|
|
5890
5907
|
var PreferencesSchema = external_exports.object({
|
|
@@ -6088,6 +6105,10 @@ var Endpoints10 = {
|
|
|
6088
6105
|
UpdatePlan: {
|
|
6089
6106
|
uri: "/subscriptions/plan/update/",
|
|
6090
6107
|
method: "PUT"
|
|
6108
|
+
},
|
|
6109
|
+
GetSubscriptionSummary: {
|
|
6110
|
+
uri: "/subscriptions/summary/list/",
|
|
6111
|
+
method: "GET"
|
|
6091
6112
|
}
|
|
6092
6113
|
};
|
|
6093
6114
|
|