@chrt-inc/typescript-sdk 1.305.0 → 1.306.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +14 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +63 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +18 -5
- package/dist/cjs/api/resources/orgs/client/Client.js +69 -7
- package/dist/cjs/api/resources/orgs/client/requests/CreateOrgPublicDataReq.d.ts +1 -5
- package/dist/cjs/api/resources/orgs/client/requests/SetOrgTypeReq.d.ts +13 -0
- package/dist/cjs/api/resources/orgs/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +47 -19
- package/dist/cjs/api/resources/taskGroups/client/Client.js +157 -31
- package/dist/cjs/api/resources/taskGroups/client/requests/SetFlightNumberReq.d.ts +12 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/SetFlightNumberReq.js +5 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskOrderingReq.d.ts +12 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskOrderingReq.js +5 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.d.ts +12 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.js +5 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.d.ts +11 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.js +5 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +4 -2
- package/dist/cjs/api/types/ClerkOrgData.d.ts +2 -1
- package/dist/cjs/api/types/CreateOrgPublicDataRes.d.ts +7 -0
- package/dist/cjs/api/types/CreateOrgPublicDataRes.js +5 -0
- package/dist/cjs/api/types/OrderDraftExpandedRes.d.ts +1 -0
- package/dist/cjs/api/types/OrgRoleEnum.d.ts +28 -0
- package/dist/cjs/api/types/OrgRoleEnum.js +12 -0
- package/dist/cjs/api/types/TaskClientUpdate1.d.ts +1 -0
- package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +14 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +63 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/client/Client.d.mts +18 -5
- package/dist/esm/api/resources/orgs/client/Client.mjs +69 -7
- package/dist/esm/api/resources/orgs/client/requests/CreateOrgPublicDataReq.d.mts +1 -5
- package/dist/esm/api/resources/orgs/client/requests/SetOrgTypeReq.d.mts +13 -0
- package/dist/esm/api/resources/orgs/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/client/Client.d.mts +47 -19
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +157 -31
- package/dist/esm/api/resources/taskGroups/client/requests/SetFlightNumberReq.d.mts +12 -0
- package/dist/esm/api/resources/taskGroups/client/requests/SetFlightNumberReq.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/client/requests/SetTaskOrderingReq.d.mts +12 -0
- package/dist/esm/api/resources/taskGroups/client/requests/SetTaskOrderingReq.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.d.mts +12 -0
- package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupCourierOrgReq.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.d.mts +11 -0
- package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupDriverReq.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +4 -2
- package/dist/esm/api/types/ClerkOrgData.d.mts +2 -1
- package/dist/esm/api/types/CreateOrgPublicDataRes.d.mts +7 -0
- package/dist/esm/api/types/CreateOrgPublicDataRes.mjs +4 -0
- package/dist/esm/api/types/OrderDraftExpandedRes.d.mts +1 -0
- package/dist/esm/api/types/OrgRoleEnum.d.mts +28 -0
- package/dist/esm/api/types/OrgRoleEnum.mjs +9 -0
- package/dist/esm/api/types/TaskClientUpdate1.d.mts +1 -0
- package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +304 -21
- package/dist/cjs/api/resources/taskGroups/client/requests/SetTaskGroupPauseReq.d.ts +0 -14
- package/dist/cjs/api/resources/taskGroups/client/requests/UpdateTaskGroupReq.d.ts +0 -14
- package/dist/esm/api/resources/taskGroups/client/requests/SetTaskGroupPauseReq.d.mts +0 -14
- package/dist/esm/api/resources/taskGroups/client/requests/UpdateTaskGroupReq.d.mts +0 -14
- /package/dist/cjs/api/resources/{taskGroups/client/requests/SetTaskGroupPauseReq.js → orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.js} +0 -0
- /package/dist/cjs/api/resources/{taskGroups/client/requests/UpdateTaskGroupReq.js → orgs/client/requests/SetOrgTypeReq.js} +0 -0
- /package/dist/esm/api/resources/{taskGroups/client/requests/SetTaskGroupPauseReq.mjs → orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.mjs} +0 -0
- /package/dist/esm/api/resources/{taskGroups/client/requests/UpdateTaskGroupReq.mjs → orgs/client/requests/SetOrgTypeReq.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -71,8 +71,8 @@ class ChrtClient {
|
|
|
71
71
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
72
72
|
"X-Fern-Language": "JavaScript",
|
|
73
73
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
74
|
-
"X-Fern-SDK-Version": "1.
|
|
75
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
74
|
+
"X-Fern-SDK-Version": "1.306.0",
|
|
75
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.306.0",
|
|
76
76
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
77
77
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
78
78
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -46,6 +46,20 @@ export declare class TaskGroup {
|
|
|
46
46
|
*/
|
|
47
47
|
addV1(request: Chrt.orderDrafts.OrderDraftAddTaskGroupReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<string>;
|
|
48
48
|
private __addV1;
|
|
49
|
+
/**
|
|
50
|
+
* Sets or removes courier org. Sets task ordering (must provide all task ids). | (UpdateTaskGroupDraftReq) -> (bool)
|
|
51
|
+
*
|
|
52
|
+
* @param {string} taskGroupId
|
|
53
|
+
* @param {Chrt.orderDrafts.UpdateTaskGroupDraftReq} request
|
|
54
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
|
+
*
|
|
56
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* await client.orderDrafts.taskGroup.updateV1("task_group_id")
|
|
60
|
+
*/
|
|
61
|
+
updateV1(taskGroupId: string, request?: Chrt.orderDrafts.UpdateTaskGroupDraftReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
62
|
+
private __updateV1;
|
|
49
63
|
/**
|
|
50
64
|
* Deletes a task group and all associated entities (tasks, task artifacts, S3 metadata). The task group must belong to a DRAFT order. | () -> (bool)
|
|
51
65
|
*
|
|
@@ -120,6 +120,69 @@ class TaskGroup {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Sets or removes courier org. Sets task ordering (must provide all task ids). | (UpdateTaskGroupDraftReq) -> (bool)
|
|
125
|
+
*
|
|
126
|
+
* @param {string} taskGroupId
|
|
127
|
+
* @param {Chrt.orderDrafts.UpdateTaskGroupDraftReq} request
|
|
128
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
|
+
*
|
|
130
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* await client.orderDrafts.taskGroup.updateV1("task_group_id")
|
|
134
|
+
*/
|
|
135
|
+
updateV1(taskGroupId, request = {}, requestOptions) {
|
|
136
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(taskGroupId, request, requestOptions));
|
|
137
|
+
}
|
|
138
|
+
__updateV1(taskGroupId_1) {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* (taskGroupId, request = {}, requestOptions) {
|
|
140
|
+
var _a, _b, _c, _d;
|
|
141
|
+
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);
|
|
142
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
143
|
+
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)}`),
|
|
144
|
+
method: "PATCH",
|
|
145
|
+
headers: _headers,
|
|
146
|
+
contentType: "application/json",
|
|
147
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
148
|
+
requestType: "json",
|
|
149
|
+
body: request,
|
|
150
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
151
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
152
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
153
|
+
});
|
|
154
|
+
if (_response.ok) {
|
|
155
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
156
|
+
}
|
|
157
|
+
if (_response.error.reason === "status-code") {
|
|
158
|
+
switch (_response.error.statusCode) {
|
|
159
|
+
case 422:
|
|
160
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
161
|
+
default:
|
|
162
|
+
throw new errors.ChrtError({
|
|
163
|
+
statusCode: _response.error.statusCode,
|
|
164
|
+
body: _response.error.body,
|
|
165
|
+
rawResponse: _response.rawResponse,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
switch (_response.error.reason) {
|
|
170
|
+
case "non-json":
|
|
171
|
+
throw new errors.ChrtError({
|
|
172
|
+
statusCode: _response.error.statusCode,
|
|
173
|
+
body: _response.error.rawBody,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
case "timeout":
|
|
177
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/update/v1/{task_group_id}.");
|
|
178
|
+
case "unknown":
|
|
179
|
+
throw new errors.ChrtError({
|
|
180
|
+
message: _response.error.errorMessage,
|
|
181
|
+
rawResponse: _response.rawResponse,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
123
186
|
/**
|
|
124
187
|
* Deletes a task group and all associated entities (tasks, task artifacts, S3 metadata). The task group must belong to a DRAFT order. | () -> (bool)
|
|
125
188
|
*
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
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
|
|
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
|
*
|
|
@@ -209,7 +209,7 @@ class Orgs {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
|
-
* Creates
|
|
212
|
+
* Creates org_public_data and org_private_data documents for the authenticated organization using org_type from JWT. | (CreateOrgPublicDataReq) -> (CreateOrgPublicDataRes)
|
|
213
213
|
*
|
|
214
214
|
* @param {Chrt.CreateOrgPublicDataReq} request
|
|
215
215
|
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -217,15 +217,13 @@ class Orgs {
|
|
|
217
217
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
218
218
|
*
|
|
219
219
|
* @example
|
|
220
|
-
* await client.orgs.createOrgPublicDataV1(
|
|
221
|
-
* org_type: "courier"
|
|
222
|
-
* })
|
|
220
|
+
* await client.orgs.createOrgPublicDataV1()
|
|
223
221
|
*/
|
|
224
|
-
createOrgPublicDataV1(request, requestOptions) {
|
|
222
|
+
createOrgPublicDataV1(request = {}, requestOptions) {
|
|
225
223
|
return core.HttpResponsePromise.fromPromise(this.__createOrgPublicDataV1(request, requestOptions));
|
|
226
224
|
}
|
|
227
|
-
__createOrgPublicDataV1(
|
|
228
|
-
return __awaiter(this,
|
|
225
|
+
__createOrgPublicDataV1() {
|
|
226
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
229
227
|
var _a, _b, _c, _d;
|
|
230
228
|
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);
|
|
231
229
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -452,6 +450,70 @@ class Orgs {
|
|
|
452
450
|
}
|
|
453
451
|
});
|
|
454
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* 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)
|
|
455
|
+
*
|
|
456
|
+
* @param {Chrt.SetOrgTypeReq} request
|
|
457
|
+
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
458
|
+
*
|
|
459
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* await client.orgs.setOrgTypeV1({
|
|
463
|
+
* org_type: "courier"
|
|
464
|
+
* })
|
|
465
|
+
*/
|
|
466
|
+
setOrgTypeV1(request, requestOptions) {
|
|
467
|
+
return core.HttpResponsePromise.fromPromise(this.__setOrgTypeV1(request, requestOptions));
|
|
468
|
+
}
|
|
469
|
+
__setOrgTypeV1(request, requestOptions) {
|
|
470
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
+
var _a, _b, _c, _d;
|
|
472
|
+
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);
|
|
473
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
474
|
+
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"),
|
|
475
|
+
method: "POST",
|
|
476
|
+
headers: _headers,
|
|
477
|
+
contentType: "application/json",
|
|
478
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
479
|
+
requestType: "json",
|
|
480
|
+
body: request,
|
|
481
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
482
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
483
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
484
|
+
});
|
|
485
|
+
if (_response.ok) {
|
|
486
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
487
|
+
}
|
|
488
|
+
if (_response.error.reason === "status-code") {
|
|
489
|
+
switch (_response.error.statusCode) {
|
|
490
|
+
case 422:
|
|
491
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
492
|
+
default:
|
|
493
|
+
throw new errors.ChrtError({
|
|
494
|
+
statusCode: _response.error.statusCode,
|
|
495
|
+
body: _response.error.body,
|
|
496
|
+
rawResponse: _response.rawResponse,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
switch (_response.error.reason) {
|
|
501
|
+
case "non-json":
|
|
502
|
+
throw new errors.ChrtError({
|
|
503
|
+
statusCode: _response.error.statusCode,
|
|
504
|
+
body: _response.error.rawBody,
|
|
505
|
+
rawResponse: _response.rawResponse,
|
|
506
|
+
});
|
|
507
|
+
case "timeout":
|
|
508
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /orgs/set_org_type/v1.");
|
|
509
|
+
case "unknown":
|
|
510
|
+
throw new errors.ChrtError({
|
|
511
|
+
message: _response.error.errorMessage,
|
|
512
|
+
rawResponse: _response.rawResponse,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
}
|
|
455
517
|
/**
|
|
456
518
|
* Retrieves the Stripe Connect account ID for the authenticated organization. Returns 404 if not set. | () -> (str)
|
|
457
519
|
*
|
|
@@ -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.js";
|
|
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.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* org_type: "courier"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface SetOrgTypeReq {
|
|
12
|
+
org_type: Chrt.OrgTypeEnum;
|
|
13
|
+
}
|
|
@@ -37,49 +37,77 @@ export declare class TaskGroups {
|
|
|
37
37
|
get expanded(): Expanded;
|
|
38
38
|
get expandedList(): ExpandedList;
|
|
39
39
|
/**
|
|
40
|
-
* Updates task group
|
|
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 {
|
|
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.
|
|
49
|
-
*
|
|
49
|
+
* await client.taskGroups.setTaskOrderingV1("task_group_id", {
|
|
50
|
+
* task_ordering: ["task_ordering"]
|
|
50
51
|
* })
|
|
51
52
|
*/
|
|
52
|
-
|
|
53
|
-
private
|
|
53
|
+
setTaskOrderingV1(taskGroupId: string, request: Chrt.SetTaskOrderingReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
54
|
+
private __setTaskOrderingV1;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
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.
|
|
65
|
+
* await client.taskGroups.setFlightNumberV1("task_group_id", {
|
|
66
|
+
* flight_number: "flight_number"
|
|
67
|
+
* })
|
|
64
68
|
*/
|
|
65
|
-
|
|
66
|
-
private
|
|
69
|
+
setFlightNumberV1(taskGroupId: string, request: Chrt.SetFlightNumberReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
70
|
+
private __setFlightNumberV1;
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
72
|
+
* Sets or removes the driver assigned to a task group. | authz_personas=[courier_org_operators] | (UpdateTaskGroupDriverReq) -> (bool)
|
|
69
73
|
*
|
|
70
|
-
* @param {string}
|
|
71
|
-
* @param {Chrt.
|
|
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.
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
83
|
-
private
|
|
110
|
+
startV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
111
|
+
private __startV1;
|
|
84
112
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
85
113
|
}
|