@parra/parra-js-sdk 0.2.39 → 0.2.41

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.
@@ -35,18 +35,18 @@ export interface Price {
35
35
  export interface UnitPrice {
36
36
  currency: Currency;
37
37
  amount: number;
38
- interval?: Interval;
38
+ interval?: Interval | null;
39
39
  }
40
40
  export interface Plan {
41
41
  id: string;
42
42
  created_at: string;
43
43
  updated_at: string;
44
44
  deleted_at?: string | null;
45
- tier: string;
46
- interval: string;
47
- price: UnitPrice;
48
- discounted_price?: Price;
49
- unit_price: UnitPrice;
45
+ tier: string | null;
46
+ interval: string | null;
47
+ price: UnitPrice | null;
48
+ discounted_price?: Price | null;
49
+ unit_price: UnitPrice | null;
50
50
  context?: string | null;
51
51
  }
52
52
  export declare enum SubscriptionStatus {
@@ -72,7 +72,7 @@ export interface Subscription {
72
72
  updated_at: string;
73
73
  deleted_at?: string | null;
74
74
  customer_id: string;
75
- status: SubscriptionStatus;
75
+ status: SubscriptionStatus | null;
76
76
  cancel_at?: string | null;
77
77
  cancel_at_period_end?: boolean | null;
78
78
  canceled_at?: string | null;
@@ -82,14 +82,18 @@ export interface Subscription {
82
82
  ended_at?: string | null;
83
83
  trial_start?: string | null;
84
84
  trial_end?: string | null;
85
- items: Array<SubscriptionItem>;
85
+ items: Array<SubscriptionItem> | null;
86
86
  }
87
87
  export interface TenantPlansResponse {
88
- plans?: Array<Plan>;
89
- subscriptions?: Array<Subscription>;
88
+ plans?: Array<Plan> | null;
89
+ subscriptions?: Array<Subscription> | null;
90
90
  }
91
91
  export interface StripeEvent {
92
92
  }
93
+ export interface Entitlement {
94
+ }
95
+ export declare type Entitlements = Array<Entitlement>;
96
+ export declare type UpdateEntitlementsRequestBody = Array<Entitlement>;
93
97
  export interface CreateTenantRequestBody {
94
98
  name: string;
95
99
  is_test: boolean;
@@ -101,6 +105,7 @@ export interface Tenant {
101
105
  deleted_at?: string | null;
102
106
  name: string;
103
107
  is_test: boolean;
108
+ entitlements?: Array<Entitlement> | null;
104
109
  }
105
110
  export declare type TenantListResponse = Array<Tenant>;
106
111
  export interface TenantCollectionResponse {
@@ -165,12 +170,12 @@ export declare enum CardItemType {
165
170
  question = "question"
166
171
  }
167
172
  export interface CardItem {
168
- type: CardItemType;
169
- version: string;
170
- data: CardItemData;
173
+ type: CardItemType | null;
174
+ version: string | null;
175
+ data: CardItemData | null;
171
176
  }
172
177
  export interface CardsResponse {
173
- items: Array<CardItem>;
178
+ items: Array<CardItem> | null;
174
179
  }
175
180
  export declare enum QuestionType {
176
181
  choice = "choice",
@@ -182,28 +187,28 @@ export declare enum QuestionKind {
182
187
  star = "star"
183
188
  }
184
189
  export interface MutableChoiceQuestionOption {
185
- title: string;
186
- value: string;
190
+ title: string | null;
191
+ value: string | null;
187
192
  is_other?: boolean | null;
188
193
  }
189
194
  export interface ChoiceQuestionOption {
190
- title: string;
191
- value: string;
195
+ title: string | null;
196
+ value: string | null;
192
197
  is_other?: boolean | null;
193
- id: string;
198
+ id: string | null;
194
199
  }
195
200
  export interface ChoiceQuestionBody {
196
- options: Array<ChoiceQuestionOption>;
201
+ options: Array<ChoiceQuestionOption> | null;
197
202
  }
198
203
  export interface MutableChoiceQuestionBody {
199
- options: Array<MutableChoiceQuestionOption>;
204
+ options: Array<MutableChoiceQuestionOption> | null;
200
205
  }
201
206
  export declare type MutableQuestionData = MutableChoiceQuestionBody;
202
207
  export declare type QuestionData = ChoiceQuestionBody;
203
208
  export interface UpdateQuestionRequestBody {
204
209
  title: string;
205
210
  subtitle?: string | null;
206
- data: MutableQuestionData;
211
+ data: MutableQuestionData | null;
207
212
  active?: boolean;
208
213
  expires_at?: string | null;
209
214
  answer_quota?: number | null;
@@ -211,12 +216,12 @@ export interface UpdateQuestionRequestBody {
211
216
  export interface CreateQuestionRequestBody {
212
217
  title: string;
213
218
  subtitle?: string | null;
214
- data: MutableQuestionData;
219
+ data: MutableQuestionData | null;
215
220
  active?: boolean;
216
221
  expires_at?: string | null;
217
222
  answer_quota?: number | null;
218
- type: QuestionType;
219
- kind: QuestionKind;
223
+ type: QuestionType | null;
224
+ kind: QuestionKind | null;
220
225
  }
221
226
  export declare enum QuestionStatus {
222
227
  open = "open",
@@ -227,20 +232,20 @@ export interface Question {
227
232
  created_at: string;
228
233
  updated_at: string;
229
234
  deleted_at?: string | null;
230
- status: QuestionStatus;
235
+ status: QuestionStatus | null;
231
236
  tenant_id: string;
232
237
  title: string;
233
238
  subtitle?: string | null;
234
- type: QuestionType;
235
- kind: QuestionKind;
236
- data: QuestionData;
239
+ type: QuestionType | null;
240
+ kind: QuestionKind | null;
241
+ data: QuestionData | null;
237
242
  active?: boolean;
238
243
  answer_quota?: number | null;
239
244
  answer_count?: number;
240
245
  expires_at?: string | null;
241
246
  closed_at?: string | null;
242
- answer?: Answer;
243
- metrics?: QuestionMetrics;
247
+ answer?: Answer | null;
248
+ metrics?: QuestionMetrics | null;
244
249
  }
245
250
  export interface QuestionCollectionResponse {
246
251
  page: number;
@@ -256,18 +261,18 @@ export interface QuestionMetrics {
256
261
  deleted_at?: string | null;
257
262
  question_id: string;
258
263
  answer_count: number;
259
- type: QuestionType;
260
- data: QuestionMetricsData;
264
+ type: QuestionType | null;
265
+ data: QuestionMetricsData | null;
261
266
  }
262
267
  export declare type QuestionMetricsData = ChoiceQuestionMetricsBody;
263
268
  export interface ChoiceQuestionMetricsBody {
264
- options: Array<ChoiceQuestionMetricsOption>;
269
+ options: Array<ChoiceQuestionMetricsOption> | null;
265
270
  }
266
271
  export interface ChoiceQuestionMetricsOption {
267
- title: string;
268
- value: string;
272
+ title: string | null;
273
+ value: string | null;
269
274
  is_other?: boolean | null;
270
- id: string;
275
+ id: string | null;
271
276
  answer_count: number;
272
277
  }
273
278
  export interface NotificationRecipient {
@@ -287,7 +292,7 @@ export interface CreateNotificationRequestBody {
287
292
  silent?: boolean;
288
293
  content_available?: boolean;
289
294
  expires_at?: string | null;
290
- recipients: Array<NotificationRecipient>;
295
+ recipients: Array<NotificationRecipient> | null;
291
296
  }
292
297
  export interface NotificationResponse {
293
298
  type?: string;
@@ -360,7 +365,7 @@ export interface CreateUserRequestBody {
360
365
  avatar_url?: string | null;
361
366
  locale?: string | null;
362
367
  type: string;
363
- identities?: Array<CreateIdentityRequestBody>;
368
+ identities?: Array<CreateIdentityRequestBody> | null;
364
369
  }
365
370
  export interface UpdateUserRequestBody {
366
371
  first_name: string;
@@ -384,6 +389,7 @@ declare class ParraAPI {
384
389
  baseUrl: string;
385
390
  });
386
391
  createCustomer: (body?: CreateCustomerRequestBody | undefined) => Promise<Customer>;
392
+ updateEntitlementsForCustomerById: (customer_id: string) => Promise<Response>;
387
393
  createBillingPortalSession: (tenant_id: string) => Promise<BillingPortalSession>;
388
394
  createCheckoutSession: (body?: CreateCheckoutSessionRequestBody | undefined) => Promise<CheckoutSession>;
389
395
  getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
package/dist/ParraAPI.js CHANGED
@@ -54,6 +54,11 @@ var ParraAPI = /** @class */ (function () {
54
54
  },
55
55
  });
56
56
  };
57
+ this.updateEntitlementsForCustomerById = function (customer_id) {
58
+ return _this.http.execute(_this.options.baseUrl + "/v1/customers/" + customer_id + "/entitlements", {
59
+ method: "post",
60
+ });
61
+ };
57
62
  this.createBillingPortalSession = function (tenant_id) {
58
63
  return _this.http.execute(_this.options.baseUrl + "/v1/tenants/" + tenant_id + "/billing-portal/sessions", {
59
64
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.39",
3
+ "version": "0.2.41",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",