@lcdp/api-react-rest-client 3.1.8 → 3.1.9
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/package.json
CHANGED
|
@@ -13,6 +13,10 @@ import * as runtime from '../runtime';
|
|
|
13
13
|
export interface CreateTaskOccurrenceRequest {
|
|
14
14
|
taskId: string;
|
|
15
15
|
}
|
|
16
|
+
export interface UpdateTaskMutedRequest {
|
|
17
|
+
taskId: string;
|
|
18
|
+
body?: boolean;
|
|
19
|
+
}
|
|
16
20
|
/**
|
|
17
21
|
*
|
|
18
22
|
*/
|
|
@@ -25,4 +29,12 @@ export declare class ManageTaskApi extends runtime.BaseAPI {
|
|
|
25
29
|
* Ask for creation of new taskId occurrence
|
|
26
30
|
*/
|
|
27
31
|
createTaskOccurrence(requestParameters: CreateTaskOccurrenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Mute/Unmute a task
|
|
34
|
+
*/
|
|
35
|
+
updateTaskMutedRaw(requestParameters: UpdateTaskMutedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
36
|
+
/**
|
|
37
|
+
* Mute/Unmute a task
|
|
38
|
+
*/
|
|
39
|
+
updateTaskMuted(requestParameters: UpdateTaskMutedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
28
40
|
}
|
|
@@ -140,6 +140,74 @@ var ManageTaskApi = /** @class */ (function (_super) {
|
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* Mute/Unmute a task
|
|
145
|
+
*/
|
|
146
|
+
ManageTaskApi.prototype.updateTaskMutedRaw = function (requestParameters, initOverrides) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
+
var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
|
|
149
|
+
return __generator(this, function (_c) {
|
|
150
|
+
switch (_c.label) {
|
|
151
|
+
case 0:
|
|
152
|
+
if (requestParameters['taskId'] == null) {
|
|
153
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling updateTaskMuted().');
|
|
154
|
+
}
|
|
155
|
+
queryParameters = {};
|
|
156
|
+
headerParameters = {};
|
|
157
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
158
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
159
|
+
_a = headerParameters;
|
|
160
|
+
_b = "x-api-key";
|
|
161
|
+
return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
|
|
162
|
+
case 1:
|
|
163
|
+
_a[_b] = _c.sent(); // apiKeyAuth authentication
|
|
164
|
+
_c.label = 2;
|
|
165
|
+
case 2:
|
|
166
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
|
|
167
|
+
token = this.configuration.accessToken;
|
|
168
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
169
|
+
case 3:
|
|
170
|
+
tokenString = _c.sent();
|
|
171
|
+
if (tokenString) {
|
|
172
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
173
|
+
}
|
|
174
|
+
_c.label = 4;
|
|
175
|
+
case 4:
|
|
176
|
+
_c.trys.push([4, 6, , 7]);
|
|
177
|
+
return [4 /*yield*/, this.request({
|
|
178
|
+
path: "/tasks/{taskId}/muted".replace("{".concat("taskId", "}"), encodeURIComponent(String(requestParameters['taskId']))),
|
|
179
|
+
method: 'PUT',
|
|
180
|
+
headers: headerParameters,
|
|
181
|
+
query: queryParameters,
|
|
182
|
+
body: requestParameters['body'],
|
|
183
|
+
}, initOverrides)];
|
|
184
|
+
case 5:
|
|
185
|
+
response = _c.sent();
|
|
186
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
187
|
+
case 6:
|
|
188
|
+
response_2 = _c.sent();
|
|
189
|
+
console.debug(response_2);
|
|
190
|
+
throw response_2;
|
|
191
|
+
case 7: return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Mute/Unmute a task
|
|
198
|
+
*/
|
|
199
|
+
ManageTaskApi.prototype.updateTaskMuted = function (requestParameters, initOverrides) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0: return [4 /*yield*/, this.updateTaskMutedRaw(requestParameters, initOverrides)];
|
|
204
|
+
case 1:
|
|
205
|
+
_a.sent();
|
|
206
|
+
return [2 /*return*/];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
143
211
|
return ManageTaskApi;
|
|
144
212
|
}(runtime.BaseAPI));
|
|
145
213
|
exports.ManageTaskApi = ManageTaskApi;
|
|
@@ -27,6 +27,12 @@ export interface Task {
|
|
|
27
27
|
* @memberof Task
|
|
28
28
|
*/
|
|
29
29
|
lastSuccessfulDate?: Date;
|
|
30
|
+
/**
|
|
31
|
+
* When 'true', the task will never run in periodic or manual occurence
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof Task
|
|
34
|
+
*/
|
|
35
|
+
muted: boolean;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Check if a given object implements the Task interface.
|
|
@@ -18,6 +18,8 @@ exports.TaskToJSON = exports.TaskFromJSONTyped = exports.TaskFromJSON = exports.
|
|
|
18
18
|
* Check if a given object implements the Task interface.
|
|
19
19
|
*/
|
|
20
20
|
function instanceOfTask(value) {
|
|
21
|
+
if (!('muted' in value) || value['muted'] === undefined)
|
|
22
|
+
return false;
|
|
21
23
|
return true;
|
|
22
24
|
}
|
|
23
25
|
exports.instanceOfTask = instanceOfTask;
|
|
@@ -32,6 +34,7 @@ function TaskFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
32
34
|
return {
|
|
33
35
|
'id': json['id'],
|
|
34
36
|
'lastSuccessfulDate': (json['lastSuccessfulDate'] === null || json['lastSuccessfulDate'] === undefined) ? json['lastSuccessfulDate'] : new Date(json['lastSuccessfulDate']),
|
|
37
|
+
'muted': json['muted'],
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
exports.TaskFromJSONTyped = TaskFromJSONTyped;
|
|
@@ -42,6 +45,7 @@ function TaskToJSON(value) {
|
|
|
42
45
|
return {
|
|
43
46
|
'id': value['id'],
|
|
44
47
|
'lastSuccessfulDate': (value['lastSuccessfulDate'] === null || value['lastSuccessfulDate'] === undefined) ? value['lastSuccessfulDate'] : (value['lastSuccessfulDate']).toISOString(),
|
|
48
|
+
'muted': value['muted'],
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
exports.TaskToJSON = TaskToJSON;
|