@chrt-inc/typescript-sdk 1.296.0 → 1.299.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 (119) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +6 -65
  3. package/dist/cjs/api/resources/taskGroups/client/Client.js +7 -301
  4. package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +0 -2
  5. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/Client.d.ts +76 -0
  6. package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/client/Client.js +108 -26
  7. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/index.d.ts +2 -0
  8. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/index.js +17 -0
  9. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.ts +20 -0
  10. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.d.ts +90 -0
  12. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.js +326 -0
  13. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.js +17 -0
  15. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.ts +40 -0
  16. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.ts +40 -0
  17. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/index.d.ts +2 -0
  18. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/index.js +2 -0
  19. package/dist/cjs/api/resources/taskGroups/resources/expandedList/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/taskGroups/resources/expandedList/index.js +17 -0
  21. package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +4 -1
  22. package/dist/cjs/api/resources/taskGroups/resources/index.js +8 -2
  23. package/dist/cjs/api/types/SortOrderEnum.d.ts +11 -0
  24. package/dist/cjs/api/types/SortOrderEnum.js +10 -0
  25. package/dist/cjs/api/types/TaskExpanded.d.ts +1 -1
  26. package/dist/cjs/api/types/TaskGroupExpandedForCourierAdministrator.d.ts +1 -1
  27. package/dist/cjs/api/types/TaskGroupExpandedForCourierAdministratorReq.d.ts +19 -0
  28. package/dist/cjs/api/types/TaskGroupExpandedForCourierDriver.d.ts +2 -0
  29. package/dist/cjs/api/types/TaskGroupExpandedForCourierDriverReq.d.ts +19 -0
  30. package/dist/cjs/api/types/TaskGroupExpandedForShipper.d.ts +18 -0
  31. package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.d.ts +12 -0
  32. package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.js +11 -0
  33. package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.ts +4 -0
  34. package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.d.ts +4 -0
  35. package/dist/cjs/api/types/index.d.ts +5 -6
  36. package/dist/cjs/api/types/index.js +5 -6
  37. package/dist/cjs/version.d.ts +1 -1
  38. package/dist/cjs/version.js +1 -1
  39. package/dist/esm/Client.mjs +2 -2
  40. package/dist/esm/api/resources/taskGroups/client/Client.d.mts +6 -65
  41. package/dist/esm/api/resources/taskGroups/client/Client.mjs +7 -301
  42. package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +0 -2
  43. package/dist/esm/api/resources/taskGroups/resources/expanded/client/Client.d.mts +76 -0
  44. package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/client/Client.mjs +106 -24
  45. package/dist/esm/api/resources/taskGroups/resources/expanded/client/index.d.mts +2 -0
  46. package/dist/esm/api/resources/taskGroups/resources/expanded/client/index.mjs +1 -0
  47. package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.mts +20 -0
  48. package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/index.d.mts +1 -0
  49. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.d.mts +90 -0
  50. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.mjs +289 -0
  51. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.d.mts +2 -0
  52. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.mjs +1 -0
  53. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.mts +40 -0
  54. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.mts +40 -0
  55. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/index.d.mts +2 -0
  56. package/dist/esm/api/resources/taskGroups/resources/expandedList/index.d.mts +1 -0
  57. package/dist/esm/api/resources/taskGroups/resources/expandedList/index.mjs +1 -0
  58. package/dist/esm/api/resources/taskGroups/resources/index.d.mts +4 -1
  59. package/dist/esm/api/resources/taskGroups/resources/index.mjs +4 -1
  60. package/dist/esm/api/types/SortOrderEnum.d.mts +11 -0
  61. package/dist/esm/api/types/SortOrderEnum.mjs +7 -0
  62. package/dist/esm/api/types/TaskExpanded.d.mts +1 -1
  63. package/dist/esm/api/types/TaskGroupExpandedForCourierAdministrator.d.mts +1 -1
  64. package/dist/esm/api/types/TaskGroupExpandedForCourierAdministratorReq.d.mts +19 -0
  65. package/dist/esm/api/types/TaskGroupExpandedForCourierDriver.d.mts +2 -0
  66. package/dist/esm/api/types/TaskGroupExpandedForCourierDriverReq.d.mts +19 -0
  67. package/dist/esm/api/types/TaskGroupExpandedForShipper.d.mts +18 -0
  68. package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.d.mts +12 -0
  69. package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.mjs +8 -0
  70. package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.mts +4 -0
  71. package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.d.mts +4 -0
  72. package/dist/esm/api/types/index.d.mts +5 -6
  73. package/dist/esm/api/types/index.mjs +5 -6
  74. package/dist/esm/version.d.mts +1 -1
  75. package/dist/esm/version.mjs +1 -1
  76. package/package.json +1 -1
  77. package/reference.md +262 -316
  78. package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierAdministratorReq.d.ts +0 -34
  79. package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.ts +0 -32
  80. package/dist/cjs/api/resources/taskGroups/resources/full/client/Client.d.ts +0 -57
  81. package/dist/cjs/api/types/MultipleTaskGroupsDetailsResponse.d.ts +0 -7
  82. package/dist/cjs/api/types/MultipleTaskGroupsWithTasks.d.ts +0 -7
  83. package/dist/cjs/api/types/TaskGroupDetailsResponse.d.ts +0 -8
  84. package/dist/cjs/api/types/TaskGroupWithDetails.d.ts +0 -8
  85. package/dist/cjs/api/types/TaskGroupWithTasks.d.ts +0 -8
  86. package/dist/cjs/api/types/TaskGroupWithTasks.js +0 -5
  87. package/dist/cjs/api/types/TaskWithDetails.d.ts +0 -9
  88. package/dist/cjs/api/types/TaskWithDetails.js +0 -5
  89. package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierAdministratorReq.d.mts +0 -34
  90. package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.mts +0 -32
  91. package/dist/esm/api/resources/taskGroups/resources/full/client/Client.d.mts +0 -57
  92. package/dist/esm/api/resources/taskGroups/resources/full/client/index.d.mts +0 -1
  93. package/dist/esm/api/types/MultipleTaskGroupsDetailsResponse.d.mts +0 -7
  94. package/dist/esm/api/types/MultipleTaskGroupsWithTasks.d.mts +0 -7
  95. package/dist/esm/api/types/TaskGroupDetailsResponse.d.mts +0 -8
  96. package/dist/esm/api/types/TaskGroupWithDetails.d.mts +0 -8
  97. package/dist/esm/api/types/TaskGroupWithTasks.d.mts +0 -8
  98. package/dist/esm/api/types/TaskGroupWithTasks.mjs +0 -4
  99. package/dist/esm/api/types/TaskWithDetails.d.mts +0 -9
  100. package/dist/esm/api/types/TaskWithDetails.mjs +0 -4
  101. /package/dist/cjs/api/resources/taskGroups/{client/requests/TaskGroupExpandedForCourierAdministratorReq.js → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.js} +0 -0
  102. /package/dist/cjs/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.js +0 -0
  103. /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.d.ts +0 -0
  104. /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.js +0 -0
  105. /package/dist/cjs/api/resources/taskGroups/{client/requests/TaskGroupExpandedForCourierDriverReq.js → resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.js} +0 -0
  106. /package/dist/cjs/api/{types/MultipleTaskGroupsDetailsResponse.js → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.js} +0 -0
  107. /package/dist/cjs/api/types/{MultipleTaskGroupsWithTasks.js → TaskGroupExpandedForCourierAdministratorReq.js} +0 -0
  108. /package/dist/cjs/api/types/{TaskGroupDetailsResponse.js → TaskGroupExpandedForCourierDriverReq.js} +0 -0
  109. /package/dist/cjs/api/types/{TaskGroupWithDetails.js → TaskGroupExpandedForShipper.js} +0 -0
  110. /package/dist/esm/api/resources/taskGroups/{client/requests/TaskGroupExpandedForCourierAdministratorReq.mjs → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.mjs} +0 -0
  111. /package/dist/esm/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.mjs +0 -0
  112. /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.d.mts +0 -0
  113. /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.mjs +0 -0
  114. /package/dist/esm/api/resources/taskGroups/{client/requests/TaskGroupExpandedForCourierDriverReq.mjs → resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.mjs} +0 -0
  115. /package/dist/esm/api/{types/MultipleTaskGroupsDetailsResponse.mjs → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.mjs} +0 -0
  116. /package/dist/{cjs/api/resources/taskGroups/resources/full/client/index.d.ts → esm/api/resources/taskGroups/resources/expandedList/client/requests/index.mjs} +0 -0
  117. /package/dist/esm/api/types/{MultipleTaskGroupsWithTasks.mjs → TaskGroupExpandedForCourierAdministratorReq.mjs} +0 -0
  118. /package/dist/esm/api/types/{TaskGroupDetailsResponse.mjs → TaskGroupExpandedForCourierDriverReq.mjs} +0 -0
  119. /package/dist/esm/api/types/{TaskGroupWithDetails.mjs → TaskGroupExpandedForShipper.mjs} +0 -0
