@chrt-inc/typescript-sdk 1.692.0 → 1.704.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.
Files changed (186) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/operations/client/Client.d.ts +6 -0
  3. package/dist/cjs/api/resources/operations/client/Client.js +12 -2
  4. package/dist/cjs/api/resources/operations/resources/cases/client/Client.d.ts +100 -0
  5. package/dist/cjs/api/resources/operations/resources/cases/client/Client.js +394 -0
  6. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.d.ts +12 -0
  7. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.js +5 -0
  8. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.d.ts +15 -0
  9. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.js +5 -0
  10. package/dist/cjs/api/resources/operations/resources/cases/client/requests/index.d.ts +2 -0
  11. package/dist/cjs/api/resources/operations/resources/checklists/client/Client.d.ts +150 -0
  12. package/dist/cjs/api/resources/operations/resources/checklists/client/Client.js +581 -0
  13. package/dist/cjs/api/resources/operations/resources/checklists/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/operations/resources/checklists/client/index.js +17 -0
  15. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.d.ts +11 -0
  16. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.js +5 -0
  17. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.d.ts +11 -0
  18. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.js +5 -0
  19. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.d.ts +17 -0
  20. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.js +5 -0
  21. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.d.ts +12 -0
  22. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.js +5 -0
  23. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.d.ts +24 -0
  24. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.js +5 -0
  25. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/index.d.ts +5 -0
  26. package/dist/cjs/api/resources/operations/resources/checklists/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/operations/resources/checklists/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/operations/resources/checklists/index.js +17 -0
  29. package/dist/cjs/api/resources/operations/resources/index.d.ts +4 -0
  30. package/dist/cjs/api/resources/operations/resources/index.js +5 -1
  31. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/Client.d.ts +170 -0
  32. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/Client.js +653 -0
  33. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/index.js +17 -0
  35. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.d.ts +12 -0
  36. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.js +5 -0
  37. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.d.ts +19 -0
  38. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.js +5 -0
  39. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.d.ts +12 -0
  40. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.js +5 -0
  41. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.d.ts +33 -0
  42. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.js +5 -0
  43. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/index.d.ts +4 -0
  44. package/dist/cjs/api/resources/operations/resources/operationsTasks/client/requests/index.js +2 -0
  45. package/dist/cjs/api/resources/operations/resources/operationsTasks/index.d.ts +1 -0
  46. package/dist/cjs/api/resources/operations/resources/operationsTasks/index.js +17 -0
  47. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +26 -0
  48. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.js +75 -0
  49. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.d.ts +3 -0
  50. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.js +17 -5
  51. package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionsListV1Request.d.ts +9 -0
  52. package/dist/cjs/api/types/AiImageDescription.d.ts +30 -0
  53. package/dist/cjs/api/types/AiImageDescription.js +5 -0
  54. package/dist/cjs/api/types/Case1.d.ts +4 -0
  55. package/dist/cjs/api/types/CaseChecksDisableReq.d.ts +7 -0
  56. package/dist/cjs/api/types/CaseChecksDisableReq.js +5 -0
  57. package/dist/cjs/api/types/CaseChecksDismissReq.d.ts +8 -0
  58. package/dist/cjs/api/types/CaseChecksDismissReq.js +5 -0
  59. package/dist/cjs/api/types/CaseChecksSummary1.d.ts +27 -0
  60. package/dist/cjs/api/types/CaseChecksSummary1.js +5 -0
  61. package/dist/cjs/api/types/Check1.d.ts +33 -0
  62. package/dist/cjs/api/types/Check1.js +5 -0
  63. package/dist/cjs/api/types/CheckEnum.d.ts +46 -0
  64. package/dist/cjs/api/types/CheckEnum.js +23 -0
  65. package/dist/cjs/api/types/CheckStatusEnum.d.ts +32 -0
  66. package/dist/cjs/api/types/CheckStatusEnum.js +15 -0
  67. package/dist/cjs/api/types/Checklist1.d.ts +18 -0
  68. package/dist/cjs/api/types/Checklist1.js +5 -0
  69. package/dist/cjs/api/types/ChecklistCheck1.d.ts +15 -0
  70. package/dist/cjs/api/types/ChecklistCheck1.js +5 -0
  71. package/dist/cjs/api/types/ChecklistListRes.d.ts +8 -0
  72. package/dist/cjs/api/types/ChecklistListRes.js +5 -0
  73. package/dist/cjs/api/types/ChecklistSortByEnum.d.ts +9 -0
  74. package/dist/cjs/api/types/ChecklistSortByEnum.js +11 -0
  75. package/dist/cjs/api/types/LlmModelEnum.d.ts +12 -0
  76. package/dist/cjs/api/types/LlmModelEnum.js +14 -0
  77. package/dist/cjs/api/types/OperationsTask1.d.ts +19 -0
  78. package/dist/cjs/api/types/OperationsTask1.js +5 -0
  79. package/dist/cjs/api/types/OperationsTaskComment1.d.ts +10 -0
  80. package/dist/cjs/api/types/OperationsTaskComment1.js +5 -0
  81. package/dist/cjs/api/types/OperationsTaskListRes.d.ts +8 -0
  82. package/dist/cjs/api/types/OperationsTaskListRes.js +5 -0
  83. package/dist/cjs/api/types/OperationsTaskSortByEnum.d.ts +8 -0
  84. package/dist/cjs/api/types/OperationsTaskSortByEnum.js +10 -0
  85. package/dist/cjs/api/types/Session1.d.ts +2 -0
  86. package/dist/cjs/api/types/SessionSortByEnum.d.ts +2 -1
  87. package/dist/cjs/api/types/SessionSortByEnum.js +1 -0
  88. package/dist/cjs/api/types/TaskArtifactS3ObjectMetadata1.d.ts +2 -0
  89. package/dist/cjs/api/types/index.d.ts +16 -0
  90. package/dist/cjs/api/types/index.js +16 -0
  91. package/dist/cjs/version.d.ts +1 -1
  92. package/dist/cjs/version.js +1 -1
  93. package/dist/esm/Client.mjs +2 -2
  94. package/dist/esm/api/resources/operations/client/Client.d.mts +6 -0
  95. package/dist/esm/api/resources/operations/client/Client.mjs +10 -0
  96. package/dist/esm/api/resources/operations/resources/cases/client/Client.d.mts +100 -0
  97. package/dist/esm/api/resources/operations/resources/cases/client/Client.mjs +394 -0
  98. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.d.mts +12 -0
  99. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksApplyChecklistReq.mjs +4 -0
  100. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.d.mts +15 -0
  101. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseChecksRecordImageAnalysisResultsReq.mjs +4 -0
  102. package/dist/esm/api/resources/operations/resources/cases/client/requests/index.d.mts +2 -0
  103. package/dist/esm/api/resources/operations/resources/checklists/client/Client.d.mts +150 -0
  104. package/dist/esm/api/resources/operations/resources/checklists/client/Client.mjs +544 -0
  105. package/dist/esm/api/resources/operations/resources/checklists/client/index.d.mts +2 -0
  106. package/dist/esm/api/resources/operations/resources/checklists/client/index.mjs +1 -0
  107. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.d.mts +11 -0
  108. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksAdd1.mjs +4 -0
  109. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.d.mts +11 -0
  110. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistChecksRemove1.mjs +4 -0
  111. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.d.mts +17 -0
  112. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientCreate1.mjs +4 -0
  113. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.d.mts +12 -0
  114. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistClientUpdate1.mjs +4 -0
  115. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.d.mts +24 -0
  116. package/dist/esm/api/resources/operations/resources/checklists/client/requests/ChecklistsListV1Request.mjs +4 -0
  117. package/dist/esm/api/resources/operations/resources/checklists/client/requests/index.d.mts +5 -0
  118. package/dist/esm/api/resources/operations/resources/checklists/client/requests/index.mjs +1 -0
  119. package/dist/esm/api/resources/operations/resources/checklists/index.d.mts +1 -0
  120. package/dist/esm/api/resources/operations/resources/checklists/index.mjs +1 -0
  121. package/dist/esm/api/resources/operations/resources/index.d.mts +4 -0
  122. package/dist/esm/api/resources/operations/resources/index.mjs +4 -0
  123. package/dist/esm/api/resources/operations/resources/operationsTasks/client/Client.d.mts +170 -0
  124. package/dist/esm/api/resources/operations/resources/operationsTasks/client/Client.mjs +616 -0
  125. package/dist/esm/api/resources/operations/resources/operationsTasks/client/index.d.mts +2 -0
  126. package/dist/esm/api/resources/operations/resources/operationsTasks/client/index.mjs +1 -0
  127. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.d.mts +12 -0
  128. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskAddCommentReq1.mjs +4 -0
  129. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.d.mts +19 -0
  130. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientCreate1.mjs +4 -0
  131. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.d.mts +12 -0
  132. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTaskClientUpdate1.mjs +4 -0
  133. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.d.mts +33 -0
  134. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/OperationsTasksListV1Request.mjs +4 -0
  135. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/index.d.mts +4 -0
  136. package/dist/esm/api/resources/operations/resources/operationsTasks/client/requests/index.mjs +1 -0
  137. package/dist/esm/api/resources/operations/resources/operationsTasks/index.d.mts +1 -0
  138. package/dist/esm/api/resources/operations/resources/operationsTasks/index.mjs +1 -0
  139. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +26 -0
  140. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.mjs +75 -0
  141. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.d.mts +3 -0
  142. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.mjs +17 -5
  143. package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsListV1Request.d.mts +9 -0
  144. package/dist/esm/api/types/AiImageDescription.d.mts +30 -0
  145. package/dist/esm/api/types/AiImageDescription.mjs +4 -0
  146. package/dist/esm/api/types/Case1.d.mts +4 -0
  147. package/dist/esm/api/types/CaseChecksDisableReq.d.mts +7 -0
  148. package/dist/esm/api/types/CaseChecksDisableReq.mjs +4 -0
  149. package/dist/esm/api/types/CaseChecksDismissReq.d.mts +8 -0
  150. package/dist/esm/api/types/CaseChecksDismissReq.mjs +4 -0
  151. package/dist/esm/api/types/CaseChecksSummary1.d.mts +27 -0
  152. package/dist/esm/api/types/CaseChecksSummary1.mjs +4 -0
  153. package/dist/esm/api/types/Check1.d.mts +33 -0
  154. package/dist/esm/api/types/Check1.mjs +4 -0
  155. package/dist/esm/api/types/CheckEnum.d.mts +46 -0
  156. package/dist/esm/api/types/CheckEnum.mjs +20 -0
  157. package/dist/esm/api/types/CheckStatusEnum.d.mts +32 -0
  158. package/dist/esm/api/types/CheckStatusEnum.mjs +12 -0
  159. package/dist/esm/api/types/Checklist1.d.mts +18 -0
  160. package/dist/esm/api/types/Checklist1.mjs +4 -0
  161. package/dist/esm/api/types/ChecklistCheck1.d.mts +15 -0
  162. package/dist/esm/api/types/ChecklistCheck1.mjs +4 -0
  163. package/dist/esm/api/types/ChecklistListRes.d.mts +8 -0
  164. package/dist/esm/api/types/ChecklistListRes.mjs +4 -0
  165. package/dist/esm/api/types/ChecklistSortByEnum.d.mts +9 -0
  166. package/dist/esm/api/types/ChecklistSortByEnum.mjs +8 -0
  167. package/dist/esm/api/types/LlmModelEnum.d.mts +12 -0
  168. package/dist/esm/api/types/LlmModelEnum.mjs +11 -0
  169. package/dist/esm/api/types/OperationsTask1.d.mts +19 -0
  170. package/dist/esm/api/types/OperationsTask1.mjs +4 -0
  171. package/dist/esm/api/types/OperationsTaskComment1.d.mts +10 -0
  172. package/dist/esm/api/types/OperationsTaskComment1.mjs +4 -0
  173. package/dist/esm/api/types/OperationsTaskListRes.d.mts +8 -0
  174. package/dist/esm/api/types/OperationsTaskListRes.mjs +4 -0
  175. package/dist/esm/api/types/OperationsTaskSortByEnum.d.mts +8 -0
  176. package/dist/esm/api/types/OperationsTaskSortByEnum.mjs +7 -0
  177. package/dist/esm/api/types/Session1.d.mts +2 -0
  178. package/dist/esm/api/types/SessionSortByEnum.d.mts +2 -1
  179. package/dist/esm/api/types/SessionSortByEnum.mjs +1 -0
  180. package/dist/esm/api/types/TaskArtifactS3ObjectMetadata1.d.mts +2 -0
  181. package/dist/esm/api/types/index.d.mts +16 -0
  182. package/dist/esm/api/types/index.mjs +16 -0
  183. package/dist/esm/version.d.mts +1 -1
  184. package/dist/esm/version.mjs +1 -1
  185. package/package.json +1 -1
  186. package/reference.md +1829 -153
