@paid-ai/paid-node 1.0.0 → 1.0.1-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +4 -17
- package/dist/cjs/BaseClient.js +0 -59
- package/dist/cjs/Client.d.ts +28 -28
- package/dist/cjs/Client.js +52 -11
- package/dist/cjs/api/errors/BadRequestError.js +1 -5
- package/dist/cjs/api/errors/ForbiddenError.js +1 -5
- package/dist/cjs/api/errors/InternalServerError.js +1 -5
- package/dist/cjs/api/errors/NotFoundError.js +1 -5
- package/dist/cjs/api/resources/agents/client/Client.d.ts +23 -22
- package/dist/cjs/api/resources/agents/client/Client.js +158 -55
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +19 -18
- package/dist/cjs/api/resources/contacts/client/Client.js +122 -43
- package/dist/cjs/api/resources/customers/client/Client.d.ts +37 -36
- package/dist/cjs/api/resources/customers/client/Client.js +315 -113
- package/dist/cjs/api/resources/orders/client/Client.d.ts +28 -27
- package/dist/cjs/api/resources/orders/client/Client.js +177 -62
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +9 -8
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +32 -13
- package/dist/cjs/api/resources/plans/client/Client.d.ts +25 -12
- package/dist/cjs/api/resources/plans/client/Client.js +143 -33
- package/dist/cjs/api/resources/products/client/Client.d.ts +23 -22
- package/dist/cjs/api/resources/products/client/Client.js +158 -55
- package/dist/cjs/api/resources/products/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/products/client/requests/index.js +0 -3
- package/dist/cjs/api/resources/traces/client/Client.d.ts +9 -8
- package/dist/cjs/api/resources/traces/client/Client.js +57 -23
- package/dist/cjs/api/resources/usage/client/Client.d.ts +16 -15
- package/dist/cjs/api/resources/usage/client/Client.js +71 -28
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.ts +3 -3
- package/dist/cjs/api/types/PlanWithFeatures.d.ts +34 -0
- package/dist/cjs/api/types/PlanWithFeatures.js +3 -0
- package/dist/cjs/api/types/SignalV2.d.ts +5 -5
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -4
- package/dist/cjs/core/auth/BearerToken.d.ts +1 -3
- package/dist/cjs/core/auth/BearerToken.js +6 -7
- package/dist/cjs/core/auth/index.d.ts +0 -1
- package/dist/cjs/core/auth/index.js +1 -3
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +7 -6
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +4 -10
- package/dist/cjs/core/fetcher/Fetcher.js +10 -204
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/cjs/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +0 -4
- package/dist/cjs/core/fetcher/getResponseBody.js +4 -18
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +2 -0
- package/dist/cjs/core/fetcher/requestWithRetries.js +9 -0
- package/dist/cjs/core/fetcher/signals.d.ts +7 -1
- package/dist/cjs/core/fetcher/signals.js +12 -0
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/headers.js +4 -6
- package/dist/cjs/core/index.d.ts +0 -1
- package/dist/cjs/core/index.js +1 -2
- package/dist/cjs/core/runtime/runtime.js +10 -11
- package/dist/cjs/core/url/join.js +1 -0
- package/dist/cjs/errors/PaidError.js +1 -5
- package/dist/cjs/errors/PaidTimeoutError.js +1 -5
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/integrations/adapters/expressjs/index.d.ts +2 -2
- package/dist/cjs/integrations/adapters/expressjs/index.js +2 -1
- package/dist/cjs/integrations/adapters/expressjs/routes.d.ts +16 -0
- package/dist/cjs/integrations/adapters/expressjs/routes.js +28 -0
- package/dist/cjs/integrations/adapters/nextjs/index.d.ts +1 -1
- package/dist/cjs/integrations/adapters/nextjs/index.js +2 -1
- package/dist/cjs/integrations/adapters/nextjs/routes.d.ts +15 -0
- package/dist/cjs/integrations/adapters/nextjs/routes.js +21 -0
- package/dist/cjs/integrations/controllers/index.d.ts +1 -0
- package/dist/cjs/integrations/controllers/index.js +3 -1
- package/dist/cjs/integrations/controllers/orders.js +52 -17
- package/dist/cjs/integrations/controllers/plans.d.ts +50 -0
- package/dist/cjs/integrations/controllers/plans.js +88 -0
- package/dist/cjs/integrations/types.d.ts +5 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +4 -17
- package/dist/esm/BaseClient.mjs +1 -24
- package/dist/esm/Client.d.mts +28 -28
- package/dist/esm/Client.mjs +27 -19
- package/dist/esm/api/errors/BadRequestError.mjs +1 -5
- package/dist/esm/api/errors/ForbiddenError.mjs +1 -5
- package/dist/esm/api/errors/InternalServerError.mjs +1 -5
- package/dist/esm/api/errors/NotFoundError.mjs +1 -5
- package/dist/esm/api/resources/agents/client/Client.d.mts +23 -22
- package/dist/esm/api/resources/agents/client/Client.mjs +157 -54
- package/dist/esm/api/resources/contacts/client/Client.d.mts +19 -18
- package/dist/esm/api/resources/contacts/client/Client.mjs +121 -42
- package/dist/esm/api/resources/customers/client/Client.d.mts +37 -36
- package/dist/esm/api/resources/customers/client/Client.mjs +314 -112
- package/dist/esm/api/resources/orders/client/Client.d.mts +28 -27
- package/dist/esm/api/resources/orders/client/Client.mjs +177 -62
- package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +9 -8
- package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +31 -12
- package/dist/esm/api/resources/plans/client/Client.d.mts +25 -12
- package/dist/esm/api/resources/plans/client/Client.mjs +142 -32
- package/dist/esm/api/resources/products/client/Client.d.mts +23 -22
- package/dist/esm/api/resources/products/client/Client.mjs +157 -54
- package/dist/esm/api/resources/products/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/products/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/traces/client/Client.d.mts +9 -8
- package/dist/esm/api/resources/traces/client/Client.mjs +56 -22
- package/dist/esm/api/resources/usage/client/Client.d.mts +16 -15
- package/dist/esm/api/resources/usage/client/Client.mjs +70 -27
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.mts +3 -3
- package/dist/esm/api/types/PlanWithFeatures.d.mts +34 -0
- package/dist/esm/api/types/PlanWithFeatures.mjs +2 -0
- package/dist/esm/api/types/SignalV2.d.mts +5 -5
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -4
- package/dist/esm/core/auth/BearerToken.d.mts +1 -3
- package/dist/esm/core/auth/BearerToken.mjs +6 -7
- package/dist/esm/core/auth/index.d.mts +0 -1
- package/dist/esm/core/auth/index.mjs +0 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +7 -6
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +4 -10
- package/dist/esm/core/fetcher/Fetcher.mjs +10 -204
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +4 -0
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +3 -0
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +0 -4
- package/dist/esm/core/fetcher/getResponseBody.mjs +4 -18
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +2 -0
- package/dist/esm/core/fetcher/requestWithRetries.mjs +9 -0
- package/dist/esm/core/fetcher/signals.d.mts +7 -1
- package/dist/esm/core/fetcher/signals.mjs +12 -0
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/headers.mjs +4 -6
- package/dist/esm/core/index.d.mts +0 -1
- package/dist/esm/core/index.mjs +0 -1
- package/dist/esm/core/runtime/runtime.mjs +10 -11
- package/dist/esm/core/url/join.mjs +1 -0
- package/dist/esm/errors/PaidError.mjs +1 -5
- package/dist/esm/errors/PaidTimeoutError.mjs +1 -5
- package/dist/esm/index.d.mts +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/integrations/adapters/expressjs/index.d.mts +2 -2
- package/dist/esm/integrations/adapters/expressjs/index.mjs +2 -2
- package/dist/esm/integrations/adapters/expressjs/routes.d.mts +16 -0
- package/dist/esm/integrations/adapters/expressjs/routes.mjs +27 -0
- package/dist/esm/integrations/adapters/nextjs/index.d.mts +1 -1
- package/dist/esm/integrations/adapters/nextjs/index.mjs +1 -1
- package/dist/esm/integrations/adapters/nextjs/routes.d.mts +15 -0
- package/dist/esm/integrations/adapters/nextjs/routes.mjs +20 -0
- package/dist/esm/integrations/controllers/index.d.mts +1 -0
- package/dist/esm/integrations/controllers/index.mjs +1 -0
- package/dist/esm/integrations/controllers/orders.mjs +52 -17
- package/dist/esm/integrations/controllers/plans.d.mts +50 -0
- package/dist/esm/integrations/controllers/plans.mjs +84 -0
- package/dist/esm/integrations/types.d.mts +5 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +38 -7
- package/reference.md +106 -57
- package/dist/cjs/auth/BearerAuthProvider.d.ts +0 -20
- package/dist/cjs/auth/BearerAuthProvider.js +0 -79
- package/dist/cjs/auth/index.d.ts +0 -1
- package/dist/cjs/auth/index.js +0 -5
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +0 -5
- package/dist/cjs/core/auth/NoOpAuthProvider.js +0 -9
- package/dist/cjs/core/exports.d.ts +0 -1
- package/dist/cjs/core/exports.js +0 -17
- package/dist/cjs/core/logging/exports.d.ts +0 -18
- package/dist/cjs/core/logging/exports.js +0 -45
- package/dist/cjs/core/logging/index.d.ts +0 -1
- package/dist/cjs/core/logging/index.js +0 -17
- package/dist/cjs/core/logging/logger.d.ts +0 -126
- package/dist/cjs/core/logging/logger.js +0 -144
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +0 -2
- package/dist/cjs/errors/handleNonStatusCodeError.js +0 -65
- package/dist/cjs/exports.d.ts +0 -1
- package/dist/cjs/exports.js +0 -17
- package/dist/esm/auth/BearerAuthProvider.d.mts +0 -20
- package/dist/esm/auth/BearerAuthProvider.mjs +0 -42
- package/dist/esm/auth/index.d.mts +0 -1
- package/dist/esm/auth/index.mjs +0 -1
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +0 -5
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +0 -5
- package/dist/esm/core/exports.d.mts +0 -1
- package/dist/esm/core/exports.mjs +0 -1
- package/dist/esm/core/logging/exports.d.mts +0 -18
- package/dist/esm/core/logging/exports.mjs +0 -9
- package/dist/esm/core/logging/index.d.mts +0 -1
- package/dist/esm/core/logging/index.mjs +0 -1
- package/dist/esm/core/logging/logger.d.mts +0 -126
- package/dist/esm/core/logging/logger.mjs +0 -138
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +0 -2
- package/dist/esm/errors/handleNonStatusCodeError.mjs +0 -29
- package/dist/esm/exports.d.mts +0 -1
- package/dist/esm/exports.mjs +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
-
import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
|
|
3
2
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
3
|
import type * as Paid from "../../../../../index.mjs";
|
|
5
|
-
export declare namespace
|
|
6
|
-
|
|
4
|
+
export declare namespace Lines {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class Lines {
|
|
11
|
+
protected readonly _options: Lines.Options;
|
|
12
|
+
constructor(_options?: Lines.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {string} orderId
|
|
15
15
|
* @param {Paid.orders.LinesUpdateRequest} request
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {Lines.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* await client.orders.lines.update("orderId", {
|
|
@@ -26,6 +26,7 @@ export declare class LinesClient {
|
|
|
26
26
|
* }]
|
|
27
27
|
* })
|
|
28
28
|
*/
|
|
29
|
-
update(orderId: string, request?: Paid.orders.LinesUpdateRequest, requestOptions?:
|
|
29
|
+
update(orderId: string, request?: Paid.orders.LinesUpdateRequest, requestOptions?: Lines.RequestOptions): core.HttpResponsePromise<Paid.Order>;
|
|
30
30
|
private __update;
|
|
31
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
31
32
|
}
|
|
@@ -8,20 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
12
|
-
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
11
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
13
12
|
import * as core from "../../../../../../core/index.mjs";
|
|
14
13
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
-
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
14
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
-
export class
|
|
18
|
-
constructor(
|
|
19
|
-
this._options =
|
|
15
|
+
export class Lines {
|
|
16
|
+
constructor(_options = {}) {
|
|
17
|
+
this._options = _options;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
20
|
* @param {string} orderId
|
|
23
21
|
* @param {Paid.orders.LinesUpdateRequest} request
|
|
24
|
-
* @param {
|
|
22
|
+
* @param {Lines.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
23
|
*
|
|
26
24
|
* @example
|
|
27
25
|
* await client.orders.lines.update("orderId", {
|
|
@@ -39,8 +37,8 @@ export class LinesClient {
|
|
|
39
37
|
}
|
|
40
38
|
__update(orderId_1) {
|
|
41
39
|
return __awaiter(this, arguments, void 0, function* (orderId, request = {}, requestOptions) {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
43
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
44
42
|
const _response = yield core.fetcher({
|
|
45
43
|
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.PaidEnvironment.Production, `orders/${core.url.encodePathParam(orderId)}/lines`),
|
|
46
44
|
method: "PUT",
|
|
@@ -52,8 +50,6 @@ export class LinesClient {
|
|
|
52
50
|
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,
|
|
53
51
|
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,
|
|
54
52
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
55
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
56
|
-
logging: this._options.logging,
|
|
57
53
|
});
|
|
58
54
|
if (_response.ok) {
|
|
59
55
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -65,7 +61,30 @@ export class LinesClient {
|
|
|
65
61
|
rawResponse: _response.rawResponse,
|
|
66
62
|
});
|
|
67
63
|
}
|
|
68
|
-
|
|
64
|
+
switch (_response.error.reason) {
|
|
65
|
+
case "non-json":
|
|
66
|
+
throw new errors.PaidError({
|
|
67
|
+
statusCode: _response.error.statusCode,
|
|
68
|
+
body: _response.error.rawBody,
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
});
|
|
71
|
+
case "timeout":
|
|
72
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /orders/{orderId}/lines.");
|
|
73
|
+
case "unknown":
|
|
74
|
+
throw new errors.PaidError({
|
|
75
|
+
message: _response.error.errorMessage,
|
|
76
|
+
rawResponse: _response.rawResponse,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
_getAuthorizationHeader() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
84
|
+
if (bearer != null) {
|
|
85
|
+
return `Bearer ${bearer}`;
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
69
88
|
});
|
|
70
89
|
}
|
|
71
90
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
2
|
import * as core from "../../../../core/index.mjs";
|
|
4
3
|
import * as Paid from "../../../index.mjs";
|
|
5
|
-
export declare namespace
|
|
6
|
-
|
|
4
|
+
export declare namespace Plans {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class Plans {
|
|
11
|
+
protected readonly _options: Plans.Options;
|
|
12
|
+
constructor(_options?: Plans.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {string} planId - The ID of the plan
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
16
|
*
|
|
17
17
|
* @throws {@link Paid.ForbiddenError}
|
|
18
18
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -20,12 +20,12 @@ export declare class PlansClient {
|
|
|
20
20
|
* @example
|
|
21
21
|
* await client.plans.getById("planId")
|
|
22
22
|
*/
|
|
23
|
-
getById(planId: string, requestOptions?:
|
|
23
|
+
getById(planId: string, requestOptions?: Plans.RequestOptions): core.HttpResponsePromise<Paid.Plan>;
|
|
24
24
|
private __getById;
|
|
25
25
|
/**
|
|
26
26
|
* @param {string} planId - The ID of the plan
|
|
27
27
|
* @param {Paid.PlansGetUsageRequest} request
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
29
|
*
|
|
30
30
|
* @throws {@link Paid.BadRequestError}
|
|
31
31
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -40,11 +40,11 @@ export declare class PlansClient {
|
|
|
40
40
|
* endTime: "2024-01-15T09:30:00Z"
|
|
41
41
|
* })
|
|
42
42
|
*/
|
|
43
|
-
getUsage(planId: string, request: Paid.PlansGetUsageRequest, requestOptions?:
|
|
43
|
+
getUsage(planId: string, request: Paid.PlansGetUsageRequest, requestOptions?: Plans.RequestOptions): core.HttpResponsePromise<Paid.UsageSummariesResponse>;
|
|
44
44
|
private __getUsage;
|
|
45
45
|
/**
|
|
46
46
|
* @param {string} planGroupId - The ID of the plan group
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @throws {@link Paid.ForbiddenError}
|
|
50
50
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -52,6 +52,19 @@ export declare class PlansClient {
|
|
|
52
52
|
* @example
|
|
53
53
|
* await client.plans.getGroupById("planGroupId")
|
|
54
54
|
*/
|
|
55
|
-
getGroupById(planGroupId: string, requestOptions?:
|
|
55
|
+
getGroupById(planGroupId: string, requestOptions?: Plans.RequestOptions): core.HttpResponsePromise<Paid.PlanGroup>;
|
|
56
56
|
private __getGroupById;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} planGroupId - The ID of the plan group
|
|
59
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
|
+
*
|
|
61
|
+
* @throws {@link Paid.ForbiddenError}
|
|
62
|
+
* @throws {@link Paid.NotFoundError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.plans.getGroupPlans("planGroupId")
|
|
66
|
+
*/
|
|
67
|
+
getGroupPlans(planGroupId: string, requestOptions?: Plans.RequestOptions): core.HttpResponsePromise<Paid.PlanWithFeatures[]>;
|
|
68
|
+
private __getGroupPlans;
|
|
69
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
57
70
|
}
|
|
@@ -8,20 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
11
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
12
|
import * as core from "../../../../core/index.mjs";
|
|
14
13
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
-
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
14
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
15
|
import * as Paid from "../../../index.mjs";
|
|
18
|
-
export class
|
|
19
|
-
constructor(
|
|
20
|
-
this._options =
|
|
16
|
+
export class Plans {
|
|
17
|
+
constructor(_options = {}) {
|
|
18
|
+
this._options = _options;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
21
|
* @param {string} planId - The ID of the plan
|
|
24
|
-
* @param {
|
|
22
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
23
|
*
|
|
26
24
|
* @throws {@link Paid.ForbiddenError}
|
|
27
25
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -34,8 +32,8 @@ export class PlansClient {
|
|
|
34
32
|
}
|
|
35
33
|
__getById(planId, requestOptions) {
|
|
36
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
38
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
39
37
|
const _response = yield core.fetcher({
|
|
40
38
|
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.PaidEnvironment.Production, `plans/${core.url.encodePathParam(planId)}`),
|
|
41
39
|
method: "GET",
|
|
@@ -44,8 +42,6 @@ export class PlansClient {
|
|
|
44
42
|
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,
|
|
45
43
|
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,
|
|
46
44
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
47
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
48
|
-
logging: this._options.logging,
|
|
49
45
|
});
|
|
50
46
|
if (_response.ok) {
|
|
51
47
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -64,13 +60,27 @@ export class PlansClient {
|
|
|
64
60
|
});
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
|
-
|
|
63
|
+
switch (_response.error.reason) {
|
|
64
|
+
case "non-json":
|
|
65
|
+
throw new errors.PaidError({
|
|
66
|
+
statusCode: _response.error.statusCode,
|
|
67
|
+
body: _response.error.rawBody,
|
|
68
|
+
rawResponse: _response.rawResponse,
|
|
69
|
+
});
|
|
70
|
+
case "timeout":
|
|
71
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/{planId}.");
|
|
72
|
+
case "unknown":
|
|
73
|
+
throw new errors.PaidError({
|
|
74
|
+
message: _response.error.errorMessage,
|
|
75
|
+
rawResponse: _response.rawResponse,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
68
78
|
});
|
|
69
79
|
}
|
|
70
80
|
/**
|
|
71
81
|
* @param {string} planId - The ID of the plan
|
|
72
82
|
* @param {Paid.PlansGetUsageRequest} request
|
|
73
|
-
* @param {
|
|
83
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
84
|
*
|
|
75
85
|
* @throws {@link Paid.BadRequestError}
|
|
76
86
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -90,16 +100,23 @@ export class PlansClient {
|
|
|
90
100
|
}
|
|
91
101
|
__getUsage(planId, request, requestOptions) {
|
|
92
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
103
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
94
104
|
const { externalId, limit, offset, startTime, endTime } = request;
|
|
95
|
-
const _queryParams = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
const _queryParams = {};
|
|
106
|
+
_queryParams.externalId = externalId;
|
|
107
|
+
if (limit != null) {
|
|
108
|
+
_queryParams.limit = limit.toString();
|
|
109
|
+
}
|
|
110
|
+
if (offset != null) {
|
|
111
|
+
_queryParams.offset = offset.toString();
|
|
112
|
+
}
|
|
113
|
+
if (startTime != null) {
|
|
114
|
+
_queryParams.startTime = startTime;
|
|
115
|
+
}
|
|
116
|
+
if (endTime != null) {
|
|
117
|
+
_queryParams.endTime = endTime;
|
|
118
|
+
}
|
|
119
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
103
120
|
const _response = yield core.fetcher({
|
|
104
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.PaidEnvironment.Production, `plans/${core.url.encodePathParam(planId)}/usage`),
|
|
105
122
|
method: "GET",
|
|
@@ -108,8 +125,6 @@ export class PlansClient {
|
|
|
108
125
|
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,
|
|
109
126
|
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,
|
|
110
127
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
111
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
112
|
-
logging: this._options.logging,
|
|
113
128
|
});
|
|
114
129
|
if (_response.ok) {
|
|
115
130
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -130,12 +145,26 @@ export class PlansClient {
|
|
|
130
145
|
});
|
|
131
146
|
}
|
|
132
147
|
}
|
|
133
|
-
|
|
148
|
+
switch (_response.error.reason) {
|
|
149
|
+
case "non-json":
|
|
150
|
+
throw new errors.PaidError({
|
|
151
|
+
statusCode: _response.error.statusCode,
|
|
152
|
+
body: _response.error.rawBody,
|
|
153
|
+
rawResponse: _response.rawResponse,
|
|
154
|
+
});
|
|
155
|
+
case "timeout":
|
|
156
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/{planId}/usage.");
|
|
157
|
+
case "unknown":
|
|
158
|
+
throw new errors.PaidError({
|
|
159
|
+
message: _response.error.errorMessage,
|
|
160
|
+
rawResponse: _response.rawResponse,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
134
163
|
});
|
|
135
164
|
}
|
|
136
165
|
/**
|
|
137
166
|
* @param {string} planGroupId - The ID of the plan group
|
|
138
|
-
* @param {
|
|
167
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
139
168
|
*
|
|
140
169
|
* @throws {@link Paid.ForbiddenError}
|
|
141
170
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -148,18 +177,16 @@ export class PlansClient {
|
|
|
148
177
|
}
|
|
149
178
|
__getGroupById(planGroupId, requestOptions) {
|
|
150
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
152
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
180
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
181
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
153
182
|
const _response = yield core.fetcher({
|
|
154
|
-
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.PaidEnvironment.Production, `plans/
|
|
183
|
+
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.PaidEnvironment.Production, `plans/planGroup/${core.url.encodePathParam(planGroupId)}`),
|
|
155
184
|
method: "GET",
|
|
156
185
|
headers: _headers,
|
|
157
186
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
158
187
|
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,
|
|
159
188
|
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,
|
|
160
189
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
161
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
162
|
-
logging: this._options.logging,
|
|
163
190
|
});
|
|
164
191
|
if (_response.ok) {
|
|
165
192
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -178,7 +205,90 @@ export class PlansClient {
|
|
|
178
205
|
});
|
|
179
206
|
}
|
|
180
207
|
}
|
|
181
|
-
|
|
208
|
+
switch (_response.error.reason) {
|
|
209
|
+
case "non-json":
|
|
210
|
+
throw new errors.PaidError({
|
|
211
|
+
statusCode: _response.error.statusCode,
|
|
212
|
+
body: _response.error.rawBody,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
});
|
|
215
|
+
case "timeout":
|
|
216
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/planGroup/{planGroupId}.");
|
|
217
|
+
case "unknown":
|
|
218
|
+
throw new errors.PaidError({
|
|
219
|
+
message: _response.error.errorMessage,
|
|
220
|
+
rawResponse: _response.rawResponse,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* @param {string} planGroupId - The ID of the plan group
|
|
227
|
+
* @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
|
+
*
|
|
229
|
+
* @throws {@link Paid.ForbiddenError}
|
|
230
|
+
* @throws {@link Paid.NotFoundError}
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* await client.plans.getGroupPlans("planGroupId")
|
|
234
|
+
*/
|
|
235
|
+
getGroupPlans(planGroupId, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__getGroupPlans(planGroupId, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__getGroupPlans(planGroupId, requestOptions) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
241
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
242
|
+
const _response = yield core.fetcher({
|
|
243
|
+
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.PaidEnvironment.Production, `plans/planGroup/${core.url.encodePathParam(planGroupId)}/plans`),
|
|
244
|
+
method: "GET",
|
|
245
|
+
headers: _headers,
|
|
246
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
247
|
+
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,
|
|
248
|
+
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,
|
|
249
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
250
|
+
});
|
|
251
|
+
if (_response.ok) {
|
|
252
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
253
|
+
}
|
|
254
|
+
if (_response.error.reason === "status-code") {
|
|
255
|
+
switch (_response.error.statusCode) {
|
|
256
|
+
case 403:
|
|
257
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
258
|
+
case 404:
|
|
259
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
260
|
+
default:
|
|
261
|
+
throw new errors.PaidError({
|
|
262
|
+
statusCode: _response.error.statusCode,
|
|
263
|
+
body: _response.error.body,
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
switch (_response.error.reason) {
|
|
269
|
+
case "non-json":
|
|
270
|
+
throw new errors.PaidError({
|
|
271
|
+
statusCode: _response.error.statusCode,
|
|
272
|
+
body: _response.error.rawBody,
|
|
273
|
+
rawResponse: _response.rawResponse,
|
|
274
|
+
});
|
|
275
|
+
case "timeout":
|
|
276
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/planGroup/{planGroupId}/plans.");
|
|
277
|
+
case "unknown":
|
|
278
|
+
throw new errors.PaidError({
|
|
279
|
+
message: _response.error.errorMessage,
|
|
280
|
+
rawResponse: _response.rawResponse,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
_getAuthorizationHeader() {
|
|
286
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
288
|
+
if (bearer != null) {
|
|
289
|
+
return `Bearer ${bearer}`;
|
|
290
|
+
}
|
|
291
|
+
return undefined;
|
|
182
292
|
});
|
|
183
293
|
}
|
|
184
294
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
2
|
import * as core from "../../../../core/index.mjs";
|
|
4
3
|
import type * as Paid from "../../../index.mjs";
|
|
5
|
-
export declare namespace
|
|
6
|
-
|
|
4
|
+
export declare namespace Products {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class Products {
|
|
11
|
+
protected readonly _options: Products.Options;
|
|
12
|
+
constructor(_options?: Products.Options);
|
|
13
13
|
/**
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* await client.products.list()
|
|
18
18
|
*/
|
|
19
|
-
list(requestOptions?:
|
|
19
|
+
list(requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product[]>;
|
|
20
20
|
private __list;
|
|
21
21
|
/**
|
|
22
22
|
* @param {Paid.ProductCreate} request
|
|
23
|
-
* @param {
|
|
23
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* await client.products.create({
|
|
@@ -30,62 +30,63 @@ export declare class ProductsClient {
|
|
|
30
30
|
* type: "product"
|
|
31
31
|
* })
|
|
32
32
|
*/
|
|
33
|
-
create(request: Paid.ProductCreate, requestOptions?:
|
|
33
|
+
create(request: Paid.ProductCreate, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product>;
|
|
34
34
|
private __create;
|
|
35
35
|
/**
|
|
36
36
|
* @param {string} productId
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* await client.products.get("productId")
|
|
41
41
|
*/
|
|
42
|
-
get(productId: string, requestOptions?:
|
|
42
|
+
get(productId: string, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product>;
|
|
43
43
|
private __get;
|
|
44
44
|
/**
|
|
45
45
|
* @param {string} productId
|
|
46
46
|
* @param {Paid.ProductUpdate} request
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* await client.products.update("productId", {})
|
|
51
51
|
*/
|
|
52
|
-
update(productId: string, request: Paid.ProductUpdate, requestOptions?:
|
|
52
|
+
update(productId: string, request: Paid.ProductUpdate, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product>;
|
|
53
53
|
private __update;
|
|
54
54
|
/**
|
|
55
55
|
* @param {string} productId
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* await client.products.delete("productId")
|
|
60
60
|
*/
|
|
61
|
-
delete(productId: string, requestOptions?:
|
|
61
|
+
delete(productId: string, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
62
|
private __delete;
|
|
63
63
|
/**
|
|
64
64
|
* @param {string} externalId
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
68
|
* await client.products.getByExternalId("externalId")
|
|
69
69
|
*/
|
|
70
|
-
getByExternalId(externalId: string, requestOptions?:
|
|
70
|
+
getByExternalId(externalId: string, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product>;
|
|
71
71
|
private __getByExternalId;
|
|
72
72
|
/**
|
|
73
73
|
* @param {string} externalId
|
|
74
74
|
* @param {Paid.ProductUpdate} request
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
76
|
*
|
|
77
77
|
* @example
|
|
78
78
|
* await client.products.updateByExternalId("externalId", {})
|
|
79
79
|
*/
|
|
80
|
-
updateByExternalId(externalId: string, request: Paid.ProductUpdate, requestOptions?:
|
|
80
|
+
updateByExternalId(externalId: string, request: Paid.ProductUpdate, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<Paid.Product>;
|
|
81
81
|
private __updateByExternalId;
|
|
82
82
|
/**
|
|
83
83
|
* @param {string} externalId
|
|
84
|
-
* @param {
|
|
84
|
+
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* await client.products.deleteByExternalId("externalId")
|
|
88
88
|
*/
|
|
89
|
-
deleteByExternalId(externalId: string, requestOptions?:
|
|
89
|
+
deleteByExternalId(externalId: string, requestOptions?: Products.RequestOptions): core.HttpResponsePromise<void>;
|
|
90
90
|
private __deleteByExternalId;
|
|
91
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
91
92
|
}
|