@beach-depository/sdk 0.0.1 → 0.0.3
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 +2 -2
- package/dist/cjs/BaseClient.d.ts +3 -0
- package/dist/cjs/api/resources/fboAccounts/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/fboAccounts/client/Client.js +2 -2
- package/dist/cjs/api/resources/fboAccounts/resources/addresses/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/fboAccounts/resources/addresses/client/Client.js +2 -2
- package/dist/cjs/api/resources/fboAccounts/resources/aliases/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/fboAccounts/resources/aliases/client/Client.js +2 -2
- package/dist/cjs/api/resources/inboundShipments/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/inboundShipments/client/Client.js +2 -2
- package/dist/cjs/api/resources/outboundRequests/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/outboundRequests/client/Client.js +2 -2
- package/dist/cjs/api/resources/transfers/client/Client.d.ts +19 -3
- package/dist/cjs/api/resources/transfers/client/Client.js +47 -2
- package/dist/cjs/api/resources/transfers/client/requests/ConfirmTransfersRequest.d.ts +9 -0
- package/dist/cjs/api/resources/transfers/client/requests/ConfirmTransfersRequest.js +3 -0
- package/dist/cjs/api/resources/transfers/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/transfers/types/CancelTransfersResponse.d.ts +8 -2
- package/dist/cjs/api/resources/transfers/types/CancelTransfersResponse.js +6 -2
- package/dist/cjs/api/resources/transfers/types/ConfirmTransfersResponse.d.ts +34 -0
- package/dist/cjs/api/resources/transfers/types/ConfirmTransfersResponse.js +21 -0
- package/dist/cjs/api/resources/transfers/types/CreateTransfersResponse.d.ts +8 -2
- package/dist/cjs/api/resources/transfers/types/CreateTransfersResponse.js +6 -2
- package/dist/cjs/api/resources/transfers/types/GetTransfersResponse.d.ts +8 -2
- package/dist/cjs/api/resources/transfers/types/GetTransfersResponse.js +6 -2
- package/dist/cjs/api/resources/transfers/types/ListTransfersRequestStatus.d.ts +2 -2
- package/dist/cjs/api/resources/transfers/types/ListTransfersRequestStatus.js +2 -2
- package/dist/cjs/api/resources/transfers/types/ListTransfersResponse.d.ts +8 -2
- package/dist/cjs/api/resources/transfers/types/ListTransfersResponse.js +6 -2
- package/dist/cjs/api/resources/transfers/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/transfers/types/index.js +1 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/webhooks/client/Client.js +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/api/resources/fboAccounts/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/fboAccounts/client/Client.mjs +3 -3
- package/dist/esm/api/resources/fboAccounts/resources/addresses/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/fboAccounts/resources/addresses/client/Client.mjs +3 -3
- package/dist/esm/api/resources/fboAccounts/resources/aliases/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/fboAccounts/resources/aliases/client/Client.mjs +3 -3
- package/dist/esm/api/resources/inboundShipments/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/inboundShipments/client/Client.mjs +3 -3
- package/dist/esm/api/resources/outboundRequests/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/outboundRequests/client/Client.mjs +3 -3
- package/dist/esm/api/resources/transfers/client/Client.d.mts +19 -3
- package/dist/esm/api/resources/transfers/client/Client.mjs +48 -3
- package/dist/esm/api/resources/transfers/client/requests/ConfirmTransfersRequest.d.mts +9 -0
- package/dist/esm/api/resources/transfers/client/requests/ConfirmTransfersRequest.mjs +2 -0
- package/dist/esm/api/resources/transfers/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/transfers/types/CancelTransfersResponse.d.mts +8 -2
- package/dist/esm/api/resources/transfers/types/CancelTransfersResponse.mjs +6 -2
- package/dist/esm/api/resources/transfers/types/ConfirmTransfersResponse.d.mts +34 -0
- package/dist/esm/api/resources/transfers/types/ConfirmTransfersResponse.mjs +18 -0
- package/dist/esm/api/resources/transfers/types/CreateTransfersResponse.d.mts +8 -2
- package/dist/esm/api/resources/transfers/types/CreateTransfersResponse.mjs +6 -2
- package/dist/esm/api/resources/transfers/types/GetTransfersResponse.d.mts +8 -2
- package/dist/esm/api/resources/transfers/types/GetTransfersResponse.mjs +6 -2
- package/dist/esm/api/resources/transfers/types/ListTransfersRequestStatus.d.mts +2 -2
- package/dist/esm/api/resources/transfers/types/ListTransfersRequestStatus.mjs +2 -2
- package/dist/esm/api/resources/transfers/types/ListTransfersResponse.d.mts +8 -2
- package/dist/esm/api/resources/transfers/types/ListTransfersResponse.mjs +6 -2
- package/dist/esm/api/resources/transfers/types/index.d.mts +1 -0
- package/dist/esm/api/resources/transfers/types/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/webhooks/client/Client.mjs +3 -3
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const ListTransfersRequestStatus: {
|
|
2
|
-
readonly
|
|
3
|
-
readonly
|
|
2
|
+
readonly PendingApproval: "pending_approval";
|
|
3
|
+
readonly Processing: "processing";
|
|
4
4
|
readonly Completed: "completed";
|
|
5
5
|
readonly Rejected: "rejected";
|
|
6
6
|
readonly Cancelled: "cancelled";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ListTransfersRequestStatus = void 0;
|
|
5
5
|
exports.ListTransfersRequestStatus = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
PendingApproval: "pending_approval",
|
|
7
|
+
Processing: "processing",
|
|
8
8
|
Completed: "completed",
|
|
9
9
|
Rejected: "rejected",
|
|
10
10
|
Cancelled: "cancelled",
|
|
@@ -11,6 +11,7 @@ export declare namespace ListTransfersResponse {
|
|
|
11
11
|
toFboAccountId: string;
|
|
12
12
|
organizationId: string;
|
|
13
13
|
status: Item.Status;
|
|
14
|
+
initiatedBy: Item.InitiatedBy;
|
|
14
15
|
totalItems: number;
|
|
15
16
|
approvedBySystem?: boolean | undefined;
|
|
16
17
|
notes?: string | undefined;
|
|
@@ -20,13 +21,18 @@ export declare namespace ListTransfersResponse {
|
|
|
20
21
|
}
|
|
21
22
|
namespace Item {
|
|
22
23
|
const Status: {
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
24
|
+
readonly PendingApproval: "pending_approval";
|
|
25
|
+
readonly Processing: "processing";
|
|
25
26
|
readonly Completed: "completed";
|
|
26
27
|
readonly Rejected: "rejected";
|
|
27
28
|
readonly Cancelled: "cancelled";
|
|
28
29
|
};
|
|
29
30
|
type Status = (typeof Status)[keyof typeof Status];
|
|
31
|
+
const InitiatedBy: {
|
|
32
|
+
readonly Customer: "customer";
|
|
33
|
+
readonly Vault: "vault";
|
|
34
|
+
};
|
|
35
|
+
type InitiatedBy = (typeof InitiatedBy)[keyof typeof InitiatedBy];
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
interface Pagination {
|
|
@@ -9,12 +9,16 @@ var ListTransfersResponse;
|
|
|
9
9
|
let Item;
|
|
10
10
|
(function (Item) {
|
|
11
11
|
Item.Status = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
PendingApproval: "pending_approval",
|
|
13
|
+
Processing: "processing",
|
|
14
14
|
Completed: "completed",
|
|
15
15
|
Rejected: "rejected",
|
|
16
16
|
Cancelled: "cancelled",
|
|
17
17
|
};
|
|
18
|
+
Item.InitiatedBy = {
|
|
19
|
+
Customer: "customer",
|
|
20
|
+
Vault: "vault",
|
|
21
|
+
};
|
|
18
22
|
})(Item = Data.Item || (Data.Item = {}));
|
|
19
23
|
})(Data = ListTransfersResponse.Data || (ListTransfersResponse.Data = {}));
|
|
20
24
|
})(ListTransfersResponse || (exports.ListTransfersResponse = ListTransfersResponse = {}));
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./CancelTransfersResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./ConfirmTransfersResponse.js"), exports);
|
|
18
19
|
__exportStar(require("./CreateTransfersResponse.js"), exports);
|
|
19
20
|
__exportStar(require("./GetTransfersResponse.js"), exports);
|
|
20
21
|
__exportStar(require("./ListTransfersRequestStatus.js"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import * as core from "../../../../core/index.js";
|
|
4
4
|
import type * as BeachApi from "../../../index.js";
|
|
@@ -6,6 +6,8 @@ export declare namespace WebhooksClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class WebhooksClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
@@ -23,7 +25,7 @@ export declare class WebhooksClient {
|
|
|
23
25
|
private __list;
|
|
24
26
|
/**
|
|
25
27
|
* @param {BeachApi.CreateWebhooksRequest} request
|
|
26
|
-
* @param {WebhooksClient.
|
|
28
|
+
* @param {WebhooksClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
27
29
|
*
|
|
28
30
|
* @throws {@link errors.BeachApiError}
|
|
29
31
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -35,7 +37,7 @@ export declare class WebhooksClient {
|
|
|
35
37
|
* events: ["events"]
|
|
36
38
|
* })
|
|
37
39
|
*/
|
|
38
|
-
create(request: BeachApi.CreateWebhooksRequest, requestOptions?: WebhooksClient.
|
|
40
|
+
create(request: BeachApi.CreateWebhooksRequest, requestOptions?: WebhooksClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.CreateWebhooksResponse>;
|
|
39
41
|
private __create;
|
|
40
42
|
/**
|
|
41
43
|
* @param {BeachApi.DeleteWebhooksRequest} request
|
|
@@ -98,7 +98,7 @@ class WebhooksClient {
|
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* @param {BeachApi.CreateWebhooksRequest} request
|
|
101
|
-
* @param {WebhooksClient.
|
|
101
|
+
* @param {WebhooksClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
102
102
|
*
|
|
103
103
|
* @throws {@link errors.BeachApiError}
|
|
104
104
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -117,7 +117,7 @@ class WebhooksClient {
|
|
|
117
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
118
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
119
119
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
120
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
121
121
|
const _response = yield core.fetcher({
|
|
122
122
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, "v1/webhooks"),
|
|
123
123
|
method: "POST",
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as BeachApi from "./api/index.js";
|
|
2
|
-
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
2
|
+
export type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
3
3
|
export { BeachApiClient } from "./Client.js";
|
|
4
4
|
export { BeachApiEnvironment } from "./environments.js";
|
|
5
5
|
export { BeachApiError, BeachApiTimeoutError } from "./errors/index.js";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.3";
|
package/dist/cjs/version.js
CHANGED
|
@@ -43,6 +43,9 @@ export interface BaseRequestOptions {
|
|
|
43
43
|
maxReconnectionAttempts?: number;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
export interface BaseIdempotentRequestOptions {
|
|
47
|
+
idempotencyKey?: string | undefined;
|
|
48
|
+
}
|
|
46
49
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
47
50
|
logging: core.logging.Logger;
|
|
48
51
|
authProvider?: core.AuthProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../index.mjs";
|
|
@@ -8,6 +8,8 @@ export declare namespace FboAccountsClient {
|
|
|
8
8
|
type Options = BaseClientOptions;
|
|
9
9
|
interface RequestOptions extends BaseRequestOptions {
|
|
10
10
|
}
|
|
11
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
export declare class FboAccountsClient {
|
|
13
15
|
protected readonly _options: NormalizedClientOptionsWithAuth<FboAccountsClient.Options>;
|
|
@@ -30,7 +32,7 @@ export declare class FboAccountsClient {
|
|
|
30
32
|
private __list;
|
|
31
33
|
/**
|
|
32
34
|
* @param {BeachApi.CreateFboAccountsRequest} request
|
|
33
|
-
* @param {FboAccountsClient.
|
|
35
|
+
* @param {FboAccountsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
34
36
|
*
|
|
35
37
|
* @throws {@link errors.BeachApiError}
|
|
36
38
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -43,7 +45,7 @@ export declare class FboAccountsClient {
|
|
|
43
45
|
* phone: "phone"
|
|
44
46
|
* })
|
|
45
47
|
*/
|
|
46
|
-
create(request: BeachApi.CreateFboAccountsRequest, requestOptions?: FboAccountsClient.
|
|
48
|
+
create(request: BeachApi.CreateFboAccountsRequest, requestOptions?: FboAccountsClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.CreateFboAccountsResponse>;
|
|
47
49
|
private __create;
|
|
48
50
|
/**
|
|
49
51
|
* @param {BeachApi.GetFboAccountsRequest} request
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
26
26
|
import * as environments from "../../../../environments.mjs";
|
|
@@ -93,7 +93,7 @@ export class FboAccountsClient {
|
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* @param {BeachApi.CreateFboAccountsRequest} request
|
|
96
|
-
* @param {FboAccountsClient.
|
|
96
|
+
* @param {FboAccountsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
97
97
|
*
|
|
98
98
|
* @throws {@link errors.BeachApiError}
|
|
99
99
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -113,7 +113,7 @@ export class FboAccountsClient {
|
|
|
113
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
114
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
115
115
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
116
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
116
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
117
117
|
const _response = yield core.fetcher({
|
|
118
118
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, "v1/fbo-accounts"),
|
|
119
119
|
method: "POST",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../../../index.mjs";
|
|
@@ -6,6 +6,8 @@ export declare namespace AddressesClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class AddressesClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<AddressesClient.Options>;
|
|
@@ -26,7 +28,7 @@ export declare class AddressesClient {
|
|
|
26
28
|
private __list;
|
|
27
29
|
/**
|
|
28
30
|
* @param {BeachApi.fboAccounts.CreateAddressesRequest} request
|
|
29
|
-
* @param {AddressesClient.
|
|
31
|
+
* @param {AddressesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
30
32
|
*
|
|
31
33
|
* @throws {@link errors.BeachApiError}
|
|
32
34
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -42,7 +44,7 @@ export declare class AddressesClient {
|
|
|
42
44
|
* country: "country"
|
|
43
45
|
* })
|
|
44
46
|
*/
|
|
45
|
-
create(request: BeachApi.fboAccounts.CreateAddressesRequest, requestOptions?: AddressesClient.
|
|
47
|
+
create(request: BeachApi.fboAccounts.CreateAddressesRequest, requestOptions?: AddressesClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.fboAccounts.CreateAddressesResponse>;
|
|
46
48
|
private __create;
|
|
47
49
|
/**
|
|
48
50
|
* @param {BeachApi.fboAccounts.DeleteAddressesRequest} request
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../../../core/index.mjs";
|
|
25
25
|
import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.mjs";
|
|
26
26
|
import * as environments from "../../../../../../environments.mjs";
|
|
@@ -80,7 +80,7 @@ export class AddressesClient {
|
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* @param {BeachApi.fboAccounts.CreateAddressesRequest} request
|
|
83
|
-
* @param {AddressesClient.
|
|
83
|
+
* @param {AddressesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
84
84
|
*
|
|
85
85
|
* @throws {@link errors.BeachApiError}
|
|
86
86
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -104,7 +104,7 @@ export class AddressesClient {
|
|
|
104
104
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
105
105
|
const { id } = request, _body = __rest(request, ["id"]);
|
|
106
106
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
107
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
107
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
108
108
|
const _response = yield core.fetcher({
|
|
109
109
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, `v1/fbo-accounts/${core.url.encodePathParam(id)}/addresses`),
|
|
110
110
|
method: "POST",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../../../index.mjs";
|
|
@@ -6,6 +6,8 @@ export declare namespace AliasesClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class AliasesClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<AliasesClient.Options>;
|
|
@@ -26,7 +28,7 @@ export declare class AliasesClient {
|
|
|
26
28
|
private __list;
|
|
27
29
|
/**
|
|
28
30
|
* @param {BeachApi.fboAccounts.CreateAliasesRequest} request
|
|
29
|
-
* @param {AliasesClient.
|
|
31
|
+
* @param {AliasesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
30
32
|
*
|
|
31
33
|
* @throws {@link errors.BeachApiError}
|
|
32
34
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -37,7 +39,7 @@ export declare class AliasesClient {
|
|
|
37
39
|
* aliasVaultId: "aliasVaultId"
|
|
38
40
|
* })
|
|
39
41
|
*/
|
|
40
|
-
create(request: BeachApi.fboAccounts.CreateAliasesRequest, requestOptions?: AliasesClient.
|
|
42
|
+
create(request: BeachApi.fboAccounts.CreateAliasesRequest, requestOptions?: AliasesClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.fboAccounts.CreateAliasesResponse>;
|
|
41
43
|
private __create;
|
|
42
44
|
/**
|
|
43
45
|
* @param {BeachApi.fboAccounts.DeleteAliasesRequest} request
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../../../core/index.mjs";
|
|
25
25
|
import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.mjs";
|
|
26
26
|
import * as environments from "../../../../../../environments.mjs";
|
|
@@ -80,7 +80,7 @@ export class AliasesClient {
|
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* @param {BeachApi.fboAccounts.CreateAliasesRequest} request
|
|
83
|
-
* @param {AliasesClient.
|
|
83
|
+
* @param {AliasesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
84
84
|
*
|
|
85
85
|
* @throws {@link errors.BeachApiError}
|
|
86
86
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -99,7 +99,7 @@ export class AliasesClient {
|
|
|
99
99
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
100
100
|
const { id } = request, _body = __rest(request, ["id"]);
|
|
101
101
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
102
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
102
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
103
103
|
const _response = yield core.fetcher({
|
|
104
104
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, `v1/fbo-accounts/${core.url.encodePathParam(id)}/aliases`),
|
|
105
105
|
method: "POST",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../index.mjs";
|
|
@@ -6,6 +6,8 @@ export declare namespace InboundShipmentsClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class InboundShipmentsClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<InboundShipmentsClient.Options>;
|
|
@@ -24,7 +26,7 @@ export declare class InboundShipmentsClient {
|
|
|
24
26
|
private __list;
|
|
25
27
|
/**
|
|
26
28
|
* @param {BeachApi.CreateInboundShipmentsRequest} request
|
|
27
|
-
* @param {InboundShipmentsClient.
|
|
29
|
+
* @param {InboundShipmentsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
28
30
|
*
|
|
29
31
|
* @throws {@link errors.BeachApiError}
|
|
30
32
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -38,7 +40,7 @@ export declare class InboundShipmentsClient {
|
|
|
38
40
|
* }]
|
|
39
41
|
* })
|
|
40
42
|
*/
|
|
41
|
-
create(request: BeachApi.CreateInboundShipmentsRequest, requestOptions?: InboundShipmentsClient.
|
|
43
|
+
create(request: BeachApi.CreateInboundShipmentsRequest, requestOptions?: InboundShipmentsClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.CreateInboundShipmentsResponse>;
|
|
42
44
|
private __create;
|
|
43
45
|
/**
|
|
44
46
|
* @param {BeachApi.GetInboundShipmentsRequest} request
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { toJson } from "../../../../core/json.mjs";
|
|
26
26
|
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
@@ -96,7 +96,7 @@ export class InboundShipmentsClient {
|
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* @param {BeachApi.CreateInboundShipmentsRequest} request
|
|
99
|
-
* @param {InboundShipmentsClient.
|
|
99
|
+
* @param {InboundShipmentsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
100
100
|
*
|
|
101
101
|
* @throws {@link errors.BeachApiError}
|
|
102
102
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -117,7 +117,7 @@ export class InboundShipmentsClient {
|
|
|
117
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
118
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
119
119
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
120
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
121
121
|
const _response = yield core.fetcher({
|
|
122
122
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, "v1/inbound-shipments"),
|
|
123
123
|
method: "POST",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../index.mjs";
|
|
@@ -6,6 +6,8 @@ export declare namespace OutboundRequestsClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class OutboundRequestsClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<OutboundRequestsClient.Options>;
|
|
@@ -24,7 +26,7 @@ export declare class OutboundRequestsClient {
|
|
|
24
26
|
private __list;
|
|
25
27
|
/**
|
|
26
28
|
* @param {BeachApi.CreateOutboundRequestsRequest} request
|
|
27
|
-
* @param {OutboundRequestsClient.
|
|
29
|
+
* @param {OutboundRequestsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
28
30
|
*
|
|
29
31
|
* @throws {@link errors.BeachApiError}
|
|
30
32
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -37,7 +39,7 @@ export declare class OutboundRequestsClient {
|
|
|
37
39
|
* }]
|
|
38
40
|
* })
|
|
39
41
|
*/
|
|
40
|
-
create(request: BeachApi.CreateOutboundRequestsRequest, requestOptions?: OutboundRequestsClient.
|
|
42
|
+
create(request: BeachApi.CreateOutboundRequestsRequest, requestOptions?: OutboundRequestsClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.CreateOutboundRequestsResponse>;
|
|
41
43
|
private __create;
|
|
42
44
|
/**
|
|
43
45
|
* @param {BeachApi.GetOutboundRequestsRequest} request
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { toJson } from "../../../../core/json.mjs";
|
|
26
26
|
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
@@ -96,7 +96,7 @@ export class OutboundRequestsClient {
|
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* @param {BeachApi.CreateOutboundRequestsRequest} request
|
|
99
|
-
* @param {OutboundRequestsClient.
|
|
99
|
+
* @param {OutboundRequestsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
100
100
|
*
|
|
101
101
|
* @throws {@link errors.BeachApiError}
|
|
102
102
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -116,7 +116,7 @@ export class OutboundRequestsClient {
|
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
118
118
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
119
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
119
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
120
|
const _response = yield core.fetcher({
|
|
121
121
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, "v1/outbound-requests"),
|
|
122
122
|
method: "POST",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as BeachApi from "../../../index.mjs";
|
|
@@ -6,6 +6,8 @@ export declare namespace TransfersClient {
|
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
|
+
interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
export declare class TransfersClient {
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<TransfersClient.Options>;
|
|
@@ -24,7 +26,7 @@ export declare class TransfersClient {
|
|
|
24
26
|
private __list;
|
|
25
27
|
/**
|
|
26
28
|
* @param {BeachApi.CreateTransfersRequest} request
|
|
27
|
-
* @param {TransfersClient.
|
|
29
|
+
* @param {TransfersClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
28
30
|
*
|
|
29
31
|
* @throws {@link errors.BeachApiError}
|
|
30
32
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -39,7 +41,7 @@ export declare class TransfersClient {
|
|
|
39
41
|
* }]
|
|
40
42
|
* })
|
|
41
43
|
*/
|
|
42
|
-
create(request: BeachApi.CreateTransfersRequest, requestOptions?: TransfersClient.
|
|
44
|
+
create(request: BeachApi.CreateTransfersRequest, requestOptions?: TransfersClient.IdempotentRequestOptions): core.HttpResponsePromise<BeachApi.CreateTransfersResponse>;
|
|
43
45
|
private __create;
|
|
44
46
|
/**
|
|
45
47
|
* @param {BeachApi.GetTransfersRequest} request
|
|
@@ -55,6 +57,20 @@ export declare class TransfersClient {
|
|
|
55
57
|
*/
|
|
56
58
|
get(request: BeachApi.GetTransfersRequest, requestOptions?: TransfersClient.RequestOptions): core.HttpResponsePromise<BeachApi.GetTransfersResponse>;
|
|
57
59
|
private __get;
|
|
60
|
+
/**
|
|
61
|
+
* @param {BeachApi.ConfirmTransfersRequest} request
|
|
62
|
+
* @param {TransfersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link errors.BeachApiError}
|
|
65
|
+
* @throws {@link errors.BeachApiTimeoutError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.transfers.confirm({
|
|
69
|
+
* id: "id"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
confirm(request: BeachApi.ConfirmTransfersRequest, requestOptions?: TransfersClient.RequestOptions): core.HttpResponsePromise<BeachApi.ConfirmTransfersResponse>;
|
|
73
|
+
private __confirm;
|
|
58
74
|
/**
|
|
59
75
|
* @param {BeachApi.CancelTransfersRequest} request
|
|
60
76
|
* @param {TransfersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
26
26
|
import * as environments from "../../../../environments.mjs";
|
|
@@ -84,7 +84,7 @@ export class TransfersClient {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* @param {BeachApi.CreateTransfersRequest} request
|
|
87
|
-
* @param {TransfersClient.
|
|
87
|
+
* @param {TransfersClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
88
88
|
*
|
|
89
89
|
* @throws {@link errors.BeachApiError}
|
|
90
90
|
* @throws {@link errors.BeachApiTimeoutError}
|
|
@@ -106,7 +106,7 @@ export class TransfersClient {
|
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
108
108
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
109
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
109
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
110
110
|
const _response = yield core.fetcher({
|
|
111
111
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, "v1/transfers"),
|
|
112
112
|
method: "POST",
|
|
@@ -179,6 +179,51 @@ export class TransfersClient {
|
|
|
179
179
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/transfers/{id}");
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* @param {BeachApi.ConfirmTransfersRequest} request
|
|
184
|
+
* @param {TransfersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
185
|
+
*
|
|
186
|
+
* @throws {@link errors.BeachApiError}
|
|
187
|
+
* @throws {@link errors.BeachApiTimeoutError}
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await client.transfers.confirm({
|
|
191
|
+
* id: "id"
|
|
192
|
+
* })
|
|
193
|
+
*/
|
|
194
|
+
confirm(request, requestOptions) {
|
|
195
|
+
return core.HttpResponsePromise.fromPromise(this.__confirm(request, requestOptions));
|
|
196
|
+
}
|
|
197
|
+
__confirm(request, requestOptions) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
200
|
+
const { id } = request;
|
|
201
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
202
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
203
|
+
const _response = yield core.fetcher({
|
|
204
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BeachApiEnvironment.Sandbox, `v1/transfers/${core.url.encodePathParam(id)}/confirm`),
|
|
205
|
+
method: "POST",
|
|
206
|
+
headers: _headers,
|
|
207
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
208
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
209
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
210
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
211
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
212
|
+
logging: this._options.logging,
|
|
213
|
+
});
|
|
214
|
+
if (_response.ok) {
|
|
215
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
216
|
+
}
|
|
217
|
+
if (_response.error.reason === "status-code") {
|
|
218
|
+
throw new errors.BeachApiError({
|
|
219
|
+
statusCode: _response.error.statusCode,
|
|
220
|
+
body: _response.error.body,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/transfers/{id}/confirm");
|
|
225
|
+
});
|
|
226
|
+
}
|
|
182
227
|
/**
|
|
183
228
|
* @param {BeachApi.CancelTransfersRequest} request
|
|
184
229
|
* @param {TransfersClient.RequestOptions} requestOptions - Request-specific configuration.
|