pkg-sdk-test 0.0.14 → 0.0.15
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/payments/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/payments/client/Client.js +37 -37
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.ts +2 -2
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/staticWallets/client/Client.js +32 -32
- 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 +5 -5
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +4 -4
- 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/payments/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/payments/client/Client.mjs +37 -37
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts +2 -2
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +1 -1
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.mts +2 -2
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +32 -32
- 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 +5 -5
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +4 -4
- 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 +698 -0
|
@@ -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.15";
|
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.15",
|
|
10
|
+
"User-Agent": "pkg-sdk-test/0.0.15",
|
|
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,80 @@ 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
59
|
/**
|
|
60
60
|
* Cancel a payment
|
|
61
61
|
*
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
63
63
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
64
|
*
|
|
65
|
-
* @throws {@link
|
|
66
|
-
* @throws {@link
|
|
65
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
66
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
69
|
* await client.payments.cancelPayment({
|
|
70
70
|
* paymentId: "paymentId"
|
|
71
71
|
* })
|
|
72
72
|
*/
|
|
73
|
-
cancelPayment(request:
|
|
73
|
+
cancelPayment(request: SuwardSDK.PostV1PaymentsPaymentIdCancelRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPaymentResponse>;
|
|
74
74
|
private __cancelPayment;
|
|
75
75
|
/**
|
|
76
76
|
* Simulate payment status change (test mode only)
|
|
77
77
|
*
|
|
78
|
-
* @param {
|
|
78
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
79
79
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
80
|
*
|
|
81
|
-
* @throws {@link
|
|
82
|
-
* @throws {@link
|
|
83
|
-
* @throws {@link
|
|
81
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
82
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
83
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
84
84
|
*
|
|
85
85
|
* @example
|
|
86
86
|
* await client.payments.simulatePayment({
|
|
87
87
|
* paymentId: "paymentId"
|
|
88
88
|
* })
|
|
89
89
|
*/
|
|
90
|
-
simulatePayment(request:
|
|
90
|
+
simulatePayment(request: SuwardSDK.CryptopaySimulatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardSDK.CryptopayPaymentResponse>;
|
|
91
91
|
private __simulatePayment;
|
|
92
92
|
}
|
|
@@ -24,7 +24,7 @@ import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
26
26
|
import * as errors from "../../../../errors/index.mjs";
|
|
27
|
-
import * as
|
|
27
|
+
import * as SuwardSDK from "../../../index.mjs";
|
|
28
28
|
export class PaymentsClient {
|
|
29
29
|
constructor(options) {
|
|
30
30
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
@@ -32,12 +32,12 @@ export class PaymentsClient {
|
|
|
32
32
|
/**
|
|
33
33
|
* List payments for a project
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {SuwardSDK.GetV1PaymentsRequest} request
|
|
36
36
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
|
-
* @throws {@link
|
|
39
|
-
* @throws {@link
|
|
40
|
-
* @throws {@link
|
|
38
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
39
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
40
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* await client.payments.listPayments()
|
|
@@ -48,9 +48,9 @@ export class PaymentsClient {
|
|
|
48
48
|
__listPayments() {
|
|
49
49
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
50
50
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
51
|
-
const {
|
|
51
|
+
const { ordeddddr, limit, lastId } = request;
|
|
52
52
|
const _queryParams = {
|
|
53
|
-
|
|
53
|
+
ordeddddr,
|
|
54
54
|
limit,
|
|
55
55
|
lastId,
|
|
56
56
|
};
|
|
@@ -80,13 +80,13 @@ export class PaymentsClient {
|
|
|
80
80
|
if (_response.error.reason === "status-code") {
|
|
81
81
|
switch (_response.error.statusCode) {
|
|
82
82
|
case 400:
|
|
83
|
-
throw new
|
|
83
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
84
84
|
case 401:
|
|
85
|
-
throw new
|
|
85
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
86
86
|
case 500:
|
|
87
|
-
throw new
|
|
87
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
88
88
|
default:
|
|
89
|
-
throw new errors.
|
|
89
|
+
throw new errors.SuwardSDKError({
|
|
90
90
|
statusCode: _response.error.statusCode,
|
|
91
91
|
body: _response.error.body,
|
|
92
92
|
rawResponse: _response.rawResponse,
|
|
@@ -99,12 +99,12 @@ export class PaymentsClient {
|
|
|
99
99
|
/**
|
|
100
100
|
* Create a new payment
|
|
101
101
|
*
|
|
102
|
-
* @param {
|
|
102
|
+
* @param {SuwardSDK.CryptopayCreatePaymentRequest} request
|
|
103
103
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
104
|
*
|
|
105
|
-
* @throws {@link
|
|
106
|
-
* @throws {@link
|
|
107
|
-
* @throws {@link
|
|
105
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
106
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
107
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
108
108
|
*
|
|
109
109
|
* @example
|
|
110
110
|
* await client.payments.createPayment()
|
|
@@ -137,13 +137,13 @@ export class PaymentsClient {
|
|
|
137
137
|
if (_response.error.reason === "status-code") {
|
|
138
138
|
switch (_response.error.statusCode) {
|
|
139
139
|
case 400:
|
|
140
|
-
throw new
|
|
140
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
141
141
|
case 401:
|
|
142
|
-
throw new
|
|
142
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
143
143
|
case 500:
|
|
144
|
-
throw new
|
|
144
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
145
145
|
default:
|
|
146
|
-
throw new errors.
|
|
146
|
+
throw new errors.SuwardSDKError({
|
|
147
147
|
statusCode: _response.error.statusCode,
|
|
148
148
|
body: _response.error.body,
|
|
149
149
|
rawResponse: _response.rawResponse,
|
|
@@ -157,10 +157,10 @@ export class PaymentsClient {
|
|
|
157
157
|
* Returns full payment details when called with an API key (merchant view).
|
|
158
158
|
* Returns limited payment details when called without an API key (customer view).
|
|
159
159
|
*
|
|
160
|
-
* @param {
|
|
160
|
+
* @param {SuwardSDK.GetV1PaymentsPaymentIdRequest} request
|
|
161
161
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
162
162
|
*
|
|
163
|
-
* @throws {@link
|
|
163
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
164
164
|
*
|
|
165
165
|
* @example
|
|
166
166
|
* await client.payments.getPayment({
|
|
@@ -196,9 +196,9 @@ export class PaymentsClient {
|
|
|
196
196
|
if (_response.error.reason === "status-code") {
|
|
197
197
|
switch (_response.error.statusCode) {
|
|
198
198
|
case 500:
|
|
199
|
-
throw new
|
|
199
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
200
200
|
default:
|
|
201
|
-
throw new errors.
|
|
201
|
+
throw new errors.SuwardSDKError({
|
|
202
202
|
statusCode: _response.error.statusCode,
|
|
203
203
|
body: _response.error.body,
|
|
204
204
|
rawResponse: _response.rawResponse,
|
|
@@ -211,11 +211,11 @@ export class PaymentsClient {
|
|
|
211
211
|
/**
|
|
212
212
|
* Cancel a payment
|
|
213
213
|
*
|
|
214
|
-
* @param {
|
|
214
|
+
* @param {SuwardSDK.PostV1PaymentsPaymentIdCancelRequest} request
|
|
215
215
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
216
|
*
|
|
217
|
-
* @throws {@link
|
|
218
|
-
* @throws {@link
|
|
217
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
218
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
219
219
|
*
|
|
220
220
|
* @example
|
|
221
221
|
* await client.payments.cancelPayment({
|
|
@@ -248,11 +248,11 @@ export class PaymentsClient {
|
|
|
248
248
|
if (_response.error.reason === "status-code") {
|
|
249
249
|
switch (_response.error.statusCode) {
|
|
250
250
|
case 401:
|
|
251
|
-
throw new
|
|
251
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
252
252
|
case 500:
|
|
253
|
-
throw new
|
|
253
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
254
254
|
default:
|
|
255
|
-
throw new errors.
|
|
255
|
+
throw new errors.SuwardSDKError({
|
|
256
256
|
statusCode: _response.error.statusCode,
|
|
257
257
|
body: _response.error.body,
|
|
258
258
|
rawResponse: _response.rawResponse,
|
|
@@ -265,12 +265,12 @@ export class PaymentsClient {
|
|
|
265
265
|
/**
|
|
266
266
|
* Simulate payment status change (test mode only)
|
|
267
267
|
*
|
|
268
|
-
* @param {
|
|
268
|
+
* @param {SuwardSDK.CryptopaySimulatePaymentRequest} request
|
|
269
269
|
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
270
270
|
*
|
|
271
|
-
* @throws {@link
|
|
272
|
-
* @throws {@link
|
|
273
|
-
* @throws {@link
|
|
271
|
+
* @throws {@link SuwardSDK.BadRequestError}
|
|
272
|
+
* @throws {@link SuwardSDK.UnauthorizedError}
|
|
273
|
+
* @throws {@link SuwardSDK.InternalServerError}
|
|
274
274
|
*
|
|
275
275
|
* @example
|
|
276
276
|
* await client.payments.simulatePayment({
|
|
@@ -306,13 +306,13 @@ export class PaymentsClient {
|
|
|
306
306
|
if (_response.error.reason === "status-code") {
|
|
307
307
|
switch (_response.error.statusCode) {
|
|
308
308
|
case 400:
|
|
309
|
-
throw new
|
|
309
|
+
throw new SuwardSDK.BadRequestError(_response.error.body, _response.rawResponse);
|
|
310
310
|
case 401:
|
|
311
|
-
throw new
|
|
311
|
+
throw new SuwardSDK.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
312
312
|
case 500:
|
|
313
|
-
throw new
|
|
313
|
+
throw new SuwardSDK.InternalServerError(_response.error.body, _response.rawResponse);
|
|
314
314
|
default:
|
|
315
|
-
throw new errors.
|
|
315
|
+
throw new errors.SuwardSDKError({
|
|
316
316
|
statusCode: _response.error.statusCode,
|
|
317
317
|
body: _response.error.body,
|
|
318
318
|
rawResponse: _response.rawResponse,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {}
|
|
@@ -11,7 +11,7 @@ export interface CryptopayCreatePaymentRequest {
|
|
|
11
11
|
isTest?: boolean;
|
|
12
12
|
metadata?: Record<string, unknown>;
|
|
13
13
|
paymentWindowSeconds?: number;
|
|
14
|
-
redirect?:
|
|
14
|
+
redirect?: SuwardSDK.CryptopayRedirectConfigDto;
|
|
15
15
|
underpaymentTolerance?: string;
|
|
16
16
|
webhookUrl?: string;
|
|
17
17
|
}
|
package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as SuwardSDK from "../../../../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -9,5 +9,5 @@ export interface CryptopaySimulatePaymentRequest {
|
|
|
9
9
|
/** Payment ID */
|
|
10
10
|
paymentId: string;
|
|
11
11
|
amount?: string;
|
|
12
|
-
subStatus?:
|
|
12
|
+
subStatus?: SuwardSDK.CryptopayPaymentSubStatusEnum;
|
|
13
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
export type GetV1PaymentsPaymentIdResponse =
|
|
1
|
+
import type * as SuwardSDK from "../../../index.mjs";
|
|
2
|
+
export type GetV1PaymentsPaymentIdResponse = SuwardSDK.CryptopayPaymentResponse | SuwardSDK.CryptopayPublicPaymentResponse;
|