@chrt-inc/typescript-sdk 1.935.0 → 1.944.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/shippingIntegrations/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/shippingIntegrations/client/Client.js +9 -4
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/client/Client.js +22 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/client/index.js +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/index.d.ts +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/index.js +18 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/Client.d.ts +119 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/Client.js +430 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/index.js +17 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientCreate1.d.ts +26 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientCreate1.js +5 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientUpdate1.d.ts +15 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientUpdate1.js +5 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.d.ts +1 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.js +17 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/index.js +43 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/Client.d.ts +104 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/Client.js +371 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/index.js +17 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/EcourierOrderSyncOneReq.d.ts +15 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/EcourierOrderSyncOneReq.js +5 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/OrdersListV1Request.d.ts +48 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/OrdersListV1Request.js +5 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/index.d.ts +1 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/ecourier/resources/orders/index.js +17 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/shippingIntegrations/resources/index.js +2 -1
- package/dist/cjs/api/types/EcourierCredsLimited1.d.ts +29 -0
- package/dist/cjs/api/types/EcourierCredsLimited1.js +5 -0
- package/dist/cjs/api/types/EcourierCredsListRes.d.ts +8 -0
- package/dist/cjs/api/types/EcourierCredsListRes.js +5 -0
- package/dist/cjs/api/types/EcourierCredsTestRes.d.ts +11 -0
- package/dist/cjs/api/types/EcourierCredsTestRes.js +5 -0
- package/dist/cjs/api/types/EcourierOrder1.d.ts +19 -0
- package/dist/cjs/api/types/EcourierOrder1.js +5 -0
- package/dist/cjs/api/types/EcourierOrderCustomerResponse1.d.ts +16 -0
- package/dist/cjs/api/types/EcourierOrderCustomerResponse1.js +5 -0
- package/dist/cjs/api/types/EcourierOrderListRes.d.ts +8 -0
- package/dist/cjs/api/types/EcourierOrderListRes.js +5 -0
- package/dist/cjs/api/types/EcourierOrderResponse1.d.ts +43 -0
- package/dist/cjs/api/types/EcourierOrderResponse1.js +5 -0
- package/dist/cjs/api/types/EcourierOrderSortByEnum.d.ts +10 -0
- package/dist/cjs/api/types/EcourierOrderSortByEnum.js +12 -0
- package/dist/cjs/api/types/EcourierOrderStopResponse1.d.ts +27 -0
- package/dist/cjs/api/types/EcourierOrderStopResponse1.js +5 -0
- package/dist/cjs/api/types/FraytWebhookResponse.d.ts +7 -0
- package/dist/cjs/api/types/FraytWebhookResponse.js +5 -0
- package/dist/cjs/api/types/NotificationEventsForOrgsEnum.d.ts +6 -1
- package/dist/cjs/api/types/NotificationEventsForOrgsEnum.js +5 -0
- package/dist/cjs/api/types/NotificationEventsForUsersEnum.d.ts +6 -1
- package/dist/cjs/api/types/NotificationEventsForUsersEnum.js +5 -0
- package/dist/cjs/api/types/OrgShippingIntegrationEnum1.d.ts +2 -1
- package/dist/cjs/api/types/OrgShippingIntegrationEnum1.js +1 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChange1.d.ts +17 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChange1.js +5 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedReq.d.ts +12 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedReq.js +5 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedRes.d.ts +6 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedRes.js +5 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedWebhookPayload.d.ts +37 -0
- package/dist/cjs/api/types/ShippingIntegrationOrderStatusChangedWebhookPayload.js +16 -0
- package/dist/cjs/api/types/index.d.ts +14 -0
- package/dist/cjs/api/types/index.js +14 -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/shippingIntegrations/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/shippingIntegrations/client/Client.mjs +5 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/client/Client.mjs +18 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/client/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/index.d.mts +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/index.mjs +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/Client.d.mts +119 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/Client.mjs +393 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/index.d.mts +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientCreate1.d.mts +26 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientCreate1.mjs +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientUpdate1.d.mts +15 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/EcourierCredsClientUpdate1.mjs +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.d.mts +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/index.mjs +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/Client.d.mts +104 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/Client.mjs +334 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/index.d.mts +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/EcourierOrderSyncOneReq.d.mts +15 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/EcourierOrderSyncOneReq.mjs +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/OrdersListV1Request.d.mts +48 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/OrdersListV1Request.mjs +4 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/index.d.mts +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/orders/index.mjs +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/shippingIntegrations/resources/index.mjs +1 -0
- package/dist/esm/api/types/EcourierCredsLimited1.d.mts +29 -0
- package/dist/esm/api/types/EcourierCredsLimited1.mjs +4 -0
- package/dist/esm/api/types/EcourierCredsListRes.d.mts +8 -0
- package/dist/esm/api/types/EcourierCredsListRes.mjs +4 -0
- package/dist/esm/api/types/EcourierCredsTestRes.d.mts +11 -0
- package/dist/esm/api/types/EcourierCredsTestRes.mjs +4 -0
- package/dist/esm/api/types/EcourierOrder1.d.mts +19 -0
- package/dist/esm/api/types/EcourierOrder1.mjs +4 -0
- package/dist/esm/api/types/EcourierOrderCustomerResponse1.d.mts +16 -0
- package/dist/esm/api/types/EcourierOrderCustomerResponse1.mjs +4 -0
- package/dist/esm/api/types/EcourierOrderListRes.d.mts +8 -0
- package/dist/esm/api/types/EcourierOrderListRes.mjs +4 -0
- package/dist/esm/api/types/EcourierOrderResponse1.d.mts +43 -0
- package/dist/esm/api/types/EcourierOrderResponse1.mjs +4 -0
- package/dist/esm/api/types/EcourierOrderSortByEnum.d.mts +10 -0
- package/dist/esm/api/types/EcourierOrderSortByEnum.mjs +9 -0
- package/dist/esm/api/types/EcourierOrderStopResponse1.d.mts +27 -0
- package/dist/esm/api/types/EcourierOrderStopResponse1.mjs +4 -0
- package/dist/esm/api/types/FraytWebhookResponse.d.mts +7 -0
- package/dist/esm/api/types/FraytWebhookResponse.mjs +4 -0
- package/dist/esm/api/types/NotificationEventsForOrgsEnum.d.mts +6 -1
- package/dist/esm/api/types/NotificationEventsForOrgsEnum.mjs +5 -0
- package/dist/esm/api/types/NotificationEventsForUsersEnum.d.mts +6 -1
- package/dist/esm/api/types/NotificationEventsForUsersEnum.mjs +5 -0
- package/dist/esm/api/types/OrgShippingIntegrationEnum1.d.mts +2 -1
- package/dist/esm/api/types/OrgShippingIntegrationEnum1.mjs +1 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChange1.d.mts +17 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChange1.mjs +4 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedReq.d.mts +12 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedReq.mjs +4 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedRes.d.mts +6 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedRes.mjs +4 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedWebhookPayload.d.mts +37 -0
- package/dist/esm/api/types/ShippingIntegrationOrderStatusChangedWebhookPayload.mjs +13 -0
- package/dist/esm/api/types/index.d.mts +14 -0
- package/dist/esm/api/types/index.mjs +14 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +678 -0
|
@@ -0,0 +1,26 @@
|
|
|
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 { Creds } from "../resources/creds/client/Client.mjs";
|
|
7
|
+
import { Orders } from "../resources/orders/client/Client.mjs";
|
|
8
|
+
export declare namespace Ecourier {
|
|
9
|
+
interface Options {
|
|
10
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
11
|
+
/** Specify a custom URL to connect the client to. */
|
|
12
|
+
baseUrl?: core.Supplier<string>;
|
|
13
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
14
|
+
/** Additional headers to include in requests. */
|
|
15
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
16
|
+
fetcher?: core.FetchFunction;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export declare class Ecourier {
|
|
20
|
+
protected readonly _options: Ecourier.Options;
|
|
21
|
+
protected _creds: Creds | undefined;
|
|
22
|
+
protected _orders: Orders | undefined;
|
|
23
|
+
constructor(_options?: Ecourier.Options);
|
|
24
|
+
get creds(): Creds;
|
|
25
|
+
get orders(): Orders;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import { Creds } from "../resources/creds/client/Client.mjs";
|
|
5
|
+
import { Orders } from "../resources/orders/client/Client.mjs";
|
|
6
|
+
export class Ecourier {
|
|
7
|
+
constructor(_options = {}) {
|
|
8
|
+
this._options = _options;
|
|
9
|
+
}
|
|
10
|
+
get creds() {
|
|
11
|
+
var _a;
|
|
12
|
+
return ((_a = this._creds) !== null && _a !== void 0 ? _a : (this._creds = new Creds(this._options)));
|
|
13
|
+
}
|
|
14
|
+
get orders() {
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Orders(this._options)));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
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 Creds {
|
|
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 Creds {
|
|
31
|
+
protected readonly _options: Creds.Options;
|
|
32
|
+
constructor(_options?: Creds.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Returns the caller's e-Courier credential for one provider, without the password or session token. | () -> (EcourierCredsLimited1)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
37
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.shippingIntegrations.ecourier.creds.detailV1("provider_org_id")
|
|
43
|
+
*/
|
|
44
|
+
detailV1(providerOrgId: string, requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<Chrt.EcourierCredsLimited1>;
|
|
45
|
+
private __detailV1;
|
|
46
|
+
/**
|
|
47
|
+
* Lists the caller's e-Courier credentials, one per connected provider, without the password or session token. | () -> (EcourierCredsListRes)
|
|
48
|
+
*
|
|
49
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.shippingIntegrations.ecourier.creds.listV1()
|
|
53
|
+
*/
|
|
54
|
+
listV1(requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<Chrt.EcourierCredsListRes>;
|
|
55
|
+
private __listV1;
|
|
56
|
+
/**
|
|
57
|
+
* Confirms the caller's stored e-Courier credentials for one provider can still log in, and reports which customer the credential is scoped to. | authz: min_org_role=operator | () -> (EcourierCredsTestRes)
|
|
58
|
+
*
|
|
59
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
60
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.shippingIntegrations.ecourier.creds.testV1("provider_org_id")
|
|
66
|
+
*/
|
|
67
|
+
testV1(providerOrgId: string, requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<Chrt.EcourierCredsTestRes>;
|
|
68
|
+
private __testV1;
|
|
69
|
+
/**
|
|
70
|
+
* Stores e-Courier credentials for one provider on behalf of the caller's organization. | authz: min_org_role=administrator | (EcourierCredsClientCreate1) -> (PydanticObjectId)
|
|
71
|
+
*
|
|
72
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
73
|
+
* @param {Chrt.shippingIntegrations.ecourier.EcourierCredsClientCreate1} request
|
|
74
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.shippingIntegrations.ecourier.creds.createV1("provider_org_id", {
|
|
80
|
+
* base_url: "https://bigtex.e-courier.com",
|
|
81
|
+
* ecourier_customer_code: "ecourier_customer_code",
|
|
82
|
+
* ecourier_customer_id: "ecourier_customer_id",
|
|
83
|
+
* ecourier_database: "ecourier_database",
|
|
84
|
+
* password: "password",
|
|
85
|
+
* schema_version: 1,
|
|
86
|
+
* username: "username"
|
|
87
|
+
* })
|
|
88
|
+
*/
|
|
89
|
+
createV1(providerOrgId: string, request: Chrt.shippingIntegrations.ecourier.EcourierCredsClientCreate1, requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<string>;
|
|
90
|
+
private __createV1;
|
|
91
|
+
/**
|
|
92
|
+
* Deletes the caller's e-Courier credentials for one provider, stopping future syncs. | authz: min_org_role=administrator | () -> (bool)
|
|
93
|
+
*
|
|
94
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
95
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await client.shippingIntegrations.ecourier.creds.deleteV1("provider_org_id")
|
|
101
|
+
*/
|
|
102
|
+
deleteV1(providerOrgId: string, requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
103
|
+
private __deleteV1;
|
|
104
|
+
/**
|
|
105
|
+
* Updates the caller's e-Courier credentials for one provider. | authz: min_org_role=administrator | (EcourierCredsClientUpdate1) -> (bool)
|
|
106
|
+
*
|
|
107
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
108
|
+
* @param {Chrt.shippingIntegrations.ecourier.EcourierCredsClientUpdate1} request
|
|
109
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.shippingIntegrations.ecourier.creds.updateV1("provider_org_id")
|
|
115
|
+
*/
|
|
116
|
+
updateV1(providerOrgId: string, request?: Chrt.shippingIntegrations.ecourier.EcourierCredsClientUpdate1, requestOptions?: Creds.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
117
|
+
private __updateV1;
|
|
118
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
119
|
+
}
|
|
@@ -0,0 +1,393 @@
|
|
|
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 Creds {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the caller's e-Courier credential for one provider, without the password or session token. | () -> (EcourierCredsLimited1)
|
|
24
|
+
*
|
|
25
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
26
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.shippingIntegrations.ecourier.creds.detailV1("provider_org_id")
|
|
32
|
+
*/
|
|
33
|
+
detailV1(providerOrgId, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__detailV1(providerOrgId, requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__detailV1(providerOrgId, requestOptions) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
|
+
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);
|
|
40
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
41
|
+
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, `shipping_integrations/ecourier/creds/detail/v1/${encodeURIComponent(providerOrgId)}`),
|
|
42
|
+
method: "GET",
|
|
43
|
+
headers: _headers,
|
|
44
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
45
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
46
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
47
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
48
|
+
});
|
|
49
|
+
if (_response.ok) {
|
|
50
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
51
|
+
}
|
|
52
|
+
if (_response.error.reason === "status-code") {
|
|
53
|
+
switch (_response.error.statusCode) {
|
|
54
|
+
case 422:
|
|
55
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
56
|
+
default:
|
|
57
|
+
throw new errors.ChrtError({
|
|
58
|
+
statusCode: _response.error.statusCode,
|
|
59
|
+
body: _response.error.body,
|
|
60
|
+
rawResponse: _response.rawResponse,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
switch (_response.error.reason) {
|
|
65
|
+
case "non-json":
|
|
66
|
+
throw new errors.ChrtError({
|
|
67
|
+
statusCode: _response.error.statusCode,
|
|
68
|
+
body: _response.error.rawBody,
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
});
|
|
71
|
+
case "timeout":
|
|
72
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping_integrations/ecourier/creds/detail/v1/{provider_org_id}.");
|
|
73
|
+
case "unknown":
|
|
74
|
+
throw new errors.ChrtError({
|
|
75
|
+
message: _response.error.errorMessage,
|
|
76
|
+
rawResponse: _response.rawResponse,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Lists the caller's e-Courier credentials, one per connected provider, without the password or session token. | () -> (EcourierCredsListRes)
|
|
83
|
+
*
|
|
84
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.shippingIntegrations.ecourier.creds.listV1()
|
|
88
|
+
*/
|
|
89
|
+
listV1(requestOptions) {
|
|
90
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(requestOptions));
|
|
91
|
+
}
|
|
92
|
+
__listV1(requestOptions) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
|
+
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);
|
|
96
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
97
|
+
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, "shipping_integrations/ecourier/creds/list/v1"),
|
|
98
|
+
method: "GET",
|
|
99
|
+
headers: _headers,
|
|
100
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
101
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
102
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
103
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
107
|
+
}
|
|
108
|
+
if (_response.error.reason === "status-code") {
|
|
109
|
+
throw new errors.ChrtError({
|
|
110
|
+
statusCode: _response.error.statusCode,
|
|
111
|
+
body: _response.error.body,
|
|
112
|
+
rawResponse: _response.rawResponse,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
switch (_response.error.reason) {
|
|
116
|
+
case "non-json":
|
|
117
|
+
throw new errors.ChrtError({
|
|
118
|
+
statusCode: _response.error.statusCode,
|
|
119
|
+
body: _response.error.rawBody,
|
|
120
|
+
rawResponse: _response.rawResponse,
|
|
121
|
+
});
|
|
122
|
+
case "timeout":
|
|
123
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping_integrations/ecourier/creds/list/v1.");
|
|
124
|
+
case "unknown":
|
|
125
|
+
throw new errors.ChrtError({
|
|
126
|
+
message: _response.error.errorMessage,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Confirms the caller's stored e-Courier credentials for one provider can still log in, and reports which customer the credential is scoped to. | authz: min_org_role=operator | () -> (EcourierCredsTestRes)
|
|
134
|
+
*
|
|
135
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
136
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
137
|
+
*
|
|
138
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* await client.shippingIntegrations.ecourier.creds.testV1("provider_org_id")
|
|
142
|
+
*/
|
|
143
|
+
testV1(providerOrgId, requestOptions) {
|
|
144
|
+
return core.HttpResponsePromise.fromPromise(this.__testV1(providerOrgId, requestOptions));
|
|
145
|
+
}
|
|
146
|
+
__testV1(providerOrgId, requestOptions) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
var _a, _b, _c, _d;
|
|
149
|
+
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);
|
|
150
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
151
|
+
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, `shipping_integrations/ecourier/creds/test/v1/${encodeURIComponent(providerOrgId)}`),
|
|
152
|
+
method: "POST",
|
|
153
|
+
headers: _headers,
|
|
154
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
155
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
156
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
157
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
158
|
+
});
|
|
159
|
+
if (_response.ok) {
|
|
160
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
161
|
+
}
|
|
162
|
+
if (_response.error.reason === "status-code") {
|
|
163
|
+
switch (_response.error.statusCode) {
|
|
164
|
+
case 422:
|
|
165
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
166
|
+
default:
|
|
167
|
+
throw new errors.ChrtError({
|
|
168
|
+
statusCode: _response.error.statusCode,
|
|
169
|
+
body: _response.error.body,
|
|
170
|
+
rawResponse: _response.rawResponse,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
switch (_response.error.reason) {
|
|
175
|
+
case "non-json":
|
|
176
|
+
throw new errors.ChrtError({
|
|
177
|
+
statusCode: _response.error.statusCode,
|
|
178
|
+
body: _response.error.rawBody,
|
|
179
|
+
rawResponse: _response.rawResponse,
|
|
180
|
+
});
|
|
181
|
+
case "timeout":
|
|
182
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping_integrations/ecourier/creds/test/v1/{provider_org_id}.");
|
|
183
|
+
case "unknown":
|
|
184
|
+
throw new errors.ChrtError({
|
|
185
|
+
message: _response.error.errorMessage,
|
|
186
|
+
rawResponse: _response.rawResponse,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Stores e-Courier credentials for one provider on behalf of the caller's organization. | authz: min_org_role=administrator | (EcourierCredsClientCreate1) -> (PydanticObjectId)
|
|
193
|
+
*
|
|
194
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
195
|
+
* @param {Chrt.shippingIntegrations.ecourier.EcourierCredsClientCreate1} request
|
|
196
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
197
|
+
*
|
|
198
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* await client.shippingIntegrations.ecourier.creds.createV1("provider_org_id", {
|
|
202
|
+
* base_url: "https://bigtex.e-courier.com",
|
|
203
|
+
* ecourier_customer_code: "ecourier_customer_code",
|
|
204
|
+
* ecourier_customer_id: "ecourier_customer_id",
|
|
205
|
+
* ecourier_database: "ecourier_database",
|
|
206
|
+
* password: "password",
|
|
207
|
+
* schema_version: 1,
|
|
208
|
+
* username: "username"
|
|
209
|
+
* })
|
|
210
|
+
*/
|
|
211
|
+
createV1(providerOrgId, request, requestOptions) {
|
|
212
|
+
return core.HttpResponsePromise.fromPromise(this.__createV1(providerOrgId, request, requestOptions));
|
|
213
|
+
}
|
|
214
|
+
__createV1(providerOrgId, request, requestOptions) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
var _a, _b, _c, _d;
|
|
217
|
+
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);
|
|
218
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
219
|
+
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, `shipping_integrations/ecourier/creds/v1/${encodeURIComponent(providerOrgId)}`),
|
|
220
|
+
method: "POST",
|
|
221
|
+
headers: _headers,
|
|
222
|
+
contentType: "application/json",
|
|
223
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
224
|
+
requestType: "json",
|
|
225
|
+
body: request,
|
|
226
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
227
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
228
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
229
|
+
});
|
|
230
|
+
if (_response.ok) {
|
|
231
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 422:
|
|
236
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
237
|
+
default:
|
|
238
|
+
throw new errors.ChrtError({
|
|
239
|
+
statusCode: _response.error.statusCode,
|
|
240
|
+
body: _response.error.body,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
switch (_response.error.reason) {
|
|
246
|
+
case "non-json":
|
|
247
|
+
throw new errors.ChrtError({
|
|
248
|
+
statusCode: _response.error.statusCode,
|
|
249
|
+
body: _response.error.rawBody,
|
|
250
|
+
rawResponse: _response.rawResponse,
|
|
251
|
+
});
|
|
252
|
+
case "timeout":
|
|
253
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping_integrations/ecourier/creds/v1/{provider_org_id}.");
|
|
254
|
+
case "unknown":
|
|
255
|
+
throw new errors.ChrtError({
|
|
256
|
+
message: _response.error.errorMessage,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Deletes the caller's e-Courier credentials for one provider, stopping future syncs. | authz: min_org_role=administrator | () -> (bool)
|
|
264
|
+
*
|
|
265
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
266
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
267
|
+
*
|
|
268
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* await client.shippingIntegrations.ecourier.creds.deleteV1("provider_org_id")
|
|
272
|
+
*/
|
|
273
|
+
deleteV1(providerOrgId, requestOptions) {
|
|
274
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(providerOrgId, requestOptions));
|
|
275
|
+
}
|
|
276
|
+
__deleteV1(providerOrgId, requestOptions) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
var _a, _b, _c, _d;
|
|
279
|
+
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);
|
|
280
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
281
|
+
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, `shipping_integrations/ecourier/creds/v1/${encodeURIComponent(providerOrgId)}`),
|
|
282
|
+
method: "DELETE",
|
|
283
|
+
headers: _headers,
|
|
284
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
285
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
286
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
287
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
288
|
+
});
|
|
289
|
+
if (_response.ok) {
|
|
290
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
291
|
+
}
|
|
292
|
+
if (_response.error.reason === "status-code") {
|
|
293
|
+
switch (_response.error.statusCode) {
|
|
294
|
+
case 422:
|
|
295
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
296
|
+
default:
|
|
297
|
+
throw new errors.ChrtError({
|
|
298
|
+
statusCode: _response.error.statusCode,
|
|
299
|
+
body: _response.error.body,
|
|
300
|
+
rawResponse: _response.rawResponse,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
switch (_response.error.reason) {
|
|
305
|
+
case "non-json":
|
|
306
|
+
throw new errors.ChrtError({
|
|
307
|
+
statusCode: _response.error.statusCode,
|
|
308
|
+
body: _response.error.rawBody,
|
|
309
|
+
rawResponse: _response.rawResponse,
|
|
310
|
+
});
|
|
311
|
+
case "timeout":
|
|
312
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /shipping_integrations/ecourier/creds/v1/{provider_org_id}.");
|
|
313
|
+
case "unknown":
|
|
314
|
+
throw new errors.ChrtError({
|
|
315
|
+
message: _response.error.errorMessage,
|
|
316
|
+
rawResponse: _response.rawResponse,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Updates the caller's e-Courier credentials for one provider. | authz: min_org_role=administrator | (EcourierCredsClientUpdate1) -> (bool)
|
|
323
|
+
*
|
|
324
|
+
* @param {string} providerOrgId - Must be a string starting with `org_`
|
|
325
|
+
* @param {Chrt.shippingIntegrations.ecourier.EcourierCredsClientUpdate1} request
|
|
326
|
+
* @param {Creds.RequestOptions} requestOptions - Request-specific configuration.
|
|
327
|
+
*
|
|
328
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* await client.shippingIntegrations.ecourier.creds.updateV1("provider_org_id")
|
|
332
|
+
*/
|
|
333
|
+
updateV1(providerOrgId, request = {}, requestOptions) {
|
|
334
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(providerOrgId, request, requestOptions));
|
|
335
|
+
}
|
|
336
|
+
__updateV1(providerOrgId_1) {
|
|
337
|
+
return __awaiter(this, arguments, void 0, function* (providerOrgId, request = {}, requestOptions) {
|
|
338
|
+
var _a, _b, _c, _d;
|
|
339
|
+
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);
|
|
340
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
341
|
+
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, `shipping_integrations/ecourier/creds/v1/${encodeURIComponent(providerOrgId)}`),
|
|
342
|
+
method: "PATCH",
|
|
343
|
+
headers: _headers,
|
|
344
|
+
contentType: "application/json",
|
|
345
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
346
|
+
requestType: "json",
|
|
347
|
+
body: request,
|
|
348
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
349
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
350
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
351
|
+
});
|
|
352
|
+
if (_response.ok) {
|
|
353
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
354
|
+
}
|
|
355
|
+
if (_response.error.reason === "status-code") {
|
|
356
|
+
switch (_response.error.statusCode) {
|
|
357
|
+
case 422:
|
|
358
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
359
|
+
default:
|
|
360
|
+
throw new errors.ChrtError({
|
|
361
|
+
statusCode: _response.error.statusCode,
|
|
362
|
+
body: _response.error.body,
|
|
363
|
+
rawResponse: _response.rawResponse,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
switch (_response.error.reason) {
|
|
368
|
+
case "non-json":
|
|
369
|
+
throw new errors.ChrtError({
|
|
370
|
+
statusCode: _response.error.statusCode,
|
|
371
|
+
body: _response.error.rawBody,
|
|
372
|
+
rawResponse: _response.rawResponse,
|
|
373
|
+
});
|
|
374
|
+
case "timeout":
|
|
375
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping_integrations/ecourier/creds/v1/{provider_org_id}.");
|
|
376
|
+
case "unknown":
|
|
377
|
+
throw new errors.ChrtError({
|
|
378
|
+
message: _response.error.errorMessage,
|
|
379
|
+
rawResponse: _response.rawResponse,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
_getAuthorizationHeader() {
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
387
|
+
if (bearer != null) {
|
|
388
|
+
return `Bearer ${bearer}`;
|
|
389
|
+
}
|
|
390
|
+
return undefined;
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* base_url: "https://bigtex.e-courier.com",
|
|
8
|
+
* ecourier_customer_code: "ecourier_customer_code",
|
|
9
|
+
* ecourier_customer_id: "ecourier_customer_id",
|
|
10
|
+
* ecourier_database: "ecourier_database",
|
|
11
|
+
* password: "password",
|
|
12
|
+
* schema_version: 1,
|
|
13
|
+
* username: "username"
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface EcourierCredsClientCreate1 {
|
|
17
|
+
/** Origin of the courier's e-Courier host, with no path. The request path is derived from `ecourier_database`. */
|
|
18
|
+
base_url: string;
|
|
19
|
+
ecourier_customer_code: string;
|
|
20
|
+
ecourier_customer_id: string;
|
|
21
|
+
ecourier_database: string;
|
|
22
|
+
notes?: string | null;
|
|
23
|
+
password: string;
|
|
24
|
+
schema_version: number;
|
|
25
|
+
username: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface EcourierCredsClientUpdate1 {
|
|
9
|
+
ecourier_customer_code?: string | null;
|
|
10
|
+
ecourier_customer_id?: string | null;
|
|
11
|
+
notes?: string | null;
|
|
12
|
+
notes__set_to_None?: boolean;
|
|
13
|
+
password?: string | null;
|
|
14
|
+
password__set_to_None?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
package/dist/esm/api/resources/shippingIntegrations/resources/ecourier/resources/creds/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|