shred-api-client 1.9.19 → 1.9.21

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.
@@ -34,7 +34,9 @@ class SubscriptionAPI {
34
34
  return data.success;
35
35
  }
36
36
  async getProducts(ctx) {
37
- const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProducts;
37
+ const endpointInfo = ctx
38
+ ? Subscription_schema_1.SubscriptionEndpoints.GetProductsByUser
39
+ : Subscription_schema_1.SubscriptionEndpoints.GetProducts;
38
40
  const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
39
41
  return data;
40
42
  }
@@ -23,6 +23,10 @@ declare const SubscriptionEndpoints: {
23
23
  uri: string;
24
24
  method: string;
25
25
  };
26
+ GetProductsByUser: {
27
+ uri: string;
28
+ method: string;
29
+ };
26
30
  Checkout: {
27
31
  uri: string;
28
32
  method: string;
@@ -75,4 +79,15 @@ type Subscription = {
75
79
  type?: SubscriptionType;
76
80
  plan?: Plan;
77
81
  };
78
- export { SubscriptionAPISchema, Product, Subscription, SubscriptionEndpoints, Plan, };
82
+ type Charge = {
83
+ id: number;
84
+ created: number;
85
+ paid: boolean;
86
+ receiptUrl: string;
87
+ status: string;
88
+ price: string;
89
+ paymentType: string;
90
+ last4?: string;
91
+ brand?: string;
92
+ };
93
+ export { SubscriptionAPISchema, Product, Subscription, SubscriptionEndpoints, Charge, Plan, };
@@ -18,6 +18,10 @@ const SubscriptionEndpoints = {
18
18
  uri: "/subscriptions/products/public/list/",
19
19
  method: "GET",
20
20
  },
21
+ GetProductsByUser: {
22
+ uri: "/subscriptions/products/list/",
23
+ method: "GET",
24
+ },
21
25
  Checkout: {
22
26
  uri: "/subscriptions/payment/checkout/",
23
27
  method: "POST",
@@ -1,4 +1,4 @@
1
- import { Product as TProduct, Subscription as TSubscription } from "./model/Subscription.schema";
1
+ import { Product as TProduct, Subscription as TSubscription, Charge as TCharge } from "./model/Subscription.schema";
2
2
  import { System as TSystem, User as TUser, Preferences as UserPreferences, Role as TRole } from "./model/User.schema";
3
3
  import { Email as TEmail } from "./model/Email.schema";
4
4
  import { Asset as TAsset } from "./model/Asset.schema";
@@ -12,6 +12,7 @@ export declare namespace Shred {
12
12
  type Tenant = TTenant;
13
13
  type Product = TProduct;
14
14
  type Subscription = TSubscription;
15
+ type Charge = TCharge;
15
16
  type User = TUser;
16
17
  type Email = TEmail;
17
18
  type System = TSystem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.9.19",
3
+ "version": "1.9.21",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",