@chrt-inc/typescript-sdk 1.762.0 → 1.788.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 (102) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.d.ts +18 -0
  3. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +67 -0
  4. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupSharedTaskGroupMileageCreateClientReq.d.ts +23 -0
  5. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/notifications/resources/adHoc/client/Client.d.ts +36 -2
  7. package/dist/cjs/api/resources/notifications/resources/adHoc/client/Client.js +138 -1
  8. package/dist/cjs/api/resources/notifications/resources/adHoc/client/requests/AdHocListBySessionIdV1Request.d.ts +14 -0
  9. package/dist/cjs/api/resources/notifications/resources/adHoc/client/requests/index.d.ts +1 -1
  10. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/Client.d.ts +46 -9
  11. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/Client.js +148 -16
  12. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListClientCreate1.d.ts +1 -1
  13. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListReorderEntries1.d.ts +1 -1
  14. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/index.d.ts +0 -1
  15. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/OrdersNewDraftReq.d.ts +2 -0
  16. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.d.ts +1 -0
  17. package/dist/cjs/api/resources/shipping/resources/orderTemplates/client/requests/OrderTemplateClientCreate1.d.ts +1 -0
  18. package/dist/cjs/api/resources/shipping/resources/orderTemplates/client/requests/OrderTemplateClientUpdate1.d.ts +1 -0
  19. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.d.ts +2 -2
  20. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.js +2 -2
  21. package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionClientCreate1.d.ts +3 -0
  22. package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionClientUpdate1.d.ts +4 -0
  23. package/dist/cjs/api/types/LineItem1.d.ts +1 -0
  24. package/dist/cjs/api/types/NotificationEventsForAdHocEnum.d.ts +4 -3
  25. package/dist/cjs/api/types/NotificationEventsForAdHocEnum.js +1 -0
  26. package/dist/cjs/api/types/NotificationEventsForOrgsEnum.d.ts +2 -1
  27. package/dist/cjs/api/types/NotificationEventsForOrgsEnum.js +1 -0
  28. package/dist/cjs/api/types/NotificationEventsForUsersEnum.d.ts +2 -1
  29. package/dist/cjs/api/types/NotificationEventsForUsersEnum.js +1 -0
  30. package/dist/cjs/api/types/NotificationIntentAdHoc1.d.ts +2 -1
  31. package/dist/cjs/api/{resources/notifications/resources/adHoc/client/requests → types}/NotificationIntentAdHocClientCreate1.d.ts +1 -8
  32. package/dist/cjs/api/types/NotificationIntentAdHocClientCreate1.js +5 -0
  33. package/dist/cjs/api/types/OnboardCourierTaskActionEnum1.d.ts +1 -11
  34. package/dist/cjs/api/types/OnboardCourierTaskActionEnum1.js +0 -10
  35. package/dist/cjs/api/types/OperationsTaskListEntry1.d.ts +4 -12
  36. package/dist/cjs/api/types/OperationsTaskListEntryClientCreate1.d.ts +15 -0
  37. package/dist/cjs/api/types/OperationsTaskListEntryClientCreate1.js +5 -0
  38. package/dist/cjs/api/types/OrderTemplate1.d.ts +1 -0
  39. package/dist/cjs/api/types/OrderTemplateCore1.d.ts +1 -0
  40. package/dist/cjs/api/types/Session1.d.ts +3 -0
  41. package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
  42. package/dist/cjs/api/types/TrackingSessionDestinationGeofenceEnteredWebhookPayload.d.ts +10 -0
  43. package/dist/cjs/api/types/TrackingSessionDestinationGeofenceEnteredWebhookPayload.js +5 -0
  44. package/dist/cjs/api/types/index.d.ts +3 -0
  45. package/dist/cjs/api/types/index.js +3 -0
  46. package/dist/cjs/version.d.ts +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/Client.mjs +2 -2
  49. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.d.mts +18 -0
  50. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +67 -0
  51. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupSharedTaskGroupMileageCreateClientReq.d.mts +23 -0
  52. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/index.d.mts +1 -0
  53. package/dist/esm/api/resources/notifications/resources/adHoc/client/Client.d.mts +36 -2
  54. package/dist/esm/api/resources/notifications/resources/adHoc/client/Client.mjs +138 -1
  55. package/dist/esm/api/resources/notifications/resources/adHoc/client/requests/AdHocListBySessionIdV1Request.d.mts +14 -0
  56. package/dist/esm/api/resources/notifications/resources/adHoc/client/requests/index.d.mts +1 -1
  57. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/Client.d.mts +46 -9
  58. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/Client.mjs +148 -16
  59. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListClientCreate1.d.mts +1 -1
  60. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListReorderEntries1.d.mts +1 -1
  61. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/index.d.mts +0 -1
  62. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/OrdersNewDraftReq.d.mts +2 -0
  63. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.d.mts +1 -0
  64. package/dist/esm/api/resources/shipping/resources/orderTemplates/client/requests/OrderTemplateClientCreate1.d.mts +1 -0
  65. package/dist/esm/api/resources/shipping/resources/orderTemplates/client/requests/OrderTemplateClientUpdate1.d.mts +1 -0
  66. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.d.mts +2 -2
  67. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.mjs +2 -2
  68. package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionClientCreate1.d.mts +3 -0
  69. package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionClientUpdate1.d.mts +4 -0
  70. package/dist/esm/api/types/LineItem1.d.mts +1 -0
  71. package/dist/esm/api/types/NotificationEventsForAdHocEnum.d.mts +4 -3
  72. package/dist/esm/api/types/NotificationEventsForAdHocEnum.mjs +1 -0
  73. package/dist/esm/api/types/NotificationEventsForOrgsEnum.d.mts +2 -1
  74. package/dist/esm/api/types/NotificationEventsForOrgsEnum.mjs +1 -0
  75. package/dist/esm/api/types/NotificationEventsForUsersEnum.d.mts +2 -1
  76. package/dist/esm/api/types/NotificationEventsForUsersEnum.mjs +1 -0
  77. package/dist/esm/api/types/NotificationIntentAdHoc1.d.mts +2 -1
  78. package/dist/esm/api/{resources/notifications/resources/adHoc/client/requests → types}/NotificationIntentAdHocClientCreate1.d.mts +1 -8
  79. package/dist/esm/api/types/NotificationIntentAdHocClientCreate1.mjs +4 -0
  80. package/dist/esm/api/types/OnboardCourierTaskActionEnum1.d.mts +1 -11
  81. package/dist/esm/api/types/OnboardCourierTaskActionEnum1.mjs +0 -10
  82. package/dist/esm/api/types/OperationsTaskListEntry1.d.mts +4 -12
  83. package/dist/esm/api/types/OperationsTaskListEntryClientCreate1.d.mts +15 -0
  84. package/dist/esm/api/types/OperationsTaskListEntryClientCreate1.mjs +4 -0
  85. package/dist/esm/api/types/OrderTemplate1.d.mts +1 -0
  86. package/dist/esm/api/types/OrderTemplateCore1.d.mts +1 -0
  87. package/dist/esm/api/types/Session1.d.mts +3 -0
  88. package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
  89. package/dist/esm/api/types/TrackingSessionDestinationGeofenceEnteredWebhookPayload.d.mts +10 -0
  90. package/dist/esm/api/types/TrackingSessionDestinationGeofenceEnteredWebhookPayload.mjs +4 -0
  91. package/dist/esm/api/types/index.d.mts +3 -0
  92. package/dist/esm/api/types/index.mjs +3 -0
  93. package/dist/esm/version.d.mts +1 -1
  94. package/dist/esm/version.mjs +1 -1
  95. package/package.json +1 -1
  96. package/reference.md +384 -10
  97. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.d.ts +0 -11
  98. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.d.mts +0 -11
  99. /package/dist/cjs/api/resources/{notifications/resources/adHoc/client/requests/NotificationIntentAdHocClientCreate1.js → billing/resources/lineItemGroups/client/requests/LineItemGroupSharedTaskGroupMileageCreateClientReq.js} +0 -0
  100. /package/dist/cjs/api/resources/{operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.js → notifications/resources/adHoc/client/requests/AdHocListBySessionIdV1Request.js} +0 -0
  101. /package/dist/esm/api/resources/{notifications/resources/adHoc/client/requests/NotificationIntentAdHocClientCreate1.mjs → billing/resources/lineItemGroups/client/requests/LineItemGroupSharedTaskGroupMileageCreateClientReq.mjs} +0 -0
  102. /package/dist/esm/api/resources/{operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.mjs → notifications/resources/adHoc/client/requests/AdHocListBySessionIdV1Request.mjs} +0 -0
