@parra/parra-js-sdk 0.2.32 → 0.2.35

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.
@@ -18,6 +18,38 @@ export interface Customer {
18
18
  tenant_id: string;
19
19
  stripe_customer_id: string;
20
20
  }
21
+ export declare enum Currency {
22
+ usd = "usd"
23
+ }
24
+ export declare enum Interval {
25
+ monthly = "monthly",
26
+ annual = "annual"
27
+ }
28
+ export interface Price {
29
+ currency: Currency;
30
+ amount: number;
31
+ }
32
+ export interface UnitPrice {
33
+ currency: Currency;
34
+ amount: number;
35
+ interval?: Interval;
36
+ }
37
+ export interface Plan {
38
+ id: string;
39
+ created_at: string;
40
+ updated_at: string;
41
+ deleted_at?: string | null;
42
+ }
43
+ export interface Subscription {
44
+ id: string;
45
+ created_at: string;
46
+ updated_at: string;
47
+ deleted_at?: string | null;
48
+ }
49
+ export interface TenantPlansResponse {
50
+ plans?: Array<Plan>;
51
+ subscriptions?: Array<Subscription>;
52
+ }
21
53
  export interface CreateTenantRequestBody {
22
54
  name: string;
23
55
  is_test: boolean;
@@ -313,6 +345,7 @@ declare class ParraAPI {
313
345
  });
314
346
  createCustomer: (body?: CreateCustomerRequestBody | undefined) => Promise<Customer>;
315
347
  createCheckoutSession: (body?: CreateCheckoutSessionRequestBody | undefined) => Promise<CheckoutSession>;
348
+ getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
316
349
  getTenantById: (tenant_id: string) => Promise<Tenant>;
317
350
  createTenantForUserById: (user_id: string, body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
318
351
  getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
package/dist/ParraAPI.js CHANGED
@@ -1,6 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionStatus = exports.QuestionKind = exports.QuestionType = exports.CardItemType = void 0;
3
+ exports.QuestionStatus = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.Interval = exports.Currency = void 0;
4
+ var Currency;
5
+ (function (Currency) {
6
+ Currency["usd"] = "usd";
7
+ })(Currency = exports.Currency || (exports.Currency = {}));
8
+ var Interval;
9
+ (function (Interval) {
10
+ Interval["monthly"] = "monthly";
11
+ Interval["annual"] = "annual";
12
+ })(Interval = exports.Interval || (exports.Interval = {}));
4
13
  var CardItemType;
5
14
  (function (CardItemType) {
6
15
  CardItemType["question"] = "question";
@@ -44,6 +53,11 @@ var ParraAPI = /** @class */ (function () {
44
53
  },
45
54
  });
46
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
+ };
47
61
  this.getTenantById = function (tenant_id) {
48
62
  return _this.http.execute(_this.options.baseUrl + "/v1/tenants/" + tenant_id, {
49
63
  method: "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.32",
3
+ "version": "0.2.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",