@@ -0,0 +1,653 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.OperationsTasks = void 0;
49
+ const environments = __importStar(require("../../../../../../environments.js"));
50
+ const core = __importStar(require("../../../../../../core/index.js"));
51
+ const Chrt = __importStar(require("../../../../../index.js"));
52
+ const headers_js_1 = require("../../../../../../core/headers.js");
53
+ const errors = __importStar(require("../../../../../../errors/index.js"));
54
+ class OperationsTasks {
55
+ constructor(_options = {}) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * Lists incomplete OperationsTasks for the caller's organization by default, with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (OperationsTaskListRes)
60
+ *
61
+ * @param {Chrt.operations.OperationsTasksListV1Request} request
62
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Chrt.UnprocessableEntityError}
65
+ *
66
+ * @example
67
+ * await client.operations.operationsTasks.listV1({
68
+ * sort_by: "deadline_timestamp",
69
+ * sort_order: "asc",
70
+ * page: 1,
71
+ * page_size: 1,
72
+ * filter_case_id: "filter_case_id",
73
+ * filter_completed: true,
74
+ * filter_deadline_gte: "2024-01-15T09:30:00Z",
75
+ * filter_deadline_lte: "2024-01-15T09:30:00Z"
76
+ * })
77
+ */
78
+ listV1(request = {}, requestOptions) {
79
+ return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
80
+ }
81
+ __listV1() {
82
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
83
+ var _a, _b, _c, _d, _e, _f, _g;
84
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_case_id: filterCaseId, filter_completed: filterCompleted, filter_deadline_gte: filterDeadlineGte, filter_deadline_lte: filterDeadlineLte, } = request;
85
+ const _queryParams = {};
86
+ if (sortBy !== undefined) {
87
+ _queryParams["sort_by"] = sortBy;
88
+ }
89
+ if (sortOrder !== undefined) {
90
+ _queryParams["sort_order"] = sortOrder;
91
+ }
92
+ if (page !== undefined) {
93
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
94
+ }
95
+ if (pageSize !== undefined) {
96
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
97
+ }
98
+ if (filterCaseId !== undefined) {
99
+ _queryParams["filter_case_id"] = filterCaseId;
100
+ }
101
+ if (filterCompleted !== undefined) {
102
+ _queryParams["filter_completed"] = (_c = filterCompleted === null || filterCompleted === void 0 ? void 0 : filterCompleted.toString()) !== null && _c !== void 0 ? _c : null;
103
+ }
104
+ if (filterDeadlineGte !== undefined) {
105
+ _queryParams["filter_deadline_gte"] = filterDeadlineGte;
106
+ }
107
+ if (filterDeadlineLte !== undefined) {
108
+ _queryParams["filter_deadline_lte"] = filterDeadlineLte;
109
+ }
110
+ let _headers = (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
111
+ const _response = yield ((_e = this._options.fetcher) !== null && _e !== void 0 ? _e : core.fetcher)({
112
+ 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/operations_tasks/list/v1"),
113
+ method: "GET",
114
+ headers: _headers,
115
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
116
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
117
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
118
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
119
+ });
120
+ if (_response.ok) {
121
+ return { data: _response.body, rawResponse: _response.rawResponse };
122
+ }
123
+ if (_response.error.reason === "status-code") {
124
+ switch (_response.error.statusCode) {
125
+ case 422:
126
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
127
+ default:
128
+ throw new errors.ChrtError({
129
+ statusCode: _response.error.statusCode,
130
+ body: _response.error.body,
131
+ rawResponse: _response.rawResponse,
132
+ });
133
+ }
134
+ }
135
+ switch (_response.error.reason) {
136
+ case "non-json":
137
+ throw new errors.ChrtError({
138
+ statusCode: _response.error.statusCode,
139
+ body: _response.error.rawBody,
140
+ rawResponse: _response.rawResponse,
141
+ });
142
+ case "timeout":
143
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/operations_tasks/list/v1.");
144
+ case "unknown":
145
+ throw new errors.ChrtError({
146
+ message: _response.error.errorMessage,
147
+ rawResponse: _response.rawResponse,
148
+ });
149
+ }
150
+ });
151
+ }
152
+ /**
153
+ * Retrieves a single OperationsTask by id. | authz: min_org_role=operator | () -> (OperationsTask1)
154
+ *
155
+ * @param {string} taskId
156
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
157
+ *
158
+ * @throws {@link Chrt.UnprocessableEntityError}
159
+ *
160
+ * @example
161
+ * await client.operations.operationsTasks.getV1("task_id")
162
+ */
163
+ getV1(taskId, requestOptions) {
164
+ return core.HttpResponsePromise.fromPromise(this.__getV1(taskId, requestOptions));
165
+ }
166
+ __getV1(taskId, requestOptions) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ var _a, _b, _c, _d;
169
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
170
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
171
+ 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/operations_tasks/v1/${encodeURIComponent(taskId)}`),
172
+ method: "GET",
173
+ headers: _headers,
174
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
175
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
176
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ });
179
+ if (_response.ok) {
180
+ return { data: _response.body, rawResponse: _response.rawResponse };
181
+ }
182
+ if (_response.error.reason === "status-code") {
183
+ switch (_response.error.statusCode) {
184
+ case 422:
185
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
186
+ default:
187
+ throw new errors.ChrtError({
188
+ statusCode: _response.error.statusCode,
189
+ body: _response.error.body,
190
+ rawResponse: _response.rawResponse,
191
+ });
192
+ }
193
+ }
194
+ switch (_response.error.reason) {
195
+ case "non-json":
196
+ throw new errors.ChrtError({
197
+ statusCode: _response.error.statusCode,
198
+ body: _response.error.rawBody,
199
+ rawResponse: _response.rawResponse,
200
+ });
201
+ case "timeout":
202
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/operations_tasks/v1/{task_id}.");
203
+ case "unknown":
204
+ throw new errors.ChrtError({
205
+ message: _response.error.errorMessage,
206
+ rawResponse: _response.rawResponse,
207
+ });
208
+ }
209
+ });
210
+ }
211
+ /**
212
+ * Hard-deletes an OperationsTask. | authz: min_org_role=operator | () -> (bool)
213
+ *
214
+ * @param {string} taskId
215
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
216
+ *
217
+ * @throws {@link Chrt.UnprocessableEntityError}
218
+ *
219
+ * @example
220
+ * await client.operations.operationsTasks.deleteV1("task_id")
221
+ */
222
+ deleteV1(taskId, requestOptions) {
223
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(taskId, requestOptions));
224
+ }
225
+ __deleteV1(taskId, requestOptions) {
226
+ return __awaiter(this, void 0, void 0, function* () {
227
+ var _a, _b, _c, _d;
228
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
229
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
230
+ 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/operations_tasks/v1/${encodeURIComponent(taskId)}`),
231
+ method: "DELETE",
232
+ headers: _headers,
233
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
234
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
235
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
236
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
237
+ });
238
+ if (_response.ok) {
239
+ return { data: _response.body, rawResponse: _response.rawResponse };
240
+ }
241
+ if (_response.error.reason === "status-code") {
242
+ switch (_response.error.statusCode) {
243
+ case 422:
244
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
245
+ default:
246
+ throw new errors.ChrtError({
247
+ statusCode: _response.error.statusCode,
248
+ body: _response.error.body,
249
+ rawResponse: _response.rawResponse,
250
+ });
251
+ }
252
+ }
253
+ switch (_response.error.reason) {
254
+ case "non-json":
255
+ throw new errors.ChrtError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.rawBody,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ case "timeout":
261
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /operations/operations_tasks/v1/{task_id}.");
262
+ case "unknown":
263
+ throw new errors.ChrtError({
264
+ message: _response.error.errorMessage,
265
+ rawResponse: _response.rawResponse,
266
+ });
267
+ }
268
+ });
269
+ }
270
+ /**
271
+ * Updates scalar fields (title, description, deadline_timestamp) on an OperationsTask. | authz: min_org_role=operator | (OperationsTaskClientUpdate1) -> (bool)
272
+ *
273
+ * @param {string} taskId
274
+ * @param {Chrt.operations.OperationsTaskClientUpdate1} request
275
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
276
+ *
277
+ * @throws {@link Chrt.UnprocessableEntityError}
278
+ *
279
+ * @example
280
+ * await client.operations.operationsTasks.updateV1("task_id")
281
+ */
282
+ updateV1(taskId, request = {}, requestOptions) {
283
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(taskId, request, requestOptions));
284
+ }
285
+ __updateV1(taskId_1) {
286
+ return __awaiter(this, arguments, void 0, function* (taskId, request = {}, requestOptions) {
287
+ var _a, _b, _c, _d;
288
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
289
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
290
+ 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/operations_tasks/v1/${encodeURIComponent(taskId)}`),
291
+ method: "PATCH",
292
+ headers: _headers,
293
+ contentType: "application/json",
294
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
295
+ requestType: "json",
296
+ body: request,
297
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
298
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
299
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
300
+ });
301
+ if (_response.ok) {
302
+ return { data: _response.body, rawResponse: _response.rawResponse };
303
+ }
304
+ if (_response.error.reason === "status-code") {
305
+ switch (_response.error.statusCode) {
306
+ case 422:
307
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
308
+ default:
309
+ throw new errors.ChrtError({
310
+ statusCode: _response.error.statusCode,
311
+ body: _response.error.body,
312
+ rawResponse: _response.rawResponse,
313
+ });
314
+ }
315
+ }
316
+ switch (_response.error.reason) {
317
+ case "non-json":
318
+ throw new errors.ChrtError({
319
+ statusCode: _response.error.statusCode,
320
+ body: _response.error.rawBody,
321
+ rawResponse: _response.rawResponse,
322
+ });
323
+ case "timeout":
324
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/operations_tasks/v1/{task_id}.");
325
+ case "unknown":
326
+ throw new errors.ChrtError({
327
+ message: _response.error.errorMessage,
328
+ rawResponse: _response.rawResponse,
329
+ });
330
+ }
331
+ });
332
+ }
333
+ /**
334
+ * Creates a new OperationsTask on a Case owned by the caller's organization. | authz: min_org_role=operator | (OperationsTaskClientCreate1) -> (PydanticObjectId)
335
+ *
336
+ * @param {Chrt.operations.OperationsTaskClientCreate1} request
337
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
338
+ *
339
+ * @throws {@link Chrt.UnprocessableEntityError}
340
+ *
341
+ * @example
342
+ * await client.operations.operationsTasks.createV1({
343
+ * schema_version: 1,
344
+ * case_id: "case_id",
345
+ * title: "title",
346
+ * description: "description"
347
+ * })
348
+ */
349
+ createV1(request, requestOptions) {
350
+ return core.HttpResponsePromise.fromPromise(this.__createV1(request, requestOptions));
351
+ }
352
+ __createV1(request, requestOptions) {
353
+ return __awaiter(this, void 0, void 0, function* () {
354
+ var _a, _b, _c, _d;
355
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
356
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
357
+ 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/operations_tasks/v1"),
358
+ method: "POST",
359
+ headers: _headers,
360
+ contentType: "application/json",
361
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
362
+ requestType: "json",
363
+ body: request,
364
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
365
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
366
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
367
+ });
368
+ if (_response.ok) {
369
+ return { data: _response.body, rawResponse: _response.rawResponse };
370
+ }
371
+ if (_response.error.reason === "status-code") {
372
+ switch (_response.error.statusCode) {
373
+ case 422:
374
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
375
+ default:
376
+ throw new errors.ChrtError({
377
+ statusCode: _response.error.statusCode,
378
+ body: _response.error.body,
379
+ rawResponse: _response.rawResponse,
380
+ });
381
+ }
382
+ }
383
+ switch (_response.error.reason) {
384
+ case "non-json":
385
+ throw new errors.ChrtError({
386
+ statusCode: _response.error.statusCode,
387
+ body: _response.error.rawBody,
388
+ rawResponse: _response.rawResponse,
389
+ });
390
+ case "timeout":
391
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_tasks/v1.");
392
+ case "unknown":
393
+ throw new errors.ChrtError({
394
+ message: _response.error.errorMessage,
395
+ rawResponse: _response.rawResponse,
396
+ });
397
+ }
398
+ });
399
+ }
400
+ /**
401
+ * Marks an OperationsTask as completed. Idempotent — calling on an already-completed task is a no-op that returns False. | authz: min_org_role=operator | () -> (bool)
402
+ *
403
+ * @param {string} taskId
404
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
405
+ *
406
+ * @throws {@link Chrt.UnprocessableEntityError}
407
+ *
408
+ * @example
409
+ * await client.operations.operationsTasks.completeV1("task_id")
410
+ */
411
+ completeV1(taskId, requestOptions) {
412
+ return core.HttpResponsePromise.fromPromise(this.__completeV1(taskId, requestOptions));
413
+ }
414
+ __completeV1(taskId, requestOptions) {
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ var _a, _b, _c, _d;
417
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
418
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
419
+ 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/operations_tasks/complete/v1/${encodeURIComponent(taskId)}`),
420
+ method: "POST",
421
+ headers: _headers,
422
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
423
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
424
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
425
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
426
+ });
427
+ if (_response.ok) {
428
+ return { data: _response.body, rawResponse: _response.rawResponse };
429
+ }
430
+ if (_response.error.reason === "status-code") {
431
+ switch (_response.error.statusCode) {
432
+ case 422:
433
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
434
+ default:
435
+ throw new errors.ChrtError({
436
+ statusCode: _response.error.statusCode,
437
+ body: _response.error.body,
438
+ rawResponse: _response.rawResponse,
439
+ });
440
+ }
441
+ }
442
+ switch (_response.error.reason) {
443
+ case "non-json":
444
+ throw new errors.ChrtError({
445
+ statusCode: _response.error.statusCode,
446
+ body: _response.error.rawBody,
447
+ rawResponse: _response.rawResponse,
448
+ });
449
+ case "timeout":
450
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_tasks/complete/v1/{task_id}.");
451
+ case "unknown":
452
+ throw new errors.ChrtError({
453
+ message: _response.error.errorMessage,
454
+ rawResponse: _response.rawResponse,
455
+ });
456
+ }
457
+ });
458
+ }
459
+ /**
460
+ * Marks a previously-completed OperationsTask as incomplete and clears its completion timestamps. Idempotent — calling on an already-incomplete task is a no-op that returns False. | authz: min_org_role=operator | () -> (bool)
461
+ *
462
+ * @param {string} taskId
463
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
464
+ *
465
+ * @throws {@link Chrt.UnprocessableEntityError}
466
+ *
467
+ * @example
468
+ * await client.operations.operationsTasks.uncompleteV1("task_id")
469
+ */
470
+ uncompleteV1(taskId, requestOptions) {
471
+ return core.HttpResponsePromise.fromPromise(this.__uncompleteV1(taskId, requestOptions));
472
+ }
473
+ __uncompleteV1(taskId, requestOptions) {
474
+ return __awaiter(this, void 0, void 0, function* () {
475
+ var _a, _b, _c, _d;
476
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
477
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
478
+ 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/operations_tasks/uncomplete/v1/${encodeURIComponent(taskId)}`),
479
+ method: "POST",
480
+ headers: _headers,
481
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
482
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
483
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
484
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
485
+ });
486
+ if (_response.ok) {
487
+ return { data: _response.body, rawResponse: _response.rawResponse };
488
+ }
489
+ if (_response.error.reason === "status-code") {
490
+ switch (_response.error.statusCode) {
491
+ case 422:
492
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
493
+ default:
494
+ throw new errors.ChrtError({
495
+ statusCode: _response.error.statusCode,
496
+ body: _response.error.body,
497
+ rawResponse: _response.rawResponse,
498
+ });
499
+ }
500
+ }
501
+ switch (_response.error.reason) {
502
+ case "non-json":
503
+ throw new errors.ChrtError({
504
+ statusCode: _response.error.statusCode,
505
+ body: _response.error.rawBody,
506
+ rawResponse: _response.rawResponse,
507
+ });
508
+ case "timeout":
509
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_tasks/uncomplete/v1/{task_id}.");
510
+ case "unknown":
511
+ throw new errors.ChrtError({
512
+ message: _response.error.errorMessage,
513
+ rawResponse: _response.rawResponse,
514
+ });
515
+ }
516
+ });
517
+ }
518
+ /**
519
+ * Appends a comment to an OperationsTask's comment thread. Returns the new comment id. | authz: min_org_role=operator | (OperationsTaskAddCommentReq1) -> (str)
520
+ *
521
+ * @param {string} taskId
522
+ * @param {Chrt.operations.OperationsTaskAddCommentReq1} request
523
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
524
+ *
525
+ * @throws {@link Chrt.UnprocessableEntityError}
526
+ *
527
+ * @example
528
+ * await client.operations.operationsTasks.addCommentV1("task_id", {
529
+ * comment: "comment"
530
+ * })
531
+ */
532
+ addCommentV1(taskId, request, requestOptions) {
533
+ return core.HttpResponsePromise.fromPromise(this.__addCommentV1(taskId, request, requestOptions));
534
+ }
535
+ __addCommentV1(taskId, request, requestOptions) {
536
+ return __awaiter(this, void 0, void 0, function* () {
537
+ var _a, _b, _c, _d;
538
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
539
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
540
+ 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/operations_tasks/add_comment/v1/${encodeURIComponent(taskId)}`),
541
+ method: "POST",
542
+ headers: _headers,
543
+ contentType: "application/json",
544
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
545
+ requestType: "json",
546
+ body: request,
547
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
548
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
549
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
550
+ });
551
+ if (_response.ok) {
552
+ return { data: _response.body, rawResponse: _response.rawResponse };
553
+ }
554
+ if (_response.error.reason === "status-code") {
555
+ switch (_response.error.statusCode) {
556
+ case 422:
557
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
558
+ default:
559
+ throw new errors.ChrtError({
560
+ statusCode: _response.error.statusCode,
561
+ body: _response.error.body,
562
+ rawResponse: _response.rawResponse,
563
+ });
564
+ }
565
+ }
566
+ switch (_response.error.reason) {
567
+ case "non-json":
568
+ throw new errors.ChrtError({
569
+ statusCode: _response.error.statusCode,
570
+ body: _response.error.rawBody,
571
+ rawResponse: _response.rawResponse,
572
+ });
573
+ case "timeout":
574
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_tasks/add_comment/v1/{task_id}.");
575
+ case "unknown":
576
+ throw new errors.ChrtError({
577
+ message: _response.error.errorMessage,
578
+ rawResponse: _response.rawResponse,
579
+ });
580
+ }
581
+ });
582
+ }
583
+ /**
584
+ * Deletes a comment from an OperationsTask's comment thread. 404 if the comment isn't found. | authz: min_org_role=operator | () -> (bool)
585
+ *
586
+ * @param {string} taskId
587
+ * @param {string} commentId
588
+ * @param {OperationsTasks.RequestOptions} requestOptions - Request-specific configuration.
589
+ *
590
+ * @throws {@link Chrt.UnprocessableEntityError}
591
+ *
592
+ * @example
593
+ * await client.operations.operationsTasks.deleteCommentV1("task_id", "comment_id")
594
+ */
595
+ deleteCommentV1(taskId, commentId, requestOptions) {
596
+ return core.HttpResponsePromise.fromPromise(this.__deleteCommentV1(taskId, commentId, requestOptions));
597
+ }
598
+ __deleteCommentV1(taskId, commentId, requestOptions) {
599
+ return __awaiter(this, void 0, void 0, function* () {
600
+ var _a, _b, _c, _d;
601
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
602
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
603
+ 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/operations_tasks/delete_comment/v1/${encodeURIComponent(taskId)}/${encodeURIComponent(commentId)}`),
604
+ method: "DELETE",
605
+ headers: _headers,
606
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
607
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
608
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
609
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
610
+ });
611
+ if (_response.ok) {
612
+ return { data: _response.body, rawResponse: _response.rawResponse };
613
+ }
614
+ if (_response.error.reason === "status-code") {
615
+ switch (_response.error.statusCode) {
616
+ case 422:
617
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
618
+ default:
619
+ throw new errors.ChrtError({
620
+ statusCode: _response.error.statusCode,
621
+ body: _response.error.body,
622
+ rawResponse: _response.rawResponse,
623
+ });
624
+ }
625
+ }
626
+ switch (_response.error.reason) {
627
+ case "non-json":
628
+ throw new errors.ChrtError({
629
+ statusCode: _response.error.statusCode,
630
+ body: _response.error.rawBody,
631
+ rawResponse: _response.rawResponse,
632
+ });
633
+ case "timeout":
634
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /operations/operations_tasks/delete_comment/v1/{task_id}/{comment_id}.");
635
+ case "unknown":
636
+ throw new errors.ChrtError({
637
+ message: _response.error.errorMessage,
638
+ rawResponse: _response.rawResponse,
639
+ });
640
+ }
641
+ });
642
+ }
643
+ _getAuthorizationHeader() {
644
+ return __awaiter(this, void 0, void 0, function* () {
645
+ const bearer = yield core.Supplier.get(this._options.token);
646
+ if (bearer != null) {
647
+ return `Bearer ${bearer}`;
648
+ }
649
+ return undefined;
650
+ });
651
+ }
652
+ }
653
+ exports.OperationsTasks = OperationsTasks;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.js";