@parra/parra-js-sdk 0.2.114 → 0.2.116

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.
@@ -436,13 +436,16 @@ export interface Answer {
436
436
  user_id: string;
437
437
  tenant_id: string;
438
438
  campaign_id?: string | null;
439
+ bucket_item_id?: string | null;
439
440
  data: AnswerData;
440
441
  }
441
442
  export interface AnswerQuestionBody {
443
+ bucket_item_id?: string | null;
442
444
  data: AnswerData;
443
445
  }
444
446
  export interface BulkAnswerQuestionBody {
445
447
  question_id: string;
448
+ bucket_item_id?: string | null;
446
449
  data: AnswerData;
447
450
  }
448
451
  export declare type BulkAnswerQuestionsBody = Array<BulkAnswerQuestionBody>;
@@ -644,12 +647,16 @@ export interface QuestionCollectionResponse {
644
647
  total_count: number;
645
648
  data: Array<Question>;
646
649
  }
650
+ export interface CreateQuestionMetricsRequestBody {
651
+ campaign_id?: string | null;
652
+ }
647
653
  export interface QuestionMetrics {
648
654
  id: string;
649
655
  created_at: string;
650
656
  updated_at: string;
651
657
  deleted_at?: string | null;
652
658
  question_id: string;
659
+ campaign_id?: string | null;
653
660
  answer_count: number;
654
661
  type: QuestionType;
655
662
  kind: QuestionKind;
@@ -1035,10 +1042,12 @@ declare class ParraAPI {
1035
1042
  $expand?: string | undefined;
1036
1043
  $search?: string | undefined;
1037
1044
  } | undefined) => Promise<QuestionCollectionResponse>;
1038
- getQuestionById: (question_id: string) => Promise<Question>;
1045
+ getQuestionById: (question_id: string, query: {
1046
+ campaign_id: string;
1047
+ }) => Promise<Question>;
1039
1048
  updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody | undefined) => Promise<Question>;
1040
1049
  deleteQuestionById: (question_id: string) => Promise<Response>;
1041
- createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
1050
+ createMetricsForQuestionById: (question_id: string, body?: CreateQuestionMetricsRequestBody | undefined) => Promise<QuestionMetrics>;
1042
1051
  answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
1043
1052
  paginateAnswersForQuestionById: (question_id: string, query?: {
1044
1053
  $select?: string | undefined;
package/dist/ParraAPI.js CHANGED
@@ -397,9 +397,10 @@ var ParraAPI = /** @class */ (function () {
397
397
  query: query,
398
398
  });
399
399
  };
400
- this.getQuestionById = function (question_id) {
400
+ this.getQuestionById = function (question_id, query) {
401
401
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
402
402
  method: "get",
403
+ query: query,
403
404
  });
404
405
  };
405
406
  this.updateQuestionById = function (question_id, body) {
@@ -416,9 +417,13 @@ var ParraAPI = /** @class */ (function () {
416
417
  method: "delete",
417
418
  });
418
419
  };
419
- this.createMetricsForQuestionById = function (question_id) {
420
+ this.createMetricsForQuestionById = function (question_id, body) {
420
421
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/metrics"), {
421
422
  method: "post",
423
+ body: JSON.stringify(body),
424
+ headers: {
425
+ "content-type": "application/json",
426
+ },
422
427
  });
423
428
  };
424
429
  this.answerQuestionById = function (question_id, body) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.114",
3
+ "version": "0.2.116",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",