shred-api-client 1.4.1 → 1.4.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.
@@ -5,8 +5,8 @@ declare class SubscriptionAPI implements SubscriptionAPISchema {
5
5
  private env;
6
6
  private clientHTTP;
7
7
  constructor(env: Environment);
8
- getProduct(id: string): Promise<Product>;
9
- getProducts(): Promise<Product[]>;
8
+ getProduct(id: string, context?: Context): Promise<Product>;
9
+ getProducts(ctx?: Context): Promise<Product[]>;
10
10
  createCheckout(planId: string | null, ctx: Context): Promise<string>;
11
11
  }
12
12
  export default SubscriptionAPI;
@@ -10,14 +10,14 @@ class SubscriptionAPI {
10
10
  this.env = env;
11
11
  this.clientHTTP = new HTTPClient_1.default();
12
12
  }
13
- async getProduct(id) {
13
+ async getProduct(id, context) {
14
14
  const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProduct;
15
- const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}/${id}`, endpointInfo.method, null);
15
+ const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}/${id}`, endpointInfo.method, null, context);
16
16
  return data;
17
17
  }
18
- async getProducts() {
18
+ async getProducts(ctx) {
19
19
  const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProducts;
20
- const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null);
20
+ const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
21
21
  return data;
22
22
  }
23
23
  async createCheckout(planId, ctx) {
@@ -1,7 +1,7 @@
1
1
  import Context from "./Context";
2
2
  interface SubscriptionAPISchema {
3
- getProduct: (id: string) => Promise<Product>;
4
- getProducts: () => Promise<Product[]>;
3
+ getProduct: (id: string, context?: Context) => Promise<Product>;
4
+ getProducts: (ctx?: Context) => Promise<Product[]>;
5
5
  createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
6
6
  }
7
7
  declare const SubscriptionEndpoints: {
@@ -32,12 +32,14 @@ declare const UserEndpoints: {
32
32
  declare enum Role {
33
33
  USER = "User",
34
34
  EDITOR = "Editor",
35
- QA = "QA"
35
+ QA = "QA",
36
+ ADMIN = "ADMIN"
36
37
  }
37
38
  declare enum System {
38
39
  APP = "APP",
39
40
  EDITOR = "EDITOR",
40
- QA = "QA"
41
+ QA = "QA",
42
+ ADMIN = "ADMIN"
41
43
  }
42
44
  type Preferences = {
43
45
  primaryColor?: string;
@@ -29,10 +29,12 @@ var Role;
29
29
  Role["USER"] = "User";
30
30
  Role["EDITOR"] = "Editor";
31
31
  Role["QA"] = "QA";
32
+ Role["ADMIN"] = "ADMIN";
32
33
  })(Role || (exports.Role = Role = {}));
33
34
  var System;
34
35
  (function (System) {
35
36
  System["APP"] = "APP";
36
37
  System["EDITOR"] = "EDITOR";
37
38
  System["QA"] = "QA";
39
+ System["ADMIN"] = "ADMIN";
38
40
  })(System || (exports.System = System = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",