@chrt-inc/typescript-sdk 1.305.0 → 1.308.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 (84) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/drivers/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/drivers/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/drivers/client/requests/DriverCreateReq.d.ts +1 -1
  5. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +14 -0
  6. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +63 -0
  7. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.ts +13 -0
  8. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/orgs/client/Client.d.ts +18 -5
  10. package/dist/cjs/api/resources/orgs/client/Client.js +69 -7
  11. package/dist/cjs/api/resources/orgs/client/requests/CreateOrgPublicDataReq.d.ts +1 -5
  12. package/dist/cjs/api/resources/orgs/client/requests/SetOrgTypeReq.d.ts +13 -0
  13. package/dist/cjs/api/resources/orgs/client/requests/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +47 -19
  15. package/dist/cjs/api/resources/taskGroups/client/Client.js +157 -31
  16. package/dist/cjs/api/resources/taskGroups/client/requests/SetFlightNumberReq.d.ts +12 -0
  17. package/dist/cjs/api/resources/taskGroups/client/requests/SetFlightNumberReq.js +5 -0
  18. package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskOrderingReq.d.ts +12 -0
  19. package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskOrderingReq.js +5 -0
  20. package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.d.ts +12 -0
  21. package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.js +5 -0
  22. package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.d.ts +11 -0
  23. package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.js +5 -0
  24. package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +4 -2
  25. package/dist/cjs/api/types/ClerkOrgData.d.ts +2 -1
  26. package/dist/cjs/api/types/CreateOrgPublicDataRes.d.ts +7 -0
  27. package/dist/cjs/api/types/CreateOrgPublicDataRes.js +5 -0
  28. package/dist/cjs/api/types/OrderDraftExpandedRes.d.ts +1 -0
  29. package/dist/cjs/api/types/OrgMemberDetails.d.ts +2 -2
  30. package/dist/cjs/api/types/OrgRoleEnum.d.ts +29 -0
  31. package/dist/cjs/api/types/OrgRoleEnum.js +12 -0
  32. package/dist/cjs/api/types/TaskClientUpdate1.d.ts +1 -0
  33. package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
  34. package/dist/cjs/api/types/index.d.ts +2 -0
  35. package/dist/cjs/api/types/index.js +2 -0
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/Client.mjs +2 -2
  39. package/dist/esm/api/resources/drivers/client/Client.d.mts +1 -1
  40. package/dist/esm/api/resources/drivers/client/Client.mjs +1 -1
  41. package/dist/esm/api/resources/drivers/client/requests/DriverCreateReq.d.mts +1 -1
  42. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +14 -0
  43. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +63 -0
  44. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.mts +13 -0
  45. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +1 -0
  46. package/dist/esm/api/resources/orgs/client/Client.d.mts +18 -5
  47. package/dist/esm/api/resources/orgs/client/Client.mjs +69 -7
  48. package/dist/esm/api/resources/orgs/client/requests/CreateOrgPublicDataReq.d.mts +1 -5
  49. package/dist/esm/api/resources/orgs/client/requests/SetOrgTypeReq.d.mts +13 -0
  50. package/dist/esm/api/resources/orgs/client/requests/index.d.mts +1 -0
  51. package/dist/esm/api/resources/taskGroups/client/Client.d.mts +47 -19
  52. package/dist/esm/api/resources/taskGroups/client/Client.mjs +157 -31
  53. package/dist/esm/api/resources/taskGroups/client/requests/SetFlightNumberReq.d.mts +12 -0
  54. package/dist/esm/api/resources/taskGroups/client/requests/SetFlightNumberReq.mjs +4 -0
  55. package/dist/esm/api/resources/taskGroups/client/requests/SetTaskOrderingReq.d.mts +12 -0
  56. package/dist/esm/api/resources/taskGroups/client/requests/SetTaskOrderingReq.mjs +4 -0
  57. package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.d.mts +12 -0
  58. package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.mjs +4 -0
  59. package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.d.mts +11 -0
  60. package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.mjs +4 -0
  61. package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +4 -2
  62. package/dist/esm/api/types/ClerkOrgData.d.mts +2 -1
  63. package/dist/esm/api/types/CreateOrgPublicDataRes.d.mts +7 -0
  64. package/dist/esm/api/types/CreateOrgPublicDataRes.mjs +4 -0
  65. package/dist/esm/api/types/OrderDraftExpandedRes.d.mts +1 -0
  66. package/dist/esm/api/types/OrgMemberDetails.d.mts +2 -2
  67. package/dist/esm/api/types/OrgRoleEnum.d.mts +29 -0
  68. package/dist/esm/api/types/OrgRoleEnum.mjs +9 -0
  69. package/dist/esm/api/types/TaskClientUpdate1.d.mts +1 -0
  70. package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
  71. package/dist/esm/api/types/index.d.mts +2 -0
  72. package/dist/esm/api/types/index.mjs +2 -0
  73. package/dist/esm/version.d.mts +1 -1
  74. package/dist/esm/version.mjs +1 -1
  75. package/package.json +1 -1
  76. package/reference.md +305 -22
  77. package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskGroupPauseReq.d.ts +0 -14
  78. package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupReq.d.ts +0 -14
  79. package/dist/esm/api/resources/taskGroups/client/requests/SetTaskGroupPauseReq.d.mts +0 -14
  80. package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupReq.d.mts +0 -14
  81. /package/dist/cjs/api/resources/{taskGroups/client/requests/SetTaskGroupPauseReq.js → orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.js} +0 -0
  82. /package/dist/cjs/api/resources/{taskGroups/client/requests/UpdateTaskGroupReq.js → orgs/client/requests/SetOrgTypeReq.js} +0 -0
  83. /package/dist/esm/api/resources/{taskGroups/client/requests/SetTaskGroupPauseReq.mjs → orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.mjs} +0 -0
  84. /package/dist/esm/api/resources/{taskGroups/client/requests/UpdateTaskGroupReq.mjs → orgs/client/requests/SetOrgTypeReq.mjs} +0 -0
