@parra/parra-js-sdk 0.2.33 → 0.2.36

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,6 +34,28 @@ export interface UnitPrice {
34
34
  amount: number;
35
35
  interval?: Interval;
36
36
  }
37
+ export interface Plan {
38
+ id: string;
39
+ created_at: string;
40
+ updated_at: string;
41
+ deleted_at?: string | null;
42
+ tier: string;
43
+ interval: string;
44
+ price: UnitPrice;
45
+ discounted_price?: Price;
46
+ unit_price: UnitPrice;
47
+ context: string;
48
+ }
49
+ export interface Subscription {
50
+ id: string;
51
+ created_at: string;
52
+ updated_at: string;
53
+ deleted_at?: string | null;
54
+ }
55
+ export interface TenantPlansResponse {
56
+ plans?: Array<Plan>;
57
+ subscriptions?: Array<Subscription>;
58
+ }
37
59
  export interface CreateTenantRequestBody {
38
60
  name: string;
39
61
  is_test: boolean;
@@ -329,6 +351,7 @@ declare class ParraAPI {
329
351
  });
330
352
  createCustomer: (body?: CreateCustomerRequestBody | undefined) => Promise<Customer>;
331
353
  createCheckoutSession: (body?: CreateCheckoutSessionRequestBody | undefined) => Promise<CheckoutSession>;
354
+ getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
332
355
  getTenantById: (tenant_id: string) => Promise<Tenant>;
333
356
  createTenantForUserById: (user_id: string, body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
334
357
  getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
package/dist/ParraAPI.js CHANGED
@@ -53,6 +53,11 @@ var ParraAPI = /** @class */ (function () {
53
53
  },
54
54
  });
55
55
  };
56
+ this.getPlansForTenantById = function (tenant_id) {
57
+ return _this.http.execute(_this.options.baseUrl + "/v1/tenants/" + tenant_id + "/plans", {
58
+ method: "post",
59
+ });
60
+ };
56
61
  this.getTenantById = function (tenant_id) {
57
62
  return _this.http.execute(_this.options.baseUrl + "/v1/tenants/" + tenant_id, {
58
63
  method: "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.33",
3
+ "version": "0.2.36",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",