shred-api-client 1.10.1 → 1.10.2

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.
@@ -9,6 +9,7 @@ declare class SubscriptionAPI implements SubscriptionAPISchema {
9
9
  getCharges(ctx: Context): Promise<Charge[]>;
10
10
  getSubscription(context: Context, userId?: string): Promise<Subscription | null>;
11
11
  charge(ctx: Context): Promise<boolean>;
12
+ disableAutomaticRenew(ctx: Context): Promise<boolean>;
12
13
  getProducts(ctx?: Context): Promise<Product[]>;
13
14
  createCheckout(planId: string | null, ctx: Context): Promise<string>;
14
15
  }
@@ -38,6 +38,11 @@ class SubscriptionAPI {
38
38
  const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
39
39
  return data.success;
40
40
  }
41
+ async disableAutomaticRenew(ctx) {
42
+ const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.DisableAutomaticRenew;
43
+ const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
44
+ return data;
45
+ }
41
46
  async getProducts(ctx) {
42
47
  const endpointInfo = ctx
43
48
  ? Subscription_schema_1.SubscriptionEndpoints.GetProductsByUser
@@ -5,6 +5,7 @@ interface SubscriptionAPISchema {
5
5
  getProduct: (id: string, context?: Context) => Promise<Product>;
6
6
  getProducts: (ctx?: Context) => Promise<Product[]>;
7
7
  charge: (ctx: Context) => Promise<boolean>;
8
+ disableAutomaticRenew: (ctx: Context) => Promise<boolean>;
8
9
  createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
9
10
  }
10
11
  declare const SubscriptionEndpoints: {
@@ -40,11 +41,7 @@ declare const SubscriptionEndpoints: {
40
41
  uri: string;
41
42
  method: string;
42
43
  };
43
- UpdateUser: {
44
- uri: string;
45
- method: string;
46
- };
47
- CreateUser: {
44
+ DisableAutomaticRenew: {
48
45
  uri: string;
49
46
  method: string;
50
47
  };
@@ -34,12 +34,8 @@ const SubscriptionEndpoints = {
34
34
  uri: "/subscriptions/payment/charge/",
35
35
  method: "POST",
36
36
  },
37
- UpdateUser: {
38
- uri: "/api/user/update/",
39
- method: "PUT",
40
- },
41
- CreateUser: {
42
- uri: "/api/user/public/createAccount/",
37
+ DisableAutomaticRenew: {
38
+ uri: "/subscriptions/payment/disableAutomaticRenew",
43
39
  method: "POST",
44
40
  },
45
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",