@parra/parra-js-sdk 0.2.22 → 0.2.25
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 +10 -3
- package/dist/ParraAPI.js +11 -1
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -114,11 +114,16 @@ export interface CreateQuestionRequestBody {
|
|
|
114
114
|
expires_at?: string | null;
|
|
115
115
|
answer_quota?: number | null;
|
|
116
116
|
}
|
|
117
|
+
export declare enum QuestionStatus {
|
|
118
|
+
open = "open",
|
|
119
|
+
closed = "closed"
|
|
120
|
+
}
|
|
117
121
|
export interface Question {
|
|
118
122
|
id: string;
|
|
119
123
|
created_at: string;
|
|
120
124
|
updated_at: string;
|
|
121
125
|
deleted_at?: string | null;
|
|
126
|
+
status: QuestionStatus;
|
|
122
127
|
tenant_id: string;
|
|
123
128
|
title: string;
|
|
124
129
|
subtitle?: string | null;
|
|
@@ -126,9 +131,10 @@ export interface Question {
|
|
|
126
131
|
kind: QuestionKind;
|
|
127
132
|
data: QuestionData;
|
|
128
133
|
active?: boolean;
|
|
129
|
-
expires_at?: string | null;
|
|
130
134
|
answer_quota?: number | null;
|
|
131
135
|
answer_count?: number;
|
|
136
|
+
expires_at?: string | null;
|
|
137
|
+
closed_at?: string | null;
|
|
132
138
|
answer?: Answer;
|
|
133
139
|
metrics?: QuestionMetrics;
|
|
134
140
|
}
|
|
@@ -151,9 +157,9 @@ export interface QuestionMetrics {
|
|
|
151
157
|
}
|
|
152
158
|
export declare type QuestionMetricsData = ChoiceQuestionMetricsBody;
|
|
153
159
|
export interface ChoiceQuestionMetricsBody {
|
|
154
|
-
options: Array<
|
|
160
|
+
options: Array<ChoiceQuestionMetricsOption>;
|
|
155
161
|
}
|
|
156
|
-
export interface
|
|
162
|
+
export interface ChoiceQuestionMetricsOption {
|
|
157
163
|
title: string;
|
|
158
164
|
value: string;
|
|
159
165
|
is_other?: boolean | null;
|
|
@@ -294,6 +300,7 @@ declare class ParraAPI {
|
|
|
294
300
|
} | undefined) => Promise<QuestionCollectionResponse>;
|
|
295
301
|
getQuestionById: (question_id: string) => Promise<Question>;
|
|
296
302
|
deleteQuestionById: (question_id: string) => Promise<Response>;
|
|
303
|
+
closeQuestionById: (question_id: string) => Promise<Response>;
|
|
297
304
|
createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
|
|
298
305
|
answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
|
|
299
306
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
package/dist/ParraAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuestionKind = exports.QuestionType = exports.CardItemType = void 0;
|
|
3
|
+
exports.QuestionStatus = exports.QuestionKind = exports.QuestionType = exports.CardItemType = void 0;
|
|
4
4
|
var CardItemType;
|
|
5
5
|
(function (CardItemType) {
|
|
6
6
|
CardItemType["question"] = "question";
|
|
@@ -16,6 +16,11 @@ var QuestionKind;
|
|
|
16
16
|
QuestionKind["checkbox"] = "checkbox";
|
|
17
17
|
QuestionKind["star"] = "star";
|
|
18
18
|
})(QuestionKind = exports.QuestionKind || (exports.QuestionKind = {}));
|
|
19
|
+
var QuestionStatus;
|
|
20
|
+
(function (QuestionStatus) {
|
|
21
|
+
QuestionStatus["open"] = "open";
|
|
22
|
+
QuestionStatus["closed"] = "closed";
|
|
23
|
+
})(QuestionStatus = exports.QuestionStatus || (exports.QuestionStatus = {}));
|
|
19
24
|
var ParraAPI = /** @class */ (function () {
|
|
20
25
|
function ParraAPI(http, options) {
|
|
21
26
|
var _this = this;
|
|
@@ -99,6 +104,11 @@ var ParraAPI = /** @class */ (function () {
|
|
|
99
104
|
method: "delete",
|
|
100
105
|
});
|
|
101
106
|
};
|
|
107
|
+
this.closeQuestionById = function (question_id) {
|
|
108
|
+
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/close", {
|
|
109
|
+
method: "post",
|
|
110
|
+
});
|
|
111
|
+
};
|
|
102
112
|
this.createMetricsForQuestionById = function (question_id) {
|
|
103
113
|
return _this.http.execute(_this.options.baseUrl + "/v1/questions/" + question_id + "/metrics", {
|
|
104
114
|
method: "post",
|