@chrt-inc/typescript-sdk 1.662.0 → 1.662.1

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 (164) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billing/resources/billingLedgerPeriods/client/Client.d.ts +1 -0
  3. package/dist/cjs/api/resources/billing/resources/billingLedgerPeriods/client/Client.js +1 -0
  4. package/dist/cjs/api/resources/billing/resources/billingLedgerPeriods/client/requests/BillingLedgerPeriodsListV1Request.d.ts +1 -0
  5. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/Client.d.ts +2 -1
  6. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/Client.js +2 -1
  7. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientCreate1.d.ts +1 -0
  8. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientUpdate1.d.ts +2 -0
  9. package/dist/cjs/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgersListV1Request.d.ts +1 -0
  10. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.d.ts +1 -0
  11. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +1 -0
  12. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupsListV1Request.d.ts +1 -0
  13. package/dist/cjs/api/resources/billing/resources/statements/client/Client.d.ts +2 -0
  14. package/dist/cjs/api/resources/billing/resources/statements/client/Client.js +2 -0
  15. package/dist/cjs/api/resources/billing/resources/statements/client/requests/StatementsExpandedListV1Request.d.ts +1 -0
  16. package/dist/cjs/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.ts +1 -0
  17. package/dist/cjs/api/resources/listing/resources/bidThreads/client/Client.d.ts +2 -0
  18. package/dist/cjs/api/resources/listing/resources/bidThreads/client/Client.js +2 -0
  19. package/dist/cjs/api/resources/listing/resources/bidThreads/client/requests/BidThreadsListForBidderV1Request.d.ts +1 -0
  20. package/dist/cjs/api/resources/listing/resources/bidThreads/client/requests/BidThreadsListForListingV1Request.d.ts +1 -0
  21. package/dist/cjs/api/resources/listing/resources/listings/client/Client.d.ts +6 -0
  22. package/dist/cjs/api/resources/listing/resources/listings/client/Client.js +6 -0
  23. package/dist/cjs/api/resources/listing/resources/listings/client/requests/ListingsListByOrgV1Request.d.ts +2 -0
  24. package/dist/cjs/api/resources/listing/resources/listings/client/requests/ListingsListForDriverBidderV1Request.d.ts +2 -0
  25. package/dist/cjs/api/resources/listing/resources/listings/client/requests/ListingsListForProviderBidderV1Request.d.ts +2 -0
  26. package/dist/cjs/api/resources/operations/resources/cases/client/Client.d.ts +77 -0
  27. package/dist/cjs/api/resources/operations/resources/cases/client/Client.js +315 -0
  28. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.d.ts +12 -0
  29. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.js +5 -0
  30. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseStatusReq.d.ts +13 -0
  31. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CaseStatusReq.js +5 -0
  32. package/dist/cjs/api/resources/operations/resources/cases/client/requests/CasesListV1Request.d.ts +2 -0
  33. package/dist/cjs/api/resources/operations/resources/cases/client/requests/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/operations/resources/cases/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/operations/resources/cases/index.js +1 -0
  36. package/dist/cjs/api/resources/operations/resources/cases/resources/index.d.ts +2 -0
  37. package/dist/cjs/api/resources/operations/resources/cases/resources/index.js +41 -0
  38. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/Client.d.ts +83 -0
  39. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/Client.js +308 -0
  40. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/index.d.ts +2 -0
  41. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/index.js +17 -0
  42. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.d.ts +13 -0
  43. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.js +5 -0
  44. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/operations/resources/cases/resources/s3Objects/index.js +17 -0
  48. package/dist/cjs/api/resources/operations/resources/departments/client/Client.d.ts +2 -1
  49. package/dist/cjs/api/resources/operations/resources/departments/client/Client.js +2 -1
  50. package/dist/cjs/api/resources/operations/resources/departments/client/requests/DepartmentsListV1Request.d.ts +2 -1
  51. package/dist/cjs/api/resources/orgs/client/Client.d.ts +1 -0
  52. package/dist/cjs/api/resources/orgs/client/Client.js +1 -0
  53. package/dist/cjs/api/resources/orgs/client/requests/OrgsListMembersV1Request.d.ts +1 -0
  54. package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.d.ts +1 -0
  55. package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.js +1 -0
  56. package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.ts +1 -0
  57. package/dist/cjs/api/resources/shipping/resources/orderSchedules/client/Client.d.ts +2 -0
  58. package/dist/cjs/api/resources/shipping/resources/orderSchedules/client/Client.js +2 -0
  59. package/dist/cjs/api/resources/shipping/resources/orderSchedules/client/requests/OrderSchedulesListV1Request.d.ts +2 -0
  60. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.ts +2 -0
  61. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +2 -0
  62. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.ts +1 -0
  63. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.ts +1 -0
  64. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.d.ts +1 -1
  65. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.js +1 -1
  66. package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.d.ts +2 -0
  67. package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.js +2 -0
  68. package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForDriverForExecutorV1Request.d.ts +1 -0
  69. package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForExecutorOperatorsV1Request.d.ts +1 -0
  70. package/dist/cjs/api/types/BillingLedger1.d.ts +1 -0
  71. package/dist/cjs/api/types/CallerCredentialTypeEnum.d.ts +1 -2
  72. package/dist/cjs/api/types/CallerCredentialTypeEnum.js +0 -1
  73. package/dist/cjs/api/types/Case1.d.ts +4 -0
  74. package/dist/cjs/api/types/CaseMessage1.d.ts +1 -0
  75. package/dist/cjs/api/types/CaseS3ObjectMetadata1.d.ts +19 -0
  76. package/dist/cjs/api/types/CaseS3ObjectMetadata1.js +5 -0
  77. package/dist/cjs/api/types/OrgPrivateData1.d.ts +1 -0
  78. package/dist/cjs/api/types/index.d.ts +1 -0
  79. package/dist/cjs/api/types/index.js +1 -0
  80. package/dist/cjs/version.d.ts +1 -1
  81. package/dist/cjs/version.js +1 -1
  82. package/dist/esm/Client.mjs +2 -2
  83. package/dist/esm/api/resources/billing/resources/billingLedgerPeriods/client/Client.d.mts +1 -0
  84. package/dist/esm/api/resources/billing/resources/billingLedgerPeriods/client/Client.mjs +1 -0
  85. package/dist/esm/api/resources/billing/resources/billingLedgerPeriods/client/requests/BillingLedgerPeriodsListV1Request.d.mts +1 -0
  86. package/dist/esm/api/resources/billing/resources/billingLedgers/client/Client.d.mts +2 -1
  87. package/dist/esm/api/resources/billing/resources/billingLedgers/client/Client.mjs +2 -1
  88. package/dist/esm/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientCreate1.d.mts +1 -0
  89. package/dist/esm/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgerClientUpdate1.d.mts +2 -0
  90. package/dist/esm/api/resources/billing/resources/billingLedgers/client/requests/BillingLedgersListV1Request.d.mts +1 -0
  91. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.d.mts +1 -0
  92. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +1 -0
  93. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupsListV1Request.d.mts +1 -0
  94. package/dist/esm/api/resources/billing/resources/statements/client/Client.d.mts +2 -0
  95. package/dist/esm/api/resources/billing/resources/statements/client/Client.mjs +2 -0
  96. package/dist/esm/api/resources/billing/resources/statements/client/requests/StatementsExpandedListV1Request.d.mts +1 -0
  97. package/dist/esm/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.mts +1 -0
  98. package/dist/esm/api/resources/listing/resources/bidThreads/client/Client.d.mts +2 -0
  99. package/dist/esm/api/resources/listing/resources/bidThreads/client/Client.mjs +2 -0
  100. package/dist/esm/api/resources/listing/resources/bidThreads/client/requests/BidThreadsListForBidderV1Request.d.mts +1 -0
  101. package/dist/esm/api/resources/listing/resources/bidThreads/client/requests/BidThreadsListForListingV1Request.d.mts +1 -0
  102. package/dist/esm/api/resources/listing/resources/listings/client/Client.d.mts +6 -0
  103. package/dist/esm/api/resources/listing/resources/listings/client/Client.mjs +6 -0
  104. package/dist/esm/api/resources/listing/resources/listings/client/requests/ListingsListByOrgV1Request.d.mts +2 -0
  105. package/dist/esm/api/resources/listing/resources/listings/client/requests/ListingsListForDriverBidderV1Request.d.mts +2 -0
  106. package/dist/esm/api/resources/listing/resources/listings/client/requests/ListingsListForProviderBidderV1Request.d.mts +2 -0
  107. package/dist/esm/api/resources/operations/resources/cases/client/Client.d.mts +77 -0
  108. package/dist/esm/api/resources/operations/resources/cases/client/Client.mjs +315 -0
  109. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.d.mts +12 -0
  110. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseNeedsActionReq.mjs +4 -0
  111. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseStatusReq.d.mts +13 -0
  112. package/dist/esm/api/resources/operations/resources/cases/client/requests/CaseStatusReq.mjs +4 -0
  113. package/dist/esm/api/resources/operations/resources/cases/client/requests/CasesListV1Request.d.mts +2 -0
  114. package/dist/esm/api/resources/operations/resources/cases/client/requests/index.d.mts +2 -0
  115. package/dist/esm/api/resources/operations/resources/cases/index.d.mts +1 -0
  116. package/dist/esm/api/resources/operations/resources/cases/index.mjs +1 -0
  117. package/dist/esm/api/resources/operations/resources/cases/resources/index.d.mts +2 -0
  118. package/dist/esm/api/resources/operations/resources/cases/resources/index.mjs +2 -0
  119. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/Client.d.mts +83 -0
  120. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/Client.mjs +271 -0
  121. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/index.d.mts +2 -0
  122. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/index.mjs +1 -0
  123. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.d.mts +13 -0
  124. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/BodyPostCasesS3ObjectsAddV1OperationsCasesS3ObjectsAddV1CaseIdPost.mjs +4 -0
  125. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.d.mts +1 -0
  126. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/client/requests/index.mjs +1 -0
  127. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/index.d.mts +1 -0
  128. package/dist/esm/api/resources/operations/resources/cases/resources/s3Objects/index.mjs +1 -0
  129. package/dist/esm/api/resources/operations/resources/departments/client/Client.d.mts +2 -1
  130. package/dist/esm/api/resources/operations/resources/departments/client/Client.mjs +2 -1
  131. package/dist/esm/api/resources/operations/resources/departments/client/requests/DepartmentsListV1Request.d.mts +2 -1
  132. package/dist/esm/api/resources/orgs/client/Client.d.mts +1 -0
  133. package/dist/esm/api/resources/orgs/client/Client.mjs +1 -0
  134. package/dist/esm/api/resources/orgs/client/requests/OrgsListMembersV1Request.d.mts +1 -0
  135. package/dist/esm/api/resources/shipping/resources/drivers/client/Client.d.mts +1 -0
  136. package/dist/esm/api/resources/shipping/resources/drivers/client/Client.mjs +1 -0
  137. package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.mts +1 -0
  138. package/dist/esm/api/resources/shipping/resources/orderSchedules/client/Client.d.mts +2 -0
  139. package/dist/esm/api/resources/shipping/resources/orderSchedules/client/Client.mjs +2 -0
  140. package/dist/esm/api/resources/shipping/resources/orderSchedules/client/requests/OrderSchedulesListV1Request.d.mts +2 -0
  141. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.mts +2 -0
  142. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +2 -0
  143. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.mts +1 -0
  144. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.mts +1 -0
  145. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.d.mts +1 -1
  146. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.mjs +1 -1
  147. package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.d.mts +2 -0
  148. package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.mjs +2 -0
  149. package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForDriverForExecutorV1Request.d.mts +1 -0
  150. package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForExecutorOperatorsV1Request.d.mts +1 -0
  151. package/dist/esm/api/types/BillingLedger1.d.mts +1 -0
  152. package/dist/esm/api/types/CallerCredentialTypeEnum.d.mts +1 -2
  153. package/dist/esm/api/types/CallerCredentialTypeEnum.mjs +0 -1
  154. package/dist/esm/api/types/Case1.d.mts +4 -0
  155. package/dist/esm/api/types/CaseMessage1.d.mts +1 -0
  156. package/dist/esm/api/types/CaseS3ObjectMetadata1.d.mts +19 -0
  157. package/dist/esm/api/types/CaseS3ObjectMetadata1.mjs +4 -0
  158. package/dist/esm/api/types/OrgPrivateData1.d.mts +1 -0
  159. package/dist/esm/api/types/index.d.mts +1 -0
  160. package/dist/esm/api/types/index.mjs +1 -0
  161. package/dist/esm/version.d.mts +1 -1
  162. package/dist/esm/version.mjs +1 -1
  163. package/package.json +1 -1
  164. package/reference.md +692 -61
