@parra/parra-js-sdk 0.2.105 → 0.2.107

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.
@@ -268,6 +268,13 @@ export interface TeamMember {
268
268
  export declare type TeamMemberListResponse = Array<TeamMember>;
269
269
  export interface AnswerData {
270
270
  }
271
+ export interface AnswerCollectionResponse {
272
+ page: number;
273
+ page_count: number;
274
+ page_size: number;
275
+ total_count: number;
276
+ data: Array<Answer>;
277
+ }
271
278
  export interface UpdateAnalyticEventTypeRequestBody {
272
279
  description?: string | null;
273
280
  }
@@ -326,7 +333,8 @@ export declare enum CampaignStatus {
326
333
  draft = "draft",
327
334
  scheduled = "scheduled",
328
335
  complete = "complete",
329
- closed = "closed"
336
+ closed = "closed",
337
+ archived = "archived"
330
338
  }
331
339
  export interface UpdateCampaignRequestBody {
332
340
  name: string;
@@ -506,22 +514,22 @@ export interface MutableStarQuestionBody {
506
514
  export interface ShortTextQuestionBody {
507
515
  placeholder?: string;
508
516
  min_length?: number;
509
- max_length: number;
517
+ max_length?: number;
510
518
  }
511
519
  export interface MutableShortTextQuestionBody {
512
520
  placeholder?: string;
513
521
  min_length?: number;
514
- max_length: number;
522
+ max_length?: number;
515
523
  }
516
524
  export interface LongTextQuestionBody {
517
525
  placeholder?: string;
518
526
  min_length?: number;
519
- max_length: number;
527
+ max_length?: number;
520
528
  }
521
529
  export interface MutableLongTextQuestionBody {
522
530
  placeholder?: string;
523
531
  min_length?: number;
524
- max_length: number;
532
+ max_length?: number;
525
533
  }
526
534
  export interface MutableBooleanQuestionOption {
527
535
  title: string;
@@ -610,9 +618,10 @@ export interface QuestionMetrics {
610
618
  question_id: string;
611
619
  answer_count: number;
612
620
  type: QuestionType;
621
+ kind: QuestionKind;
613
622
  data: QuestionMetricsData;
614
623
  }
615
- export declare type QuestionMetricsData = ChoiceQuestionMetricsBody | CheckboxQuestionMetricsBody | InageQuestionMetricsBody | RatingQuestionMetricsBody;
624
+ export declare type QuestionMetricsData = ChoiceQuestionMetricsBody | CheckboxQuestionMetricsBody | InageQuestionMetricsBody | RatingQuestionMetricsBody | StarQuestionMetricsBody | LongTextQuestionMetricsBody | ShortTextQuestionMetricsBody | BooleanQuestionMetricsBody;
616
625
  export interface ChoiceQuestionMetricsBody {
617
626
  options: Array<ChoiceQuestionMetricsOption>;
618
627
  }
@@ -645,6 +654,7 @@ export interface ImageQuestionMetricsOption {
645
654
  answer_count: number;
646
655
  }
647
656
  export interface RatingQuestionMetricsBody {
657
+ average_rating: number;
648
658
  options: Array<RatingQuestionMetricsOption>;
649
659
  }
650
660
  export interface RatingQuestionMetricsOption {
@@ -653,6 +663,39 @@ export interface RatingQuestionMetricsOption {
653
663
  id: string;
654
664
  answer_count: number;
655
665
  }
666
+ export interface MutableStarQuestionOption {
667
+ title: string;
668
+ value: number;
669
+ }
670
+ export interface StarQuestionOption {
671
+ title: string;
672
+ value: number;
673
+ id: string;
674
+ }
675
+ export interface StarQuestionMetricsBody {
676
+ average_rating: number;
677
+ options: Array<StarQuestionMetricsOption>;
678
+ }
679
+ export interface StarQuestionMetricsOption {
680
+ title: string;
681
+ value: number;
682
+ id: string;
683
+ answer_count: number;
684
+ }
685
+ export interface ShortTextQuestionMetricsBody {
686
+ }
687
+ export interface LongTextQuestionMetricsBody {
688
+ }
689
+ export interface BooleanQuestionMetricsBody {
690
+ average_rating: number;
691
+ options: Array<BooleanQuestionMetricsOption>;
692
+ }
693
+ export interface BooleanQuestionMetricsOption {
694
+ title: string;
695
+ value: string;
696
+ id: string;
697
+ answer_count: number;
698
+ }
656
699
  export interface Event {
657
700
  name: string;
658
701
  created_at: string | null;
@@ -953,6 +996,15 @@ declare class ParraAPI {
953
996
  closeQuestionById: (question_id: string) => Promise<Response>;
954
997
  createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
955
998
  answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
999
+ paginateAnswersForQuestionById: (question_id: string, query?: {
1000
+ $select?: string | undefined;
1001
+ $top?: number | undefined;
1002
+ $skip?: number | undefined;
1003
+ $orderby?: string | undefined;
1004
+ $filter?: string | undefined;
1005
+ $expand?: string | undefined;
1006
+ $search?: string | undefined;
1007
+ } | undefined) => Promise<AnswerCollectionResponse>;
956
1008
  bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody | undefined) => Promise<Response>;
957
1009
  paginateTemplateTags: (query?: {
958
1010
  $select?: string | undefined;
package/dist/ParraAPI.js CHANGED
@@ -27,6 +27,7 @@ var CampaignStatus;
27
27
  CampaignStatus["scheduled"] = "scheduled";
28
28
  CampaignStatus["complete"] = "complete";
29
29
  CampaignStatus["closed"] = "closed";
30
+ CampaignStatus["archived"] = "archived";
30
31
  })(CampaignStatus = exports.CampaignStatus || (exports.CampaignStatus = {}));
31
32
  var CardItemType;
32
33
  (function (CardItemType) {
@@ -410,6 +411,12 @@ var ParraAPI = /** @class */ (function () {
410
411
  raw: true,
411
412
  });
412
413
  };
414
+ this.paginateAnswersForQuestionById = function (question_id, query) {
415
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answers"), {
416
+ method: "get",
417
+ query: query,
418
+ });
419
+ };
413
420
  this.bulkAnswerQuestions = function (body) {
414
421
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/bulk/questions/answer"), {
415
422
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.105",
3
+ "version": "0.2.107",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",