@@ -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.762.0",
60
- "User-Agent": "@chrt-inc/typescript-sdk/1.762.0",
59
+ "X-Fern-SDK-Version": "1.788.0",
60
+ "User-Agent": "@chrt-inc/typescript-sdk/1.788.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) });
@@ -268,5 +268,23 @@ export declare class LineItemGroups {
268
268
  */
269
269
  fromRateSheetCreateForProviderPayDriverV1(request: Chrt.CreateLigFromRateSheetForVectorClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
270
270
  private __fromRateSheetCreateForProviderPayDriverV1;
271
+ /**
272
+ * Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (LineItemGroupSharedTaskGroupMileageCreateClientReq) -> (LineItemGroup1)
273
+ *
274
+ * @param {Chrt.billing.LineItemGroupSharedTaskGroupMileageCreateClientReq} request
275
+ * @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
276
+ *
277
+ * @throws {@link Chrt.UnprocessableEntityError}
278
+ *
279
+ * @example
280
+ * await client.billing.lineItemGroups.sharedTaskGroupMileageCreateV1({
281
+ * order_group_id: "order_group_id",
282
+ * rate_sheet_id: "rate_sheet_id",
283
+ * payment_destination_driver_id: "payment_destination_driver_id",
284
+ * task_ids: ["task_ids"]
285
+ * })
286
+ */
287
+ sharedTaskGroupMileageCreateV1(request: Chrt.billing.LineItemGroupSharedTaskGroupMileageCreateClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
288
+ private __sharedTaskGroupMileageCreateV1;
271
289
  protected _getAuthorizationHeader(): Promise<string | undefined>;
272
290
  }
@@ -1057,6 +1057,73 @@ class LineItemGroups {
1057
1057
  }
1058
1058
  });
