pkg-sdk-test 0.0.14 → 0.0.16
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 +295 -0
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/Client.d.ts +4 -4
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
- package/dist/cjs/api/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
- package/dist/cjs/api/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
- package/dist/cjs/api/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
- package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +1 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +38 -23
- package/dist/cjs/api/resources/payments/client/Client.js +89 -36
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +3 -3
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +3 -2
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.ts +10 -0
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.ts +2 -2
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +24 -23
- package/dist/cjs/api/resources/staticWallets/client/Client.js +59 -39
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.ts +12 -2
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.js +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/staticWallets/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/staticWallets/index.d.ts +1 -0
- package/dist/cjs/api/resources/staticWallets/index.js +1 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.ts +5 -0
- package/dist/cjs/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.js +8 -0
- package/dist/cjs/api/resources/staticWallets/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/staticWallets/types/index.js +18 -0
- package/dist/cjs/api/types/CryptopayAssetId.d.ts +32 -0
- package/dist/cjs/api/types/CryptopayAssetId.js +35 -0
- package/dist/cjs/api/types/CryptopayListPaymentsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticDepositsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayListStaticWalletsResponse.d.ts +2 -2
- package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +6 -6
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +5 -5
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.d.ts +11 -1
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.d.ts +13 -2
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.js +11 -0
- package/dist/cjs/api/types/CryptopayStaticWalletResponse.d.ts +2 -1
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
- package/dist/cjs/auth/HeaderAuthProvider.js +1 -1
- package/dist/cjs/errors/{SuwardApiError.d.ts → SuwardSDKError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiError.js → SuwardSDKError.js} +4 -4
- package/dist/{esm/errors/SuwardApiTimeoutError.d.mts → cjs/errors/SuwardSDKTimeoutError.d.ts} +1 -1
- package/dist/cjs/errors/{SuwardApiTimeoutError.js → SuwardSDKTimeoutError.js} +4 -4
- package/dist/cjs/errors/handleNonStatusCodeError.js +5 -5
- package/dist/cjs/errors/index.d.ts +2 -2
- package/dist/cjs/errors/index.js +5 -5
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/Client.d.mts +4 -4
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
- package/dist/esm/api/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
- package/dist/esm/api/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
- package/dist/esm/api/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
- package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +38 -23
- package/dist/esm/api/resources/payments/client/Client.mjs +89 -36
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +3 -3
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +3 -2
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.d.mts +10 -0
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdActivateRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.mts +2 -2
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +24 -23
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +59 -39
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.mts +12 -2
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.mjs +9 -1
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.d.mts +13 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.mts +7 -0
- package/dist/esm/api/resources/staticWallets/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/staticWallets/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/staticWallets/index.d.mts +1 -0
- package/dist/esm/api/resources/staticWallets/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.d.mts +5 -0
- package/dist/esm/api/resources/staticWallets/types/GetV1StaticWalletsStaticWalletIdDepositsRequestOrder.mjs +5 -0
- package/dist/esm/api/resources/staticWallets/types/index.d.mts +2 -0
- package/dist/esm/api/resources/staticWallets/types/index.mjs +2 -0
- package/dist/esm/api/types/CryptopayAssetId.d.mts +32 -0
- package/dist/esm/api/types/CryptopayAssetId.mjs +32 -0
- package/dist/esm/api/types/CryptopayListPaymentsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticDepositsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayListStaticWalletsResponse.d.mts +2 -2
- package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +6 -6
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +5 -5
- package/dist/esm/api/types/CryptopayRedirectConfigDto.d.mts +11 -1
- package/dist/esm/api/types/CryptopayRedirectConfigDto.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticDepositResponse.d.mts +13 -2
- package/dist/esm/api/types/CryptopayStaticDepositResponse.mjs +10 -1
- package/dist/esm/api/types/CryptopayStaticWalletResponse.d.mts +2 -1
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
- package/dist/esm/auth/HeaderAuthProvider.mjs +1 -1
- package/dist/esm/errors/{SuwardApiError.d.mts → SuwardSDKError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiError.mjs → SuwardSDKError.mjs} +2 -2
- package/dist/{cjs/errors/SuwardApiTimeoutError.d.ts → esm/errors/SuwardSDKTimeoutError.d.mts} +1 -1
- package/dist/esm/errors/{SuwardApiTimeoutError.mjs → SuwardSDKTimeoutError.mjs} +2 -2
- package/dist/esm/errors/handleNonStatusCodeError.mjs +5 -5
- package/dist/esm/errors/index.d.mts +2 -2
- package/dist/esm/errors/index.mjs +2 -2
- package/dist/esm/index.d.mts +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +86 -82
- package/reference.md +771 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
1
2
|
export interface CryptopayStaticDepositResponse {
|
|
2
3
|
acceptedAt?: number | undefined;
|
|
3
4
|
address?: string | undefined;
|
|
4
5
|
amount?: string | undefined;
|
|
5
|
-
asset?:
|
|
6
|
+
asset?: SuwardSDK.CryptopayAssetId | undefined;
|
|
6
7
|
confirmedAt?: number | undefined;
|
|
7
8
|
createdAt?: number | undefined;
|
|
8
9
|
detectedAt?: number | undefined;
|
|
@@ -13,8 +14,18 @@ export interface CryptopayStaticDepositResponse {
|
|
|
13
14
|
networkFee?: string | undefined;
|
|
14
15
|
projectId?: string | undefined;
|
|
15
16
|
staticWalletId?: string | undefined;
|
|
16
|
-
status?:
|
|
17
|
+
status?: CryptopayStaticDepositResponse.Status | undefined;
|
|
17
18
|
transferIndex?: string | undefined;
|
|
18
19
|
txHash?: string | undefined;
|
|
19
20
|
updatedAt?: number | undefined;
|
|
20
21
|
}
|
|
22
|
+
export declare namespace CryptopayStaticDepositResponse {
|
|
23
|
+
const Status: {
|
|
24
|
+
readonly Detected: "detected";
|
|
25
|
+
readonly Accepted: "accepted";
|
|
26
|
+
readonly Confirmed: "confirmed";
|
|
27
|
+
readonly Ignored: "ignored";
|
|
28
|
+
readonly Invalidated: "invalidated";
|
|
29
|
+
};
|
|
30
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
31
|
+
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CryptopayStaticDepositResponse = void 0;
|
|
5
|
+
var CryptopayStaticDepositResponse;
|
|
6
|
+
(function (CryptopayStaticDepositResponse) {
|
|
7
|
+
CryptopayStaticDepositResponse.Status = {
|
|
8
|
+
Detected: "detected",
|
|
9
|
+
Accepted: "accepted",
|
|
10
|
+
Confirmed: "confirmed",
|
|
11
|
+
Ignored: "ignored",
|
|
12
|
+
Invalidated: "invalidated",
|
|
13
|
+
};
|
|
14
|
+
})(CryptopayStaticDepositResponse || (exports.CryptopayStaticDepositResponse = CryptopayStaticDepositResponse = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type * as SuwardSDK from "../index.js";
|
|
1
2
|
export interface CryptopayStaticWalletResponse {
|
|
2
3
|
address?: string | undefined;
|
|
3
|
-
allowedAssets?:
|
|
4
|
+
allowedAssets?: SuwardSDK.CryptopayAssetId[] | undefined;
|
|
4
5
|
createdAt?: number | undefined;
|
|
5
6
|
externalId?: string | undefined;
|
|
6
7
|
id?: string | undefined;
|
|
@@ -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("./ControllerErrorResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./CryptopayAssetId.js"), exports);
|
|
18
19
|
__exportStar(require("./CryptopayListPaymentsResponse.js"), exports);
|
|
19
20
|
__exportStar(require("./CryptopayListStaticDepositsResponse.js"), exports);
|
|
20
21
|
__exportStar(require("./CryptopayListStaticWalletsResponse.js"), exports);
|
|
@@ -13,7 +13,7 @@ export declare namespace HeaderAuthProvider {
|
|
|
13
13
|
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
14
14
|
type Options = AuthOptions;
|
|
15
15
|
type AuthOptions = {
|
|
16
|
-
[PARAM_KEY]
|
|
16
|
+
[PARAM_KEY]?: core.Supplier<string>;
|
|
17
17
|
};
|
|
18
18
|
function createInstance(options: Options): core.AuthProvider;
|
|
19
19
|
}
|
|
@@ -59,7 +59,7 @@ class HeaderAuthProvider {
|
|
|
59
59
|
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
60
60
|
const headerValue = yield core.Supplier.get(this.options[PARAM_KEY]);
|
|
61
61
|
if (headerValue == null) {
|
|
62
|
-
throw new errors.
|
|
62
|
+
throw new errors.SuwardSDKError({
|
|
63
63
|
message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SuwardSDKError = void 0;
|
|
5
5
|
const json_js_1 = require("../core/json.js");
|
|
6
|
-
class
|
|
6
|
+
class SuwardSDKError extends Error {
|
|
7
7
|
constructor({ message, statusCode, body, rawResponse, cause, }) {
|
|
8
8
|
super(buildMessage({ message, statusCode, body }));
|
|
9
9
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
10
|
if (Error.captureStackTrace) {
|
|
11
11
|
Error.captureStackTrace(this, this.constructor);
|
|
12
12
|
}
|
|
13
|
-
this.name = "
|
|
13
|
+
this.name = "SuwardSDKError";
|
|
14
14
|
this.statusCode = statusCode;
|
|
15
15
|
this.body = body;
|
|
16
16
|
this.rawResponse = rawResponse;
|
|
@@ -19,7 +19,7 @@ class SuwardApiError extends Error {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
exports.
|
|
22
|
+
exports.SuwardSDKError = SuwardSDKError;
|
|
23
23
|
function buildMessage({ message, statusCode, body, }) {
|
|
24
24
|
const lines = [];
|
|
25
25
|
if (message != null) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
class
|
|
4
|
+
exports.SuwardSDKTimeoutError = void 0;
|
|
5
|
+
class SuwardSDKTimeoutError extends Error {
|
|
6
6
|
constructor(message, opts) {
|
|
7
7
|
super(message);
|
|
8
8
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
9
|
if (Error.captureStackTrace) {
|
|
10
10
|
Error.captureStackTrace(this, this.constructor);
|
|
11
11
|
}
|
|
12
|
-
this.name = "
|
|
12
|
+
this.name = "SuwardSDKTimeoutError";
|
|
13
13
|
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
14
14
|
this.cause = opts.cause;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
18
|
+
exports.SuwardSDKTimeoutError = SuwardSDKTimeoutError;
|
|
@@ -39,28 +39,28 @@ const errors = __importStar(require("./index.js"));
|
|
|
39
39
|
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
40
40
|
switch (error.reason) {
|
|
41
41
|
case "non-json":
|
|
42
|
-
throw new errors.
|
|
42
|
+
throw new errors.SuwardSDKError({
|
|
43
43
|
statusCode: error.statusCode,
|
|
44
44
|
body: error.rawBody,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
47
|
case "body-is-null":
|
|
48
|
-
throw new errors.
|
|
48
|
+
throw new errors.SuwardSDKError({
|
|
49
49
|
statusCode: error.statusCode,
|
|
50
50
|
rawResponse: rawResponse,
|
|
51
51
|
});
|
|
52
52
|
case "timeout":
|
|
53
|
-
throw new errors.
|
|
53
|
+
throw new errors.SuwardSDKTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
54
54
|
cause: error.cause,
|
|
55
55
|
});
|
|
56
56
|
case "unknown":
|
|
57
|
-
throw new errors.
|
|
57
|
+
throw new errors.SuwardSDKError({
|
|
58
58
|
message: error.errorMessage,
|
|
59
59
|
rawResponse: rawResponse,
|
|
60
60
|
cause: error.cause,
|
|
61
61
|
});
|
|
62
62
|
default:
|
|
63
|
-
throw new errors.
|
|
63
|
+
throw new errors.SuwardSDKError({
|
|
64
64
|
message: "Unknown error",
|
|
65
65
|
rawResponse: rawResponse,
|
|
66
66
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { SuwardSDKError } from "./SuwardSDKError.js";
|
|
2
|
+
export { SuwardSDKTimeoutError } from "./SuwardSDKTimeoutError.js";
|
package/dist/cjs/errors/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.SuwardSDKTimeoutError = exports.SuwardSDKError = void 0;
|
|
4
|
+
var SuwardSDKError_js_1 = require("./SuwardSDKError.js");
|
|
5
|
+
Object.defineProperty(exports, "SuwardSDKError", { enumerable: true, get: function () { return SuwardSDKError_js_1.SuwardSDKError; } });
|
|
6
|
+
var SuwardSDKTimeoutError_js_1 = require("./SuwardSDKTimeoutError.js");
|
|
7
|
+
Object.defineProperty(exports, "SuwardSDKTimeoutError", { enumerable: true, get: function () { return SuwardSDKTimeoutError_js_1.SuwardSDKTimeoutError; } });
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as SuwardSDK from "./api/index.js";
|
|
2
2
|
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { SuwardSDKClient } from "./Client.js";
|
|
4
|
+
export { SuwardSDKError, SuwardSDKTimeoutError } from "./errors/index.js";
|
|
5
5
|
export * from "./exports.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,11 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
39
|
+
exports.SuwardSDKTimeoutError = exports.SuwardSDKError = exports.SuwardSDKClient = exports.SuwardSDK = void 0;
|
|
40
|
+
exports.SuwardSDK = __importStar(require("./api/index.js"));
|
|
41
41
|
var Client_js_1 = require("./Client.js");
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "SuwardSDKClient", { enumerable: true, get: function () { return Client_js_1.SuwardSDKClient; } });
|
|
43
43
|
var index_js_1 = require("./errors/index.js");
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
Object.defineProperty(exports, "
|
|
44
|
+
Object.defineProperty(exports, "SuwardSDKError", { enumerable: true, get: function () { return index_js_1.SuwardSDKError; } });
|
|
45
|
+
Object.defineProperty(exports, "SuwardSDKTimeoutError", { enumerable: true, get: function () { return index_js_1.SuwardSDKTimeoutError; } });
|
|
46
46
|
__exportStar(require("./exports.js"), exports);
|
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.16";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import * as core from "./core/index.mjs";
|
|
|
5
5
|
export function normalizeClientOptions(options) {
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
|
-
"X-Fern-SDK-Name": "
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "
|
|
8
|
+
"X-Fern-SDK-Name": "pkg-sdk-test",
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.16",
|
|
10
|
+
"User-Agent": "pkg-sdk-test/0.0.16",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -3,16 +3,16 @@ import { StaticWalletsClient } from "./api/resources/staticWallets/client/Client
|
|
|
3
3
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
4
4
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
5
5
|
import * as core from "./core/index.mjs";
|
|
6
|
-
export declare namespace
|
|
6
|
+
export declare namespace SuwardSDKClient {
|
|
7
7
|
type Options = BaseClientOptions;
|
|
8
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
12
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<
|
|
11
|
+
export declare class SuwardSDKClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<SuwardSDKClient.Options>;
|
|
13
13
|
protected _payments: PaymentsClient | undefined;
|
|
14
14
|
protected _staticWallets: StaticWalletsClient | undefined;
|
|
15
|
-
constructor(options:
|
|
15
|
+
constructor(options: SuwardSDKClient.Options);
|
|
16
16
|
get payments(): PaymentsClient;
|
|
17
17
|
get staticWallets(): StaticWalletsClient;
|
|
18
18
|
/**
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { PaymentsClient } from "./api/resources/payments/client/Client.mjs";
|
|
|
12
12
|
import { StaticWalletsClient } from "./api/resources/staticWallets/client/Client.mjs";
|
|
13
13
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
14
14
|
import * as core from "./core/index.mjs";
|
|
15
|
-
export class
|
|
15
|
+
export class SuwardSDKClient {
|
|
16
16
|
constructor(options) {
|
|
17
17
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as core from "../../core/index.mjs";
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
import type * as
|
|
4
|
-
export declare class BadRequestError extends errors.
|
|
5
|
-
constructor(body:
|
|
3
|
+
import type * as SuwardSDK from "../index.mjs";
|
|
4
|
+
export declare class BadRequestError extends errors.SuwardSDKError {
|
|
5
|
+
constructor(body: SuwardSDK.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
export class BadRequestError extends errors.
|
|
3
|
+
export class BadRequestError extends errors.SuwardSDKError {
|
|
4
4
|
constructor(body, rawResponse) {
|
|
5
5
|
super({
|
|
6
6
|
message: "BadRequestError",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as core from "../../core/index.mjs";
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
import type * as
|
|
4
|
-
export declare class InternalServerError extends errors.
|
|
5
|
-
constructor(body:
|
|
3
|
+
import type * as SuwardSDK from "../index.mjs";
|
|
4
|
+
export declare class InternalServerError extends errors.SuwardSDKError {
|
|
5
|
+
constructor(body: SuwardSDK.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
export class InternalServerError extends errors.
|
|
3
|
+
export class InternalServerError extends errors.SuwardSDKError {
|
|
4
4
|
constructor(body, rawResponse) {
|
|
5
5
|
super({
|
|
6
6
|
message: "InternalServerError",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as core from "../../core/index.mjs";
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
import type * as
|
|
4
|
-
export declare class NotFoundError extends errors.
|
|
5
|
-
constructor(body:
|
|
3
|
+
import type * as SuwardSDK from "../index.mjs";
|
|
4
|
+
export declare class NotFoundError extends errors.SuwardSDKError {
|
|
5
|
+
constructor(body: SuwardSDK.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
export class NotFoundError extends errors.
|
|
3
|
+
export class NotFoundError extends errors.SuwardSDKError {
|
|
4
4
|
constructor(body, rawResponse) {
|
|
5
5
|
super({
|
|
6
6
|
message: "NotFoundError",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as core from "../../core/index.mjs";
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
import type * as
|
|
4
|
-
export declare class UnauthorizedError extends errors.
|
|
5
|
-
constructor(body:
|
|
3
|
+
import type * as SuwardSDK from "../index.mjs";
|
|
4
|
+
export declare class UnauthorizedError extends errors.SuwardSDKError {
|
|
5
|
+
constructor(body: SuwardSDK.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
|
-
export class UnauthorizedError extends errors.
|
|
3
|
+
export class UnauthorizedError extends errors.SuwardSDKError {
|
|
4
4
|
constructor(body, rawResponse) {
|
|
5
5
|
super({
|
|
6
6
|
message: "UnauthorizedError",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
5
5
|
export declare namespace PaymentsClient {
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -13,80 +13,95 @@ export declare class PaymentsClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* List payments for a project
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {SuwardSDK.GetV1PaymentsRequest} request
|
|
17
17
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
|
-
* @throws {@link
|
|
20
|
-
* @throws {@link
|
|
21
|
-
* @throws {@link
|
|
19
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
20
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
21
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* await client.payments.listPayments()
|
|
25
25
|
*/
|
|
26
|
-
listPayments(request?:
|
|
26
|
+
listPayments(request?: SuwardSDK.GetV1PaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayListPaymentsResponse>;
|
|
27
27
|
private __listPayments;
|
|
28
28
|
/**
|
|
29
29
|
* Create a new payment
|
|
30
30
|
*
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {SuwardSDK.CryptopayCreatePaymentRequest} request
|
|
32
32
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
33
|
*
|
|
34
|
-
* @throws {@link
|
|
35
|
-
* @throws {@link
|
|
36
|
-
* @throws {@link
|
|
34
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
35
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
36
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.payments.createPayment()
|
|
40
40
|
*/
|
|
41
|
-
createPayment(request?:
|
|
41
|
+
createPayment(request?: SuwardSDK.CryptopayCreatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPaymentResponse>;
|
|
42
42
|
private __createPayment;
|
|
43
43
|
/**
|
|
44
44
|
* Returns full payment details when called with an API key (merchant view).
|
|
45
45
|
* Returns limited payment details when called without an API key (customer view).
|
|
46
46
|
*
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {SuwardSDK.GetV1PaymentsPaymentIdRequest} request
|
|
48
48
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
49
49
|
*
|
|
50
|
-
* @throws {@link
|
|
50
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* await client.payments.getPayment({
|
|
54
54
|
* paymentId: "paymentId"
|
|
55
55
|
* })
|
|
56
56
|
*/
|
|
57
|
-
getPayment(request:
|
|
57
|
+
getPayment(request: SuwardSDK.GetV1PaymentsPaymentIdRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.GetV1PaymentsPaymentIdResponse>;
|
|
58
58
|
private __getPayment;
|
|
59
|
+
/**
|
|
60
|
+
* Activate a payment (public, customer-facing)
|
|
61
|
+
*
|
|
62
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdActivateRequest} request
|
|
63
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.payments.activatePayment({
|
|
69
|
+
* paymentId: "paymentId"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
activatePayment(request: SuwardSDK.PostV1PaymentsPaymentIdActivateRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPublicPaymentResponse>;
|
|
73
|
+
private __activatePayment;
|
|
59
74
|
/**
|
|
60
75
|
* Cancel a payment
|
|
61
76
|
*
|
|
62
|
-
* @param {
|
|
77
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
63
78
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
79
|
*
|
|
65
|
-
* @throws {@link
|
|
66
|
-
* @throws {@link
|
|
80
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
81
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
67
82
|
*
|
|
68
83
|
* @example
|
|
69
84
|
* await client.payments.cancelPayment({
|
|
70
85
|
* paymentId: "paymentId"
|
|
71
86
|
* })
|
|
72
87
|
*/
|
|
73
|
-
cancelPayment(request:
|
|
88
|
+
cancelPayment(request: SuwardSDK.PostV1PaymentsPaymentIdCancelRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPaymentResponse>;
|
|
74
89
|
private __cancelPayment;
|
|
75
90
|
/**
|
|
76
91
|
* Simulate payment status change (test mode only)
|
|
77
92
|
*
|
|
78
|
-
* @param {
|
|
93
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
79
94
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
95
|
*
|
|
81
|
-
* @throws {@link
|
|
82
|
-
* @throws {@link
|
|
83
|
-
* @throws {@link
|
|
96
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
97
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
98
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
84
99
|
*
|
|
85
100
|
* @example
|
|
86
101
|
* await client.payments.simulatePayment({
|
|
87
102
|
* paymentId: "paymentId"
|
|
88
103
|
* })
|
|
89
104
|
*/
|
|
90
|
-
simulatePayment(request:
|
|
105
|
+
simulatePayment(request: SuwardSDK.CryptopaySimulatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPaymentResponse>;
|
|
91
106
|
private __simulatePayment;
|
|
92
107
|
}
|