@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
@@ -241,7 +241,7 @@ export class BillingLedgers {
241
241
  });
242
242
  }
243
243
  /**
244
- * 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)
244
+ * 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)
245
245
  *
246
246
  * @param {string} id
247
247
  * @param {Chrt.billing.BillingLedgerClientUpdate1} request
@@ -10,6 +10,7 @@ import * as Chrt from "../../../../../../index.mjs";
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.mjs";
5
5
  import * as core from "../../../../../../core/index.mjs";
6
6
  import * as Chrt from "../../../../../index.mjs";
7
+ import { S3Objects } from "../resources/s3Objects/client/Client.mjs";
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
  }
@@ -15,10 +15,15 @@ import * as core from "../../../../../../core/index.mjs";
15
15
  import * as Chrt from "../../../../../index.mjs";
16
16
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
17
  import * as errors from "../../../../../../errors/index.mjs";
18
+ import { S3Objects } from "../resources/s3Objects/client/Client.mjs";
18
19
  export class Cases {
19
20
  constructor(_options = {}) {
20
21
  this._options = _options;
21
22
  }
23
+ get s3Objects() {
24
+ var _a;
25
+ return ((_a = this._s3Objects) !== null && _a !== void 0 ? _a : (this._s3Objects = new S3Objects(this._options)));
26
+ }
22
27
  /**
23
28
  * Lists cases for the caller's organization with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (CaseListRes)
24
29
  *
@@ -306,6 +311,254 @@ export class Cases {
306
311
  }
307
312
  });
308
313
  }
314
+ /**
315
+ * Retrieves the case for a given order ID, short ID, or off-chrt reference ID. | authz: min_org_role=operator | () -> (Case1)
316
+ *
317
+ * @param {string} orderRef - Order ID, short ID, or off-chrt reference ID
318
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
319
+ *
320
+ * @throws {@link Chrt.UnprocessableEntityError}
321
+ *
322
+ * @example
323
+ * await client.operations.cases.getByOrderRefV1("order_ref")
324
+ */
325
+ getByOrderRefV1(orderRef, requestOptions) {
326
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderRefV1(orderRef, requestOptions));
327
+ }
328
+ __getByOrderRefV1(orderRef, requestOptions) {
329
+ return __awaiter(this, void 0, void 0, function* () {
330
+ var _a, _b, _c, _d;
331
+ 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);
332
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
333
+ 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)}`),
334
+ method: "GET",
335
+ headers: _headers,
336
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
337
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
338
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
339
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
340
+ });
341
+ if (_response.ok) {
342
+ return { data: _response.body, rawResponse: _response.rawResponse };
343
+ }
344
+ if (_response.error.reason === "status-code") {
345
+ switch (_response.error.statusCode) {
346
+ case 422:
347
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
348
+ default:
349
+ throw new errors.ChrtError({
350
+ statusCode: _response.error.statusCode,
351
+ body: _response.error.body,
352
+ rawResponse: _response.rawResponse,
353
+ });
354
+ }
355
+ }
356
+ switch (_response.error.reason) {
357
+ case "non-json":
358
+ throw new errors.ChrtError({
359
+ statusCode: _response.error.statusCode,
360
+ body: _response.error.rawBody,
361
+ rawResponse: _response.rawResponse,
362
+ });
363
+ case "timeout":
364
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_ref/v1/{order_ref}.");
365
+ case "unknown":
366
+ throw new errors.ChrtError({
367
+ message: _response.error.errorMessage,
368
+ rawResponse: _response.rawResponse,
369
+ });
370
+ }
371
+ });
372
+ }
373
+ /**
374
+ * Retrieves the case for a given order short ID. | authz: min_org_role=operator | () -> (Case1)
375
+ *
376
+ * @param {string} orderShortId
377
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
378
+ *
379
+ * @throws {@link Chrt.UnprocessableEntityError}
380
+ *
381
+ * @example
382
+ * await client.operations.cases.getByOrderShortIdV1("order_short_id")
383
+ */
384
+ getByOrderShortIdV1(orderShortId, requestOptions) {
385
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderShortIdV1(orderShortId, requestOptions));
386
+ }
387
+ __getByOrderShortIdV1(orderShortId, requestOptions) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ var _a, _b, _c, _d;
390
+ 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);
391
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
392
+ 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)}`),
393
+ method: "GET",
394
+ headers: _headers,
395
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
396
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
397
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
398
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
399
+ });
400
+ if (_response.ok) {
401
+ return { data: _response.body, rawResponse: _response.rawResponse };
402
+ }
403
+ if (_response.error.reason === "status-code") {
404
+ switch (_response.error.statusCode) {
405
+ case 422:
406
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
407
+ default:
408
+ throw new errors.ChrtError({
409
+ statusCode: _response.error.statusCode,
410
+ body: _response.error.body,
411
+ rawResponse: _response.rawResponse,
412
+ });
413
+ }
414
+ }
415
+ switch (_response.error.reason) {
416
+ case "non-json":
417
+ throw new errors.ChrtError({
418
+ statusCode: _response.error.statusCode,
419
+ body: _response.error.rawBody,
420
+ rawResponse: _response.rawResponse,
421
+ });
422
+ case "timeout":
423
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_short_id/v1/{order_short_id}.");
424
+ case "unknown":
425
+ throw new errors.ChrtError({
426
+ message: _response.error.errorMessage,
427
+ rawResponse: _response.rawResponse,
428
+ });
429
+ }
430
+ });
431
+ }
432
+ /**
433
+ * Updates whether a case needs action. | authz: min_org_role=operator | (CaseNeedsActionReq) -> (bool)
434
+ *
435
+ * @param {string} caseId
436
+ * @param {Chrt.operations.CaseNeedsActionReq} request
437
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
438
+ *
439
+ * @throws {@link Chrt.UnprocessableEntityError}
440
+ *
441
+ * @example
442
+ * await client.operations.cases.updateNeedsActionV1("case_id", {
443
+ * needs_action: true
444
+ * })
445
+ */
446
+ updateNeedsActionV1(caseId, request, requestOptions) {
447
+ return core.HttpResponsePromise.fromPromise(this.__updateNeedsActionV1(caseId, request, requestOptions));
448
+ }
449
+ __updateNeedsActionV1(caseId, request, requestOptions) {
450
+ return __awaiter(this, void 0, void 0, function* () {
451
+ var _a, _b, _c, _d;
452
+ 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);
453
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
454
+ 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)}`),
455
+ method: "PATCH",
456
+ headers: _headers,
457
+ contentType: "application/json",
458
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
459
+ requestType: "json",
460
+ body: request,
461
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
462
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
463
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
464
+ });
465
+ if (_response.ok) {
466
+ return { data: _response.body, rawResponse: _response.rawResponse };
467
+ }
468
+ if (_response.error.reason === "status-code") {
469
+ switch (_response.error.statusCode) {
470
+ case 422:
471
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
472
+ default:
473
+ throw new errors.ChrtError({
474
+ statusCode: _response.error.statusCode,
475
+ body: _response.error.body,
476
+ rawResponse: _response.rawResponse,
477
+ });
478
+ }
479
+ }
480
+ switch (_response.error.reason) {
481
+ case "non-json":
482
+ throw new errors.ChrtError({
483
+ statusCode: _response.error.statusCode,
484
+ body: _response.error.rawBody,
485
+ rawResponse: _response.rawResponse,
486
+ });
487
+ case "timeout":
488
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/needs_action/v1/{case_id}.");
489
+ case "unknown":
490
+ throw new errors.ChrtError({
491
+ message: _response.error.errorMessage,
492
+ rawResponse: _response.rawResponse,
493
+ });
494
+ }
495
+ });
496
+ }
497
+ /**
498
+ * Updates a case's status. Closing a case also clears needs_action. | authz: min_org_role=operator | (CaseStatusReq) -> (bool)
499
+ *
500
+ * @param {string} caseId
501
+ * @param {Chrt.operations.CaseStatusReq} request
502
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
503
+ *
504
+ * @throws {@link Chrt.UnprocessableEntityError}
505
+ *
506
+ * @example
507
+ * await client.operations.cases.updateStatusV1("case_id", {
508
+ * status: "open"
509
+ * })
510
+ */
511
+ updateStatusV1(caseId, request, requestOptions) {
512
+ return core.HttpResponsePromise.fromPromise(this.__updateStatusV1(caseId, request, requestOptions));
513
+ }
514
+ __updateStatusV1(caseId, request, requestOptions) {
515
+ return __awaiter(this, void 0, void 0, function* () {
516
+ var _a, _b, _c, _d;
517
+ 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);
518
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
519
+ 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)}`),
520
+ method: "PATCH",
521
+ headers: _headers,
522
+ contentType: "application/json",
523
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
524
+ requestType: "json",
525
+ body: request,
526
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
527
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
528
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
529
+ });
530
+ if (_response.ok) {
531
+ return { data: _response.body, rawResponse: _response.rawResponse };
532
+ }
533
+ if (_response.error.reason === "status-code") {
534
+ switch (_response.error.statusCode) {
535
+ case 422:
536
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
537
+ default:
538
+ throw new errors.ChrtError({
539
+ statusCode: _response.error.statusCode,
540
+ body: _response.error.body,
541
+ rawResponse: _response.rawResponse,
542
+ });
543
+ }
544
+ }
545
+ switch (_response.error.reason) {
546
+ case "non-json":
547
+ throw new errors.ChrtError({
548
+ statusCode: _response.error.statusCode,
549
+ body: _response.error.rawBody,
550
+ rawResponse: _response.rawResponse,
551
+ });
552
+ case "timeout":
553
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/status/v1/{case_id}.");
554
+ case "unknown":
555
+ throw new errors.ChrtError({
556
+ message: _response.error.errorMessage,
557
+ rawResponse: _response.rawResponse,
558
+ });
559
+ }
560
+ });
561
+ }
309
562
  /**
310
563
  * Adds operator(s) to a case. | authz: min_org_role=operator | (CaseAssignReq) -> (bool)
311
564
  *
@@ -501,6 +754,66 @@ export class Cases {
501
754
  }
502
755
  });
503
756
  }
757
+ /**
758
+ * Deletes a message from a case. | authz: min_org_role=operator | () -> (bool)
759
+ *
760
+ * @param {string} caseId
761
+ * @param {string} messageId
762
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
763
+ *
764
+ * @throws {@link Chrt.UnprocessableEntityError}
765
+ *
766
+ * @example
767
+ * await client.operations.cases.deleteMessageV1("case_id", "message_id")
768
+ */
769
+ deleteMessageV1(caseId, messageId, requestOptions) {
770
+ return core.HttpResponsePromise.fromPromise(this.__deleteMessageV1(caseId, messageId, requestOptions));
771
+ }
772
+ __deleteMessageV1(caseId, messageId, requestOptions) {
773
+ return __awaiter(this, void 0, void 0, function* () {
774
+ var _a, _b, _c, _d;
775
+ 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);
776
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
777
+ 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)}`),
778
+ method: "DELETE",
779
+ headers: _headers,
780
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
781
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
782
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
783
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
784
+ });
785
+ if (_response.ok) {
786
+ return { data: _response.body, rawResponse: _response.rawResponse };
787
+ }
788
+ if (_response.error.reason === "status-code") {
789
+ switch (_response.error.statusCode) {
790
+ case 422:
791
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
792
+ default:
793
+ throw new errors.ChrtError({
794
+ statusCode: _response.error.statusCode,
795
+ body: _response.error.body,
796
+ rawResponse: _response.rawResponse,
797
+ });
798
+ }
799
+ }
800
+ switch (_response.error.reason) {
801
+ case "non-json":
802
+ throw new errors.ChrtError({
803
+ statusCode: _response.error.statusCode,
804
+ body: _response.error.rawBody,
805
+ rawResponse: _response.rawResponse,
806
+ });
807
+ case "timeout":
808
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /operations/cases/delete_message/v1/{case_id}/{message_id}.");
809
+ case "unknown":
810
+ throw new errors.ChrtError({
811
+ message: _response.error.errorMessage,
812
+ rawResponse: _response.rawResponse,
813
+ });
814
+ }
815
+ });
816
+ }
504
817
  _getAuthorizationHeader() {
505
818
  return __awaiter(this, void 0, void 0, function* () {
506
819
  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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,13 @@
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
+ * status: "open"
9
+ * }
10
+ */
11
+ export interface CaseStatusReq {
12
+ status: Chrt.CaseStatusEnum;
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -1,5 +1,7 @@
1
1
  export { type CasesListV1Request } from "./CasesListV1Request.mjs";
2
2
  export { type CaseClientUpdate1 } from "./CaseClientUpdate1.mjs";
3
+ export { type CaseNeedsActionReq } from "./CaseNeedsActionReq.mjs";
4
+ export { type CaseStatusReq } from "./CaseStatusReq.mjs";
3
5
  export { type CaseAssignReq } from "./CaseAssignReq.mjs";
4
6
  export { type CaseUnassignReq } from "./CaseUnassignReq.mjs";
5
7
  export { type CaseAddMessageReq } from "./CaseAddMessageReq.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * as s3Objects from "./s3Objects/index.mjs";
2
+ export * from "./s3Objects/client/requests/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * as s3Objects from "./s3Objects/index.mjs";
2
+ export * from "./s3Objects/client/requests/index.mjs";
@@ -0,0 +1,83 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../../../environments.mjs";
5
+ import * as core from "../../../../../../../../core/index.mjs";
6
+ import * as Chrt from "../../../../../../../index.mjs";
7
+ export declare namespace S3Objects {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<core.BearerToken | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional query string parameters to include in the request. */
25
+ queryParams?: Record<string, unknown>;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
+ }
29
+ }
30
+ export declare class S3Objects {
31
+ protected readonly _options: S3Objects.Options;
32
+ constructor(_options?: S3Objects.Options);
33
+ /**
34
+ * Retrieves metadata for a case S3 object. | authz: min_org_role=operator | () -> (CaseS3ObjectMetadata1)
35
+ *
36
+ * @param {string} caseS3ObjectMetadataId
37
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.operations.cases.s3Objects.getS3ObjectMetadataV1("case_s3_object_metadata_id")
43
+ */
44
+ getS3ObjectMetadataV1(caseS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<Chrt.CaseS3ObjectMetadata1>;
45
+ private __getS3ObjectMetadataV1;
46
+ /**
47
+ * Streams a case S3 object file from storage. | authz: min_org_role=operator | () -> (binary)
48
+ * @throws {@link Chrt.UnprocessableEntityError}
49
+ */
50
+ getV1(caseS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
51
+ private __getV1;
52
+ /**
53
+ * Uploads a file to a case. Automatic blurhash generation for images. | authz: min_org_role=operator | (UploadFile) -> (bool)
54
+ *
55
+ * @param {string} caseId
56
+ * @param {Chrt.operations.cases.BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost} request
57
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link Chrt.UnprocessableEntityError}
60
+ *
61
+ * @example
62
+ * import { createReadStream } from "fs";
63
+ * await client.operations.cases.s3Objects.addV1("case_id", {
64
+ * file: fs.createReadStream("/path/to/your/file")
65
+ * })
66
+ */
67
+ addV1(caseId: string, request: Chrt.operations.cases.BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<boolean>;
68
+ private __addV1;
69
+ /**
70
+ * Deletes an S3 object metadata and the associated S3 object from a case. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
71
+ *
72
+ * @param {string} caseS3ObjectMetadataId
73
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Chrt.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.operations.cases.s3Objects.deleteV1("case_s3_object_metadata_id")
79
+ */
80
+ deleteV1(caseS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<boolean>;
81
+ private __deleteV1;
82
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
83
+ }