@chrt-inc/typescript-sdk 1.662.0 → 1.675.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 (82) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientCreate1.d.ts +1 -0
  5. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientUpdate1.d.ts +2 -0
  6. package/dist/cjs/api/resources/operations/resources/cases/client/Client.d.ts +75 -0
  7. package/dist/cjs/api/resources/operations/resources/cases/client/Client.js +313 -0
  8. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.d.ts +12 -0
  9. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.js +5 -0
  10. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseStatusReq.d.ts +13 -0
  11. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseStatusReq.js +5 -0
  12. package/dist/cjs/api/resources/operations/resources/cases/client/requests/index.d.ts +2 -0
  13. package/dist/cjs/api/resources/operations/resources/cases/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/operations/resources/cases/index.js +1 -0
  15. package/dist/cjs/api/resources/operations/resources/cases/resources/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/operations/resources/cases/resources/index.js +41 -0
  17. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/Client.d.ts +83 -0
  18. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/Client.js +308 -0
  19. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/index.d.ts +2 -0
  20. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/index.js +17 -0
  21. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.d.ts +13 -0
  22. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.js +5 -0
  23. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.js +2 -0
  25. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/index.js +17 -0
  27. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.d.ts +1 -1
  28. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.js +1 -1
  29. package/dist/cjs/api/types/BillingLedger1.d.ts +1 -0
  30. package/dist/cjs/api/types/CallerCredentialTypeEnum.d.ts +1 -2
  31. package/dist/cjs/api/types/CallerCredentialTypeEnum.js +0 -1
  32. package/dist/cjs/api/types/Case1.d.ts +4 -0
  33. package/dist/cjs/api/types/CaseMessage1.d.ts +1 -0
  34. package/dist/cjs/api/types/CaseS3ObjectMetadata1.d.ts +19 -0
  35. package/dist/cjs/api/types/CaseS3ObjectMetadata1.js +5 -0
  36. package/dist/cjs/api/types/OrgPrivateData1.d.ts +1 -0
  37. package/dist/cjs/api/types/index.d.ts +1 -0
  38. package/dist/cjs/api/types/index.js +1 -0
  39. package/dist/cjs/version.d.ts +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/esm/Client.mjs +2 -2
  42. package/dist/esm/api/resources/billing/resources/billingLedgers/client/Client.d.mts +1 -1
  43. package/dist/esm/api/resources/billing/resources/billingLedgers/client/Client.mjs +1 -1
  44. package/dist/esm/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientCreate1.d.mts +1 -0
  45. package/dist/esm/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientUpdate1.d.mts +2 -0
  46. package/dist/esm/api/resources/operations/resources/cases/client/Client.d.mts +75 -0
  47. package/dist/esm/api/resources/operations/resources/cases/client/Client.mjs +313 -0
  48. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.d.mts +12 -0
  49. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.mjs +4 -0
  50. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseStatusReq.d.mts +13 -0
  51. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseStatusReq.mjs +4 -0
  52. package/dist/esm/api/resources/operations/resources/cases/client/requests/index.d.mts +2 -0
  53. package/dist/esm/api/resources/operations/resources/cases/index.d.mts +1 -0
  54. package/dist/esm/api/resources/operations/resources/cases/index.mjs +1 -0
  55. package/dist/esm/api/resources/operations/resources/cases/resources/index.d.mts +2 -0
  56. package/dist/esm/api/resources/operations/resources/cases/resources/index.mjs +2 -0
  57. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/Client.d.mts +83 -0
  58. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/Client.mjs +271 -0
  59. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/index.d.mts +2 -0
  60. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/index.mjs +1 -0
  61. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.d.mts +13 -0
  62. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.mjs +4 -0
  63. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.d.mts +1 -0
  64. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.mjs +1 -0
  65. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/index.d.mts +1 -0
  66. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/index.mjs +1 -0
  67. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.d.mts +1 -1
  68. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.mjs +1 -1
  69. package/dist/esm/api/types/BillingLedger1.d.mts +1 -0
  70. package/dist/esm/api/types/CallerCredentialTypeEnum.d.mts +1 -2
  71. package/dist/esm/api/types/CallerCredentialTypeEnum.mjs +0 -1
  72. package/dist/esm/api/types/Case1.d.mts +4 -0
  73. package/dist/esm/api/types/CaseMessage1.d.mts +1 -0
  74. package/dist/esm/api/types/CaseS3ObjectMetadata1.d.mts +19 -0
  75. package/dist/esm/api/types/CaseS3ObjectMetadata1.mjs +4 -0
  76. package/dist/esm/api/types/OrgPrivateData1.d.mts +1 -0
  77. package/dist/esm/api/types/index.d.mts +1 -0
  78. package/dist/esm/api/types/index.mjs +1 -0
  79. package/dist/esm/version.d.mts +1 -1
  80. package/dist/esm/version.mjs +1 -1
  81. package/package.json +1 -1
  82. package/reference.md +668 -61