@@ -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
  *
@@ -33,6 +38,8 @@ export class Cases {
33
38
  * sort_order: "asc",
34
39
  * page: 1,
35
40
  * page_size: 1,
41
+ * filter_status: ["open"],
42
+ * filter_department_id: ["filter_department_id"],
36
43
  * filter_assigned_operator_user_id: "filter_assigned_operator_user_id",
37
44
  * filter_needs_action: true,
38
45
  * filter_unassigned: true
@@ -306,6 +313,254 @@ export class Cases {
306
313
  }
307
314
  });
308
315
  }
316
+ /**
317
+ * Retrieves the case for a given order ID, short ID, or off-chrt reference ID. | authz: min_org_role=operator | () -> (Case1)
318
+ *
319
+ * @param {string} orderRef - Order ID, short ID, or off-chrt reference ID
320
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
321
+ *
322
+ * @throws {@link Chrt.UnprocessableEntityError}
323
+ *
324
+ * @example
325
+ * await client.operations.cases.getByOrderRefV1("order_ref")
326
+ */
327
+ getByOrderRefV1(orderRef, requestOptions) {
328
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderRefV1(orderRef, requestOptions));
329
+ }
330
+ __getByOrderRefV1(orderRef, requestOptions) {
331
+ return __awaiter(this, void 0, void 0, function* () {
332
+ var _a, _b, _c, _d;
333
+ 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);
334
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
335
+ 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)}`),
336
+ method: "GET",
337
+ headers: _headers,
338
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
339
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
340
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
341
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
342
+ });
343
+ if (_response.ok) {
344
+ return { data: _response.body, rawResponse: _response.rawResponse };
345
+ }
346
+ if (_response.error.reason === "status-code") {
347
+ switch (_response.error.statusCode) {
348
+ case 422:
349
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
350
+ default:
351
+ throw new errors.ChrtError({
352
+ statusCode: _response.error.statusCode,
353
+ body: _response.error.body,
354
+ rawResponse: _response.rawResponse,
355
+ });
356
+ }
357
+ }
358
+ switch (_response.error.reason) {
359
+ case "non-json":
360
+ throw new errors.ChrtError({
361
+ statusCode: _response.error.statusCode,
362
+ body: _response.error.rawBody,
363
+ rawResponse: _response.rawResponse,
364
+ });
365
+ case "timeout":
366
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_ref/v1/{order_ref}.");
367
+ case "unknown":
368
+ throw new errors.ChrtError({
369
+ message: _response.error.errorMessage,
370
+ rawResponse: _response.rawResponse,
371
+ });
372
+ }
373
+ });
374
+ }
375
+ /**
376
+ * Retrieves the case for a given order short ID. | authz: min_org_role=operator | () -> (Case1)
377
+ *
378
+ * @param {string} orderShortId
379
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
380
+ *
381
+ * @throws {@link Chrt.UnprocessableEntityError}
382
+ *
383
+ * @example
384
+ * await client.operations.cases.getByOrderShortIdV1("order_short_id")
385
+ */
386
+ getByOrderShortIdV1(orderShortId, requestOptions) {
387
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderShortIdV1(orderShortId, requestOptions));
388
+ }
389
+ __getByOrderShortIdV1(orderShortId, requestOptions) {
390
+ return __awaiter(this, void 0, void 0, function* () {
391
+ var _a, _b, _c, _d;
392
+ 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);
393
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
394
+ 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)}`),
395
+ method: "GET",
396
+ headers: _headers,
397
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
398
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
399
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
400
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
401
+ });
402
+ if (_response.ok) {
403
+ return { data: _response.body, rawResponse: _response.rawResponse };
404
+ }
405
+ if (_response.error.reason === "status-code") {
406
+ switch (_response.error.statusCode) {
407
+ case 422:
408
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
409
+ default:
410
+ throw new errors.ChrtError({
411
+ statusCode: _response.error.statusCode,
412
+ body: _response.error.body,
413
+ rawResponse: _response.rawResponse,
414
+ });
415
+ }
416
+ }
417
+ switch (_response.error.reason) {
418
+ case "non-json":
419
+ throw new errors.ChrtError({
420
+ statusCode: _response.error.statusCode,
421
+ body: _response.error.rawBody,
422
+ rawResponse: _response.rawResponse,
423
+ });
424
+ case "timeout":
425
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /operations/cases/by_order_short_id/v1/{order_short_id}.");
426
+ case "unknown":
427
+ throw new errors.ChrtError({
428
+ message: _response.error.errorMessage,
429
+ rawResponse: _response.rawResponse,
430
+ });
431
+ }
432
+ });
433
+ }
434
+ /**
435
+ * Updates whether a case needs action. | authz: min_org_role=operator | (CaseNeedsActionReq) -> (bool)
436
+ *
437
+ * @param {string} caseId
438
+ * @param {Chrt.operations.CaseNeedsActionReq} request
439
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
440
+ *
441
+ * @throws {@link Chrt.UnprocessableEntityError}
442
+ *
443
+ * @example
444
+ * await client.operations.cases.updateNeedsActionV1("case_id", {
445
+ * needs_action: true
446
+ * })
447
+ */
448
+ updateNeedsActionV1(caseId, request, requestOptions) {
449
+ return core.HttpResponsePromise.fromPromise(this.__updateNeedsActionV1(caseId, request, requestOptions));
450
+ }
451
+ __updateNeedsActionV1(caseId, request, requestOptions) {
452
+ return __awaiter(this, void 0, void 0, function* () {
453
+ var _a, _b, _c, _d;
454
+ 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);
455
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
456
+ 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)}`),
457
+ method: "PATCH",
458
+ headers: _headers,
459
+ contentType: "application/json",
460
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
461
+ requestType: "json",
462
+ body: request,
463
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
464
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
465
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
466
+ });
467
+ if (_response.ok) {
468
+ return { data: _response.body, rawResponse: _response.rawResponse };
469
+ }
470
+ if (_response.error.reason === "status-code") {
471
+ switch (_response.error.statusCode) {
472
+ case 422:
473
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
474
+ default:
475
+ throw new errors.ChrtError({
476
+ statusCode: _response.error.statusCode,
477
+ body: _response.error.body,
478
+ rawResponse: _response.rawResponse,
479
+ });
480
+ }
481
+ }
482
+ switch (_response.error.reason) {
483
+ case "non-json":
484
+ throw new errors.ChrtError({
485
+ statusCode: _response.error.statusCode,
486
+ body: _response.error.rawBody,
487
+ rawResponse: _response.rawResponse,
488
+ });
489
+ case "timeout":
490
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/needs_action/v1/{case_id}.");
491
+ case "unknown":
492
+ throw new errors.ChrtError({
493
+ message: _response.error.errorMessage,
494
+ rawResponse: _response.rawResponse,
495
+ });
496
+ }
497
+ });
498
+ }
499
+ /**
500
+ * Updates a case's status. Closing a case also clears needs_action. | authz: min_org_role=operator | (CaseStatusReq) -> (bool)
501
+ *
502
+ * @param {string} caseId
503
+ * @param {Chrt.operations.CaseStatusReq} request
504
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
505
+ *
506
+ * @throws {@link Chrt.UnprocessableEntityError}
507
+ *
508
+ * @example
509
+ * await client.operations.cases.updateStatusV1("case_id", {
510
+ * status: "open"
511
+ * })
512
+ */
513
+ updateStatusV1(caseId, request, requestOptions) {
514
+ return core.HttpResponsePromise.fromPromise(this.__updateStatusV1(caseId, request, requestOptions));
515
+ }
516
+ __updateStatusV1(caseId, request, requestOptions) {
517
+ return __awaiter(this, void 0, void 0, function* () {
518
+ var _a, _b, _c, _d;
519
+ 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);
520
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
521
+ 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)}`),
522
+ method: "PATCH",
523
+ headers: _headers,
524
+ contentType: "application/json",
525
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
526
+ requestType: "json",
527
+ body: request,
528
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
529
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
530
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
531
+ });
532
+ if (_response.ok) {
533
+ return { data: _response.body, rawResponse: _response.rawResponse };
534
+ }
535
+ if (_response.error.reason === "status-code") {
536
+ switch (_response.error.statusCode) {
537
+ case 422:
538
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
539
+ default:
540
+ throw new errors.ChrtError({
541
+ statusCode: _response.error.statusCode,
542
+ body: _response.error.body,
543
+ rawResponse: _response.rawResponse,
544
+ });
545
+ }
546
+ }
547
+ switch (_response.error.reason) {
548
+ case "non-json":
549
+ throw new errors.ChrtError({
550
+ statusCode: _response.error.statusCode,
551
+ body: _response.error.rawBody,
552
+ rawResponse: _response.rawResponse,
553
+ });
554
+ case "timeout":
555
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /operations/cases/status/v1/{case_id}.");
556
+ case "unknown":
557
+ throw new errors.ChrtError({
558
+ message: _response.error.errorMessage,
559
+ rawResponse: _response.rawResponse,
560
+ });
561
+ }
562
+ });
563
+ }
309
564
  /**
310
565
  * Adds operator(s) to a case. | authz: min_org_role=operator | (CaseAssignReq) -> (bool)
311
566
  *
@@ -501,6 +756,66 @@ export class Cases {
501
756
  }
502
757
  });
503
758
  }
759
+ /**
760
+ * Deletes a message from a case. | authz: min_org_role=operator | () -> (bool)
761
+ *
762
+ * @param {string} caseId
763
+ * @param {string} messageId
764
+ * @param {Cases.RequestOptions} requestOptions - Request-specific configuration.
765
+ *
766
+ * @throws {@link Chrt.UnprocessableEntityError}
767
+ *
768
+ * @example
769
+ * await client.operations.cases.deleteMessageV1("case_id", "message_id")
770
+ */
771
+ deleteMessageV1(caseId, messageId, requestOptions) {
772
+ return core.HttpResponsePromise.fromPromise(this.__deleteMessageV1(caseId, messageId, requestOptions));
773
+ }
774
+ __deleteMessageV1(caseId, messageId, requestOptions) {
775
+ return __awaiter(this, void 0, void 0, function* () {
776
+ var _a, _b, _c, _d;
777
+ 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);
778
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
779
+ 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)}`),
780
+ method: "DELETE",
781
+ headers: _headers,
782
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
783
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
784
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
785
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
786
+ });
787
+ if (_response.ok) {
788
+ return { data: _response.body, rawResponse: _response.rawResponse };
789
+ }
790
+ if (_response.error.reason === "status-code") {
791
+ switch (_response.error.statusCode) {
792
+ case 422:
793
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
794
+ default:
795
+ throw new errors.ChrtError({
796
+ statusCode: _response.error.statusCode,
797
+ body: _response.error.body,
798
+ rawResponse: _response.rawResponse,
799
+ });
800
+ }
801
+ }
802
+ switch (_response.error.reason) {
803
+ case "non-json":
804
+ throw new errors.ChrtError({
805
+ statusCode: _response.error.statusCode,
806
+ body: _response.error.rawBody,
807
+ rawResponse: _response.rawResponse,
808
+ });
809
+ case "timeout":
810
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /operations/cases/delete_message/v1/{case_id}/{message_id}.");
811
+ case "unknown":
812
+ throw new errors.ChrtError({
813
+ message: _response.error.errorMessage,
814
+ rawResponse: _response.rawResponse,
815
+ });
816
+ }
817
+ });
818
+ }
504
819
  _getAuthorizationHeader() {
505
820
  return __awaiter(this, void 0, void 0, function* () {
506
821
  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 {};
@@ -9,6 +9,8 @@ import * as Chrt from "../../../../../../index.mjs";
9
9
  * sort_order: "asc",
10
10
  * page: 1,
11
11
  * page_size: 1,
12
+ * filter_status: ["open"],
13
+ * filter_department_id: ["filter_department_id"],
12
14
  * filter_assigned_operator_user_id: "filter_assigned_operator_user_id",
13
15
  * filter_needs_action: true,
14
16
  * filter_unassigned: true
@@ -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
+ }