lark-billing 0.0.5 → 0.0.6
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 +10 -10
- package/dist/cjs/Client.d.ts +1 -6
- package/dist/cjs/Client.js +2 -12
- package/dist/cjs/api/resources/checkout/client/Client.d.ts +19 -4
- package/dist/cjs/api/resources/checkout/client/Client.js +78 -9
- package/dist/cjs/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.d.ts → CreateSubscriptionCheckoutSessionRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/checkout/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/featureAccess/client/Client.d.ts +4 -0
- package/dist/cjs/api/resources/featureAccess/client/Client.js +7 -1
- package/dist/cjs/api/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/index.js +1 -3
- package/dist/cjs/api/resources/rateCards/client/Client.d.ts +8 -0
- package/dist/cjs/api/resources/rateCards/client/Client.js +16 -6
- package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +1 -0
- package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardVersionRequest.d.ts +3 -0
- package/dist/cjs/api/resources/subjects/client/Client.d.ts +4 -0
- package/dist/cjs/api/resources/subjects/client/Client.js +11 -5
- package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +4 -0
- package/dist/cjs/api/resources/subscriptions/client/Client.js +11 -5
- package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +23 -0
- package/dist/cjs/api/resources/usageEvents/client/Client.js +75 -1
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +1 -1
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.ts +30 -0
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.js +14 -0
- package/dist/cjs/api/resources/usageEvents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/CompleteSubscriptionCheckoutResponse.d.ts +8 -0
- package/dist/cjs/api/types/CreateDimensionalUsageBasedRateInterface.d.ts +2 -0
- package/dist/cjs/api/types/CreateFixedRateInterface.d.ts +1 -0
- package/dist/cjs/api/types/CreatePricingMetricInterface.d.ts +1 -0
- package/dist/cjs/api/types/CreateSimpleUsageBasedRateInterface.d.ts +2 -0
- package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +10 -0
- package/dist/cjs/api/{resources/creditPools/client/index.js → types/CreateSubscriptionCheckoutSessionResponse.js} +3 -0
- package/dist/cjs/api/types/CreateUsageEventSummaryResponse.d.ts +10 -0
- package/dist/cjs/api/{resources/pricingPlans/client/index.js → types/CreateUsageEventSummaryResponse.js} +3 -0
- package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.d.ts +1 -0
- package/dist/cjs/api/types/DimensionalUsageBasedRateInterface.d.ts +3 -0
- package/dist/cjs/api/types/FixedRateInterface.d.ts +2 -0
- package/dist/cjs/api/types/LastAggregationPricingMetricInterface.d.ts +1 -0
- package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.d.ts +1 -0
- package/dist/cjs/api/types/Period.d.ts +9 -0
- package/dist/cjs/api/types/Period.js +5 -0
- package/dist/cjs/api/types/PricingMetricInterface.d.ts +2 -0
- package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +3 -0
- package/dist/cjs/api/types/SumAggregationPricingMetricInterface.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +4 -1
- package/dist/cjs/api/types/index.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +1 -6
- package/dist/esm/Client.mjs +2 -12
- package/dist/esm/api/resources/checkout/client/Client.d.mts +19 -4
- package/dist/esm/api/resources/checkout/client/Client.mjs +79 -10
- package/dist/esm/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.d.mts → CreateSubscriptionCheckoutSessionRequest.d.mts} +1 -1
- package/dist/esm/api/resources/checkout/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/featureAccess/client/Client.d.mts +4 -0
- package/dist/esm/api/resources/featureAccess/client/Client.mjs +8 -2
- package/dist/esm/api/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/index.mjs +0 -2
- package/dist/esm/api/resources/rateCards/client/Client.d.mts +8 -0
- package/dist/esm/api/resources/rateCards/client/Client.mjs +17 -7
- package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +1 -0
- package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardVersionRequest.d.mts +3 -0
- package/dist/esm/api/resources/subjects/client/Client.d.mts +4 -0
- package/dist/esm/api/resources/subjects/client/Client.mjs +12 -6
- package/dist/esm/api/resources/subscriptions/client/Client.d.mts +4 -0
- package/dist/esm/api/resources/subscriptions/client/Client.mjs +12 -6
- package/dist/esm/api/resources/usageEvents/client/Client.d.mts +23 -0
- package/dist/esm/api/resources/usageEvents/client/Client.mjs +76 -2
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +1 -1
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.mts +30 -0
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.mjs +11 -0
- package/dist/esm/api/resources/usageEvents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/CompleteSubscriptionCheckoutResponse.d.mts +8 -0
- package/dist/esm/api/types/CreateDimensionalUsageBasedRateInterface.d.mts +2 -0
- package/dist/esm/api/types/CreateFixedRateInterface.d.mts +1 -0
- package/dist/esm/api/types/CreatePricingMetricInterface.d.mts +1 -0
- package/dist/esm/api/types/CreateSimpleUsageBasedRateInterface.d.mts +2 -0
- package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +10 -0
- package/dist/{cjs/api/types/CreateRateCardCheckoutResponse.d.ts → esm/api/types/CreateSubscriptionCheckoutSessionResponse.mjs} +1 -3
- package/dist/esm/api/types/CreateUsageEventSummaryResponse.d.mts +10 -0
- package/dist/esm/api/types/{CreateRateCardCheckoutResponse.d.mts → CreateUsageEventSummaryResponse.mjs} +1 -3
- package/dist/esm/api/types/CustomAggregationPricingMetricInterface.d.mts +1 -0
- package/dist/esm/api/types/DimensionalUsageBasedRateInterface.d.mts +3 -0
- package/dist/esm/api/types/FixedRateInterface.d.mts +2 -0
- package/dist/esm/api/types/LastAggregationPricingMetricInterface.d.mts +1 -0
- package/dist/esm/api/types/MaxAggregationPricingMetricInterface.d.mts +1 -0
- package/dist/esm/api/types/Period.d.mts +9 -0
- package/dist/esm/api/types/Period.mjs +4 -0
- package/dist/esm/api/types/PricingMetricInterface.d.mts +2 -0
- package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +3 -0
- package/dist/esm/api/types/SumAggregationPricingMetricInterface.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +4 -1
- package/dist/esm/api/types/index.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +111 -351
- package/dist/cjs/api/resources/creditPools/client/Client.d.ts +0 -53
- package/dist/cjs/api/resources/creditPools/client/Client.js +0 -204
- package/dist/cjs/api/resources/creditPools/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/creditPools/index.d.ts +0 -1
- package/dist/cjs/api/resources/creditPools/index.js +0 -17
- package/dist/cjs/api/resources/pricingPlans/client/Client.d.ts +0 -72
- package/dist/cjs/api/resources/pricingPlans/client/Client.js +0 -305
- package/dist/cjs/api/resources/pricingPlans/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/pricingPlans/index.d.ts +0 -1
- package/dist/cjs/api/resources/pricingPlans/index.js +0 -17
- package/dist/esm/api/resources/creditPools/client/Client.d.mts +0 -53
- package/dist/esm/api/resources/creditPools/client/Client.mjs +0 -167
- package/dist/esm/api/resources/creditPools/client/index.d.mts +0 -1
- package/dist/esm/api/resources/creditPools/client/index.mjs +0 -1
- package/dist/esm/api/resources/creditPools/index.d.mts +0 -1
- package/dist/esm/api/resources/creditPools/index.mjs +0 -1
- package/dist/esm/api/resources/pricingPlans/client/Client.d.mts +0 -72
- package/dist/esm/api/resources/pricingPlans/client/Client.mjs +0 -268
- package/dist/esm/api/resources/pricingPlans/client/index.d.mts +0 -1
- package/dist/esm/api/resources/pricingPlans/client/index.mjs +0 -1
- package/dist/esm/api/resources/pricingPlans/index.d.mts +0 -1
- package/dist/esm/api/resources/pricingPlans/index.mjs +0 -1
- /package/dist/cjs/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.js → CreateSubscriptionCheckoutSessionRequest.js} +0 -0
- /package/dist/cjs/api/types/{CreateRateCardCheckoutResponse.js → CompleteSubscriptionCheckoutResponse.js} +0 -0
- /package/dist/esm/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.mjs → CreateSubscriptionCheckoutSessionRequest.mjs} +0 -0
- /package/dist/esm/api/types/{CreateRateCardCheckoutResponse.mjs → CompleteSubscriptionCheckoutResponse.mjs} +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as core from "../../../../core/index.mjs";
|
|
5
|
-
export declare namespace CreditPools {
|
|
6
|
-
interface Options {
|
|
7
|
-
environment: core.Supplier<string>;
|
|
8
|
-
/** Specify a custom URL to connect the client to. */
|
|
9
|
-
baseUrl?: core.Supplier<string>;
|
|
10
|
-
/** Additional headers to include in requests. */
|
|
11
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
12
|
-
}
|
|
13
|
-
interface RequestOptions {
|
|
14
|
-
/** The maximum time to wait for a response in seconds. */
|
|
15
|
-
timeoutInSeconds?: number;
|
|
16
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
-
maxRetries?: number;
|
|
18
|
-
/** A hook to abort the request. */
|
|
19
|
-
abortSignal?: AbortSignal;
|
|
20
|
-
/** Additional query string parameters to include in the request. */
|
|
21
|
-
queryParams?: Record<string, unknown>;
|
|
22
|
-
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export declare class CreditPools {
|
|
27
|
-
protected readonly _options: CreditPools.Options;
|
|
28
|
-
constructor(_options: CreditPools.Options);
|
|
29
|
-
/**
|
|
30
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* await client.creditPools.listCreditPools()
|
|
34
|
-
*/
|
|
35
|
-
listCreditPools(requestOptions?: CreditPools.RequestOptions): core.HttpResponsePromise<void>;
|
|
36
|
-
private __listCreditPools;
|
|
37
|
-
/**
|
|
38
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* await client.creditPools.createCreditPool()
|
|
42
|
-
*/
|
|
43
|
-
createCreditPool(requestOptions?: CreditPools.RequestOptions): core.HttpResponsePromise<void>;
|
|
44
|
-
private __createCreditPool;
|
|
45
|
-
/**
|
|
46
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* await client.creditPools.grantCredits()
|
|
50
|
-
*/
|
|
51
|
-
grantCredits(requestOptions?: CreditPools.RequestOptions): core.HttpResponsePromise<void>;
|
|
52
|
-
private __grantCredits;
|
|
53
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
import * as core from "../../../../core/index.mjs";
|
|
14
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
15
|
-
import * as errors from "../../../../errors/index.mjs";
|
|
16
|
-
export class CreditPools {
|
|
17
|
-
constructor(_options) {
|
|
18
|
-
this._options = _options;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* await client.creditPools.listCreditPools()
|
|
25
|
-
*/
|
|
26
|
-
listCreditPools(requestOptions) {
|
|
27
|
-
return core.HttpResponsePromise.fromPromise(this.__listCreditPools(requestOptions));
|
|
28
|
-
}
|
|
29
|
-
__listCreditPools(requestOptions) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
33
|
-
const _response = yield core.fetcher({
|
|
34
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "credit-pools"),
|
|
35
|
-
method: "GET",
|
|
36
|
-
headers: _headers,
|
|
37
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
38
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
39
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
40
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
41
|
-
});
|
|
42
|
-
if (_response.ok) {
|
|
43
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
44
|
-
}
|
|
45
|
-
if (_response.error.reason === "status-code") {
|
|
46
|
-
throw new errors.LarkError({
|
|
47
|
-
statusCode: _response.error.statusCode,
|
|
48
|
-
body: _response.error.body,
|
|
49
|
-
rawResponse: _response.rawResponse,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
switch (_response.error.reason) {
|
|
53
|
-
case "non-json":
|
|
54
|
-
throw new errors.LarkError({
|
|
55
|
-
statusCode: _response.error.statusCode,
|
|
56
|
-
body: _response.error.rawBody,
|
|
57
|
-
rawResponse: _response.rawResponse,
|
|
58
|
-
});
|
|
59
|
-
case "timeout":
|
|
60
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /credit-pools.");
|
|
61
|
-
case "unknown":
|
|
62
|
-
throw new errors.LarkError({
|
|
63
|
-
message: _response.error.errorMessage,
|
|
64
|
-
rawResponse: _response.rawResponse,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* await client.creditPools.createCreditPool()
|
|
74
|
-
*/
|
|
75
|
-
createCreditPool(requestOptions) {
|
|
76
|
-
return core.HttpResponsePromise.fromPromise(this.__createCreditPool(requestOptions));
|
|
77
|
-
}
|
|
78
|
-
__createCreditPool(requestOptions) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
|
-
const _response = yield core.fetcher({
|
|
83
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "credit-pools"),
|
|
84
|
-
method: "POST",
|
|
85
|
-
headers: _headers,
|
|
86
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
87
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
-
});
|
|
91
|
-
if (_response.ok) {
|
|
92
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
93
|
-
}
|
|
94
|
-
if (_response.error.reason === "status-code") {
|
|
95
|
-
throw new errors.LarkError({
|
|
96
|
-
statusCode: _response.error.statusCode,
|
|
97
|
-
body: _response.error.body,
|
|
98
|
-
rawResponse: _response.rawResponse,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
switch (_response.error.reason) {
|
|
102
|
-
case "non-json":
|
|
103
|
-
throw new errors.LarkError({
|
|
104
|
-
statusCode: _response.error.statusCode,
|
|
105
|
-
body: _response.error.rawBody,
|
|
106
|
-
rawResponse: _response.rawResponse,
|
|
107
|
-
});
|
|
108
|
-
case "timeout":
|
|
109
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /credit-pools.");
|
|
110
|
-
case "unknown":
|
|
111
|
-
throw new errors.LarkError({
|
|
112
|
-
message: _response.error.errorMessage,
|
|
113
|
-
rawResponse: _response.rawResponse,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* await client.creditPools.grantCredits()
|
|
123
|
-
*/
|
|
124
|
-
grantCredits(requestOptions) {
|
|
125
|
-
return core.HttpResponsePromise.fromPromise(this.__grantCredits(requestOptions));
|
|
126
|
-
}
|
|
127
|
-
__grantCredits(requestOptions) {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
131
|
-
const _response = yield core.fetcher({
|
|
132
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "credit-grants"),
|
|
133
|
-
method: "POST",
|
|
134
|
-
headers: _headers,
|
|
135
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
136
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
137
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
138
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
139
|
-
});
|
|
140
|
-
if (_response.ok) {
|
|
141
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
142
|
-
}
|
|
143
|
-
if (_response.error.reason === "status-code") {
|
|
144
|
-
throw new errors.LarkError({
|
|
145
|
-
statusCode: _response.error.statusCode,
|
|
146
|
-
body: _response.error.body,
|
|
147
|
-
rawResponse: _response.rawResponse,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
switch (_response.error.reason) {
|
|
151
|
-
case "non-json":
|
|
152
|
-
throw new errors.LarkError({
|
|
153
|
-
statusCode: _response.error.statusCode,
|
|
154
|
-
body: _response.error.rawBody,
|
|
155
|
-
rawResponse: _response.rawResponse,
|
|
156
|
-
});
|
|
157
|
-
case "timeout":
|
|
158
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /credit-grants.");
|
|
159
|
-
case "unknown":
|
|
160
|
-
throw new errors.LarkError({
|
|
161
|
-
message: _response.error.errorMessage,
|
|
162
|
-
rawResponse: _response.rawResponse,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as core from "../../../../core/index.mjs";
|
|
5
|
-
export declare namespace PricingPlans {
|
|
6
|
-
interface Options {
|
|
7
|
-
environment: core.Supplier<string>;
|
|
8
|
-
/** Specify a custom URL to connect the client to. */
|
|
9
|
-
baseUrl?: core.Supplier<string>;
|
|
10
|
-
/** Additional headers to include in requests. */
|
|
11
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
12
|
-
}
|
|
13
|
-
interface RequestOptions {
|
|
14
|
-
/** The maximum time to wait for a response in seconds. */
|
|
15
|
-
timeoutInSeconds?: number;
|
|
16
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
-
maxRetries?: number;
|
|
18
|
-
/** A hook to abort the request. */
|
|
19
|
-
abortSignal?: AbortSignal;
|
|
20
|
-
/** Additional query string parameters to include in the request. */
|
|
21
|
-
queryParams?: Record<string, unknown>;
|
|
22
|
-
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export declare class PricingPlans {
|
|
27
|
-
protected readonly _options: PricingPlans.Options;
|
|
28
|
-
constructor(_options: PricingPlans.Options);
|
|
29
|
-
/**
|
|
30
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* await client.pricingPlans.listPricingPlans()
|
|
34
|
-
*/
|
|
35
|
-
listPricingPlans(requestOptions?: PricingPlans.RequestOptions): core.HttpResponsePromise<void>;
|
|
36
|
-
private __listPricingPlans;
|
|
37
|
-
/**
|
|
38
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* await client.pricingPlans.createPricingPlan()
|
|
42
|
-
*/
|
|
43
|
-
createPricingPlan(requestOptions?: PricingPlans.RequestOptions): core.HttpResponsePromise<void>;
|
|
44
|
-
private __createPricingPlan;
|
|
45
|
-
/**
|
|
46
|
-
* @param {string} planId
|
|
47
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* await client.pricingPlans.getPricingPlan("plan_id")
|
|
51
|
-
*/
|
|
52
|
-
getPricingPlan(planId: string, requestOptions?: PricingPlans.RequestOptions): core.HttpResponsePromise<void>;
|
|
53
|
-
private __getPricingPlan;
|
|
54
|
-
/**
|
|
55
|
-
* @param {string} planId
|
|
56
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* await client.pricingPlans.updatePricingPlan("plan_id")
|
|
60
|
-
*/
|
|
61
|
-
updatePricingPlan(planId: string, requestOptions?: PricingPlans.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
|
-
private __updatePricingPlan;
|
|
63
|
-
/**
|
|
64
|
-
* @param {string} planId
|
|
65
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await client.pricingPlans.deletePricingPlan("plan_id")
|
|
69
|
-
*/
|
|
70
|
-
deletePricingPlan(planId: string, requestOptions?: PricingPlans.RequestOptions): core.HttpResponsePromise<void>;
|
|
71
|
-
private __deletePricingPlan;
|
|
72
|
-
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
import * as core from "../../../../core/index.mjs";
|
|
14
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
15
|
-
import * as errors from "../../../../errors/index.mjs";
|
|
16
|
-
export class PricingPlans {
|
|
17
|
-
constructor(_options) {
|
|
18
|
-
this._options = _options;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* await client.pricingPlans.listPricingPlans()
|
|
25
|
-
*/
|
|
26
|
-
listPricingPlans(requestOptions) {
|
|
27
|
-
return core.HttpResponsePromise.fromPromise(this.__listPricingPlans(requestOptions));
|
|
28
|
-
}
|
|
29
|
-
__listPricingPlans(requestOptions) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
33
|
-
const _response = yield core.fetcher({
|
|
34
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "pricing-plans"),
|
|
35
|
-
method: "GET",
|
|
36
|
-
headers: _headers,
|
|
37
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
38
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
39
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
40
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
41
|
-
});
|
|
42
|
-
if (_response.ok) {
|
|
43
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
44
|
-
}
|
|
45
|
-
if (_response.error.reason === "status-code") {
|
|
46
|
-
throw new errors.LarkError({
|
|
47
|
-
statusCode: _response.error.statusCode,
|
|
48
|
-
body: _response.error.body,
|
|
49
|
-
rawResponse: _response.rawResponse,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
switch (_response.error.reason) {
|
|
53
|
-
case "non-json":
|
|
54
|
-
throw new errors.LarkError({
|
|
55
|
-
statusCode: _response.error.statusCode,
|
|
56
|
-
body: _response.error.rawBody,
|
|
57
|
-
rawResponse: _response.rawResponse,
|
|
58
|
-
});
|
|
59
|
-
case "timeout":
|
|
60
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-plans.");
|
|
61
|
-
case "unknown":
|
|
62
|
-
throw new errors.LarkError({
|
|
63
|
-
message: _response.error.errorMessage,
|
|
64
|
-
rawResponse: _response.rawResponse,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* await client.pricingPlans.createPricingPlan()
|
|
74
|
-
*/
|
|
75
|
-
createPricingPlan(requestOptions) {
|
|
76
|
-
return core.HttpResponsePromise.fromPromise(this.__createPricingPlan(requestOptions));
|
|
77
|
-
}
|
|
78
|
-
__createPricingPlan(requestOptions) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
|
-
const _response = yield core.fetcher({
|
|
83
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "pricing-plans"),
|
|
84
|
-
method: "POST",
|
|
85
|
-
headers: _headers,
|
|
86
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
87
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
-
});
|
|
91
|
-
if (_response.ok) {
|
|
92
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
93
|
-
}
|
|
94
|
-
if (_response.error.reason === "status-code") {
|
|
95
|
-
throw new errors.LarkError({
|
|
96
|
-
statusCode: _response.error.statusCode,
|
|
97
|
-
body: _response.error.body,
|
|
98
|
-
rawResponse: _response.rawResponse,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
switch (_response.error.reason) {
|
|
102
|
-
case "non-json":
|
|
103
|
-
throw new errors.LarkError({
|
|
104
|
-
statusCode: _response.error.statusCode,
|
|
105
|
-
body: _response.error.rawBody,
|
|
106
|
-
rawResponse: _response.rawResponse,
|
|
107
|
-
});
|
|
108
|
-
case "timeout":
|
|
109
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /pricing-plans.");
|
|
110
|
-
case "unknown":
|
|
111
|
-
throw new errors.LarkError({
|
|
112
|
-
message: _response.error.errorMessage,
|
|
113
|
-
rawResponse: _response.rawResponse,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* @param {string} planId
|
|
120
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* await client.pricingPlans.getPricingPlan("plan_id")
|
|
124
|
-
*/
|
|
125
|
-
getPricingPlan(planId, requestOptions) {
|
|
126
|
-
return core.HttpResponsePromise.fromPromise(this.__getPricingPlan(planId, requestOptions));
|
|
127
|
-
}
|
|
128
|
-
__getPricingPlan(planId, requestOptions) {
|
|
129
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
var _a, _b;
|
|
131
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
132
|
-
const _response = yield core.fetcher({
|
|
133
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `pricing-plans/${encodeURIComponent(planId)}`),
|
|
134
|
-
method: "GET",
|
|
135
|
-
headers: _headers,
|
|
136
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
137
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
138
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
139
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
140
|
-
});
|
|
141
|
-
if (_response.ok) {
|
|
142
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
143
|
-
}
|
|
144
|
-
if (_response.error.reason === "status-code") {
|
|
145
|
-
throw new errors.LarkError({
|
|
146
|
-
statusCode: _response.error.statusCode,
|
|
147
|
-
body: _response.error.body,
|
|
148
|
-
rawResponse: _response.rawResponse,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
switch (_response.error.reason) {
|
|
152
|
-
case "non-json":
|
|
153
|
-
throw new errors.LarkError({
|
|
154
|
-
statusCode: _response.error.statusCode,
|
|
155
|
-
body: _response.error.rawBody,
|
|
156
|
-
rawResponse: _response.rawResponse,
|
|
157
|
-
});
|
|
158
|
-
case "timeout":
|
|
159
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-plans/{plan_id}.");
|
|
160
|
-
case "unknown":
|
|
161
|
-
throw new errors.LarkError({
|
|
162
|
-
message: _response.error.errorMessage,
|
|
163
|
-
rawResponse: _response.rawResponse,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* @param {string} planId
|
|
170
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* await client.pricingPlans.updatePricingPlan("plan_id")
|
|
174
|
-
*/
|
|
175
|
-
updatePricingPlan(planId, requestOptions) {
|
|
176
|
-
return core.HttpResponsePromise.fromPromise(this.__updatePricingPlan(planId, requestOptions));
|
|
177
|
-
}
|
|
178
|
-
__updatePricingPlan(planId, requestOptions) {
|
|
179
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
-
var _a, _b;
|
|
181
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
182
|
-
const _response = yield core.fetcher({
|
|
183
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `pricing-plans/${encodeURIComponent(planId)}`),
|
|
184
|
-
method: "PUT",
|
|
185
|
-
headers: _headers,
|
|
186
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
187
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
188
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
189
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
190
|
-
});
|
|
191
|
-
if (_response.ok) {
|
|
192
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
193
|
-
}
|
|
194
|
-
if (_response.error.reason === "status-code") {
|
|
195
|
-
throw new errors.LarkError({
|
|
196
|
-
statusCode: _response.error.statusCode,
|
|
197
|
-
body: _response.error.body,
|
|
198
|
-
rawResponse: _response.rawResponse,
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
switch (_response.error.reason) {
|
|
202
|
-
case "non-json":
|
|
203
|
-
throw new errors.LarkError({
|
|
204
|
-
statusCode: _response.error.statusCode,
|
|
205
|
-
body: _response.error.rawBody,
|
|
206
|
-
rawResponse: _response.rawResponse,
|
|
207
|
-
});
|
|
208
|
-
case "timeout":
|
|
209
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling PUT /pricing-plans/{plan_id}.");
|
|
210
|
-
case "unknown":
|
|
211
|
-
throw new errors.LarkError({
|
|
212
|
-
message: _response.error.errorMessage,
|
|
213
|
-
rawResponse: _response.rawResponse,
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* @param {string} planId
|
|
220
|
-
* @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* await client.pricingPlans.deletePricingPlan("plan_id")
|
|
224
|
-
*/
|
|
225
|
-
deletePricingPlan(planId, requestOptions) {
|
|
226
|
-
return core.HttpResponsePromise.fromPromise(this.__deletePricingPlan(planId, requestOptions));
|
|
227
|
-
}
|
|
228
|
-
__deletePricingPlan(planId, requestOptions) {
|
|
229
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
var _a, _b;
|
|
231
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
232
|
-
const _response = yield core.fetcher({
|
|
233
|
-
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `pricing-plans/${encodeURIComponent(planId)}`),
|
|
234
|
-
method: "DELETE",
|
|
235
|
-
headers: _headers,
|
|
236
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
237
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
238
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
239
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
240
|
-
});
|
|
241
|
-
if (_response.ok) {
|
|
242
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
243
|
-
}
|
|
244
|
-
if (_response.error.reason === "status-code") {
|
|
245
|
-
throw new errors.LarkError({
|
|
246
|
-
statusCode: _response.error.statusCode,
|
|
247
|
-
body: _response.error.body,
|
|
248
|
-
rawResponse: _response.rawResponse,
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
switch (_response.error.reason) {
|
|
252
|
-
case "non-json":
|
|
253
|
-
throw new errors.LarkError({
|
|
254
|
-
statusCode: _response.error.statusCode,
|
|
255
|
-
body: _response.error.rawBody,
|
|
256
|
-
rawResponse: _response.rawResponse,
|
|
257
|
-
});
|
|
258
|
-
case "timeout":
|
|
259
|
-
throw new errors.LarkTimeoutError("Timeout exceeded when calling DELETE /pricing-plans/{plan_id}.");
|
|
260
|
-
case "unknown":
|
|
261
|
-
throw new errors.LarkError({
|
|
262
|
-
message: _response.error.errorMessage,
|
|
263
|
-
rawResponse: _response.rawResponse,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|