@parra/parra-js-sdk 0.2.73 → 0.2.74

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.
@@ -44,18 +44,18 @@ export interface Price {
44
44
  export interface UnitPrice {
45
45
  currency: Currency;
46
46
  amount: number;
47
- interval?: Interval | null;
47
+ interval?: Interval;
48
48
  }
49
49
  export interface Plan {
50
50
  id: string;
51
51
  created_at: string;
52
52
  updated_at: string;
53
53
  deleted_at?: string | null;
54
- tier: string | null;
55
- interval: string | null;
56
- price: UnitPrice | null;
57
- discounted_price?: Price | null;
58
- unit_price: UnitPrice | null;
54
+ tier: string;
55
+ interval: string;
56
+ price: UnitPrice;
57
+ discounted_price?: Price;
58
+ unit_price: UnitPrice;
59
59
  context?: string | null;
60
60
  }
61
61
  export declare enum SubscriptionStatus {
@@ -81,7 +81,7 @@ export interface Subscription {
81
81
  updated_at: string;
82
82
  deleted_at?: string | null;
83
83
  customer_id: string;
84
- status: SubscriptionStatus | null;
84
+ status: SubscriptionStatus;
85
85
  cancel_at?: string | null;
86
86
  cancel_at_period_end?: boolean | null;
87
87
  canceled_at?: string | null;
@@ -91,11 +91,11 @@ export interface Subscription {
91
91
  ended_at?: string | null;
92
92
  trial_start?: string | null;
93
93
  trial_end?: string | null;
94
- items: Array<SubscriptionItem> | null;
94
+ items: Array<SubscriptionItem>;
95
95
  }
96
96
  export interface TenantPlansResponse {
97
- plans?: Array<Plan> | null;
98
- subscriptions?: Array<Subscription> | null;
97
+ plans?: Array<Plan>;
98
+ subscriptions?: Array<Subscription>;
99
99
  }
100
100
  export interface StripeEvent {
101
101
  }
@@ -122,7 +122,6 @@ export interface CreateAuthTokenRequestBody {
122
122
  }
123
123
  export interface Entitlement {
124
124
  }
125
- export declare type Entitlements = Array<Entitlement>;
126
125
  export declare type UpdateEntitlementsRequestBody = Array<Entitlement>;
127
126
  export interface UpdateTenantRequestBody {
128
127
  name: string;
@@ -292,12 +291,12 @@ export declare enum CardItemType {
292
291
  question = "question"
293
292
  }
294
293
  export interface CardItem {
295
- type: CardItemType | null;
296
- version: string | null;
297
- data: CardItemData | null;
294
+ type: CardItemType;
295
+ version: string;
296
+ data: CardItemData;
298
297
  }
299
298
  export interface CardsResponse {
300
- items: Array<CardItem> | null;
299
+ items: Array<CardItem>;
301
300
  }
302
301
  export declare enum QuestionType {
303
302
  choice = "choice",
@@ -306,32 +305,50 @@ export declare enum QuestionType {
306
305
  export declare enum QuestionKind {
307
306
  radio = "radio",
308
307
  checkbox = "checkbox",
309
- star = "star"
308
+ star = "star",
309
+ image = "image"
310
310
  }
311
311
  export interface MutableChoiceQuestionOption {
312
- title: string | null;
313
- value: string | null;
312
+ title: string;
313
+ value: string;
314
314
  is_other?: boolean | null;
315
315
  }
316
316
  export interface ChoiceQuestionOption {
317
- title: string | null;
318
- value: string | null;
317
+ title: string;
318
+ value: string;
319
319
  is_other?: boolean | null;
320
- id: string | null;
320
+ id: string;
321
321
  }
322
322
  export interface ChoiceQuestionBody {
323
- options: Array<ChoiceQuestionOption> | null;
323
+ options: Array<ChoiceQuestionOption>;
324
324
  }
325
325
  export interface MutableChoiceQuestionBody {
326
- options: Array<MutableChoiceQuestionOption> | null;
326
+ options: Array<MutableChoiceQuestionOption>;
327
+ }
328
+ export interface MutableImageQuestionOption {
329
+ image_asset_id: string;
330
+ title?: string | null;
331
+ value: string;
332
+ }
333
+ export interface ImageQuestionOption {
334
+ image_asset_id: string;
335
+ title?: string | null;
336
+ value: string;
337
+ id: string;
338
+ }
339
+ export interface ImageQuestionBody {
340
+ options: Array<ImageQuestionOption>;
341
+ }
342
+ export interface MutableImageQuestionBody {
343
+ options: Array<MutableImageQuestionOption>;
327
344
  }
328
- export declare type MutableQuestionData = MutableChoiceQuestionBody;
329
- export declare type QuestionData = ChoiceQuestionBody;
345
+ export declare type MutableQuestionData = MutableChoiceQuestionBody | MutableImageQuestionBody;
346
+ export declare type QuestionData = ChoiceQuestionBody | ImageQuestionBody;
330
347
  export interface UpdateQuestionRequestBody {
331
348
  title: string;
332
349
  subtitle?: string | null;
333
350
  app_area_id?: string | null;
334
- data: MutableQuestionData | null;
351
+ data: MutableQuestionData;
335
352
  active?: boolean;
336
353
  expires_at?: string | null;
337
354
  answer_quota?: number | null;
@@ -340,12 +357,12 @@ export interface CreateQuestionRequestBody {
340
357
  title: string;
341
358
  subtitle?: string | null;
342
359
  app_area_id?: string | null;
343
- data: MutableQuestionData | null;
360
+ data: MutableQuestionData;
344
361
  active?: boolean;
345
362
  expires_at?: string | null;
346
363
  answer_quota?: number | null;
347
- type: QuestionType | null;
348
- kind: QuestionKind | null;
364
+ type: QuestionType;
365
+ kind: QuestionKind;
349
366
  }
350
367
  export declare enum QuestionStatus {
351
368
  open = "open",
@@ -356,22 +373,22 @@ export interface Question {
356
373
  created_at: string;
357
374
  updated_at: string;
358
375
  deleted_at?: string | null;
359
- status: QuestionStatus | null;
376
+ status: QuestionStatus;
360
377
  tenant_id: string;
361
378
  title: string;
362
379
  subtitle?: string | null;
363
380
  app_area_id?: string | null;
364
- type: QuestionType | null;
365
- kind: QuestionKind | null;
366
- data: QuestionData | null;
381
+ type: QuestionType;
382
+ kind: QuestionKind;
383
+ data: QuestionData;
367
384
  active?: boolean;
368
385
  answer_quota?: number | null;
369
386
  answer_count?: number;
370
387
  expires_at?: string | null;
371
388
  closed_at?: string | null;
372
- answer?: Answer | null;
373
- metrics?: QuestionMetrics | null;
374
- app_area?: AppArea | null;
389
+ answer?: Answer;
390
+ metrics?: QuestionMetrics;
391
+ app_area?: AppArea;
375
392
  }
376
393
  export interface QuestionCollectionResponse {
377
394
  page: number;
@@ -387,18 +404,18 @@ export interface QuestionMetrics {
387
404
  deleted_at?: string | null;
388
405
  question_id: string;
389
406
  answer_count: number;
390
- type: QuestionType | null;
391
- data: QuestionMetricsData | null;
407
+ type: QuestionType;
408
+ data: QuestionMetricsData;
392
409
  }
393
410
  export declare type QuestionMetricsData = ChoiceQuestionMetricsBody;
394
411
  export interface ChoiceQuestionMetricsBody {
395
- options: Array<ChoiceQuestionMetricsOption> | null;
412
+ options: Array<ChoiceQuestionMetricsOption>;
396
413
  }
397
414
  export interface ChoiceQuestionMetricsOption {
398
- title: string | null;
399
- value: string | null;
415
+ title: string;
416
+ value: string;
400
417
  is_other?: boolean | null;
401
- id: string | null;
418
+ id: string;
402
419
  answer_count: number;
403
420
  }
404
421
  export interface NotificationRecipient {
@@ -418,7 +435,7 @@ export interface CreateNotificationRequestBody {
418
435
  silent?: boolean;
419
436
  content_available?: boolean;
420
437
  expires_at?: string | null;
421
- recipients: Array<NotificationRecipient> | null;
438
+ recipients: Array<NotificationRecipient>;
422
439
  }
423
440
  export interface NotificationResponse {
424
441
  type?: string;
@@ -491,7 +508,7 @@ export interface CreateUserRequestBody {
491
508
  avatar_url?: string | null;
492
509
  locale?: string | null;
493
510
  type: string;
494
- identities?: Array<CreateIdentityRequestBody> | null;
511
+ identities?: Array<CreateIdentityRequestBody>;
495
512
  }
496
513
  export interface UpdateUserRequestBody {
497
514
  first_name: string;
@@ -548,7 +565,9 @@ declare class ParraAPI {
548
565
  getAppAreaById: (tenant_id: string, app_area_id: string) => Promise<AppArea>;
549
566
  updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody | undefined) => Promise<AppArea>;
550
567
  deleteAppAreaById: (tenant_id: string, app_area_id: string) => Promise<Response>;
551
- getCards: () => Promise<CardsResponse>;
568
+ getCards: (query?: {
569
+ app_area_id?: string | undefined;
570
+ } | undefined) => Promise<CardsResponse>;
552
571
  getFormById: (form_id: string) => Promise<Form>;
553
572
  submitFormById: (form_id: string, body?: FormResponse | undefined) => Promise<Response>;
554
573
  createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
package/dist/ParraAPI.js CHANGED
@@ -34,6 +34,7 @@ var QuestionKind;
34
34
  QuestionKind["radio"] = "radio";
35
35
  QuestionKind["checkbox"] = "checkbox";
36
36
  QuestionKind["star"] = "star";
37
+ QuestionKind["image"] = "image";
37
38
  })(QuestionKind = exports.QuestionKind || (exports.QuestionKind = {}));
38
39
  var QuestionStatus;
39
40
  (function (QuestionStatus) {
@@ -230,9 +231,10 @@ var ParraAPI = /** @class */ (function () {
230
231
  method: "delete",
231
232
  });
232
233
  };
233
- this.getCards = function () {
234
+ this.getCards = function (query) {
234
235
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
235
236
  method: "get",
237
+ query: query,
236
238
  });
237
239
  };
238
240
  this.getFormById = function (form_id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.73",
3
+ "version": "0.2.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",