@@ -68,8 +68,8 @@ class ChrtClient {
68
68
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
69
69
  "X-Fern-Language": "JavaScript",
70
70
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
71
- "X-Fern-SDK-Version": "1.296.0",
72
- "User-Agent": "@chrt-inc/typescript-sdk/1.296.0",
71
+ "X-Fern-SDK-Version": "1.299.0",
72
+ "User-Agent": "@chrt-inc/typescript-sdk/1.299.0",
73
73
  "X-Fern-Runtime": core.RUNTIME.type,
74
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
75
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -4,7 +4,8 @@
4
4
  import * as environments from "../../../../environments.js";
5
5
  import * as core from "../../../../core/index.js";
6
6
  import * as Chrt from "../../../index.js";
7
- import { Full } from "../resources/full/client/Client.js";
7
+ import { Expanded } from "../resources/expanded/client/Client.js";
8
+ import { ExpandedList } from "../resources/expandedList/client/Client.js";
8
9
  export declare namespace TaskGroups {
9
10
  interface Options {
10
11
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -30,71 +31,11 @@ export declare namespace TaskGroups {
30
31
  }
31
32
  export declare class TaskGroups {
32
33
  protected readonly _options: TaskGroups.Options;
33
- protected _full: Full | undefined;
34
+ protected _expanded: Expanded | undefined;
35
+ protected _expandedList: ExpandedList | undefined;
34
36
  constructor(_options?: TaskGroups.Options);
35
- get full(): Full;
36
- /**
37
- * Lists all task groups assigned to the authenticated courier organization with their associated tasks.
38
- *
39
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
40
- *
41
- * @example
42
- * await client.taskGroups.listByCourierOrgIdV1()
43
- */
44
- listByCourierOrgIdV1(requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.MultipleTaskGroupsWithTasks>;
45
- private __listByCourierOrgIdV1;
46
- /**
47
- * Retrieves a specific task group by ID with its associated tasks.
48
- *
49
- * @param {string} id
50
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
51
- *
52
- * @throws {@link Chrt.UnprocessableEntityError}
53
- *
54
- * @example
55
- * await client.taskGroups.getByIdV1("id")
56
- */
57
- getByIdV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupWithTasks>;
58
- private __getByIdV1;
59
- /**
60
- * Lists all task groups assigned to a specific driver.
61
- *
62
- * @param {string} driverId
63
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
64
- *
65
- * @throws {@link Chrt.UnprocessableEntityError}
66
- *
67
- * @example
68
- * await client.taskGroups.listByDriverIdV1("driver_id")
69
- */
70
- listByDriverIdV1(driverId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroup1[]>;
71
- private __listByDriverIdV1;
72
- /**
73
- * Fetches task groups for the courier organization with optional filters and expanded related data.
74
- *
75
- * @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
76
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
77
- *
78
- * @throws {@link Chrt.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.taskGroups.postExpandedCourierAdministratorV1()
82
- */
83
- postExpandedCourierAdministratorV1(request?: Chrt.TaskGroupExpandedForCourierAdministratorReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupsExpandedForCourierAdministratorRes>;
84
- private __postExpandedCourierAdministratorV1;
85
- /**
86
- * Fetches task groups assigned to the authenticated courier driver with optional expanded related data.
87
- *
88
- * @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
89
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
90
- *
91
- * @throws {@link Chrt.UnprocessableEntityError}
92
- *
93
- * @example
94
- * await client.taskGroups.postExpandedCourierDriverV1()
95
- */
96
- postExpandedCourierDriverV1(request?: Chrt.TaskGroupExpandedForCourierDriverReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupsExpandedForCourierDriverRes>;
97
- private __postExpandedCourierDriverV1;
37
+ get expanded(): Expanded;
38
+ get expandedList(): ExpandedList;
98
39
  /**
99
40
  * Updates task group driver assignments by adding or removing drivers.
100
41
  *
@@ -51,313 +51,19 @@ const core = __importStar(require("../../../../core/index.js"));
51
51
  const Chrt = __importStar(require("../../../index.js"));
52
52
  const headers_js_1 = require("../../../../core/headers.js");
53
53
  const errors = __importStar(require("../../../../errors/index.js"));
54
- const Client_js_1 = require("../resources/full/client/Client.js");
54
+ const Client_js_1 = require("../resources/expanded/client/Client.js");
55
+ const Client_js_2 = require("../resources/expandedList/client/Client.js");
55
56
  class TaskGroups {
56
57
  constructor(_options = {}) {
57
58
  this._options = _options;
58
59
  }
59
- get full() {
60
+ get expanded() {
60
61
  var _a;
61
- return ((_a = this._full) !== null && _a !== void 0 ? _a : (this._full = new Client_js_1.Full(this._options)));
62
+ return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_1.Expanded(this._options)));
62
63
  }
63
- /**
64
- * Lists all task groups assigned to the authenticated courier organization with their associated tasks.
65
- *
66
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
67
- *
68
- * @example
69
- * await client.taskGroups.listByCourierOrgIdV1()
70
- */
71
- listByCourierOrgIdV1(requestOptions) {
72
- return core.HttpResponsePromise.fromPromise(this.__listByCourierOrgIdV1(requestOptions));
73
- }
74
- __listByCourierOrgIdV1(requestOptions) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- var _a, _b, _c, _d;
77
- 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);
78
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
79
- 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/by_courier_org_id/list/v1"),
80
- method: "GET",
81
- headers: _headers,
82
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
83
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
84
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
85
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
- });
87
- if (_response.ok) {
88
- return { data: _response.body, rawResponse: _response.rawResponse };
89
- }
90
- if (_response.error.reason === "status-code") {
91
- throw new errors.ChrtError({
92
- statusCode: _response.error.statusCode,
93
- body: _response.error.body,
94
- rawResponse: _response.rawResponse,
95
- });
96
- }
97
- switch (_response.error.reason) {
98
- case "non-json":
99
- throw new errors.ChrtError({
100
- statusCode: _response.error.statusCode,
101
- body: _response.error.rawBody,
102
- rawResponse: _response.rawResponse,
103
- });
104
- case "timeout":
105
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/by_courier_org_id/list/v1.");
106
- case "unknown":
107
- throw new errors.ChrtError({
108
- message: _response.error.errorMessage,
109
- rawResponse: _response.rawResponse,
110
- });
111
- }
112
- });
113
- }
114
- /**
115
- * Retrieves a specific task group by ID with its associated tasks.
116
- *
117
- * @param {string} id
118
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
119
- *
120
- * @throws {@link Chrt.UnprocessableEntityError}
121
- *
122
- * @example
123
- * await client.taskGroups.getByIdV1("id")
124
- */
125
- getByIdV1(id, requestOptions) {
126
- return core.HttpResponsePromise.fromPromise(this.__getByIdV1(id, requestOptions));
127
- }
128
- __getByIdV1(id, requestOptions) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- var _a, _b, _c, _d;
131
- 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);
132
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
133
- 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/v1/${encodeURIComponent(id)}`),
134
- method: "GET",
135
- headers: _headers,
136
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
137
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
138
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
139
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
140
- });
141
- if (_response.ok) {
142
- return { data: _response.body, rawResponse: _response.rawResponse };
143
- }
144
- if (_response.error.reason === "status-code") {
145
- switch (_response.error.statusCode) {
146
- case 422:
147
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
148
- default:
149
- throw new errors.ChrtError({
150
- statusCode: _response.error.statusCode,
151
- body: _response.error.body,
152
- rawResponse: _response.rawResponse,
153
- });
154
- }
155
- }
156
- switch (_response.error.reason) {
157
- case "non-json":
158
- throw new errors.ChrtError({
159
- statusCode: _response.error.statusCode,
160
- body: _response.error.rawBody,
161
- rawResponse: _response.rawResponse,
162
- });
163
- case "timeout":
164
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/v1/{id}.");
165
- case "unknown":
166
- throw new errors.ChrtError({
167
- message: _response.error.errorMessage,
168
- rawResponse: _response.rawResponse,
169
- });
170
- }
171
- });
172
- }
173
- /**
174
- * Lists all task groups assigned to a specific driver.
175
- *
176
- * @param {string} driverId
177
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
178
- *
179
- * @throws {@link Chrt.UnprocessableEntityError}
180
- *
181
- * @example
182
- * await client.taskGroups.listByDriverIdV1("driver_id")
183
- */
184
- listByDriverIdV1(driverId, requestOptions) {
185
- return core.HttpResponsePromise.fromPromise(this.__listByDriverIdV1(driverId, requestOptions));
186
- }
187
- __listByDriverIdV1(driverId, requestOptions) {
188
- return __awaiter(this, void 0, void 0, function* () {
189
- var _a, _b, _c, _d;
190
- 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);
191
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
192
- 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/list/v1/${encodeURIComponent(driverId)}`),
193
- method: "GET",
194
- headers: _headers,
195
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
196
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
197
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
198
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
199
- });
200
- if (_response.ok) {
201
- return { data: _response.body, rawResponse: _response.rawResponse };
202
- }
203
- if (_response.error.reason === "status-code") {
204
- switch (_response.error.statusCode) {
205
- case 422:
206
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
207
- default:
208
- throw new errors.ChrtError({
209
- statusCode: _response.error.statusCode,
210
- body: _response.error.body,
211
- rawResponse: _response.rawResponse,
212
- });
213
- }
214
- }
215
- switch (_response.error.reason) {
216
- case "non-json":
217
- throw new errors.ChrtError({
218
- statusCode: _response.error.statusCode,
219
- body: _response.error.rawBody,
220
- rawResponse: _response.rawResponse,
221
- });
222
- case "timeout":
223
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/list/v1/{driver_id}.");
224
- case "unknown":
225
- throw new errors.ChrtError({
226
- message: _response.error.errorMessage,
227
- rawResponse: _response.rawResponse,
228
- });
229
- }
230
- });
231
- }
232
- /**
233
- * Fetches task groups for the courier organization with optional filters and expanded related data.
234
- *
235
- * @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
236
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
237
- *
238
- * @throws {@link Chrt.UnprocessableEntityError}
239
- *
240
- * @example
241
- * await client.taskGroups.postExpandedCourierAdministratorV1()
242
- */
243
- postExpandedCourierAdministratorV1(request = {}, requestOptions) {
244
- return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierAdministratorV1(request, requestOptions));
245
- }
246
- __postExpandedCourierAdministratorV1() {
247
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
248
- var _a, _b, _c, _d;
249
- 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);
250
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
251
- 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/expanded/courier_administrator/v1"),
252
- method: "POST",
253
- headers: _headers,
254
- contentType: "application/json",
255
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
256
- requestType: "json",
257
- body: request,
258
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
259
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
260
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
261
- });
262
- if (_response.ok) {
263
- return {
264
- data: _response.body,
265
- rawResponse: _response.rawResponse,
266
- };
267
- }
268
- if (_response.error.reason === "status-code") {
269
- switch (_response.error.statusCode) {
270
- case 422:
271
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
272
- default:
273
- throw new errors.ChrtError({
274
- statusCode: _response.error.statusCode,
275
- body: _response.error.body,
276
- rawResponse: _response.rawResponse,
277
- });
278
- }
279
- }
280
- switch (_response.error.reason) {
281
- case "non-json":
282
- throw new errors.ChrtError({
283
- statusCode: _response.error.statusCode,
284
- body: _response.error.rawBody,
285
- rawResponse: _response.rawResponse,
286
- });
287
- case "timeout":
288
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/expanded/courier_administrator/v1.");
289
- case "unknown":
290
- throw new errors.ChrtError({
291
- message: _response.error.errorMessage,
292
- rawResponse: _response.rawResponse,
293
- });
294
- }
295
- });
296
- }
297
- /**
298
- * Fetches task groups assigned to the authenticated courier driver with optional expanded related data.
299
- *
300
- * @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
301
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
302
- *
303
- * @throws {@link Chrt.UnprocessableEntityError}
304
- *
305
- * @example
306
- * await client.taskGroups.postExpandedCourierDriverV1()
307
- */
308
- postExpandedCourierDriverV1(request = {}, requestOptions) {
309
- return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierDriverV1(request, requestOptions));
310
- }
311
- __postExpandedCourierDriverV1() {
312
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
313
- var _a, _b, _c, _d;
314
- 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);
315
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
316
- 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/expanded/courier_driver/v1"),
317
- method: "POST",
318
- headers: _headers,
319
- contentType: "application/json",
320
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
321
- requestType: "json",
322
- body: request,
323
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
324
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
325
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
326
- });
327
- if (_response.ok) {
328
- return {
329
- data: _response.body,
330
- rawResponse: _response.rawResponse,
331
- };
332
- }
333
- if (_response.error.reason === "status-code") {
334
- switch (_response.error.statusCode) {
335
- case 422:
336
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
337
- default:
338
- throw new errors.ChrtError({
339
- statusCode: _response.error.statusCode,
340
- body: _response.error.body,
341
- rawResponse: _response.rawResponse,
342
- });
343
- }
344
- }
345
- switch (_response.error.reason) {
346
- case "non-json":
347
- throw new errors.ChrtError({
348
- statusCode: _response.error.statusCode,
349
- body: _response.error.rawBody,
350
- rawResponse: _response.rawResponse,
351
- });
352
- case "timeout":
353
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/expanded/courier_driver/v1.");
354
- case "unknown":
355
- throw new errors.ChrtError({
356
- message: _response.error.errorMessage,
357
- rawResponse: _response.rawResponse,
358
- });
359
- }
360
- });
64
+ get expandedList() {
65
+ var _a;
66
+ return ((_a = this._expandedList) !== null && _a !== void 0 ? _a : (this._expandedList = new Client_js_2.ExpandedList(this._options)));
361
67
  }