1059
1059
  }
1060
+ /**
1061
+ * Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (LineItemGroupSharedTaskGroupMileageCreateClientReq) -> (LineItemGroup1)
1062
+ *
1063
+ * @param {Chrt.billing.LineItemGroupSharedTaskGroupMileageCreateClientReq} request
1064
+ * @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
1065
+ *
1066
+ * @throws {@link Chrt.UnprocessableEntityError}
1067
+ *
1068
+ * @example
1069
+ * await client.billing.lineItemGroups.sharedTaskGroupMileageCreateV1({
1070
+ * order_group_id: "order_group_id",
1071
+ * rate_sheet_id: "rate_sheet_id",
1072
+ * payment_destination_driver_id: "payment_destination_driver_id",
1073
+ * task_ids: ["task_ids"]
1074
+ * })
1075
+ */
1076
+ sharedTaskGroupMileageCreateV1(request, requestOptions) {
1077
+ return core.HttpResponsePromise.fromPromise(this.__sharedTaskGroupMileageCreateV1(request, requestOptions));
1078
+ }
1079
+ __sharedTaskGroupMileageCreateV1(request, requestOptions) {
1080
+ return __awaiter(this, void 0, void 0, function* () {
1081
+ var _a, _b, _c, _d;
1082
+ 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);
1083
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1084
+ 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, "billing/line_item_groups/shared_task_group_mileage/create/v1"),
1085
+ method: "POST",
1086
+ headers: _headers,
1087
+ contentType: "application/json",
1088
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1089
+ requestType: "json",
1090
+ body: request,
1091
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1092
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1093
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1094
+ });
1095
+ if (_response.ok) {
1096
+ return { data: _response.body, rawResponse: _response.rawResponse };
1097
+ }
1098
+ if (_response.error.reason === "status-code") {
1099
+ switch (_response.error.statusCode) {
1100
+ case 422:
1101
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1102
+ default:
1103
+ throw new errors.ChrtError({
1104
+ statusCode: _response.error.statusCode,
1105
+ body: _response.error.body,
1106
+ rawResponse: _response.rawResponse,
1107
+ });
1108
+ }
1109
+ }
1110
+ switch (_response.error.reason) {
1111
+ case "non-json":
1112
+ throw new errors.ChrtError({
1113
+ statusCode: _response.error.statusCode,
1114
+ body: _response.error.rawBody,
1115
+ rawResponse: _response.rawResponse,
1116
+ });
1117
+ case "timeout":
1118
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/line_item_groups/shared_task_group_mileage/create/v1.");
1119
+ case "unknown":
1120
+ throw new errors.ChrtError({
1121
+ message: _response.error.errorMessage,
1122
+ rawResponse: _response.rawResponse,
1123
+ });
1124
+ }
1125
+ });
1126
+ }
1060
1127
  _getAuthorizationHeader() {
1061
1128
  return __awaiter(this, void 0, void 0, function* () {
1062
1129
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,23 @@
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
+ * order_group_id: "order_group_id",
9
+ * rate_sheet_id: "rate_sheet_id",
10
+ * payment_destination_driver_id: "payment_destination_driver_id",
11
+ * task_ids: ["task_ids"]
12
+ * }
13
+ */
14
+ export interface LineItemGroupSharedTaskGroupMileageCreateClientReq {
15
+ order_group_id: string;
16
+ rate_sheet_id: string;
17
+ payment_destination_driver_id: string;
18
+ task_ids: string[];
19
+ start_location?: Chrt.LocationFeature | null;
20
+ start_location_label?: string | null;
21
+ end_location?: Chrt.LocationFeature | null;
22
+ end_location_label?: string | null;
23
+ }
@@ -1,2 +1,3 @@
1
1
  export { type LineItemGroupsListV1Request } from "./LineItemGroupsListV1Request.js";
2
2
  export { type LineItemGroupAdHocCreateClientReq } from "./LineItemGroupAdHocCreateClientReq.js";
3
+ export { type LineItemGroupSharedTaskGroupMileageCreateClientReq } from "./LineItemGroupSharedTaskGroupMileageCreateClientReq.js";
@@ -47,11 +47,28 @@ export declare class AdHoc {
47
47
  */
48
48
  listByOrderIdV1(orderId: string, request?: Chrt.notifications.AdHocListByOrderIdV1Request, requestOptions?: AdHoc.RequestOptions): core.HttpResponsePromise<Chrt.NotificationAdHocListRes>;
49
49
  private __listByOrderIdV1;
50
+ /**
51
+ * Lists all ad-hoc notification intents for a tracking session. | authz: min_org_role=operator | () -> (NotificationAdHocListRes)
52
+ *
53
+ * @param {string} sessionId
54
+ * @param {Chrt.notifications.AdHocListBySessionIdV1Request} request
55
+ * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
56
+ *
57
+ * @throws {@link Chrt.UnprocessableEntityError}
58
+ *
59
+ * @example
60
+ * await client.notifications.adHoc.listBySessionIdV1("session_id", {
61
+ * page: 1,
62
+ * page_size: 1
63
+ * })
64
+ */
65
+ listBySessionIdV1(sessionId: string, request?: Chrt.notifications.AdHocListBySessionIdV1Request, requestOptions?: AdHoc.RequestOptions): core.HttpResponsePromise<Chrt.NotificationAdHocListRes>;
66
+ private __listBySessionIdV1;
50
67
  /**
51
68
  * Creates a new ad-hoc notification intent for an order. | authz: min_org_role=operator | (NotificationIntentAdHocClientCreate1) -> (PydanticObjectId)
52
69
  *
53
70
  * @param {string} orderId
54
- * @param {Chrt.notifications.NotificationIntentAdHocClientCreate1} request
71
+ * @param {Chrt.NotificationIntentAdHocClientCreate1} request
55
72
  * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
56
73
  *
57
74
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -62,8 +79,25 @@ export declare class AdHoc {
62
79
  * directory_entry_id: "directory_entry_id"
63
80
  * })
64
81
  */
65
- createV1(orderId: string, request: Chrt.notifications.NotificationIntentAdHocClientCreate1, requestOptions?: AdHoc.RequestOptions): core.HttpResponsePromise<string>;
82
+ createV1(orderId: string, request: Chrt.NotificationIntentAdHocClientCreate1, requestOptions?: AdHoc.RequestOptions): core.HttpResponsePromise<string>;
66
83
  private __createV1;
84
+ /**
85
+ * Creates a new ad-hoc notification intent for a tracking session. | authz: min_org_role=operator | (NotificationIntentAdHocClientCreate1) -> (PydanticObjectId)
86
+ *
87
+ * @param {string} sessionId
88
+ * @param {Chrt.NotificationIntentAdHocClientCreate1} request
89
+ * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
90
+ *
91
+ * @throws {@link Chrt.UnprocessableEntityError}
92
+ *
93
+ * @example
94
+ * await client.notifications.adHoc.createForSessionV1("session_id", {
95
+ * schema_version: 1,
96
+ * directory_entry_id: "directory_entry_id"
97
+ * })
98
+ */
99
+ createForSessionV1(sessionId: string, request: Chrt.NotificationIntentAdHocClientCreate1, requestOptions?: AdHoc.RequestOptions): core.HttpResponsePromise<string>;
100
+ private __createForSessionV1;
67
101
  /**
68
102
  * Deletes an ad-hoc notification intent. | authz: min_org_role=operator | () -> (bool)
69
103
  *
@@ -126,11 +126,82 @@ class AdHoc {
126
126
  }
127
127
  });
128
128
  }
129
+ /**
130
+ * Lists all ad-hoc notification intents for a tracking session. | authz: min_org_role=operator | () -> (NotificationAdHocListRes)
131
+ *
132
+ * @param {string} sessionId
133
+ * @param {Chrt.notifications.AdHocListBySessionIdV1Request} request
134
+ * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
135
+ *
136
+ * @throws {@link Chrt.UnprocessableEntityError}
137
+ *
138
+ * @example
139
+ * await client.notifications.adHoc.listBySessionIdV1("session_id", {
140
+ * page: 1,
141
+ * page_size: 1
142
+ * })
143
+ */
144
+ listBySessionIdV1(sessionId, request = {}, requestOptions) {
145
+ return core.HttpResponsePromise.fromPromise(this.__listBySessionIdV1(sessionId, request, requestOptions));
146
+ }
147
+ __listBySessionIdV1(sessionId_1) {
148
+ return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
149
+ var _a, _b, _c, _d, _e, _f;
150
+ const { page, page_size: pageSize } = request;
151
+ const _queryParams = {};
152
+ if (page !== undefined) {
153
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
154
+ }
155
+ if (pageSize !== undefined) {
156
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
157
+ }
158
+ let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
159
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
160
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, `notifications/ad_hoc/list_by_session_id/v1/${encodeURIComponent(sessionId)}`),
161
+ method: "GET",
162
+ headers: _headers,
163
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
164
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
165
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
166
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
167
+ });
168
+ if (_response.ok) {
169
+ return { data: _response.body, rawResponse: _response.rawResponse };
170
+ }
171
+ if (_response.error.reason === "status-code") {
172
+ switch (_response.error.statusCode) {
173
+ case 422:
174
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
175
+ default:
176
+ throw new errors.ChrtError({
177
+ statusCode: _response.error.statusCode,
178
+ body: _response.error.body,
179
+ rawResponse: _response.rawResponse,
180
+ });
181
+ }
182
+ }
183
+ switch (_response.error.reason) {
184
+ case "non-json":
185
+ throw new errors.ChrtError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.rawBody,
188
+ rawResponse: _response.rawResponse,
189
+ });
190
+ case "timeout":
191
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /notifications/ad_hoc/list_by_session_id/v1/{session_id}.");
192
+ case "unknown":
193
+ throw new errors.ChrtError({
194
+ message: _response.error.errorMessage,
195
+ rawResponse: _response.rawResponse,
196
+ });
197
+ }
198
+ });
199
+ }
129
200
  /**
130
201
  * Creates a new ad-hoc notification intent for an order. | authz: min_org_role=operator | (NotificationIntentAdHocClientCreate1) -> (PydanticObjectId)
131
202
  *
132
203
  * @param {string} orderId
133
- * @param {Chrt.notifications.NotificationIntentAdHocClientCreate1} request
204
+ * @param {Chrt.NotificationIntentAdHocClientCreate1} request
134
205
  * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
135
206
  *
136
207
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -192,6 +263,72 @@ class AdHoc {
192
263
  }
193
264
  });
194
265
  }
266
+ /**
267
+ * Creates a new ad-hoc notification intent for a tracking session. | authz: min_org_role=operator | (NotificationIntentAdHocClientCreate1) -> (PydanticObjectId)
268
+ *
269
+ * @param {string} sessionId
270
+ * @param {Chrt.NotificationIntentAdHocClientCreate1} request
271
+ * @param {AdHoc.RequestOptions} requestOptions - Request-specific configuration.
272
+ *
273
+ * @throws {@link Chrt.UnprocessableEntityError}
274
+ *
275
+ * @example
276
+ * await client.notifications.adHoc.createForSessionV1("session_id", {
277
+ * schema_version: 1,
278
+ * directory_entry_id: "directory_entry_id"
279
+ * })
280
+ */
281
+ createForSessionV1(sessionId, request, requestOptions) {
282
+ return core.HttpResponsePromise.fromPromise(this.__createForSessionV1(sessionId, request, requestOptions));
283
+ }
284
+ __createForSessionV1(sessionId, request, requestOptions) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ var _a, _b, _c, _d;
287
+ 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);
288
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
289
+ 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, `notifications/ad_hoc/create_for_session/v1/${encodeURIComponent(sessionId)}`),
290
+ method: "POST",
291
+ headers: _headers,
292
+ contentType: "application/json",
293
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
294
+ requestType: "json",
295
+ body: request,
296
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
297
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
298
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
299
+ });
300
+ if (_response.ok) {
301
+ return { data: _response.body, rawResponse: _response.rawResponse };
302
+ }
303
+ if (_response.error.reason === "status-code") {
304
+ switch (_response.error.statusCode) {
305
+ case 422:
306
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
307
+ default:
308
+ throw new errors.ChrtError({
309
+ statusCode: _response.error.statusCode,
310
+ body: _response.error.body,
311
+ rawResponse: _response.rawResponse,
312
+ });
313
+ }
314
+ }
315
+ switch (_response.error.reason) {
316
+ case "non-json":
317
+ throw new errors.ChrtError({
318
+ statusCode: _response.error.statusCode,
319
+ body: _response.error.rawBody,
320
+ rawResponse: _response.rawResponse,
321
+ });
322
+ case "timeout":
323
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /notifications/ad_hoc/create_for_session/v1/{session_id}.");
324
+ case "unknown":
325
+ throw new errors.ChrtError({
326
+ message: _response.error.errorMessage,
327
+ rawResponse: _response.rawResponse,
328
+ });
329
+ }
330
+ });
331
+ }
195
332
  /**
196
333
  * Deletes an ad-hoc notification intent. | authz: min_org_role=operator | () -> (bool)
197
334
  *
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * page: 1,
8
+ * page_size: 1
9
+ * }
10
+ */
11
+ export interface AdHocListBySessionIdV1Request {
12
+ page?: number | null;
13
+ page_size?: number | null;
14
+ }
@@ -1,2 +1,2 @@
1
1
  export { type AdHocListByOrderIdV1Request } from "./AdHocListByOrderIdV1Request.js";
