shred-api-client 1.11.18 → 1.11.19
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.
|
@@ -5,6 +5,7 @@ declare class SubscriptionAPI implements SubscriptionAPISchema {
|
|
|
5
5
|
private env;
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
|
+
updatePlan(ctx: Context, planId: string): Promise<boolean>;
|
|
8
9
|
getProduct(id: string, context?: Context): Promise<Product>;
|
|
9
10
|
getCharges(ctx: Context): Promise<Charge[]>;
|
|
10
11
|
getSubscription(context: Context, userId?: string): Promise<Subscription | null>;
|
|
@@ -10,6 +10,11 @@ class SubscriptionAPI {
|
|
|
10
10
|
this.env = env;
|
|
11
11
|
this.clientHTTP = new HTTPClient_1.default();
|
|
12
12
|
}
|
|
13
|
+
async updatePlan(ctx, planId) {
|
|
14
|
+
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.UpdatePlan;
|
|
15
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, { planId }, ctx);
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
13
18
|
async getProduct(id, context) {
|
|
14
19
|
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProduct;
|
|
15
20
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}/${id}`, endpointInfo.method, null, context);
|
|
@@ -68,5 +68,5 @@ exports.Styles = [
|
|
|
68
68
|
{ value: CaptionStyle.ONE_LINE_EMOJIS, label: "One Line + Emojis" },
|
|
69
69
|
{ value: CaptionStyle.TWO_LINES, label: "Two Lines" },
|
|
70
70
|
{ value: CaptionStyle.TWO_LINES_EMOJIS, label: "Two Lines + Emojis" },
|
|
71
|
-
{ value: CaptionStyle.HOME_HIGHLIGHT, label: "Home
|
|
71
|
+
{ value: CaptionStyle.HOME_HIGHLIGHT, label: "Home Tour" },
|
|
72
72
|
];
|
|
@@ -6,6 +6,7 @@ interface SubscriptionAPISchema {
|
|
|
6
6
|
getProducts: (ctx?: Context) => Promise<Product[]>;
|
|
7
7
|
charge: (ctx: Context) => Promise<boolean>;
|
|
8
8
|
disableAutomaticRenew: (ctx: Context) => Promise<boolean>;
|
|
9
|
+
updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
|
|
9
10
|
createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
|
|
10
11
|
}
|
|
11
12
|
declare const SubscriptionEndpoints: {
|
|
@@ -45,6 +46,10 @@ declare const SubscriptionEndpoints: {
|
|
|
45
46
|
uri: string;
|
|
46
47
|
method: string;
|
|
47
48
|
};
|
|
49
|
+
UpdatePlan: {
|
|
50
|
+
uri: string;
|
|
51
|
+
method: string;
|
|
52
|
+
};
|
|
48
53
|
};
|
|
49
54
|
type Plan = {
|
|
50
55
|
id: string;
|
|
@@ -38,6 +38,10 @@ const SubscriptionEndpoints = {
|
|
|
38
38
|
uri: "/subscriptions/payment/disableAutomaticRenew",
|
|
39
39
|
method: "POST",
|
|
40
40
|
},
|
|
41
|
+
UpdatePlan: {
|
|
42
|
+
uri: "/subscriptions/plan/update/",
|
|
43
|
+
method: "PUT",
|
|
44
|
+
},
|
|
41
45
|
};
|
|
42
46
|
exports.SubscriptionEndpoints = SubscriptionEndpoints;
|
|
43
47
|
var SubscriptionType;
|