@@ -56,8 +56,8 @@ class ChrtClient {
56
56
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
57
57
  "X-Fern-Language": "JavaScript",
58
58
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
59
- "X-Fern-SDK-Version": "1.662.0",
60
- "User-Agent": "@chrt-inc/typescript-sdk/1.662.0",
59
+ "X-Fern-SDK-Version": "1.675.0",
60
+ "User-Agent": "@chrt-inc/typescript-sdk/1.675.0",
61
61
  "X-Fern-Runtime": core.RUNTIME.type,
62
62
  "X-Fern-Runtime-Version": core.RUNTIME.version,
63
63
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -80,7 +80,7 @@ export declare class BillingLedgers {
80
80
  createV1(request: Chrt.billing.BillingLedgerClientCreate1, requestOptions?: BillingLedgers.RequestOptions): core.HttpResponsePromise<string>;
81
81
  private __createV1;
82
82
  /**
83
- * Updates a billing ledger's `comments`. Cycle and rate are per-period values supplied at `billing_ledger_periods/open/v1` time; the ledger does not carry them. | authz: allowed_org_types=[provider], min_org_role=operator, authz_personas=[billing_ledger_owner_operators] | (BillingLedgerClientUpdate1) -> (bool)
83
+ * Updates a billing ledger's `name` and `comments`. Cycle and rate are per-period values supplied at `billing_ledger_periods/open/v1` time; the ledger does not carry them. | authz: allowed_org_types=[provider], min_org_role=operator, authz_personas=[billing_ledger_owner_operators] | (BillingLedgerClientUpdate1) -> (bool)
84
84
  *
85
85
  * @param {string} id
86
86
  * @param {Chrt.billing.BillingLedgerClientUpdate1} request
@@ -277,7 +277,7 @@ class BillingLedgers {
277
277
  });
278
278
  }
279
279
  /**
280
- * Updates a billing ledger's `comments`. Cycle and rate are per-period values supplied at `billing_ledger_periods/open/v1` time; the ledger does not carry them. | authz: allowed_org_types=[provider], min_org_role=operator, authz_personas=[billing_ledger_owner_operators] | (BillingLedgerClientUpdate1) -> (bool)
280
+ * Updates a billing ledger's `name` and `comments`. Cycle and rate are per-period values supplied at `billing_ledger_periods/open/v1` time; the ledger does not carry them. | authz: allowed_org_types=[provider], min_org_role=operator, authz_personas=[billing_ledger_owner_operators] | (BillingLedgerClientUpdate1) -> (bool)
281
281
  *
282
282
  * @param {string} id
283
283
  * @param {Chrt.billing.BillingLedgerClientUpdate1} request
@@ -10,6 +10,7 @@ import * as Chrt from "../../../../../../index.js";
10
10
  */
11
11
  export interface BillingLedgerClientCreate1 {
12
12
  schema_version: number;
13
+ name?: string | null;
13
14
  task_group_type?: Chrt.TaskGroupTypeEnum1 | null;
14
15
  comments?: string | null;
15
16
  /** Must be a string starting with `org_` */
@@ -6,6 +6,8 @@
6
6
  * {}
7
7
  */
8
8
  export interface BillingLedgerClientUpdate1 {
9
+ name?: string | null;
9
10
  comments?: string | null;
11
+ name__set_to_None?: boolean;
10
12
  comments__set_to_None?: boolean;
11
13
  }
@@ -4,6 +4,7 @@
4
4
  import * as environments from "../../../../../../environments.js";
5
5
  import * as core from "../../../../../../core/index.js";
6
6
  import * as Chrt from "../../../../../index.js";
7
+ import { S3Objects } from "../resources/s3Objects/client/Client.js";
7
8
  export declare namespace Cases {
8
9
  interface Options {
9
10
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -29,7 +30,9 @@ export declare namespace Cases {
29
30
  }
30
31
  export declare class Cases {
31
32
  protected readonly _options: Cases.Options;
33
+ protected _s3Objects: S3Objects | undefined;
32
34
  constructor(_options?: Cases.Options);
35
+ get s3Objects(): S3Objects;
33
36
  /**
34
37
  * Lists cases for the caller's organization with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (CaseListRes)
35
38
  *
@@ -91,6 +94,64 @@ export declare class Cases {
91
94
  */
92
95
  getByOrderV1(orderId: string, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<Chrt.Case1>;
93
96
  private __getByOrderV1;
97
+ /**
98
+ * Retrieves the case for a given order ID, short ID, or off-chrt reference ID. | authz: min_org_role=operator | () -> (Case1)
99
+ *
100
+ * @param {string} orderRef - Order ID, short ID, or off-chrt reference ID
101
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
102
+ *
103
+ * @throws {@link Chrt.UnprocessableEntityError}
104
+ *
105
+ * @example
106
+ * await client.operations.cases.getByOrderRefV1("order_ref")
107
+ */
108
+ getByOrderRefV1(orderRef: string, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<Chrt.Case1>;
109
+ private __getByOrderRefV1;
110
+ /**
111
+ * Retrieves the case for a given order short ID. | authz: min_org_role=operator | () -> (Case1)
112
+ *
113
+ * @param {string} orderShortId
114
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
115
+ *
116
+ * @throws {@link Chrt.UnprocessableEntityError}
117
+ *
118
+ * @example
119
+ * await client.operations.cases.getByOrderShortIdV1("order_short_id")
120
+ */
121
+ getByOrderShortIdV1(orderShortId: string, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<Chrt.Case1>;
122
+ private __getByOrderShortIdV1;
123
+ /**
124
+ * Updates whether a case needs action. | authz: min_org_role=operator | (CaseNeedsActionReq) -> (bool)
125
+ *
126
+ * @param {string} caseId
127
+ * @param {Chrt.operations.CaseNeedsActionReq} request
128
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
129
+ *
130
+ * @throws {@link Chrt.UnprocessableEntityError}
131
+ *
132
+ * @example
133
+ * await client.operations.cases.updateNeedsActionV1("case_id", {
134
+ * needs_action: true
135
+ * })
136
+ */
137
+ updateNeedsActionV1(caseId: string, request: Chrt.operations.CaseNeedsActionReq, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<boolean>;
138
+ private __updateNeedsActionV1;
139
+ /**
140
+ * Updates a case's status. Closing a case also clears needs_action. | authz: min_org_role=operator | (CaseStatusReq) -> (bool)
141
+ *
142
+ * @param {string} caseId
143
+ * @param {Chrt.operations.CaseStatusReq} request
144
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
145
+ *
146
+ * @throws {@link Chrt.UnprocessableEntityError}
147
+ *
148
+ * @example
149
+ * await client.operations.cases.updateStatusV1("case_id", {
150
+ * status: "open"
151
+ * })
152
+ */
153
+ updateStatusV1(caseId: string, request: Chrt.operations.CaseStatusReq, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<boolean>;
154
+ private __updateStatusV1;
94
155
  /**
95
156
  * Adds operator(s) to a case. | authz: min_org_role=operator | (CaseAssignReq) -> (bool)
96
157
  *
@@ -139,5 +200,19 @@ export declare class Cases {
139
200
  */
140
201
  addMessageV1(caseId: string, request: Chrt.operations.CaseAddMessageReq, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<boolean>;
141
202
  private __addMessageV1;
203
+ /**
204
+ * Deletes a message from a case. | authz: min_org_role=operator | () -> (bool)
205
+ *
206
+ * @param {string} caseId
207
+ * @param {string} messageId
208
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
209
+ *
210
+ * @throws {@link Chrt.UnprocessableEntityError}
211
+ *
212
+ * @example
213
+ * await client.operations.cases.deleteMessageV1("case_id", "message_id")
214
+ */
215
+ deleteMessageV1(caseId: string, messageId: string, requestOptions?: Cases.RequestOptions): core.HttpResponsePromise<boolean>;
216
+ private __deleteMessageV1;
142
217
  protected _getAuthorizationHeader(): Promise<string | undefined>;
143
218
  }
@@ -51,10 +51,15 @@ const core = __importStar(require("../../../../../../core/index.js"));
51
51
  const Chrt = __importStar(require("../../../../../index.js"));
52
52
  const headers_js_1 = require("../../../../../../core/headers.js");
53
53
  const errors = __importStar(require("../../../../../../errors/index.js"));
54
+ const Client_js_1 = require("../resources/s3Objects/client/Client.js");
54
55
  class Cases {
55
56
  constructor(_options = {}) {
56
57
  this._options = _options;
57
58
  }
59
+ get s3Objects() {
60
+ var _a;
61
+ return ((_a = this._s3Objects) !== null && _a !== void 0 ? _a : (this._s3Objects = new Client_js_1.S3Objects(this._options)));
62
+ }
58
63
  /**
59
64
  * Lists cases for the caller's organization with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (CaseListRes)
60
65
  *
@@ -342,6 +347,254 @@ class Cases {
342
347
  }
343
348
  });
344
349
  }
350
+ /**
351
+ * Retrieves the case for a given order ID, short ID, or off-chrt reference ID. | authz: min_org_role=operator | () -> (Case1)
352
+ *
353
+ * @param {string} orderRef - Order ID, short ID, or off-chrt reference ID
354
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
355
+ *
356
+ * @throws {@link Chrt.UnprocessableEntityError}
357
+ *
358
+ * @example
359
+ * await client.operations.cases.getByOrderRefV1("order_ref")
360
+ */
361
+ getByOrderRefV1(orderRef, requestOptions) {
362
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderRefV1(orderRef, requestOptions));
363
+ }
364
+ __getByOrderRefV1(orderRef, requestOptions) {
365
+ return __awaiter(this, void 0, void 0, function* () {
366
+ var _a, _b, _c, _d;
367
+ 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);
368
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
369
+ 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/cases/by_order_ref/v1/${encodeURIComponent(orderRef)}`),
370
+ method: "GET",
371
+ headers: _headers,
372
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
373
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
374
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
375
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
376
+ });
377
+ if (_response.ok) {
378
+ return { data: _response.body, rawResponse: _response.rawResponse };
379
+ }
380
+ if (_response.error.reason === "status-code") {
381
+ switch (_response.error.statusCode) {
382
+ case 422:
383
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
384
+ default:
385
+ throw new errors.ChrtError({
386
+ statusCode: _response.error.statusCode,
387
+ body: _response.error.body,
388
+ rawResponse: _response.rawResponse,
389
+ });
390
+ }
391
+ }
392
+ switch (_response.error.reason) {
393
+ case "non-json":
394
+ throw new errors.ChrtError({
395
+ statusCode: _response.error.statusCode,
396
+ body: _response.error.rawBody,
397
+ rawResponse: _response.rawResponse,
398
+ });
399
+ case "timeout":
400
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_ref/v1/{order_ref}.");
401
+ case "unknown":
402
+ throw new errors.ChrtError({
403
+ message: _response.error.errorMessage,
404
+ rawResponse: _response.rawResponse,
405
+ });
406
+ }
407
+ });
408
+ }
409
+ /**
410
+ * Retrieves the case for a given order short ID. | authz: min_org_role=operator | () -> (Case1)
411
+ *
412
+ * @param {string} orderShortId
413
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
414
+ *
415
+ * @throws {@link Chrt.UnprocessableEntityError}
416
+ *
417
+ * @example
418
+ * await client.operations.cases.getByOrderShortIdV1("order_short_id")
419
+ */
420
+ getByOrderShortIdV1(orderShortId, requestOptions) {
421
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderShortIdV1(orderShortId, requestOptions));
422
+ }
423
+ __getByOrderShortIdV1(orderShortId, requestOptions) {
424
+ return __awaiter(this, void 0, void 0, function* () {
425
+ var _a, _b, _c, _d;
426
+ 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);
427
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
428
+ 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/cases/by_order_short_id/v1/${encodeURIComponent(orderShortId)}`),
429
+ method: "GET",
430
+ headers: _headers,
431
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
432
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
433
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
434
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
435
+ });
436
+ if (_response.ok) {
437
+ return { data: _response.body, rawResponse: _response.rawResponse };
438
+ }
439
+ if (_response.error.reason === "status-code") {
440
+ switch (_response.error.statusCode) {
441
+ case 422:
442
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
443
+ default:
444
+ throw new errors.ChrtError({
445
+ statusCode: _response.error.statusCode,
446
+ body: _response.error.body,
447
+ rawResponse: _response.rawResponse,
448
+ });
449
+ }
450
+ }
451
+ switch (_response.error.reason) {
452
+ case "non-json":
453
+ throw new errors.ChrtError({
454
+ statusCode: _response.error.statusCode,
455
+ body: _response.error.rawBody,
456
+ rawResponse: _response.rawResponse,
457
+ });
458
+ case "timeout":
459
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_short_id/v1/{order_short_id}.");
460
+ case "unknown":
461
+ throw new errors.ChrtError({
462
+ message: _response.error.errorMessage,
463
+ rawResponse: _response.rawResponse,
464
+ });
465
+ }
466
+ });
467
+ }
468
+ /**
469
+ * Updates whether a case needs action. | authz: min_org_role=operator | (CaseNeedsActionReq) -> (bool)
470
+ *
471
+ * @param {string} caseId
472
+ * @param {Chrt.operations.CaseNeedsActionReq} request
473
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
474
+ *
475
+ * @throws {@link Chrt.UnprocessableEntityError}
476
+ *
477
+ * @example
478
+ * await client.operations.cases.updateNeedsActionV1("case_id", {
479
+ * needs_action: true
480
+ * })
481
+ */
482
+ updateNeedsActionV1(caseId, request, requestOptions) {
483
+ return core.HttpResponsePromise.fromPromise(this.__updateNeedsActionV1(caseId, request, requestOptions));
484
+ }
485
+ __updateNeedsActionV1(caseId, request, requestOptions) {
486
+ return __awaiter(this, void 0, void 0, function* () {
487
+ var _a, _b, _c, _d;
488
+ 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);
489
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
490
+ 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/cases/needs_action/v1/${encodeURIComponent(caseId)}`),
491
+ method: "PATCH",
492
+ headers: _headers,
493
+ contentType: "application/json",
494
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
495
+ requestType: "json",
496
+ body: request,
497
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
498
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
499
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
500
+ });
501
+ if (_response.ok) {
502
+ return { data: _response.body, rawResponse: _response.rawResponse };
503
+ }
504
+ if (_response.error.reason === "status-code") {
505
+ switch (_response.error.statusCode) {
506
+ case 422:
507
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
508
+ default:
509
+ throw new errors.ChrtError({
510
+ statusCode: _response.error.statusCode,
511
+ body: _response.error.body,
512
+ rawResponse: _response.rawResponse,
513
+ });
514
+ }
515
+ }
516
+ switch (_response.error.reason) {
517
+ case "non-json":
518
+ throw new errors.ChrtError({
519
+ statusCode: _response.error.statusCode,
520
+ body: _response.error.rawBody,
521
+ rawResponse: _response.rawResponse,
522
+ });
523
+ case "timeout":
524
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/needs_action/v1/{case_id}.");
525
+ case "unknown":
526
+ throw new errors.ChrtError({
527
+ message: _response.error.errorMessage,
528
+ rawResponse: _response.rawResponse,
529
+ });
530
+ }
531
+ });
532
+ }
533
+ /**
534
+ * Updates a case's status. Closing a case also clears needs_action. | authz: min_org_role=operator | (CaseStatusReq) -> (bool)
535
+ *
536
+ * @param {string} caseId
537
+ * @param {Chrt.operations.CaseStatusReq} request
538
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
539
+ *
540
+ * @throws {@link Chrt.UnprocessableEntityError}
541
+ *
542
+ * @example
543
+ * await client.operations.cases.updateStatusV1("case_id", {
544
+ * status: "open"
545
+ * })
546
+ */
547
+ updateStatusV1(caseId, request, requestOptions) {
548
+ return core.HttpResponsePromise.fromPromise(this.__updateStatusV1(caseId, request, requestOptions));
549
+ }
550
+ __updateStatusV1(caseId, request, requestOptions) {
551
+ return __awaiter(this, void 0, void 0, function* () {
552
+ var _a, _b, _c, _d;
553
+ 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);
554
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
555
+ 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/cases/status/v1/${encodeURIComponent(caseId)}`),
556
+ method: "PATCH",
557
+ headers: _headers,
558
+ contentType: "application/json",
559
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
560
+ requestType: "json",
561
+ body: request,
562
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
563
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
564
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
565
+ });
566
+ if (_response.ok) {
567
+ return { data: _response.body, rawResponse: _response.rawResponse };
568
+ }
569
+ if (_response.error.reason === "status-code") {
570
+ switch (_response.error.statusCode) {
571
+ case 422:
572
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
573
+ default:
574
+ throw new errors.ChrtError({
575
+ statusCode: _response.error.statusCode,
576
+ body: _response.error.body,
577
+ rawResponse: _response.rawResponse,
578
+ });
579
+ }
580
+ }
581
+ switch (_response.error.reason) {
582
+ case "non-json":
583
+ throw new errors.ChrtError({
584
+ statusCode: _response.error.statusCode,
585
+ body: _response.error.rawBody,
586
+ rawResponse: _response.rawResponse,
587
+ });
588
+ case "timeout":
589
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/status/v1/{case_id}.");
590
+ case "unknown":
591
+ throw new errors.ChrtError({
592
+ message: _response.error.errorMessage,
593
+ rawResponse: _response.rawResponse,
594
+ });
595
+ }
596
+ });
597
+ }
345
598
  /**
346
599
  * Adds operator(s) to a case. | authz: min_org_role=operator | (CaseAssignReq) -> (bool)
347
600
  *
@@ -537,6 +790,66 @@ class Cases {
537
790
  }
538
791
  });
539
792
  }
793
+ /**
794
+ * Deletes a message from a case. | authz: min_org_role=operator | () -> (bool)
795
+ *
796
+ * @param {string} caseId
797
+ * @param {string} messageId
798
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
799
+ *
800
+ * @throws {@link Chrt.UnprocessableEntityError}
801
+ *
802
+ * @example
803
+ * await client.operations.cases.deleteMessageV1("case_id", "message_id")
804
+ */
805
+ deleteMessageV1(caseId, messageId, requestOptions) {
806
+ return core.HttpResponsePromise.fromPromise(this.__deleteMessageV1(caseId, messageId, requestOptions));
807
+ }
808
+ __deleteMessageV1(caseId, messageId, requestOptions) {
809
+ return __awaiter(this, void 0, void 0, function* () {
810
+ var _a, _b, _c, _d;
811
+ 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);
812
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
813
+ 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/cases/delete_message/v1/${encodeURIComponent(caseId)}/${encodeURIComponent(messageId)}`),
814
+ method: "DELETE",
815
+ headers: _headers,
816
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
817
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
818
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
819
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
820
+ });
821
+ if (_response.ok) {
822
+ return { data: _response.body, rawResponse: _response.rawResponse };
823
+ }
824
+ if (_response.error.reason === "status-code") {
825
+ switch (_response.error.statusCode) {
826
+ case 422:
827
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
828
+ default:
829
+ throw new errors.ChrtError({
830
+ statusCode: _response.error.statusCode,
831
+ body: _response.error.body,
832
+ rawResponse: _response.rawResponse,
833
+ });
834
+ }
835
+ }
836
+ switch (_response.error.reason) {
837
+ case "non-json":
838
+ throw new errors.ChrtError({
839
+ statusCode: _response.error.statusCode,
840
+ body: _response.error.rawBody,
841
+ rawResponse: _response.rawResponse,
842
+ });
843
+ case "timeout":
844
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /operations/cases/delete_message/v1/{case_id}/{message_id}.");
845
+ case "unknown":
846
+ throw new errors.ChrtError({
847
+ message: _response.error.errorMessage,
848
+ rawResponse: _response.rawResponse,
849
+ });
850
+ }
851
+ });
852
+ }
540
853
  _getAuthorizationHeader() {
541
854
  return __awaiter(this, void 0, void 0, function* () {
542
855
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * needs_action: true
8
+ * }
9
+ */
10
+ export interface CaseNeedsActionReq {
11
+ needs_action: boolean;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * status: "open"
9
+ * }
10
+ */
11
+ export interface CaseStatusReq {
12
+ status: Chrt.CaseStatusEnum;
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,7 @@
1
1
  export { type CasesListV1Request } from "./CasesListV1Request.js";
2
2
  export { type CaseClientUpdate1 } from "./CaseClientUpdate1.js";
3
+ export { type CaseNeedsActionReq } from "./CaseNeedsActionReq.js";
4
+ export { type CaseStatusReq } from "./CaseStatusReq.js";
3
5
  export { type CaseAssignReq } from "./CaseAssignReq.js";
4
6
  export { type CaseUnassignReq } from "./CaseUnassignReq.js";
5
7
  export { type CaseAddMessageReq } from "./CaseAddMessageReq.js";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./resources/index.js";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./resources/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * as s3Objects from "./s3Objects/index.js";
2
+ export * from "./s3Objects/client/requests/index.js";
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.s3Objects = void 0;
40
+ exports.s3Objects = __importStar(require("./s3Objects/index.js"));
41
+ __exportStar(require("./s3Objects/client/requests/index.js"), exports);