@@ -84,6 +84,69 @@ export class TaskGroup {
84
84
  }
85
85
  });
86
86
  }
87
+ /**
88
+ * Sets or removes courier org. Sets task ordering (must provide all task ids). | (UpdateTaskGroupDraftReq) -> (bool)
89
+ *
90
+ * @param {string} taskGroupId
91
+ * @param {Chrt.orderDrafts.UpdateTaskGroupDraftReq} request
92
+ * @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
93
+ *
94
+ * @throws {@link Chrt.UnprocessableEntityError}
95
+ *
96
+ * @example
97
+ * await client.orderDrafts.taskGroup.updateV1("task_group_id")
98
+ */
99
+ updateV1(taskGroupId, request = {}, requestOptions) {
100
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(taskGroupId, request, requestOptions));
101
+ }
102
+ __updateV1(taskGroupId_1) {
103
+ return __awaiter(this, arguments, void 0, function* (taskGroupId, request = {}, requestOptions) {
104
+ var _a, _b, _c, _d;
105
+ 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);
106
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
107
+ 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, `oort/order_drafts/task_group/update/v1/${encodeURIComponent(taskGroupId)}`),
108
+ method: "PATCH",
109
+ headers: _headers,
110
+ contentType: "application/json",
111
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
112
+ requestType: "json",
113
+ body: request,
114
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
115
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
116
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
117
+ });
118
+ if (_response.ok) {
119
+ return { data: _response.body, rawResponse: _response.rawResponse };
120
+ }
121
+ if (_response.error.reason === "status-code") {
122
+ switch (_response.error.statusCode) {
123
+ case 422:
124
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.ChrtError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ switch (_response.error.reason) {
134
+ case "non-json":
135
+ throw new errors.ChrtError({
136
+ statusCode: _response.error.statusCode,
137
+ body: _response.error.rawBody,
138
+ rawResponse: _response.rawResponse,
139
+ });
140
+ case "timeout":
141
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/update/v1/{task_group_id}.");
142
+ case "unknown":
143
+ throw new errors.ChrtError({
144
+ message: _response.error.errorMessage,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ });
149
+ }
87
150
  /**
88
151
  * Deletes a task group and all associated entities (tasks, task artifacts, S3 metadata). The task group must belong to a DRAFT order. | () -> (bool)
89
152
  *
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface UpdateTaskGroupDraftReq {
9
+ remove_courier_org?: boolean | null;
10
+ /** Must be a string starting with `org_` */
11
+ set_courier_org_id?: string | null;
12
+ set_task_ordering?: string[] | null;
13
+ }
@@ -1 +1,2 @@
1
1
  export { type OrderDraftAddTaskGroupReq } from "./OrderDraftAddTaskGroupReq.mjs";
2
+ export { type UpdateTaskGroupDraftReq } from "./UpdateTaskGroupDraftReq.mjs";
@@ -61,7 +61,7 @@ export declare class Orgs {
61
61
  getOrgPublicDataV1(requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<Chrt.OrgPublicData1>;
62
62
  private __getOrgPublicDataV1;
63
63
  /**
64
- * Creates an org_public_data document for the authenticated organization. | (CreateOrgPublicDataReq) -> (PydanticObjectId)
64
+ * Creates org_public_data and org_private_data documents for the authenticated organization using org_type from JWT. | (CreateOrgPublicDataReq) -> (CreateOrgPublicDataRes)
65
65
  *
66
66
  * @param {Chrt.CreateOrgPublicDataReq} request
67
67
  * @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
@@ -69,11 +69,9 @@ export declare class Orgs {
69
69
  * @throws {@link Chrt.UnprocessableEntityError}
70
70
  *
71
71
  * @example
72
- * await client.orgs.createOrgPublicDataV1({
73
- * org_type: "courier"
74
- * })
72
+ * await client.orgs.createOrgPublicDataV1()
75
73
  */
76
- createOrgPublicDataV1(request: Chrt.CreateOrgPublicDataReq, requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<string>;
74
+ createOrgPublicDataV1(request?: Chrt.CreateOrgPublicDataReq, requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<Chrt.CreateOrgPublicDataRes>;
77
75
  private __createOrgPublicDataV1;
78
76
  /**
79
77
  * Updates the handle and/or company_name for the authenticated organization. | (UpdateOrgPublicDataReq) -> (bool)
@@ -114,6 +112,21 @@ export declare class Orgs {
114
112
  */
115
113
  getOrgPublicDataHandleAvailabilityV1(handle: string, requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<boolean>;
116
114
  private __getOrgPublicDataHandleAvailabilityV1;
115
+ /**
116
+ * Sets the org_type in Clerk's JWT public metadata. Returns True if already set and matching, sets it if not present, or raises exception if conflicting. | (SetOrgTypeReq) -> (bool)
117
+ *
118
+ * @param {Chrt.SetOrgTypeReq} request
119
+ * @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
120
+ *
121
+ * @throws {@link Chrt.UnprocessableEntityError}
122
+ *
123
+ * @example
124
+ * await client.orgs.setOrgTypeV1({
125
+ * org_type: "courier"
126
+ * })
127
+ */
128
+ setOrgTypeV1(request: Chrt.SetOrgTypeReq, requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<boolean>;
129
+ private __setOrgTypeV1;
117
130
  /**
118
131
  * Retrieves the Stripe Connect account ID for the authenticated organization. Returns 404 if not set. | () -> (str)
119
132
  *
@@ -173,7 +173,7 @@ export class Orgs {
173
173
  });
174
174
  }
175
175
  /**
176
- * Creates an org_public_data document for the authenticated organization. | (CreateOrgPublicDataReq) -> (PydanticObjectId)
176
+ * Creates org_public_data and org_private_data documents for the authenticated organization using org_type from JWT. | (CreateOrgPublicDataReq) -> (CreateOrgPublicDataRes)
177
177
  *
178
178
  * @param {Chrt.CreateOrgPublicDataReq} request
179
179
  * @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
@@ -181,15 +181,13 @@ export class Orgs {
181
181
  * @throws {@link Chrt.UnprocessableEntityError}
182
182
  *
183
183
  * @example
184
- * await client.orgs.createOrgPublicDataV1({
185
- * org_type: "courier"
186
- * })
184
+ * await client.orgs.createOrgPublicDataV1()
187
185
  */
188
- createOrgPublicDataV1(request, requestOptions) {
186
+ createOrgPublicDataV1(request = {}, requestOptions) {
189
187
  return core.HttpResponsePromise.fromPromise(this.__createOrgPublicDataV1(request, requestOptions));
190
188
  }
191
- __createOrgPublicDataV1(request, requestOptions) {
192
- return __awaiter(this, void 0, void 0, function* () {
189
+ __createOrgPublicDataV1() {
190
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
193
191
  var _a, _b, _c, _d;
194
192
  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);
195
193
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -416,6 +414,70 @@ export class Orgs {
416
414
  }
417
415
  });
418
416
  }
417
+ /**
418
+ * Sets the org_type in Clerk's JWT public metadata. Returns True if already set and matching, sets it if not present, or raises exception if conflicting. | (SetOrgTypeReq) -> (bool)
419
+ *
420
+ * @param {Chrt.SetOrgTypeReq} request
421
+ * @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
422
+ *
423
+ * @throws {@link Chrt.UnprocessableEntityError}
424
+ *
425
+ * @example
426
+ * await client.orgs.setOrgTypeV1({
427
+ * org_type: "courier"
428
+ * })
429
+ */
430
+ setOrgTypeV1(request, requestOptions) {
431
+ return core.HttpResponsePromise.fromPromise(this.__setOrgTypeV1(request, requestOptions));
432
+ }
433
+ __setOrgTypeV1(request, requestOptions) {
434
+ return __awaiter(this, void 0, void 0, function* () {
435
+ var _a, _b, _c, _d;
436
+ 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);
437
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
438
+ 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, "orgs/set_org_type/v1"),
439
+ method: "POST",
440
+ headers: _headers,
441
+ contentType: "application/json",
442
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
443
+ requestType: "json",
444
+ body: request,
445
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
446
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
447
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
448
+ });
449
+ if (_response.ok) {
450
+ return { data: _response.body, rawResponse: _response.rawResponse };
451
+ }
452
+ if (_response.error.reason === "status-code") {
453
+ switch (_response.error.statusCode) {
454
+ case 422:
455
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
456
+ default:
457
+ throw new errors.ChrtError({
458
+ statusCode: _response.error.statusCode,
459
+ body: _response.error.body,
460
+ rawResponse: _response.rawResponse,
461
+ });
462
+ }
463
+ }
464
+ switch (_response.error.reason) {
465
+ case "non-json":
466
+ throw new errors.ChrtError({
467
+ statusCode: _response.error.statusCode,
468
+ body: _response.error.rawBody,
469
+ rawResponse: _response.rawResponse,
470
+ });
471
+ case "timeout":
472
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /orgs/set_org_type/v1.");
473
+ case "unknown":
474
+ throw new errors.ChrtError({
475
+ message: _response.error.errorMessage,
476
+ rawResponse: _response.rawResponse,
477
+ });
478
+ }
479
+ });
480
+ }
419
481
  /**
420
482
  * Retrieves the Stripe Connect account ID for the authenticated organization. Returns 404 if not set. | () -> (str)
421
483
  *
@@ -1,15 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Chrt from "../../../../index.mjs";
5
4
  /**
6
5
  * @example
7
- * {
8
- * org_type: "courier"
9
- * }
6
+ * {}
10
7
  */
11
8
  export interface CreateOrgPublicDataReq {
12
- org_type: Chrt.OrgTypeEnum;
13
9
  handle?: string | null;
14
10
  company_name?: string | null;
15
11
  }
@@ -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
+ * org_type: "courier"
9
+ * }
10
+ */
11
+ export interface SetOrgTypeReq {
12
+ org_type: Chrt.OrgTypeEnum;
13
+ }
@@ -1,2 +1,3 @@
1
1
  export { type CreateOrgPublicDataReq } from "./CreateOrgPublicDataReq.mjs";
2
2
  export { type UpdateOrgPublicDataReq } from "./UpdateOrgPublicDataReq.mjs";
3
+ export { type SetOrgTypeReq } from "./SetOrgTypeReq.mjs";
@@ -37,49 +37,77 @@ export declare class TaskGroups {
37
37
  get expanded(): Expanded;
38
38
  get expandedList(): ExpandedList;
39
39
  /**
40
- * Updates task group driver assignments by adding or removing drivers. | (UpdateTaskGroupReq) -> (bool)
40
+ * Updates the ordering of tasks in a task group. Task group must be in STAGED or IN_PROGRESS status. | authz_personas=[lig_org_operators] | (SetTaskOrderingReq) -> (bool)
41
41
  *
42
- * @param {Chrt.UpdateTaskGroupReq} request
42
+ * @param {string} taskGroupId
43
+ * @param {Chrt.SetTaskOrderingReq} request
43
44
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
44
45
  *
45
46
  * @throws {@link Chrt.UnprocessableEntityError}
46
47
  *
47
48
  * @example
48
- * await client.taskGroups.updateV1({
49
- * task_group_id: "task_group_id"
49
+ * await client.taskGroups.setTaskOrderingV1("task_group_id", {
50
+ * task_ordering: ["task_ordering"]
50
51
  * })
51
52
  */
52
- updateV1(request: Chrt.UpdateTaskGroupReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
53
- private __updateV1;
53
+ setTaskOrderingV1(taskGroupId: string, request: Chrt.SetTaskOrderingReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
54
+ private __setTaskOrderingV1;
54
55
  /**
55
- * Starts a task group by changing its status to in-progress and updating the order status. Only authorized personas (task_group_driver or task_group_courier_org_administrator) can start a task group. | () -> (bool)
56
+ * Updates the flight number on both task group and all its tasks. Task group must be in STAGED or IN_PROGRESS status. | authz_personas=[lig_org_operators] | (SetFlightNumberReq) -> (bool)
56
57
  *
57
58
  * @param {string} taskGroupId
59
+ * @param {Chrt.SetFlightNumberReq} request
58
60
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
59
61
  *
60
62
  * @throws {@link Chrt.UnprocessableEntityError}
61
63
  *
62
64
  * @example
63
- * await client.taskGroups.startV1("task_group_id")
65
+ * await client.taskGroups.setFlightNumberV1("task_group_id", {
66
+ * flight_number: "flight_number"
67
+ * })
64
68
  */
65
- startV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
66
- private __startV1;
69
+ setFlightNumberV1(taskGroupId: string, request: Chrt.SetFlightNumberReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
70
+ private __setFlightNumberV1;
67
71
  /**
68
- * Toggles the pause status of an in-progress task group. | (SetTaskGroupPauseReq) -> (bool)
72
+ * Sets or removes the driver assigned to a task group. | authz_personas=[courier_org_operators] | (UpdateTaskGroupDriverReq) -> (bool)
69
73
  *
70
- * @param {string} id
71
- * @param {Chrt.SetTaskGroupPauseReq} request
74
+ * @param {string} taskGroupId
75
+ * @param {Chrt.UpdateTaskGroupDriverReq} request
72
76
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
73
77
  *
74
78
  * @throws {@link Chrt.UnprocessableEntityError}
75
79
  *
76
80
  * @example
77
- * await client.taskGroups.togglePauseV1("id", {
78
- * task_group_id: "task_group_id",
79
- * paused: true
80
- * })
81
+ * await client.taskGroups.updateDriverV1("task_group_id")
82
+ */
83
+ updateDriverV1(taskGroupId: string, request?: Chrt.UpdateTaskGroupDriverReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
84
+ private __updateDriverV1;
85
+ /**
86
+ * Sets or removes the courier organization assigned to a task group. | authz_personas=[forwarder_org_operators] | (UpdateTaskGroupCourierOrgReq) -> (bool)
87
+ *
88
+ * @param {string} taskGroupId
89
+ * @param {Chrt.UpdateTaskGroupCourierOrgReq} request
90
+ * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link Chrt.UnprocessableEntityError}
93
+ *
94
+ * @example
95
+ * await client.taskGroups.updateCourierOrgV1("task_group_id")
96
+ */
97
+ updateCourierOrgV1(taskGroupId: string, request?: Chrt.UpdateTaskGroupCourierOrgReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
98
+ private __updateCourierOrgV1;
99
+ /**
100
+ * Starts a task group by changing its status to in-progress and updating the order status. | authz_personas=[courier_driver, lig_org_operators] | () -> (bool)
101
+ *
102
+ * @param {string} taskGroupId
103
+ * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
104
+ *
105
+ * @throws {@link Chrt.UnprocessableEntityError}
106
+ *
107
+ * @example
108
+ * await client.taskGroups.startV1("task_group_id")
81
109
  */
82
- togglePauseV1(id: string, request: Chrt.SetTaskGroupPauseReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
83
- private __togglePauseV1;
110
+ startV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
111
+ private __startV1;
84
112
  protected _getAuthorizationHeader(): Promise<string | undefined>;
85
113
  }
@@ -30,27 +30,28 @@ export class TaskGroups {
30
30
  return ((_a = this._expandedList) !== null && _a !== void 0 ? _a : (this._expandedList = new ExpandedList(this._options)));
31
31
  }
32
32
  /**
33
- * Updates task group driver assignments by adding or removing drivers. | (UpdateTaskGroupReq) -> (bool)
33
+ * Updates the ordering of tasks in a task group. Task group must be in STAGED or IN_PROGRESS status. | authz_personas=[lig_org_operators] | (SetTaskOrderingReq) -> (bool)
34
34
  *
35
- * @param {Chrt.UpdateTaskGroupReq} request
35
+ * @param {string} taskGroupId
36
+ * @param {Chrt.SetTaskOrderingReq} request
36
37
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
37
38
  *
38
39
  * @throws {@link Chrt.UnprocessableEntityError}
39
40
  *
40
41
  * @example
41
- * await client.taskGroups.updateV1({
42
- * task_group_id: "task_group_id"
42
+ * await client.taskGroups.setTaskOrderingV1("task_group_id", {
43
+ * task_ordering: ["task_ordering"]
43
44
  * })
44
45
  */
45
- updateV1(request, requestOptions) {
46
- return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
46
+ setTaskOrderingV1(taskGroupId, request, requestOptions) {
47
+ return core.HttpResponsePromise.fromPromise(this.__setTaskOrderingV1(taskGroupId, request, requestOptions));
47
48
  }
48
- __updateV1(request, requestOptions) {
49
+ __setTaskOrderingV1(taskGroupId, request, requestOptions) {
49
50
  return __awaiter(this, void 0, void 0, function* () {
50
51
  var _a, _b, _c, _d;
51
52
  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);
52
53
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
53
- 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, "oort/task_groups/update/v1"),
54
+ 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, `oort/task_groups/set_task_ordering/v1/${encodeURIComponent(taskGroupId)}`),
54
55
  method: "POST",
55
56
  headers: _headers,
56
57
  contentType: "application/json",
@@ -84,7 +85,7 @@ export class TaskGroups {
84
85
  rawResponse: _response.rawResponse,
85
86
  });
86
87
  case "timeout":
87
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/update/v1.");
88
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/set_task_ordering/v1/{task_group_id}.");
88
89
  case "unknown":
89
90
  throw new errors.ChrtError({
90
91
  message: _response.error.errorMessage,
@@ -94,28 +95,34 @@ export class TaskGroups {
94
95
  });
95
96
  }
96
97
  /**
97
- * Starts a task group by changing its status to in-progress and updating the order status. Only authorized personas (task_group_driver or task_group_courier_org_administrator) can start a task group. | () -> (bool)
98
+ * Updates the flight number on both task group and all its tasks. Task group must be in STAGED or IN_PROGRESS status. | authz_personas=[lig_org_operators] | (SetFlightNumberReq) -> (bool)
98
99
  *
99
100
  * @param {string} taskGroupId
101
+ * @param {Chrt.SetFlightNumberReq} request
100
102
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
101
103
  *
102
104
  * @throws {@link Chrt.UnprocessableEntityError}
103
105
  *
104
106
  * @example
105
- * await client.taskGroups.startV1("task_group_id")
107
+ * await client.taskGroups.setFlightNumberV1("task_group_id", {
108
+ * flight_number: "flight_number"
109
+ * })
106
110
  */
107
- startV1(taskGroupId, requestOptions) {
108
- return core.HttpResponsePromise.fromPromise(this.__startV1(taskGroupId, requestOptions));
111
+ setFlightNumberV1(taskGroupId, request, requestOptions) {
112
+ return core.HttpResponsePromise.fromPromise(this.__setFlightNumberV1(taskGroupId, request, requestOptions));
109
113
  }
110
- __startV1(taskGroupId, requestOptions) {
114
+ __setFlightNumberV1(taskGroupId, request, requestOptions) {
111
115
  return __awaiter(this, void 0, void 0, function* () {
112
116
  var _a, _b, _c, _d;
113
117
  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);
114
118
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
115
- 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, `oort/task_groups/start/v1/${encodeURIComponent(taskGroupId)}`),
116
- method: "PUT",
119
+ 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, `oort/task_groups/set_flight_number/v1/${encodeURIComponent(taskGroupId)}`),
120
+ method: "POST",
117
121
  headers: _headers,
122
+ contentType: "application/json",
118
123
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
124
+ requestType: "json",
125
+ body: request,
119
126
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
120
127
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
121
128
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -143,7 +150,7 @@ export class TaskGroups {
143
150
  rawResponse: _response.rawResponse,
144
151
  });
145
152
  case "timeout":
146
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/start/v1/{task_group_id}.");
153
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/set_flight_number/v1/{task_group_id}.");
147
154
  case "unknown":
148
155
  throw new errors.ChrtError({
149
156
  message: _response.error.errorMessage,
@@ -153,30 +160,90 @@ export class TaskGroups {
153
160
  });
154
161
  }
155
162
  /**
156
- * Toggles the pause status of an in-progress task group. | (SetTaskGroupPauseReq) -> (bool)
163
+ * Sets or removes the driver assigned to a task group. | authz_personas=[courier_org_operators] | (UpdateTaskGroupDriverReq) -> (bool)
157
164
  *
158
- * @param {string} id
159
- * @param {Chrt.SetTaskGroupPauseReq} request
165
+ * @param {string} taskGroupId
166
+ * @param {Chrt.UpdateTaskGroupDriverReq} request
160
167
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
161
168
  *
162
169
  * @throws {@link Chrt.UnprocessableEntityError}
163
170
  *
164
171
  * @example
165
- * await client.taskGroups.togglePauseV1("id", {
166
- * task_group_id: "task_group_id",
167
- * paused: true
168
- * })
172
+ * await client.taskGroups.updateDriverV1("task_group_id")
169
173
  */
170
- togglePauseV1(id, request, requestOptions) {
171
- return core.HttpResponsePromise.fromPromise(this.__togglePauseV1(id, request, requestOptions));
174
+ updateDriverV1(taskGroupId, request = {}, requestOptions) {
175
+ return core.HttpResponsePromise.fromPromise(this.__updateDriverV1(taskGroupId, request, requestOptions));
172
176
  }
173
- __togglePauseV1(id, request, requestOptions) {
174
- return __awaiter(this, void 0, void 0, function* () {
177
+ __updateDriverV1(taskGroupId_1) {
178
+ return __awaiter(this, arguments, void 0, function* (taskGroupId, request = {}, requestOptions) {
175
179
  var _a, _b, _c, _d;
176
180
  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);
177
181
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
178
- 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, `oort/task_groups/toggle_pause/v1/${encodeURIComponent(id)}`),
179
- method: "PUT",
182
+ 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, `oort/task_groups/update_driver/v1/${encodeURIComponent(taskGroupId)}`),
183
+ method: "POST",
184
+ headers: _headers,
185
+ contentType: "application/json",
186
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ requestType: "json",
188
+ body: request,
189
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
190
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
191
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
192
+ });
193
+ if (_response.ok) {
194
+ return { data: _response.body, rawResponse: _response.rawResponse };
195
+ }
196
+ if (_response.error.reason === "status-code") {
197
+ switch (_response.error.statusCode) {
198
+ case 422:
199
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
200
+ default:
201
+ throw new errors.ChrtError({
202
+ statusCode: _response.error.statusCode,
203
+ body: _response.error.body,
204
+ rawResponse: _response.rawResponse,
205
+ });
206
+ }
207
+ }
208
+ switch (_response.error.reason) {
209
+ case "non-json":
210
+ throw new errors.ChrtError({
211
+ statusCode: _response.error.statusCode,
212
+ body: _response.error.rawBody,
213
+ rawResponse: _response.rawResponse,
214
+ });
215
+ case "timeout":
216
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/update_driver/v1/{task_group_id}.");
217
+ case "unknown":
218
+ throw new errors.ChrtError({
219
+ message: _response.error.errorMessage,
220
+ rawResponse: _response.rawResponse,
221
+ });
222
+ }
223
+ });
224
+ }
225
+ /**
226
+ * Sets or removes the courier organization assigned to a task group. | authz_personas=[forwarder_org_operators] | (UpdateTaskGroupCourierOrgReq) -> (bool)
227
+ *
228
+ * @param {string} taskGroupId
229
+ * @param {Chrt.UpdateTaskGroupCourierOrgReq} request
230
+ * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
231
+ *
232
+ * @throws {@link Chrt.UnprocessableEntityError}
233
+ *
234
+ * @example
235
+ * await client.taskGroups.updateCourierOrgV1("task_group_id")
236
+ */
237
+ updateCourierOrgV1(taskGroupId, request = {}, requestOptions) {
238
+ return core.HttpResponsePromise.fromPromise(this.__updateCourierOrgV1(taskGroupId, request, requestOptions));
239
+ }
240
+ __updateCourierOrgV1(taskGroupId_1) {
241
+ return __awaiter(this, arguments, void 0, function* (taskGroupId, request = {}, requestOptions) {
242
+ var _a, _b, _c, _d;
243
+ 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);
244
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
245
+ 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, `oort/task_groups/update_courier_org/v1/${encodeURIComponent(taskGroupId)}`),
246
+ method: "POST",
180
247
  headers: _headers,
181
248
  contentType: "application/json",
182
249
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -209,7 +276,66 @@ export class TaskGroups {
209
276
  rawResponse: _response.rawResponse,
210
277
  });
211
278
  case "timeout":
212
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/toggle_pause/v1/{id}.");
279
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/update_courier_org/v1/{task_group_id}.");
280
+ case "unknown":
281
+ throw new errors.ChrtError({
282
+ message: _response.error.errorMessage,
283
+ rawResponse: _response.rawResponse,
284
+ });
285
+ }
286
+ });
287
+ }
288
+ /**
289
+ * Starts a task group by changing its status to in-progress and updating the order status. | authz_personas=[courier_driver, lig_org_operators] | () -> (bool)
290
+ *
291
+ * @param {string} taskGroupId
292
+ * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
293
+ *
294
+ * @throws {@link Chrt.UnprocessableEntityError}
295
+ *
296
+ * @example
297
+ * await client.taskGroups.startV1("task_group_id")
298
+ */
299
+ startV1(taskGroupId, requestOptions) {
300
+ return core.HttpResponsePromise.fromPromise(this.__startV1(taskGroupId, requestOptions));
301
+ }
302
+ __startV1(taskGroupId, requestOptions) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ var _a, _b, _c, _d;
305
+ 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);
306
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
307
+ 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, `oort/task_groups/start/v1/${encodeURIComponent(taskGroupId)}`),
308
+ method: "PUT",
309
+ headers: _headers,
310
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
311
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
312
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
313
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
314
+ });
315
+ if (_response.ok) {
316
+ return { data: _response.body, rawResponse: _response.rawResponse };
317
+ }
318
+ if (_response.error.reason === "status-code") {
319
+ switch (_response.error.statusCode) {
320
+ case 422:
321
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
322
+ default:
323
+ throw new errors.ChrtError({
324
+ statusCode: _response.error.statusCode,
325
+ body: _response.error.body,
326
+ rawResponse: _response.rawResponse,
327
+ });
328
+ }
329
+ }
330
+ switch (_response.error.reason) {
331
+ case "non-json":
332
+ throw new errors.ChrtError({
333
+ statusCode: _response.error.statusCode,
334
+ body: _response.error.rawBody,
335
+ rawResponse: _response.rawResponse,
336
+ });
337
+ case "timeout":
338
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/start/v1/{task_group_id}.");
213
339
  case "unknown":
214
340
  throw new errors.ChrtError({
215
341
  message: _response.error.errorMessage,