@parra/parra-js-sdk 0.2.21 → 0.2.24

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.
@@ -126,10 +126,12 @@ export interface Question {
126
126
  kind: QuestionKind;
127
127
  data: QuestionData;
128
128
  active?: boolean;
129
- expires_at?: string | null;
130
129
  answer_quota?: number | null;
131
130
  answer_count?: number;
131
+ expires_at?: string | null;
132
+ closed_at?: string | null;
132
133
  answer?: Answer;
134
+ metrics?: QuestionMetrics;
133
135
  }
134
136
  export interface QuestionCollectionResponse {
135
137
  page: number;
@@ -138,6 +140,27 @@ export interface QuestionCollectionResponse {
138
140
  total_count: number;
139
141
  data: Array<Question>;
140
142
  }
143
+ export interface QuestionMetrics {
144
+ id: string;
145
+ created_at: string;
146
+ updated_at: string;
147
+ deleted_at?: string | null;
148
+ question_id: string;
149
+ answer_count: number;
150
+ type: QuestionType;
151
+ data: QuestionMetricsData;
152
+ }
153
+ export declare type QuestionMetricsData = ChoiceQuestionMetricsBody;
154
+ export interface ChoiceQuestionMetricsBody {
155
+ options: Array<ChoiceQuestionMetricsOption>;
156
+ }
157
+ export interface ChoiceQuestionMetricsOption {
158
+ title: string;
159
+ value: string;
160
+ is_other?: boolean | null;
161
+ id: string;
162
+ answer_count: number;
163
+ }
141
164
  export interface NotificationRecipient {
142
165
  user_id?: string | null;
143
166
  }
@@ -272,6 +295,8 @@ declare class ParraAPI {
272
295
  } | undefined) => Promise<QuestionCollectionResponse>;
273
296
  getQuestionById: (question_id: string) => Promise<Question>;
274
297
  deleteQuestionById: (question_id: string) => Promise<Response>;
298
+ closeQuestionById: (question_id: string) => Promise<Response>;
299
+ createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
275
300
  answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
276
301
  createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
277
302
  listUsers: (query?: {
package/dist/ParraAPI.js CHANGED
@@ -99,6 +99,16 @@ var ParraAPI = /** @class */ (function () {
99
99
  method: "delete",
100
100
  });
101
101
  };
102
+ this.closeQuestionById = function (question_id) {
103
+ return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/close", {
104
+ method: "post",
105
+ });
106
+ };
107
+ this.createMetricsForQuestionById = function (question_id) {
108
+ return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/metrics", {
109
+ method: "post",
110
+ });
111
+ };
102
112
  this.answerQuestionById = function (question_id, body) {
103
113
  return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/answer", {
104
114
  method: "put",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.21",
3
+ "version": "0.2.24",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",