@parra/parra-js-sdk 0.2.25 → 0.2.28
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 +18 -3
- package/dist/ParraAPI.js +18 -0
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -62,8 +62,13 @@ export interface Answer {
|
|
|
62
62
|
data: AnswerData;
|
|
63
63
|
}
|
|
64
64
|
export interface AnswerQuestionBody {
|
|
65
|
-
data
|
|
65
|
+
data: AnswerData;
|
|
66
|
+
}
|
|
67
|
+
export interface BulkAnswerQuestionBody {
|
|
68
|
+
question_id: string;
|
|
69
|
+
data: AnswerData;
|
|
66
70
|
}
|
|
71
|
+
export declare type BulkAnswerQuestionsBody = Array<BulkAnswerQuestionBody>;
|
|
67
72
|
export declare type CardItemData = Question;
|
|
68
73
|
export declare enum CardItemType {
|
|
69
74
|
question = "question"
|
|
@@ -104,15 +109,23 @@ export interface CreateChoiceQuestionBody {
|
|
|
104
109
|
}
|
|
105
110
|
export declare type CreateQuestionData = CreateChoiceQuestionBody;
|
|
106
111
|
export declare type QuestionData = ChoiceQuestionBody;
|
|
112
|
+
export interface UpdateQuestionRequestBody {
|
|
113
|
+
title: string;
|
|
114
|
+
subtitle?: string | null;
|
|
115
|
+
data: CreateQuestionData;
|
|
116
|
+
active?: boolean;
|
|
117
|
+
expires_at?: string | null;
|
|
118
|
+
answer_quota?: number | null;
|
|
119
|
+
}
|
|
107
120
|
export interface CreateQuestionRequestBody {
|
|
108
121
|
title: string;
|
|
109
122
|
subtitle?: string | null;
|
|
110
|
-
type: QuestionType;
|
|
111
|
-
kind: QuestionKind;
|
|
112
123
|
data: CreateQuestionData;
|
|
113
124
|
active?: boolean;
|
|
114
125
|
expires_at?: string | null;
|
|
115
126
|
answer_quota?: number | null;
|
|
127
|
+
type: QuestionType;
|
|
128
|
+
kind: QuestionKind;
|
|
116
129
|
}
|
|
117
130
|
export declare enum QuestionStatus {
|
|
118
131
|
open = "open",
|
|
@@ -299,10 +312,12 @@ declare class ParraAPI {
|
|
|
299
312
|
$search?: string | undefined;
|
|
300
313
|
} | undefined) => Promise<QuestionCollectionResponse>;
|
|
301
314
|
getQuestionById: (question_id: string) => Promise<Question>;
|
|
315
|
+
updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody | undefined) => Promise<Question>;
|
|
302
316
|
deleteQuestionById: (question_id: string) => Promise<Response>;
|
|
303
317
|
closeQuestionById: (question_id: string) => Promise<Response>;
|
|
304
318
|
createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
|
|
305
319
|
answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
|
|
320
|
+
bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody | undefined) => Promise<Response>;
|
|
306
321
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
|
307
322
|
listUsers: (query?: {
|
|
308
323
|
$select?: string | undefined;
|
package/dist/ParraAPI.js
CHANGED
|
@@ -99,6 +99,15 @@ var ParraAPI = /** @class */ (function () {
|
|
|
99
99
|
method: "get",
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
+
this.updateQuestionById = function (question_id, body) {
|
|
103
|
+
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id, {
|
|
104
|
+
method: "put",
|
|
105
|
+
body: JSON.stringify(body),
|
|
106
|
+
headers: {
|
|
107
|
+
"content-type": "application/json",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
};
|
|
102
111
|
this.deleteQuestionById = function (question_id) {
|
|
103
112
|
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id, {
|
|
104
113
|
method: "delete",
|
|
@@ -123,6 +132,15 @@ var ParraAPI = /** @class */ (function () {
|
|
|
123
132
|
},
|
|
124
133
|
});
|
|
125
134
|
};
|
|
135
|
+
this.bulkAnswerQuestions = function (body) {
|
|
136
|
+
return _this.http.execute(_this.options.baseUrl + "/v1/bulk/questions/answer", {
|
|
137
|
+
method: "post",
|
|
138
|
+
body: JSON.stringify(body),
|
|
139
|
+
headers: {
|
|
140
|
+
"content-type": "application/json",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
};
|
|
126
144
|
this.createUser = function (body) {
|
|
127
145
|
return _this.http.execute(_this.options.baseUrl + "/v1/users", {
|
|
128
146
|
method: "post",
|