2
- export { type NotificationIntentAdHocClientCreate1 } from "./NotificationIntentAdHocClientCreate1.js";
2
+ export { type AdHocListBySessionIdV1Request } from "./AdHocListBySessionIdV1Request.js";
@@ -93,21 +93,58 @@ export declare class OperationsTaskLists {
93
93
  createV1(request: Chrt.operations.OperationsTaskListClientCreate1, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<string>;
94
94
  private __createV1;
95
95
  /**
96
- * Replaces an OperationsTaskList's `entries` array wholesale covering add, remove, reorder, and edit in one operation. Order is load-bearing for from_previous_task-anchored deadlines. | authz: min_org_role=operator | (OperationsTaskListSetEntries1) -> (bool)
96
+ * Appends a new entry to an OperationsTaskList's `entries` array. The server assigns a fresh UUID and returns it. Order is load-bearing for from_previous_task-anchored deadlines. | authz: min_org_role=operator | (OperationsTaskListEntryClientCreate1) -> (str)
97
97
  *
98
98
  * @param {string} taskListId
99
- * @param {Chrt.operations.OperationsTaskListSetEntries1} request
99
+ * @param {Chrt.OperationsTaskListEntryClientCreate1} request
100
100
  * @param {OperationsTaskLists.RequestOptions} requestOptions - Request-specific configuration.
101
101
  *
102
102
  * @throws {@link Chrt.UnprocessableEntityError}
103
103
  *
104
104
  * @example
105
- * await client.operations.operationsTaskLists.setEntriesV1("task_list_id")
105
+ * await client.operations.operationsTaskLists.addEntryV1("task_list_id", {
106
+ * task_type: "review_order_details",
107
+ * title: "title",
108
+ * description: "description"
109
+ * })
110
+ */
111
+ addEntryV1(taskListId: string, request: Chrt.OperationsTaskListEntryClientCreate1, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<string>;
112
+ private __addEntryV1;
113
+ /**
114
+ * Replaces the entry with the given uuid in an OperationsTaskList's `entries` array. The stored uuid is preserved regardless of the request body. 404 if no entry matches. | authz: min_org_role=operator | (OperationsTaskListEntryClientCreate1) -> (bool)
115
+ *
116
+ * @param {string} taskListId
117
+ * @param {string} entryUuid
118
+ * @param {Chrt.OperationsTaskListEntryClientCreate1} request
119
+ * @param {OperationsTaskLists.RequestOptions} requestOptions - Request-specific configuration.
120
+ *
121
+ * @throws {@link Chrt.UnprocessableEntityError}
122
+ *
123
+ * @example
124
+ * await client.operations.operationsTaskLists.editEntryV1("task_list_id", "entry_uuid", {
125
+ * task_type: "review_order_details",
126
+ * title: "title",
127
+ * description: "description"
128
+ * })
129
+ */
130
+ editEntryV1(taskListId: string, entryUuid: string, request: Chrt.OperationsTaskListEntryClientCreate1, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<boolean>;
131
+ private __editEntryV1;
132
+ /**
133
+ * Removes the entry with the given uuid from an OperationsTaskList's `entries` array, closing the gap in order. 404 if no entry matches. | authz: min_org_role=operator | () -> (bool)
134
+ *
135
+ * @param {string} taskListId
136
+ * @param {string} entryUuid
137
+ * @param {OperationsTaskLists.RequestOptions} requestOptions - Request-specific configuration.
138
+ *
139
+ * @throws {@link Chrt.UnprocessableEntityError}
140
+ *
141
+ * @example
142
+ * await client.operations.operationsTaskLists.removeEntryV1("task_list_id", "entry_uuid")
106
143
  */
107
- setEntriesV1(taskListId: string, request?: Chrt.operations.OperationsTaskListSetEntries1, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<boolean>;
108
- private __setEntriesV1;
144
+ removeEntryV1(taskListId: string, entryUuid: string, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<boolean>;
145
+ private __removeEntryV1;
109
146
  /**
110
- * Reorders an OperationsTaskList's existing entries. `entry_ids` must be an exact permutation of the list's current entry ids (every id present, no extras, no duplicates), so a reorder can never drop, add, or mutate an entry. | authz: min_org_role=operator | (OperationsTaskListReorderEntries1) -> (bool)
147
+ * Reorders an OperationsTaskList's existing entries. `entry_uuids` must be an exact permutation of the list's current entry uuids (every uuid present, no extras, no duplicates), so a reorder can never drop, add, or mutate an entry. | authz: min_org_role=operator | (OperationsTaskListReorderEntries1) -> (bool)
111
148
  *
112
149
  * @param {string} taskListId
113
150
  * @param {Chrt.operations.OperationsTaskListReorderEntries1} request
@@ -173,9 +210,9 @@ export declare class OperationsTaskLists {
173
210
  * @throws {@link Chrt.UnprocessableEntityError}
174
211
  *
175
212
  * @example
176
- * await client.operations.operationsTaskLists.removeFromCaseV1("task_list_id", "case_id")
213
+ * await client.operations.operationsTaskLists.removeNotStartedTasksFromCaseV1("task_list_id", "case_id")
177
214
  */
178
- removeFromCaseV1(taskListId: string, caseId: string, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<Chrt.OperationsTaskListRemoveFromCaseRes1>;
179
- private __removeFromCaseV1;
215
+ removeNotStartedTasksFromCaseV1(taskListId: string, caseId: string, requestOptions?: OperationsTaskLists.RequestOptions): core.HttpResponsePromise<Chrt.OperationsTaskListRemoveFromCaseRes1>;
216
+ private __removeNotStartedTasksFromCaseV1;
180
217
  protected _getAuthorizationHeader(): Promise<string | undefined>;
181
218
  }