shred-api-client 1.0.9 → 1.0.11

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.
@@ -1,8 +1,7 @@
1
1
  import { Product, SubscriptionAPISchema } from "../model/Subscription.schema";
2
- import Context from "../model/Context";
3
2
  declare class SubscriptionAPI implements SubscriptionAPISchema {
4
3
  private clientHTTP;
5
4
  constructor();
6
- getProducts(context: Context): Promise<Product[]>;
5
+ getProducts(): Promise<Product[]>;
7
6
  }
8
7
  export default SubscriptionAPI;
@@ -9,9 +9,9 @@ class SubscriptionAPI {
9
9
  constructor() {
10
10
  this.clientHTTP = new HTTPClient_1.default();
11
11
  }
12
- async getProducts(context) {
12
+ async getProducts() {
13
13
  const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProducts;
14
- const data = await this.clientHTTP.makeRequest(endpointInfo.uri, endpointInfo.method, null, context);
14
+ const data = await this.clientHTTP.makeRequest(endpointInfo.uri, endpointInfo.method, null);
15
15
  return data;
16
16
  }
17
17
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SubscriptionEndpoints = void 0;
4
4
  const SubscriptionEndpoints = {
5
5
  GetProducts: {
6
- uri: "/api/subscription/products",
6
+ uri: "/api/subscription/products/public/list",
7
7
  method: "GET",
8
8
  },
9
9
  UpdateUser: {
@@ -2,5 +2,5 @@ import Context from "./../model/Context";
2
2
  export default class HTTPClient {
3
3
  private host;
4
4
  constructor();
5
- makeRequest(uri: string, method: string, data: any, context: Context): Promise<any>;
5
+ makeRequest(uri: string, method: string, data: any, context?: Context): Promise<any>;
6
6
  }
@@ -18,8 +18,8 @@ class HTTPClient {
18
18
  method: method,
19
19
  url: this.host + uri,
20
20
  headers: {
21
- Authorization: `Bearer ${context.token}`,
22
- "X-Request-ID": context.requestId,
21
+ Authorization: (context === null || context === void 0 ? void 0 : context.token) && `Bearer ${context.token}`,
22
+ "X-Request-ID": (context === null || context === void 0 ? void 0 : context.requestId) && context.requestId,
23
23
  "Content-Type": "application/json",
24
24
  },
25
25
  data: method === "GET" ? null : data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",