@parra/parra-js-sdk 0.2.21 → 0.2.22
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.
- package/dist/ParraAPI.d.ts +23 -0
- package/dist/ParraAPI.js +5 -0
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -130,6 +130,7 @@ export interface Question {
|
|
|
130
130
|
answer_quota?: number | null;
|
|
131
131
|
answer_count?: number;
|
|
132
132
|
answer?: Answer;
|
|
133
|
+
metrics?: QuestionMetrics;
|
|
133
134
|
}
|
|
134
135
|
export interface QuestionCollectionResponse {
|
|
135
136
|
page: number;
|
|
@@ -138,6 +139,27 @@ export interface QuestionCollectionResponse {
|
|
|
138
139
|
total_count: number;
|
|
139
140
|
data: Array<Question>;
|
|
140
141
|
}
|
|
142
|
+
export interface QuestionMetrics {
|
|
143
|
+
id: string;
|
|
144
|
+
created_at: string;
|
|
145
|
+
updated_at: string;
|
|
146
|
+
deleted_at?: string | null;
|
|
147
|
+
question_id: string;
|
|
148
|
+
answer_count: number;
|
|
149
|
+
type: QuestionType;
|
|
150
|
+
data: QuestionMetricsData;
|
|
151
|
+
}
|
|
152
|
+
export declare type QuestionMetricsData = ChoiceQuestionMetricsBody;
|
|
153
|
+
export interface ChoiceQuestionMetricsBody {
|
|
154
|
+
options: Array<ChoiceQuestionOption>;
|
|
155
|
+
}
|
|
156
|
+
export interface ChoiceQuestionOption {
|
|
157
|
+
title: string;
|
|
158
|
+
value: string;
|
|
159
|
+
is_other?: boolean | null;
|
|
160
|
+
id: string;
|
|
161
|
+
answer_count: number;
|
|
162
|
+
}
|
|
141
163
|
export interface NotificationRecipient {
|
|
142
164
|
user_id?: string | null;
|
|
143
165
|
}
|
|
@@ -272,6 +294,7 @@ declare class ParraAPI {
|
|
|
272
294
|
} | undefined) => Promise<QuestionCollectionResponse>;
|
|
273
295
|
getQuestionById: (question_id: string) => Promise<Question>;
|
|
274
296
|
deleteQuestionById: (question_id: string) => Promise<Response>;
|
|
297
|
+
createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
|
|
275
298
|
answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
|
|
276
299
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
|
277
300
|
listUsers: (query?: {
|
package/dist/ParraAPI.js
CHANGED
|
@@ -99,6 +99,11 @@ var ParraAPI = /** @class */ (function () {
|
|
|
99
99
|
method: "delete",
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
+
this.createMetricsForQuestionById = function (question_id) {
|
|
103
|
+
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/metrics", {
|
|
104
|
+
method: "post",
|
|
105
|
+
});
|
|
106
|
+
};
|
|
102
107
|
this.answerQuestionById = function (question_id, body) {
|
|
103
108
|
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/answer", {
|
|
104
109
|
method: "put",
|