362
68
  /**
363
69
  * Updates task group driver assignments by adding or removing drivers.
@@ -1,4 +1,2 @@
1
- export { type TaskGroupExpandedForCourierAdministratorReq } from "./TaskGroupExpandedForCourierAdministratorReq.js";
2
- export { type TaskGroupExpandedForCourierDriverReq } from "./TaskGroupExpandedForCourierDriverReq.js";
3
1
  export { type UpdateTaskGroupReq } from "./UpdateTaskGroupReq.js";
4
2
  export { type SetTaskGroupPauseReq } from "./SetTaskGroupPauseReq.js";
@@ -0,0 +1,76 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments.js";
5
+ import * as core from "../../../../../../core/index.js";
6
+ import * as Chrt from "../../../../../index.js";
7
+ export declare namespace Expanded {
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 Expanded {
31
+ protected readonly _options: Expanded.Options;
32
+ constructor(_options?: Expanded.Options);
33
+ /**
34
+ * Fetches an expanded task group for the courier org with expanded related data.
35
+ *
36
+ * @param {string} id
37
+ * @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
38
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Chrt.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.taskGroups.expanded.forCourierAdministratorByIdV1("id", {})
44
+ */
45
+ forCourierAdministratorByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierAdministratorReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierAdministrator>;
46
+ private __forCourierAdministratorByIdV1;
47
+ /**
48
+ * Fetches an expanded task group assigned to a courier driver with optional expanded related data.
49
+ *
50
+ * @param {string} id
51
+ * @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
52
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
53
+ *
54
+ * @throws {@link Chrt.UnprocessableEntityError}
55
+ *
56
+ * @example
57
+ * await client.taskGroups.expanded.forCourierDriverByIdV1("id", {})
58
+ */
59
+ forCourierDriverByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierDriverReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierDriver>;
60
+ private __forCourierDriverByIdV1;
61
+ /**
62
+ * Fetches an expanded task group for the shipper org with expanded related data.
63
+ *
64
+ * @param {string} id
65
+ * @param {Chrt.taskGroups.TaskGroupExpandedForShipperReq} request
66
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link Chrt.UnprocessableEntityError}
69
+ *
70
+ * @example
71
+ * await client.taskGroups.expanded.forShipperByIdV1("id")
72
+ */
73
+ forShipperByIdV1(id: string, request?: Chrt.taskGroups.TaskGroupExpandedForShipperReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForShipper>;
74
+ private __forShipperByIdV1;
75
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
76
+ }