@chrt-inc/typescript-sdk 1.1023.0 → 1.1024.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/README.md +12 -9
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +6 -13
- package/dist/cjs/api/resources/chrtGpt/client/Client.js +24 -17
- package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.ts → ChrtGptReq.d.ts} +1 -1
- package/dist/cjs/api/resources/chrtGpt/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/chrtGpt/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/index.js +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +65 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +205 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.ts +21 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.js +41 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/Client.d.ts +18 -1
- package/dist/cjs/api/resources/orgs/resources/connections/client/Client.js +75 -6
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.ts +4 -1
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.ts +12 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/index.js +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.js +41 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.ts +86 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.js +319 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.js +17 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.ts +13 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.js +17 -0
- package/dist/cjs/api/types/ChrtGptAssistantMessageItem.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptAssistantMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversation1.d.ts +14 -0
- package/dist/cjs/api/types/ChrtGptConversation1.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.js +10 -0
- package/dist/cjs/api/types/ChrtGptErrorEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptErrorEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptEvent.d.ts +31 -0
- package/dist/cjs/api/types/ChrtGptEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.d.ts +22 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.js +5 -0
- package/dist/{esm/api/types/ChrtGptMessageRes.d.mts → cjs/api/types/ChrtGptStartedEvent.d.ts} +4 -2
- package/dist/cjs/api/types/ChrtGptStartedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptTitleEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.d.ts +12 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.d.ts +6 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.d.ts +18 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.js +5 -0
- package/dist/cjs/api/types/OrgPublicData1.d.ts +1 -0
- package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.d.ts +21 -0
- package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.js +5 -0
- package/dist/cjs/api/types/ShipperCoordinatorConnection1.d.ts +4 -0
- package/dist/cjs/api/types/SpecialHandlingCodeEnum1.d.ts +63 -1
- package/dist/cjs/api/types/SpecialHandlingCodeEnum1.js +62 -0
- package/dist/cjs/api/types/index.d.ts +17 -1
- package/dist/cjs/api/types/index.js +17 -1
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/core/stream/Stream.d.ts +46 -0
- package/dist/cjs/core/stream/Stream.js +169 -0
- package/dist/cjs/core/stream/index.d.ts +1 -0
- package/dist/cjs/core/stream/index.js +5 -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/chrtGpt/client/Client.d.mts +6 -13
- package/dist/esm/api/resources/chrtGpt/client/Client.mjs +24 -17
- package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.mts → ChrtGptReq.d.mts} +1 -1
- package/dist/esm/api/resources/chrtGpt/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/chrtGpt/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +65 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +168 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.mts +21 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.mjs +2 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/Client.d.mts +18 -1
- package/dist/esm/api/resources/orgs/resources/connections/client/Client.mjs +75 -6
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.mts +4 -1
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.mts +12 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +5 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/index.mjs +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.mts +86 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.mjs +282 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.mts +13 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.mjs +1 -0
- package/dist/esm/api/types/ChrtGptAssistantMessageItem.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptAssistantMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversation1.d.mts +14 -0
- package/dist/esm/api/types/ChrtGptConversation1.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationRes.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptConversationRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.mjs +7 -0
- package/dist/esm/api/types/ChrtGptErrorEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptErrorEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptEvent.d.mts +31 -0
- package/dist/esm/api/types/ChrtGptEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.d.mts +22 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.mjs +4 -0
- package/dist/{cjs/api/types/ChrtGptMessageRes.d.ts → esm/api/types/ChrtGptStartedEvent.d.mts} +4 -2
- package/dist/esm/api/types/ChrtGptStartedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptTitleEvent.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptTitleEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.d.mts +12 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.d.mts +6 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.d.mts +18 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.mjs +4 -0
- package/dist/esm/api/types/OrgPublicData1.d.mts +1 -0
- package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.d.mts +21 -0
- package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.mjs +4 -0
- package/dist/esm/api/types/ShipperCoordinatorConnection1.d.mts +4 -0
- package/dist/esm/api/types/SpecialHandlingCodeEnum1.d.mts +63 -1
- package/dist/esm/api/types/SpecialHandlingCodeEnum1.mjs +62 -0
- package/dist/esm/api/types/index.d.mts +17 -1
- package/dist/esm/api/types/index.mjs +17 -1
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/stream/Stream.d.mts +46 -0
- package/dist/esm/core/stream/Stream.mjs +164 -0
- package/dist/esm/core/stream/index.d.mts +1 -0
- package/dist/esm/core/stream/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +470 -4
- /package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.js → ChrtGptReq.js} +0 -0
- /package/dist/cjs/api/{types/ChrtGptMessageRes.js → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.js} +0 -0
- /package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.mjs → ChrtGptReq.mjs} +0 -0
- /package/dist/esm/api/{types/ChrtGptMessageRes.mjs → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.mjs} +0 -0
|
@@ -192,6 +192,22 @@ export declare class Connections {
|
|
|
192
192
|
*/
|
|
193
193
|
setShipperCoordinatorDefaultDepartmentV1(connectionId: string, request?: Chrt.orgs.ShipperCoordinatorConnectionClientUpdate1, requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
194
194
|
private __setShipperCoordinatorDefaultDepartmentV1;
|
|
195
|
+
/**
|
|
196
|
+
* Sets the coordinator's known-shipper designation for an on- or off-CHRT shipper and records who changed it and when. | authz: allowed_org_types=[provider], min_org_role=operator | (ShipperCoordinatorUpdateKnownShipperReq) -> (bool)
|
|
197
|
+
*
|
|
198
|
+
* @param {string} connectionId
|
|
199
|
+
* @param {Chrt.orgs.ShipperCoordinatorUpdateKnownShipperReq} request
|
|
200
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
+
*
|
|
202
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* await client.orgs.connections.setShipperCoordinatorKnownShipperV1("connection_id", {
|
|
206
|
+
* known_shipper: true
|
|
207
|
+
* })
|
|
208
|
+
*/
|
|
209
|
+
setShipperCoordinatorKnownShipperV1(connectionId: string, request: Chrt.orgs.ShipperCoordinatorUpdateKnownShipperReq, requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
210
|
+
private __setShipperCoordinatorKnownShipperV1;
|
|
195
211
|
/**
|
|
196
212
|
* Lists the caller's shipper connections with filtering, pagination, and identity search. | authz: allowed_org_types=[provider] | () -> (ShipperCoordinatorConnectionsForCoordinatorListRes)
|
|
197
213
|
*
|
|
@@ -206,7 +222,8 @@ export declare class Connections {
|
|
|
206
222
|
* page: 1,
|
|
207
223
|
* page_size: 1,
|
|
208
224
|
* filter_connection_ids: ["filter_connection_ids"],
|
|
209
|
-
* filter_connected: true
|
|
225
|
+
* filter_connected: true,
|
|
226
|
+
* filter_known_shipper: true
|
|
210
227
|
* })
|
|
211
228
|
*/
|
|
212
229
|
listShippersForCoordinatorV1(request?: Chrt.orgs.ConnectionsListShippersForCoordinatorV1Request, requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<Chrt.ShipperCoordinatorConnectionsForCoordinatorListRes>;
|
|
@@ -724,6 +724,71 @@ export class Connections {
|
|
|
724
724
|
}
|
|
725
725
|
});
|
|
726
726
|
}
|
|
727
|
+
/**
|
|
728
|
+
* Sets the coordinator's known-shipper designation for an on- or off-CHRT shipper and records who changed it and when. | authz: allowed_org_types=[provider], min_org_role=operator | (ShipperCoordinatorUpdateKnownShipperReq) -> (bool)
|
|
729
|
+
*
|
|
730
|
+
* @param {string} connectionId
|
|
731
|
+
* @param {Chrt.orgs.ShipperCoordinatorUpdateKnownShipperReq} request
|
|
732
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
733
|
+
*
|
|
734
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* await client.orgs.connections.setShipperCoordinatorKnownShipperV1("connection_id", {
|
|
738
|
+
* known_shipper: true
|
|
739
|
+
* })
|
|
740
|
+
*/
|
|
741
|
+
setShipperCoordinatorKnownShipperV1(connectionId, request, requestOptions) {
|
|
742
|
+
return core.HttpResponsePromise.fromPromise(this.__setShipperCoordinatorKnownShipperV1(connectionId, request, requestOptions));
|
|
743
|
+
}
|
|
744
|
+
__setShipperCoordinatorKnownShipperV1(connectionId, request, requestOptions) {
|
|
745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
746
|
+
var _a, _b, _c, _d;
|
|
747
|
+
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);
|
|
748
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
749
|
+
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/connections/set_shipper_coordinator_known_shipper/v1/${encodeURIComponent(connectionId)}`),
|
|
750
|
+
method: "PATCH",
|
|
751
|
+
headers: _headers,
|
|
752
|
+
contentType: "application/json",
|
|
753
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
754
|
+
requestType: "json",
|
|
755
|
+
body: request,
|
|
756
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
757
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
758
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
759
|
+
});
|
|
760
|
+
if (_response.ok) {
|
|
761
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
762
|
+
}
|
|
763
|
+
if (_response.error.reason === "status-code") {
|
|
764
|
+
switch (_response.error.statusCode) {
|
|
765
|
+
case 422:
|
|
766
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
767
|
+
default:
|
|
768
|
+
throw new errors.ChrtError({
|
|
769
|
+
statusCode: _response.error.statusCode,
|
|
770
|
+
body: _response.error.body,
|
|
771
|
+
rawResponse: _response.rawResponse,
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
switch (_response.error.reason) {
|
|
776
|
+
case "non-json":
|
|
777
|
+
throw new errors.ChrtError({
|
|
778
|
+
statusCode: _response.error.statusCode,
|
|
779
|
+
body: _response.error.rawBody,
|
|
780
|
+
rawResponse: _response.rawResponse,
|
|
781
|
+
});
|
|
782
|
+
case "timeout":
|
|
783
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /orgs/connections/set_shipper_coordinator_known_shipper/v1/{connection_id}.");
|
|
784
|
+
case "unknown":
|
|
785
|
+
throw new errors.ChrtError({
|
|
786
|
+
message: _response.error.errorMessage,
|
|
787
|
+
rawResponse: _response.rawResponse,
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
}
|
|
727
792
|
/**
|
|
728
793
|
* Lists the caller's shipper connections with filtering, pagination, and identity search. | authz: allowed_org_types=[provider] | () -> (ShipperCoordinatorConnectionsForCoordinatorListRes)
|
|
729
794
|
*
|
|
@@ -738,7 +803,8 @@ export class Connections {
|
|
|
738
803
|
* page: 1,
|
|
739
804
|
* page_size: 1,
|
|
740
805
|
* filter_connection_ids: ["filter_connection_ids"],
|
|
741
|
-
* filter_connected: true
|
|
806
|
+
* filter_connected: true,
|
|
807
|
+
* filter_known_shipper: true
|
|
742
808
|
* })
|
|
743
809
|
*/
|
|
744
810
|
listShippersForCoordinatorV1(request = {}, requestOptions) {
|
|
@@ -746,8 +812,8 @@ export class Connections {
|
|
|
746
812
|
}
|
|
747
813
|
__listShippersForCoordinatorV1() {
|
|
748
814
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
749
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
750
|
-
const { search, page, page_size: pageSize, filter_connection_ids: filterConnectionIds, filter_connected: filterConnected, } = request;
|
|
815
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
816
|
+
const { search, page, page_size: pageSize, filter_connection_ids: filterConnectionIds, filter_connected: filterConnected, filter_known_shipper: filterKnownShipper, } = request;
|
|
751
817
|
const _queryParams = {};
|
|
752
818
|
if (search !== undefined) {
|
|
753
819
|
_queryParams["search"] = search;
|
|
@@ -769,9 +835,12 @@ export class Connections {
|
|
|
769
835
|
if (filterConnected !== undefined) {
|
|
770
836
|
_queryParams["filter_connected"] = (_c = filterConnected === null || filterConnected === void 0 ? void 0 : filterConnected.toString()) !== null && _c !== void 0 ? _c : null;
|
|
771
837
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
838
|
+
if (filterKnownShipper !== undefined) {
|
|
839
|
+
_queryParams["filter_known_shipper"] = (_d = filterKnownShipper === null || filterKnownShipper === void 0 ? void 0 : filterKnownShipper.toString()) !== null && _d !== void 0 ? _d : null;
|
|
840
|
+
}
|
|
841
|
+
let _headers = mergeHeaders((_e = this._options) === null || _e === void 0 ? void 0 : _e.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
842
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
843
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.ChrtEnvironment.Local, "orgs/connections/shippers/list/for_coordinator/v1"),
|
|
775
844
|
method: "GET",
|
|
776
845
|
headers: _headers,
|
|
777
846
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* page: 1,
|
|
9
9
|
* page_size: 1,
|
|
10
10
|
* filter_connection_ids: ["filter_connection_ids"],
|
|
11
|
-
* filter_connected: true
|
|
11
|
+
* filter_connected: true,
|
|
12
|
+
* filter_known_shipper: true
|
|
12
13
|
* }
|
|
13
14
|
*/
|
|
14
15
|
export interface ConnectionsListShippersForCoordinatorV1Request {
|
|
@@ -20,4 +21,6 @@ export interface ConnectionsListShippersForCoordinatorV1Request {
|
|
|
20
21
|
filter_connection_ids?: (string | null) | (string | null)[];
|
|
21
22
|
/** Filter by connection status */
|
|
22
23
|
filter_connected?: boolean | null;
|
|
24
|
+
/** Filter by the coordinator's known-shipper designation */
|
|
25
|
+
filter_known_shipper?: boolean | null;
|
|
23
26
|
}
|
|
@@ -4,4 +4,5 @@ export { type ConnectionsListExecutorsGeoSearchForCoordinatorV1Request } from ".
|
|
|
4
4
|
export { type ConnectionsListExecutorsForCoordinatorV1Request } from "./ConnectionsListExecutorsForCoordinatorV1Request.mjs";
|
|
5
5
|
export { type CoordinatorExecutorUpdateAutoAssignReq } from "./CoordinatorExecutorUpdateAutoAssignReq.mjs";
|
|
6
6
|
export { type ShipperCoordinatorConnectionClientUpdate1 } from "./ShipperCoordinatorConnectionClientUpdate1.mjs";
|
|
7
|
+
export { type ShipperCoordinatorUpdateKnownShipperReq } from "./ShipperCoordinatorUpdateKnownShipperReq.mjs";
|
|
7
8
|
export { type ConnectionsListShippersForCoordinatorV1Request } from "./ConnectionsListShippersForCoordinatorV1Request.mjs";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../../../environments.mjs";
|
|
5
5
|
import * as core from "../../../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../../../index.mjs";
|
|
7
|
+
import { S3Object } from "../resources/s3Object/client/Client.mjs";
|
|
7
8
|
export declare namespace PublicData {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -29,7 +30,9 @@ export declare namespace PublicData {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class PublicData {
|
|
31
32
|
protected readonly _options: PublicData.Options;
|
|
33
|
+
protected _s3Object: S3Object | undefined;
|
|
32
34
|
constructor(_options?: PublicData.Options);
|
|
35
|
+
get s3Object(): S3Object;
|
|
33
36
|
/**
|
|
34
37
|
* Returns the organization avatar URL or a placeholder. | () -> (str)
|
|
35
38
|
*
|
|
@@ -15,10 +15,15 @@ import * as core from "../../../../../../core/index.mjs";
|
|
|
15
15
|
import * as Chrt from "../../../../../index.mjs";
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
+
import { S3Object } from "../resources/s3Object/client/Client.mjs";
|
|
18
19
|
export class PublicData {
|
|
19
20
|
constructor(_options = {}) {
|
|
20
21
|
this._options = _options;
|
|
21
22
|
}
|
|
23
|
+
get s3Object() {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new S3Object(this._options)));
|
|
26
|
+
}
|
|
22
27
|
/**
|
|
23
28
|
* Returns the organization avatar URL or a placeholder. | () -> (str)
|
|
24
29
|
*
|
package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.mts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../../../index.mjs";
|
|
7
|
+
export declare namespace S3Object {
|
|
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 S3Object {
|
|
31
|
+
protected readonly _options: S3Object.Options;
|
|
32
|
+
constructor(_options?: S3Object.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Uploads a file, such as a logo, to the caller's organization public data. Retains uploaded files; previews require a clean malware scan. | authz: min_org_role=operator | (UploadFile) -> (OrgPublicDataS3ObjectMetadata1)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.orgs.publicData.BodyPostOrgPublicDataS3ObjectAddV1} request
|
|
37
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* import { createReadStream } from "fs";
|
|
43
|
+
* await client.orgs.publicData.s3Object.addV1({
|
|
44
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
addV1(request: Chrt.orgs.publicData.BodyPostOrgPublicDataS3ObjectAddV1, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<Chrt.OrgPublicDataS3ObjectMetadata1>;
|
|
48
|
+
private __addV1;
|
|
49
|
+
/**
|
|
50
|
+
* Deletes an S3 object and its metadata from the caller's organization public data. | authz: min_org_role=operator | () -> (bool)
|
|
51
|
+
*
|
|
52
|
+
* @param {string} orgPublicDataS3ObjectMetadataId
|
|
53
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.orgs.publicData.s3Object.deleteV1("org_public_data_s3_object_metadata_id")
|
|
59
|
+
*/
|
|
60
|
+
deleteV1(orgPublicDataS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
61
|
+
private __deleteV1;
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves metadata for an organization public data S3 object. | () -> (OrgPublicDataS3ObjectMetadata1)
|
|
64
|
+
*
|
|
65
|
+
* @param {string} orgPublicDataS3ObjectMetadataId
|
|
66
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.orgs.publicData.s3Object.getS3ObjectMetadataV1("org_public_data_s3_object_metadata_id")
|
|
72
|
+
*/
|
|
73
|
+
getS3ObjectMetadataV1(orgPublicDataS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<Chrt.OrgPublicDataS3ObjectMetadata1>;
|
|
74
|
+
private __getS3ObjectMetadataV1;
|
|
75
|
+
/**
|
|
76
|
+
* Streams an organization public data S3 object file from storage. | () -> (binary)
|
|
77
|
+
* @throws {@link Chrt.ForbiddenError}
|
|
78
|
+
* @throws {@link Chrt.NotFoundError}
|
|
79
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
80
|
+
* @throws {@link Chrt.LockedError}
|
|
81
|
+
* @throws {@link Chrt.ServiceUnavailableError}
|
|
82
|
+
*/
|
|
83
|
+
getV1(orgPublicDataS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
84
|
+
private __getV1;
|
|
85
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
18
|
+
export class S3Object {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Uploads a file, such as a logo, to the caller's organization public data. Retains uploaded files; previews require a clean malware scan. | authz: min_org_role=operator | (UploadFile) -> (OrgPublicDataS3ObjectMetadata1)
|
|
24
|
+
*
|
|
25
|
+
* @param {Chrt.orgs.publicData.BodyPostOrgPublicDataS3ObjectAddV1} request
|
|
26
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* import { createReadStream } from "fs";
|
|
32
|
+
* await client.orgs.publicData.s3Object.addV1({
|
|
33
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
addV1(request, requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__addV1(request, requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__addV1(request, requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
const _request = yield core.newFormData();
|
|
43
|
+
yield _request.appendFile("file", request.file);
|
|
44
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
45
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
46
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
47
|
+
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/org_public_data/s3_object/add/v1"),
|
|
48
|
+
method: "POST",
|
|
49
|
+
headers: _headers,
|
|
50
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
51
|
+
requestType: "file",
|
|
52
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
53
|
+
body: _maybeEncodedRequest.body,
|
|
54
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
55
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
56
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
});
|
|
58
|
+
if (_response.ok) {
|
|
59
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
60
|
+
}
|
|
61
|
+
if (_response.error.reason === "status-code") {
|
|
62
|
+
switch (_response.error.statusCode) {
|
|
63
|
+
case 422:
|
|
64
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
65
|
+
default:
|
|
66
|
+
throw new errors.ChrtError({
|
|
67
|
+
statusCode: _response.error.statusCode,
|
|
68
|
+
body: _response.error.body,
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
switch (_response.error.reason) {
|
|
74
|
+
case "non-json":
|
|
75
|
+
throw new errors.ChrtError({
|
|
76
|
+
statusCode: _response.error.statusCode,
|
|
77
|
+
body: _response.error.rawBody,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
});
|
|
80
|
+
case "timeout":
|
|
81
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /orgs/org_public_data/s3_object/add/v1.");
|
|
82
|
+
case "unknown":
|
|
83
|
+
throw new errors.ChrtError({
|
|
84
|
+
message: _response.error.errorMessage,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Deletes an S3 object and its metadata from the caller's organization public data. | authz: min_org_role=operator | () -> (bool)
|
|
92
|
+
*
|
|
93
|
+
* @param {string} orgPublicDataS3ObjectMetadataId
|
|
94
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.orgs.publicData.s3Object.deleteV1("org_public_data_s3_object_metadata_id")
|
|
100
|
+
*/
|
|
101
|
+
deleteV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
102
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(orgPublicDataS3ObjectMetadataId, requestOptions));
|
|
103
|
+
}
|
|
104
|
+
__deleteV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
var _a, _b, _c, _d;
|
|
107
|
+
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);
|
|
108
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
109
|
+
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/org_public_data/s3_object/delete/v1/${encodeURIComponent(orgPublicDataS3ObjectMetadataId)}`),
|
|
110
|
+
method: "DELETE",
|
|
111
|
+
headers: _headers,
|
|
112
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
113
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
114
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
115
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
116
|
+
});
|
|
117
|
+
if (_response.ok) {
|
|
118
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
119
|
+
}
|
|
120
|
+
if (_response.error.reason === "status-code") {
|
|
121
|
+
switch (_response.error.statusCode) {
|
|
122
|
+
case 422:
|
|
123
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
124
|
+
default:
|
|
125
|
+
throw new errors.ChrtError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.body,
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
switch (_response.error.reason) {
|
|
133
|
+
case "non-json":
|
|
134
|
+
throw new errors.ChrtError({
|
|
135
|
+
statusCode: _response.error.statusCode,
|
|
136
|
+
body: _response.error.rawBody,
|
|
137
|
+
rawResponse: _response.rawResponse,
|
|
138
|
+
});
|
|
139
|
+
case "timeout":
|
|
140
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /orgs/org_public_data/s3_object/delete/v1/{org_public_data_s3_object_metadata_id}.");
|
|
141
|
+
case "unknown":
|
|
142
|
+
throw new errors.ChrtError({
|
|
143
|
+
message: _response.error.errorMessage,
|
|
144
|
+
rawResponse: _response.rawResponse,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves metadata for an organization public data S3 object. | () -> (OrgPublicDataS3ObjectMetadata1)
|
|
151
|
+
*
|
|
152
|
+
* @param {string} orgPublicDataS3ObjectMetadataId
|
|
153
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
154
|
+
*
|
|
155
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* await client.orgs.publicData.s3Object.getS3ObjectMetadataV1("org_public_data_s3_object_metadata_id")
|
|
159
|
+
*/
|
|
160
|
+
getS3ObjectMetadataV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
161
|
+
return core.HttpResponsePromise.fromPromise(this.__getS3ObjectMetadataV1(orgPublicDataS3ObjectMetadataId, requestOptions));
|
|
162
|
+
}
|
|
163
|
+
__getS3ObjectMetadataV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
var _a, _b, _c, _d;
|
|
166
|
+
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);
|
|
167
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
168
|
+
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/org_public_data/s3_object/s3_object_metadata/v1/${encodeURIComponent(orgPublicDataS3ObjectMetadataId)}`),
|
|
169
|
+
method: "GET",
|
|
170
|
+
headers: _headers,
|
|
171
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
172
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
173
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
174
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
175
|
+
});
|
|
176
|
+
if (_response.ok) {
|
|
177
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
178
|
+
}
|
|
179
|
+
if (_response.error.reason === "status-code") {
|
|
180
|
+
switch (_response.error.statusCode) {
|
|
181
|
+
case 422:
|
|
182
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
183
|
+
default:
|
|
184
|
+
throw new errors.ChrtError({
|
|
185
|
+
statusCode: _response.error.statusCode,
|
|
186
|
+
body: _response.error.body,
|
|
187
|
+
rawResponse: _response.rawResponse,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
switch (_response.error.reason) {
|
|
192
|
+
case "non-json":
|
|
193
|
+
throw new errors.ChrtError({
|
|
194
|
+
statusCode: _response.error.statusCode,
|
|
195
|
+
body: _response.error.rawBody,
|
|
196
|
+
rawResponse: _response.rawResponse,
|
|
197
|
+
});
|
|
198
|
+
case "timeout":
|
|
199
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /orgs/org_public_data/s3_object/s3_object_metadata/v1/{org_public_data_s3_object_metadata_id}.");
|
|
200
|
+
case "unknown":
|
|
201
|
+
throw new errors.ChrtError({
|
|
202
|
+
message: _response.error.errorMessage,
|
|
203
|
+
rawResponse: _response.rawResponse,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Streams an organization public data S3 object file from storage. | () -> (binary)
|
|
210
|
+
* @throws {@link Chrt.ForbiddenError}
|
|
211
|
+
* @throws {@link Chrt.NotFoundError}
|
|
212
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
213
|
+
* @throws {@link Chrt.LockedError}
|
|
214
|
+
* @throws {@link Chrt.ServiceUnavailableError}
|
|
215
|
+
*/
|
|
216
|
+
getV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
217
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(orgPublicDataS3ObjectMetadataId, requestOptions));
|
|
218
|
+
}
|
|
219
|
+
__getV1(orgPublicDataS3ObjectMetadataId, requestOptions) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
221
|
+
var _a, _b, _c, _d;
|
|
222
|
+
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);
|
|
223
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
224
|
+
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/org_public_data/s3_object/v1/${encodeURIComponent(orgPublicDataS3ObjectMetadataId)}`),
|
|
225
|
+
method: "GET",
|
|
226
|
+
headers: _headers,
|
|
227
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
228
|
+
responseType: "binary-response",
|
|
229
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
230
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
231
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
232
|
+
});
|
|
233
|
+
if (_response.ok) {
|
|
234
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
235
|
+
}
|
|
236
|
+
if (_response.error.reason === "status-code") {
|
|
237
|
+
switch (_response.error.statusCode) {
|
|
238
|
+
case 403:
|
|
239
|
+
throw new Chrt.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
240
|
+
case 404:
|
|
241
|
+
throw new Chrt.NotFoundError(_response.error.body, _response.rawResponse);
|
|
242
|
+
case 422:
|
|
243
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
244
|
+
case 423:
|
|
245
|
+
throw new Chrt.LockedError(_response.error.body, _response.rawResponse);
|
|
246
|
+
case 503:
|
|
247
|
+
throw new Chrt.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
248
|
+
default:
|
|
249
|
+
throw new errors.ChrtError({
|
|
250
|
+
statusCode: _response.error.statusCode,
|
|
251
|
+
body: _response.error.body,
|
|
252
|
+
rawResponse: _response.rawResponse,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
switch (_response.error.reason) {
|
|
257
|
+
case "non-json":
|
|
258
|
+
throw new errors.ChrtError({
|
|
259
|
+
statusCode: _response.error.statusCode,
|
|
260
|
+
body: _response.error.rawBody,
|
|
261
|
+
rawResponse: _response.rawResponse,
|
|
262
|
+
});
|
|
263
|
+
case "timeout":
|
|
264
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /orgs/org_public_data/s3_object/v1/{org_public_data_s3_object_metadata_id}.");
|
|
265
|
+
case "unknown":
|
|
266
|
+
throw new errors.ChrtError({
|
|
267
|
+
message: _response.error.errorMessage,
|
|
268
|
+
rawResponse: _response.rawResponse,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
_getAuthorizationHeader() {
|
|
274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
276
|
+
if (bearer != null) {
|
|
277
|
+
return `Bearer ${bearer}`;
|
|
278
|
+
}
|
|
279
|
+
return undefined;
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../../../../../../../../core/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface BodyPostOrgPublicDataS3ObjectAddV1 {
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type BodyPostOrgPublicDataS3ObjectAddV1 } from "./BodyPostOrgPublicDataS3ObjectAddV1.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|