@chrt-inc/typescript-sdk 1.692.0 → 1.702.0
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/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/operations/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/operations/client/Client.js +12 -2
- package/dist/cjs/api/resources/operations/resources/cases/client/Client.d.ts +100 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/Client.js +394 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.d.ts +12 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.js +5 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.d.ts +15 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.js +5 -0
- package/dist/cjs/api/resources/operations/resources/cases/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/Client.d.ts +150 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/Client.js +581 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/index.js +17 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.d.ts +11 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.d.ts +11 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.d.ts +17 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.d.ts +12 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.d.ts +24 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.js +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/operations/resources/checklists/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/operations/resources/checklists/index.d.ts +1 -0
- package/dist/cjs/api/resources/operations/resources/checklists/index.js +17 -0
- package/dist/cjs/api/resources/operations/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/operations/resources/index.js +5 -1
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/Client.d.ts +170 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/Client.js +653 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/index.js +17 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.d.ts +12 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.d.ts +19 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.d.ts +12 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.js +5 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.d.ts +33 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.js +5 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/index.d.ts +1 -0
- package/dist/cjs/api/resources/operations/resources/operationsTasks/index.js +17 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.js +75 -0
- package/dist/cjs/api/types/AiImageDescription.d.ts +30 -0
- package/dist/cjs/api/types/AiImageDescription.js +5 -0
- package/dist/cjs/api/types/Case1.d.ts +4 -0
- package/dist/cjs/api/types/CaseChecksDisableReq.d.ts +7 -0
- package/dist/cjs/api/types/CaseChecksDisableReq.js +5 -0
- package/dist/cjs/api/types/CaseChecksDismissReq.d.ts +8 -0
- package/dist/cjs/api/types/CaseChecksDismissReq.js +5 -0
- package/dist/cjs/api/types/CaseChecksSummary1.d.ts +27 -0
- package/dist/cjs/api/types/CaseChecksSummary1.js +5 -0
- package/dist/cjs/api/types/Check1.d.ts +33 -0
- package/dist/cjs/api/types/Check1.js +5 -0
- package/dist/cjs/api/types/CheckEnum.d.ts +46 -0
- package/dist/cjs/api/types/CheckEnum.js +23 -0
- package/dist/cjs/api/types/CheckStatusEnum.d.ts +32 -0
- package/dist/cjs/api/types/CheckStatusEnum.js +15 -0
- package/dist/cjs/api/types/Checklist1.d.ts +18 -0
- package/dist/cjs/api/types/Checklist1.js +5 -0
- package/dist/cjs/api/types/ChecklistCheck1.d.ts +15 -0
- package/dist/cjs/api/types/ChecklistCheck1.js +5 -0
- package/dist/cjs/api/types/ChecklistListRes.d.ts +8 -0
- package/dist/cjs/api/types/ChecklistListRes.js +5 -0
- package/dist/cjs/api/types/ChecklistSortByEnum.d.ts +9 -0
- package/dist/cjs/api/types/ChecklistSortByEnum.js +11 -0
- package/dist/cjs/api/types/LlmModelEnum.d.ts +12 -0
- package/dist/cjs/api/types/LlmModelEnum.js +14 -0
- package/dist/cjs/api/types/OperationsTask1.d.ts +19 -0
- package/dist/cjs/api/types/OperationsTask1.js +5 -0
- package/dist/cjs/api/types/OperationsTaskComment1.d.ts +10 -0
- package/dist/cjs/api/types/OperationsTaskComment1.js +5 -0
- package/dist/cjs/api/types/OperationsTaskListRes.d.ts +8 -0
- package/dist/cjs/api/types/OperationsTaskListRes.js +5 -0
- package/dist/cjs/api/types/OperationsTaskSortByEnum.d.ts +8 -0
- package/dist/cjs/api/types/OperationsTaskSortByEnum.js +10 -0
- package/dist/cjs/api/types/TaskArtifactS3ObjectMetadata1.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +16 -0
- package/dist/cjs/api/types/index.js +16 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/operations/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/operations/client/Client.mjs +10 -0
- package/dist/esm/api/resources/operations/resources/cases/client/Client.d.mts +100 -0
- package/dist/esm/api/resources/operations/resources/cases/client/Client.mjs +394 -0
- package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.d.mts +12 -0
- package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.d.mts +15 -0
- package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/cases/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/Client.d.mts +150 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/Client.mjs +544 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/index.d.mts +2 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/index.mjs +1 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.d.mts +11 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.d.mts +11 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.d.mts +17 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.d.mts +12 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.d.mts +24 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/operations/resources/checklists/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/operations/resources/checklists/index.d.mts +1 -0
- package/dist/esm/api/resources/operations/resources/checklists/index.mjs +1 -0
- package/dist/esm/api/resources/operations/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/operations/resources/index.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/Client.d.mts +170 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/Client.mjs +616 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/index.d.mts +2 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/index.mjs +1 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.d.mts +12 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.d.mts +19 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.d.mts +12 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.d.mts +33 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.mjs +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/index.d.mts +1 -0
- package/dist/esm/api/resources/operations/resources/operationsTasks/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.mjs +75 -0
- package/dist/esm/api/types/AiImageDescription.d.mts +30 -0
- package/dist/esm/api/types/AiImageDescription.mjs +4 -0
- package/dist/esm/api/types/Case1.d.mts +4 -0
- package/dist/esm/api/types/CaseChecksDisableReq.d.mts +7 -0
- package/dist/esm/api/types/CaseChecksDisableReq.mjs +4 -0
- package/dist/esm/api/types/CaseChecksDismissReq.d.mts +8 -0
- package/dist/esm/api/types/CaseChecksDismissReq.mjs +4 -0
- package/dist/esm/api/types/CaseChecksSummary1.d.mts +27 -0
- package/dist/esm/api/types/CaseChecksSummary1.mjs +4 -0
- package/dist/esm/api/types/Check1.d.mts +33 -0
- package/dist/esm/api/types/Check1.mjs +4 -0
- package/dist/esm/api/types/CheckEnum.d.mts +46 -0
- package/dist/esm/api/types/CheckEnum.mjs +20 -0
- package/dist/esm/api/types/CheckStatusEnum.d.mts +32 -0
- package/dist/esm/api/types/CheckStatusEnum.mjs +12 -0
- package/dist/esm/api/types/Checklist1.d.mts +18 -0
- package/dist/esm/api/types/Checklist1.mjs +4 -0
- package/dist/esm/api/types/ChecklistCheck1.d.mts +15 -0
- package/dist/esm/api/types/ChecklistCheck1.mjs +4 -0
- package/dist/esm/api/types/ChecklistListRes.d.mts +8 -0
- package/dist/esm/api/types/ChecklistListRes.mjs +4 -0
- package/dist/esm/api/types/ChecklistSortByEnum.d.mts +9 -0
- package/dist/esm/api/types/ChecklistSortByEnum.mjs +8 -0
- package/dist/esm/api/types/LlmModelEnum.d.mts +12 -0
- package/dist/esm/api/types/LlmModelEnum.mjs +11 -0
- package/dist/esm/api/types/OperationsTask1.d.mts +19 -0
- package/dist/esm/api/types/OperationsTask1.mjs +4 -0
- package/dist/esm/api/types/OperationsTaskComment1.d.mts +10 -0
- package/dist/esm/api/types/OperationsTaskComment1.mjs +4 -0
- package/dist/esm/api/types/OperationsTaskListRes.d.mts +8 -0
- package/dist/esm/api/types/OperationsTaskListRes.mjs +4 -0
- package/dist/esm/api/types/OperationsTaskSortByEnum.d.mts +8 -0
- package/dist/esm/api/types/OperationsTaskSortByEnum.mjs +7 -0
- package/dist/esm/api/types/TaskArtifactS3ObjectMetadata1.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +16 -0
- package/dist/esm/api/types/index.mjs +16 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +1826 -153
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
+
export class Checklists {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Lists Checklists for the caller's organization with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (ChecklistListRes)
|
|
24
|
+
*
|
|
25
|
+
* @param {Chrt.operations.ChecklistsListV1Request} request
|
|
26
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.operations.checklists.listV1({
|
|
32
|
+
* sort_by: "created_at_timestamp",
|
|
33
|
+
* sort_order: "asc",
|
|
34
|
+
* page: 1,
|
|
35
|
+
* page_size: 1,
|
|
36
|
+
* filter_archived: true
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
listV1(request = {}, requestOptions) {
|
|
40
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
41
|
+
}
|
|
42
|
+
__listV1() {
|
|
43
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
45
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_archived: filterArchived, } = request;
|
|
46
|
+
const _queryParams = {};
|
|
47
|
+
if (sortBy !== undefined) {
|
|
48
|
+
_queryParams["sort_by"] = sortBy;
|
|
49
|
+
}
|
|
50
|
+
if (sortOrder !== undefined) {
|
|
51
|
+
_queryParams["sort_order"] = sortOrder;
|
|
52
|
+
}
|
|
53
|
+
if (page !== undefined) {
|
|
54
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
55
|
+
}
|
|
56
|
+
if (pageSize !== undefined) {
|
|
57
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
58
|
+
}
|
|
59
|
+
if (filterArchived !== undefined) {
|
|
60
|
+
_queryParams["filter_archived"] = (_c = filterArchived === null || filterArchived === void 0 ? void 0 : filterArchived.toString()) !== null && _c !== void 0 ? _c : null;
|
|
61
|
+
}
|
|
62
|
+
let _headers = mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
63
|
+
const _response = yield ((_e = this._options.fetcher) !== null && _e !== void 0 ? _e : core.fetcher)({
|
|
64
|
+
url: core.url.join((_g = (_f = (yield core.Supplier.get(this._options.baseUrl))) !== null && _f !== void 0 ? _f : (yield core.Supplier.get(this._options.environment))) !== null && _g !== void 0 ? _g : environments.ChrtEnvironment.Local, "operations/checklists/list/v1"),
|
|
65
|
+
method: "GET",
|
|
66
|
+
headers: _headers,
|
|
67
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
68
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
69
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
70
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
71
|
+
});
|
|
72
|
+
if (_response.ok) {
|
|
73
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 422:
|
|
78
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
79
|
+
default:
|
|
80
|
+
throw new errors.ChrtError({
|
|
81
|
+
statusCode: _response.error.statusCode,
|
|
82
|
+
body: _response.error.body,
|
|
83
|
+
rawResponse: _response.rawResponse,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
switch (_response.error.reason) {
|
|
88
|
+
case "non-json":
|
|
89
|
+
throw new errors.ChrtError({
|
|
90
|
+
statusCode: _response.error.statusCode,
|
|
91
|
+
body: _response.error.rawBody,
|
|
92
|
+
rawResponse: _response.rawResponse,
|
|
93
|
+
});
|
|
94
|
+
case "timeout":
|
|
95
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/checklists/list/v1.");
|
|
96
|
+
case "unknown":
|
|
97
|
+
throw new errors.ChrtError({
|
|
98
|
+
message: _response.error.errorMessage,
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Retrieves a single Checklist by id. | authz: min_org_role=operator | () -> (Checklist1)
|
|
106
|
+
*
|
|
107
|
+
* @param {string} checklistId
|
|
108
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.operations.checklists.getV1("checklist_id")
|
|
114
|
+
*/
|
|
115
|
+
getV1(checklistId, requestOptions) {
|
|
116
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(checklistId, requestOptions));
|
|
117
|
+
}
|
|
118
|
+
__getV1(checklistId, requestOptions) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
122
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
123
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/v1/${encodeURIComponent(checklistId)}`),
|
|
124
|
+
method: "GET",
|
|
125
|
+
headers: _headers,
|
|
126
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
127
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
128
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
129
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
130
|
+
});
|
|
131
|
+
if (_response.ok) {
|
|
132
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
133
|
+
}
|
|
134
|
+
if (_response.error.reason === "status-code") {
|
|
135
|
+
switch (_response.error.statusCode) {
|
|
136
|
+
case 422:
|
|
137
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
138
|
+
default:
|
|
139
|
+
throw new errors.ChrtError({
|
|
140
|
+
statusCode: _response.error.statusCode,
|
|
141
|
+
body: _response.error.body,
|
|
142
|
+
rawResponse: _response.rawResponse,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
switch (_response.error.reason) {
|
|
147
|
+
case "non-json":
|
|
148
|
+
throw new errors.ChrtError({
|
|
149
|
+
statusCode: _response.error.statusCode,
|
|
150
|
+
body: _response.error.rawBody,
|
|
151
|
+
rawResponse: _response.rawResponse,
|
|
152
|
+
});
|
|
153
|
+
case "timeout":
|
|
154
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/checklists/v1/{checklist_id}.");
|
|
155
|
+
case "unknown":
|
|
156
|
+
throw new errors.ChrtError({
|
|
157
|
+
message: _response.error.errorMessage,
|
|
158
|
+
rawResponse: _response.rawResponse,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Updates scalar fields (name, description) on a Checklist. | authz: min_org_role=operator | (ChecklistClientUpdate1) -> (bool)
|
|
165
|
+
*
|
|
166
|
+
* @param {string} checklistId
|
|
167
|
+
* @param {Chrt.operations.ChecklistClientUpdate1} request
|
|
168
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
169
|
+
*
|
|
170
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.operations.checklists.updateV1("checklist_id")
|
|
174
|
+
*/
|
|
175
|
+
updateV1(checklistId, request = {}, requestOptions) {
|
|
176
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(checklistId, request, requestOptions));
|
|
177
|
+
}
|
|
178
|
+
__updateV1(checklistId_1) {
|
|
179
|
+
return __awaiter(this, arguments, void 0, function* (checklistId, request = {}, requestOptions) {
|
|
180
|
+
var _a, _b, _c, _d;
|
|
181
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
182
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
183
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/v1/${encodeURIComponent(checklistId)}`),
|
|
184
|
+
method: "PATCH",
|
|
185
|
+
headers: _headers,
|
|
186
|
+
contentType: "application/json",
|
|
187
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
188
|
+
requestType: "json",
|
|
189
|
+
body: request,
|
|
190
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
191
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
192
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
193
|
+
});
|
|
194
|
+
if (_response.ok) {
|
|
195
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
196
|
+
}
|
|
197
|
+
if (_response.error.reason === "status-code") {
|
|
198
|
+
switch (_response.error.statusCode) {
|
|
199
|
+
case 422:
|
|
200
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
201
|
+
default:
|
|
202
|
+
throw new errors.ChrtError({
|
|
203
|
+
statusCode: _response.error.statusCode,
|
|
204
|
+
body: _response.error.body,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
switch (_response.error.reason) {
|
|
210
|
+
case "non-json":
|
|
211
|
+
throw new errors.ChrtError({
|
|
212
|
+
statusCode: _response.error.statusCode,
|
|
213
|
+
body: _response.error.rawBody,
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
215
|
+
});
|
|
216
|
+
case "timeout":
|
|
217
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/checklists/v1/{checklist_id}.");
|
|
218
|
+
case "unknown":
|
|
219
|
+
throw new errors.ChrtError({
|
|
220
|
+
message: _response.error.errorMessage,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Creates a new Checklist for the caller's organization. | authz: min_org_role=operator | (ChecklistClientCreate1) -> (PydanticObjectId)
|
|
228
|
+
*
|
|
229
|
+
* @param {Chrt.operations.ChecklistClientCreate1} request
|
|
230
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
231
|
+
*
|
|
232
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* await client.operations.checklists.createV1({
|
|
236
|
+
* schema_version: 1,
|
|
237
|
+
* name: "name"
|
|
238
|
+
* })
|
|
239
|
+
*/
|
|
240
|
+
createV1(request, requestOptions) {
|
|
241
|
+
return core.HttpResponsePromise.fromPromise(this.__createV1(request, requestOptions));
|
|
242
|
+
}
|
|
243
|
+
__createV1(request, requestOptions) {
|
|
244
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
+
var _a, _b, _c, _d;
|
|
246
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
247
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
248
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "operations/checklists/v1"),
|
|
249
|
+
method: "POST",
|
|
250
|
+
headers: _headers,
|
|
251
|
+
contentType: "application/json",
|
|
252
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
253
|
+
requestType: "json",
|
|
254
|
+
body: request,
|
|
255
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
256
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
257
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
258
|
+
});
|
|
259
|
+
if (_response.ok) {
|
|
260
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
261
|
+
}
|
|
262
|
+
if (_response.error.reason === "status-code") {
|
|
263
|
+
switch (_response.error.statusCode) {
|
|
264
|
+
case 422:
|
|
265
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
266
|
+
default:
|
|
267
|
+
throw new errors.ChrtError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.body,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
switch (_response.error.reason) {
|
|
275
|
+
case "non-json":
|
|
276
|
+
throw new errors.ChrtError({
|
|
277
|
+
statusCode: _response.error.statusCode,
|
|
278
|
+
body: _response.error.rawBody,
|
|
279
|
+
rawResponse: _response.rawResponse,
|
|
280
|
+
});
|
|
281
|
+
case "timeout":
|
|
282
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/checklists/v1.");
|
|
283
|
+
case "unknown":
|
|
284
|
+
throw new errors.ChrtError({
|
|
285
|
+
message: _response.error.errorMessage,
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Adds checks to a Checklist. Idempotent for identical checks. | authz: min_org_role=operator | (ChecklistChecksAdd1) -> (bool)
|
|
293
|
+
*
|
|
294
|
+
* @param {string} checklistId
|
|
295
|
+
* @param {Chrt.operations.ChecklistChecksAdd1} request
|
|
296
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
297
|
+
*
|
|
298
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* await client.operations.checklists.addChecksV1("checklist_id")
|
|
302
|
+
*/
|
|
303
|
+
addChecksV1(checklistId, request = {}, requestOptions) {
|
|
304
|
+
return core.HttpResponsePromise.fromPromise(this.__addChecksV1(checklistId, request, requestOptions));
|
|
305
|
+
}
|
|
306
|
+
__addChecksV1(checklistId_1) {
|
|
307
|
+
return __awaiter(this, arguments, void 0, function* (checklistId, request = {}, requestOptions) {
|
|
308
|
+
var _a, _b, _c, _d;
|
|
309
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
310
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
311
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/checks/add/v1/${encodeURIComponent(checklistId)}`),
|
|
312
|
+
method: "POST",
|
|
313
|
+
headers: _headers,
|
|
314
|
+
contentType: "application/json",
|
|
315
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
316
|
+
requestType: "json",
|
|
317
|
+
body: request,
|
|
318
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
319
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
320
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
321
|
+
});
|
|
322
|
+
if (_response.ok) {
|
|
323
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
324
|
+
}
|
|
325
|
+
if (_response.error.reason === "status-code") {
|
|
326
|
+
switch (_response.error.statusCode) {
|
|
327
|
+
case 422:
|
|
328
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
329
|
+
default:
|
|
330
|
+
throw new errors.ChrtError({
|
|
331
|
+
statusCode: _response.error.statusCode,
|
|
332
|
+
body: _response.error.body,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
switch (_response.error.reason) {
|
|
338
|
+
case "non-json":
|
|
339
|
+
throw new errors.ChrtError({
|
|
340
|
+
statusCode: _response.error.statusCode,
|
|
341
|
+
body: _response.error.rawBody,
|
|
342
|
+
rawResponse: _response.rawResponse,
|
|
343
|
+
});
|
|
344
|
+
case "timeout":
|
|
345
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/checklists/checks/add/v1/{checklist_id}.");
|
|
346
|
+
case "unknown":
|
|
347
|
+
throw new errors.ChrtError({
|
|
348
|
+
message: _response.error.errorMessage,
|
|
349
|
+
rawResponse: _response.rawResponse,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Removes entries from a Checklist's `checks` list by CheckEnum. | authz: min_org_role=operator | (ChecklistChecksRemove1) -> (bool)
|
|
356
|
+
*
|
|
357
|
+
* @param {string} checklistId
|
|
358
|
+
* @param {Chrt.operations.ChecklistChecksRemove1} request
|
|
359
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
360
|
+
*
|
|
361
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* await client.operations.checklists.removeChecksV1("checklist_id")
|
|
365
|
+
*/
|
|
366
|
+
removeChecksV1(checklistId, request = {}, requestOptions) {
|
|
367
|
+
return core.HttpResponsePromise.fromPromise(this.__removeChecksV1(checklistId, request, requestOptions));
|
|
368
|
+
}
|
|
369
|
+
__removeChecksV1(checklistId_1) {
|
|
370
|
+
return __awaiter(this, arguments, void 0, function* (checklistId, request = {}, requestOptions) {
|
|
371
|
+
var _a, _b, _c, _d;
|
|
372
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
373
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
374
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/checks/remove/v1/${encodeURIComponent(checklistId)}`),
|
|
375
|
+
method: "POST",
|
|
376
|
+
headers: _headers,
|
|
377
|
+
contentType: "application/json",
|
|
378
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
379
|
+
requestType: "json",
|
|
380
|
+
body: request,
|
|
381
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
382
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
383
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
384
|
+
});
|
|
385
|
+
if (_response.ok) {
|
|
386
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
387
|
+
}
|
|
388
|
+
if (_response.error.reason === "status-code") {
|
|
389
|
+
switch (_response.error.statusCode) {
|
|
390
|
+
case 422:
|
|
391
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
392
|
+
default:
|
|
393
|
+
throw new errors.ChrtError({
|
|
394
|
+
statusCode: _response.error.statusCode,
|
|
395
|
+
body: _response.error.body,
|
|
396
|
+
rawResponse: _response.rawResponse,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
switch (_response.error.reason) {
|
|
401
|
+
case "non-json":
|
|
402
|
+
throw new errors.ChrtError({
|
|
403
|
+
statusCode: _response.error.statusCode,
|
|
404
|
+
body: _response.error.rawBody,
|
|
405
|
+
rawResponse: _response.rawResponse,
|
|
406
|
+
});
|
|
407
|
+
case "timeout":
|
|
408
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/checklists/checks/remove/v1/{checklist_id}.");
|
|
409
|
+
case "unknown":
|
|
410
|
+
throw new errors.ChrtError({
|
|
411
|
+
message: _response.error.errorMessage,
|
|
412
|
+
rawResponse: _response.rawResponse,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Soft-deletes a Checklist by setting `archived=True`. Existing Cases that applied this Checklist are unaffected (copy-on-write). | authz: min_org_role=operator | () -> (bool)
|
|
419
|
+
*
|
|
420
|
+
* @param {string} checklistId
|
|
421
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
422
|
+
*
|
|
423
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* await client.operations.checklists.archiveV1("checklist_id")
|
|
427
|
+
*/
|
|
428
|
+
archiveV1(checklistId, requestOptions) {
|
|
429
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveV1(checklistId, requestOptions));
|
|
430
|
+
}
|
|
431
|
+
__archiveV1(checklistId, requestOptions) {
|
|
432
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
433
|
+
var _a, _b, _c, _d;
|
|
434
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
435
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
436
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/archive/v1/${encodeURIComponent(checklistId)}`),
|
|
437
|
+
method: "POST",
|
|
438
|
+
headers: _headers,
|
|
439
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
440
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
441
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
442
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
443
|
+
});
|
|
444
|
+
if (_response.ok) {
|
|
445
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
446
|
+
}
|
|
447
|
+
if (_response.error.reason === "status-code") {
|
|
448
|
+
switch (_response.error.statusCode) {
|
|
449
|
+
case 422:
|
|
450
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
451
|
+
default:
|
|
452
|
+
throw new errors.ChrtError({
|
|
453
|
+
statusCode: _response.error.statusCode,
|
|
454
|
+
body: _response.error.body,
|
|
455
|
+
rawResponse: _response.rawResponse,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
switch (_response.error.reason) {
|
|
460
|
+
case "non-json":
|
|
461
|
+
throw new errors.ChrtError({
|
|
462
|
+
statusCode: _response.error.statusCode,
|
|
463
|
+
body: _response.error.rawBody,
|
|
464
|
+
rawResponse: _response.rawResponse,
|
|
465
|
+
});
|
|
466
|
+
case "timeout":
|
|
467
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/checklists/archive/v1/{checklist_id}.");
|
|
468
|
+
case "unknown":
|
|
469
|
+
throw new errors.ChrtError({
|
|
470
|
+
message: _response.error.errorMessage,
|
|
471
|
+
rawResponse: _response.rawResponse,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Restores an archived Checklist by setting `archived=False`. | authz: min_org_role=operator | () -> (bool)
|
|
478
|
+
*
|
|
479
|
+
* @param {string} checklistId
|
|
480
|
+
* @param {Checklists.RequestOptions} requestOptions - Request-specific configuration.
|
|
481
|
+
*
|
|
482
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* await client.operations.checklists.unarchiveV1("checklist_id")
|
|
486
|
+
*/
|
|
487
|
+
unarchiveV1(checklistId, requestOptions) {
|
|
488
|
+
return core.HttpResponsePromise.fromPromise(this.__unarchiveV1(checklistId, requestOptions));
|
|
489
|
+
}
|
|
490
|
+
__unarchiveV1(checklistId, requestOptions) {
|
|
491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
+
var _a, _b, _c, _d;
|
|
493
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
494
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
495
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `operations/checklists/unarchive/v1/${encodeURIComponent(checklistId)}`),
|
|
496
|
+
method: "POST",
|
|
497
|
+
headers: _headers,
|
|
498
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
499
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
500
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
501
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
502
|
+
});
|
|
503
|
+
if (_response.ok) {
|
|
504
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
505
|
+
}
|
|
506
|
+
if (_response.error.reason === "status-code") {
|
|
507
|
+
switch (_response.error.statusCode) {
|
|
508
|
+
case 422:
|
|
509
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
510
|
+
default:
|
|
511
|
+
throw new errors.ChrtError({
|
|
512
|
+
statusCode: _response.error.statusCode,
|
|
513
|
+
body: _response.error.body,
|
|
514
|
+
rawResponse: _response.rawResponse,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
switch (_response.error.reason) {
|
|
519
|
+
case "non-json":
|
|
520
|
+
throw new errors.ChrtError({
|
|
521
|
+
statusCode: _response.error.statusCode,
|
|
522
|
+
body: _response.error.rawBody,
|
|
523
|
+
rawResponse: _response.rawResponse,
|
|
524
|
+
});
|
|
525
|
+
case "timeout":
|
|
526
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/checklists/unarchive/v1/{checklist_id}.");
|
|
527
|
+
case "unknown":
|
|
528
|
+
throw new errors.ChrtError({
|
|
529
|
+
message: _response.error.errorMessage,
|
|
530
|
+
rawResponse: _response.rawResponse,
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
_getAuthorizationHeader() {
|
|
536
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
537
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
538
|
+
if (bearer != null) {
|
|
539
|
+
return `Bearer ${bearer}`;
|
|
540
|
+
}
|
|
541
|
+
return undefined;
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* schema_version: 1,
|
|
9
|
+
* name: "name"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface ChecklistClientCreate1 {
|
|
13
|
+
schema_version: number;
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
checks?: Chrt.ChecklistCheck1[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* sort_by: "created_at_timestamp",
|
|
9
|
+
* sort_order: "asc",
|
|
10
|
+
* page: 1,
|
|
11
|
+
* page_size: 1,
|
|
12
|
+
* filter_archived: true
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface ChecklistsListV1Request {
|
|
16
|
+
/** Field to sort by */
|
|
17
|
+
sort_by?: Chrt.ChecklistSortByEnum | null;
|
|
18
|
+
/** Sort order (asc or desc) */
|
|
19
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
20
|
+
page?: number | null;
|
|
21
|
+
page_size?: number | null;
|
|
22
|
+
/** Filter by archived flag. None=all, True=archived only, False=unarchived only. */
|
|
23
|
+
filter_archived?: boolean | null;
|
|
24
|
+
}
|