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.
Files changed (123) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/Client.d.ts +1 -6
  3. package/dist/cjs/Client.js +2 -12
  4. package/dist/cjs/api/resources/checkout/client/Client.d.ts +19 -4
  5. package/dist/cjs/api/resources/checkout/client/Client.js +78 -9
  6. package/dist/cjs/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.d.ts → CreateSubscriptionCheckoutSessionRequest.d.ts} +1 -1
  7. package/dist/cjs/api/resources/checkout/client/requests/index.d.ts +1 -1
  8. package/dist/cjs/api/resources/featureAccess/client/Client.d.ts +4 -0
  9. package/dist/cjs/api/resources/featureAccess/client/Client.js +7 -1
  10. package/dist/cjs/api/resources/index.d.ts +0 -2
  11. package/dist/cjs/api/resources/index.js +1 -3
  12. package/dist/cjs/api/resources/rateCards/client/Client.d.ts +8 -0
  13. package/dist/cjs/api/resources/rateCards/client/Client.js +16 -6
  14. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +1 -0
  15. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardVersionRequest.d.ts +3 -0
  16. package/dist/cjs/api/resources/subjects/client/Client.d.ts +4 -0
  17. package/dist/cjs/api/resources/subjects/client/Client.js +11 -5
  18. package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +4 -0
  19. package/dist/cjs/api/resources/subscriptions/client/Client.js +11 -5
  20. package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +23 -0
  21. package/dist/cjs/api/resources/usageEvents/client/Client.js +75 -1
  22. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +1 -1
  23. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.ts +30 -0
  24. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.js +14 -0
  25. package/dist/cjs/api/resources/usageEvents/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/types/CompleteSubscriptionCheckoutResponse.d.ts +8 -0
  27. package/dist/cjs/api/types/CreateDimensionalUsageBasedRateInterface.d.ts +2 -0
  28. package/dist/cjs/api/types/CreateFixedRateInterface.d.ts +1 -0
  29. package/dist/cjs/api/types/CreatePricingMetricInterface.d.ts +1 -0
  30. package/dist/cjs/api/types/CreateSimpleUsageBasedRateInterface.d.ts +2 -0
  31. package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +10 -0
  32. package/dist/cjs/api/{resources/creditPools/client/index.js → types/CreateSubscriptionCheckoutSessionResponse.js} +3 -0
  33. package/dist/cjs/api/types/CreateUsageEventSummaryResponse.d.ts +10 -0
  34. package/dist/cjs/api/{resources/pricingPlans/client/index.js → types/CreateUsageEventSummaryResponse.js} +3 -0
  35. package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.d.ts +1 -0
  36. package/dist/cjs/api/types/DimensionalUsageBasedRateInterface.d.ts +3 -0
  37. package/dist/cjs/api/types/FixedRateInterface.d.ts +2 -0
  38. package/dist/cjs/api/types/LastAggregationPricingMetricInterface.d.ts +1 -0
  39. package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.d.ts +1 -0
  40. package/dist/cjs/api/types/Period.d.ts +9 -0
  41. package/dist/cjs/api/types/Period.js +5 -0
  42. package/dist/cjs/api/types/PricingMetricInterface.d.ts +2 -0
  43. package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +3 -0
  44. package/dist/cjs/api/types/SumAggregationPricingMetricInterface.d.ts +1 -0
  45. package/dist/cjs/api/types/index.d.ts +4 -1
  46. package/dist/cjs/api/types/index.js +4 -1
  47. package/dist/cjs/version.d.ts +1 -1
  48. package/dist/cjs/version.js +1 -1
  49. package/dist/esm/Client.d.mts +1 -6
  50. package/dist/esm/Client.mjs +2 -12
  51. package/dist/esm/api/resources/checkout/client/Client.d.mts +19 -4
  52. package/dist/esm/api/resources/checkout/client/Client.mjs +79 -10
  53. package/dist/esm/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.d.mts → CreateSubscriptionCheckoutSessionRequest.d.mts} +1 -1
  54. package/dist/esm/api/resources/checkout/client/requests/index.d.mts +1 -1
  55. package/dist/esm/api/resources/featureAccess/client/Client.d.mts +4 -0
  56. package/dist/esm/api/resources/featureAccess/client/Client.mjs +8 -2
  57. package/dist/esm/api/resources/index.d.mts +0 -2
  58. package/dist/esm/api/resources/index.mjs +0 -2
  59. package/dist/esm/api/resources/rateCards/client/Client.d.mts +8 -0
  60. package/dist/esm/api/resources/rateCards/client/Client.mjs +17 -7
  61. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +1 -0
  62. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardVersionRequest.d.mts +3 -0
  63. package/dist/esm/api/resources/subjects/client/Client.d.mts +4 -0
  64. package/dist/esm/api/resources/subjects/client/Client.mjs +12 -6
  65. package/dist/esm/api/resources/subscriptions/client/Client.d.mts +4 -0
  66. package/dist/esm/api/resources/subscriptions/client/Client.mjs +12 -6
  67. package/dist/esm/api/resources/usageEvents/client/Client.d.mts +23 -0
  68. package/dist/esm/api/resources/usageEvents/client/Client.mjs +76 -2
  69. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +1 -1
  70. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.mts +30 -0
  71. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.mjs +11 -0
  72. package/dist/esm/api/resources/usageEvents/client/requests/index.d.mts +1 -0
  73. package/dist/esm/api/types/CompleteSubscriptionCheckoutResponse.d.mts +8 -0
  74. package/dist/esm/api/types/CreateDimensionalUsageBasedRateInterface.d.mts +2 -0
  75. package/dist/esm/api/types/CreateFixedRateInterface.d.mts +1 -0
  76. package/dist/esm/api/types/CreatePricingMetricInterface.d.mts +1 -0
  77. package/dist/esm/api/types/CreateSimpleUsageBasedRateInterface.d.mts +2 -0
  78. package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +10 -0
  79. package/dist/{cjs/api/types/CreateRateCardCheckoutResponse.d.ts → esm/api/types/CreateSubscriptionCheckoutSessionResponse.mjs} +1 -3
  80. package/dist/esm/api/types/CreateUsageEventSummaryResponse.d.mts +10 -0
  81. package/dist/esm/api/types/{CreateRateCardCheckoutResponse.d.mts → CreateUsageEventSummaryResponse.mjs} +1 -3
  82. package/dist/esm/api/types/CustomAggregationPricingMetricInterface.d.mts +1 -0
  83. package/dist/esm/api/types/DimensionalUsageBasedRateInterface.d.mts +3 -0
  84. package/dist/esm/api/types/FixedRateInterface.d.mts +2 -0
  85. package/dist/esm/api/types/LastAggregationPricingMetricInterface.d.mts +1 -0
  86. package/dist/esm/api/types/MaxAggregationPricingMetricInterface.d.mts +1 -0
  87. package/dist/esm/api/types/Period.d.mts +9 -0
  88. package/dist/esm/api/types/Period.mjs +4 -0
  89. package/dist/esm/api/types/PricingMetricInterface.d.mts +2 -0
  90. package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +3 -0
  91. package/dist/esm/api/types/SumAggregationPricingMetricInterface.d.mts +1 -0
  92. package/dist/esm/api/types/index.d.mts +4 -1
  93. package/dist/esm/api/types/index.mjs +4 -1
  94. package/dist/esm/version.d.mts +1 -1
  95. package/dist/esm/version.mjs +1 -1
  96. package/package.json +1 -1
  97. package/reference.md +111 -351
  98. package/dist/cjs/api/resources/creditPools/client/Client.d.ts +0 -53
  99. package/dist/cjs/api/resources/creditPools/client/Client.js +0 -204
  100. package/dist/cjs/api/resources/creditPools/client/index.d.ts +0 -1
  101. package/dist/cjs/api/resources/creditPools/index.d.ts +0 -1
  102. package/dist/cjs/api/resources/creditPools/index.js +0 -17
  103. package/dist/cjs/api/resources/pricingPlans/client/Client.d.ts +0 -72
  104. package/dist/cjs/api/resources/pricingPlans/client/Client.js +0 -305
  105. package/dist/cjs/api/resources/pricingPlans/client/index.d.ts +0 -1
  106. package/dist/cjs/api/resources/pricingPlans/index.d.ts +0 -1
  107. package/dist/cjs/api/resources/pricingPlans/index.js +0 -17
  108. package/dist/esm/api/resources/creditPools/client/Client.d.mts +0 -53
  109. package/dist/esm/api/resources/creditPools/client/Client.mjs +0 -167
  110. package/dist/esm/api/resources/creditPools/client/index.d.mts +0 -1
  111. package/dist/esm/api/resources/creditPools/client/index.mjs +0 -1
  112. package/dist/esm/api/resources/creditPools/index.d.mts +0 -1
  113. package/dist/esm/api/resources/creditPools/index.mjs +0 -1
  114. package/dist/esm/api/resources/pricingPlans/client/Client.d.mts +0 -72
  115. package/dist/esm/api/resources/pricingPlans/client/Client.mjs +0 -268
  116. package/dist/esm/api/resources/pricingPlans/client/index.d.mts +0 -1
  117. package/dist/esm/api/resources/pricingPlans/client/index.mjs +0 -1
  118. package/dist/esm/api/resources/pricingPlans/index.d.mts +0 -1
  119. package/dist/esm/api/resources/pricingPlans/index.mjs +0 -1
  120. /package/dist/cjs/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.js → CreateSubscriptionCheckoutSessionRequest.js} +0 -0
  121. /package/dist/cjs/api/types/{CreateRateCardCheckoutResponse.js → CompleteSubscriptionCheckoutResponse.js} +0 -0
  122. /package/dist/esm/api/resources/checkout/client/requests/{CreateRateCardCheckoutRequest.mjs → CreateSubscriptionCheckoutSessionRequest.mjs} +0 -0
  123. /package/dist/esm/api/types/{CreateRateCardCheckoutResponse.mjs → CompleteSubscriptionCheckoutResponse.mjs} +0 -0
@@ -1,204 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.CreditPools = void 0;
49
- const core = __importStar(require("../../../../core/index.js"));
50
- const headers_js_1 = require("../../../../core/headers.js");
51
- const errors = __importStar(require("../../../../errors/index.js"));
52
- class CreditPools {
53
- constructor(_options) {
54
- this._options = _options;
55
- }
56
- /**
57
- * @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
58
- *
59
- * @example
60
- * await client.creditPools.listCreditPools()
61
- */
62
- listCreditPools(requestOptions) {
63
- return core.HttpResponsePromise.fromPromise(this.__listCreditPools(requestOptions));
64
- }
65
- __listCreditPools(requestOptions) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- var _a, _b;
68
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
69
- const _response = yield core.fetcher({
70
- 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"),
71
- method: "GET",
72
- headers: _headers,
73
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
74
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
- });
78
- if (_response.ok) {
79
- return { data: undefined, rawResponse: _response.rawResponse };
80
- }
81
- if (_response.error.reason === "status-code") {
82
- throw new errors.LarkError({
83
- statusCode: _response.error.statusCode,
84
- body: _response.error.body,
85
- rawResponse: _response.rawResponse,
86
- });
87
- }
88
- switch (_response.error.reason) {
89
- case "non-json":
90
- throw new errors.LarkError({
91
- statusCode: _response.error.statusCode,
92
- body: _response.error.rawBody,
93
- rawResponse: _response.rawResponse,
94
- });
95
- case "timeout":
96
- throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /credit-pools.");
97
- case "unknown":
98
- throw new errors.LarkError({
99
- message: _response.error.errorMessage,
100
- rawResponse: _response.rawResponse,
101
- });
102
- }
103
- });
104
- }
105
- /**
106
- * @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
107
- *
108
- * @example
109
- * await client.creditPools.createCreditPool()
110
- */
111
- createCreditPool(requestOptions) {
112
- return core.HttpResponsePromise.fromPromise(this.__createCreditPool(requestOptions));
113
- }
114
- __createCreditPool(requestOptions) {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- var _a, _b;
117
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
118
- const _response = yield core.fetcher({
119
- 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"),
120
- method: "POST",
121
- headers: _headers,
122
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
123
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
124
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
125
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
126
- });
127
- if (_response.ok) {
128
- return { data: undefined, rawResponse: _response.rawResponse };
129
- }
130
- if (_response.error.reason === "status-code") {
131
- throw new errors.LarkError({
132
- statusCode: _response.error.statusCode,
133
- body: _response.error.body,
134
- rawResponse: _response.rawResponse,
135
- });
136
- }
137
- switch (_response.error.reason) {
138
- case "non-json":
139
- throw new errors.LarkError({
140
- statusCode: _response.error.statusCode,
141
- body: _response.error.rawBody,
142
- rawResponse: _response.rawResponse,
143
- });
144
- case "timeout":
145
- throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /credit-pools.");
146
- case "unknown":
147
- throw new errors.LarkError({
148
- message: _response.error.errorMessage,
149
- rawResponse: _response.rawResponse,
150
- });
151
- }
152
- });
153
- }
154
- /**
155
- * @param {CreditPools.RequestOptions} requestOptions - Request-specific configuration.
156
- *
157
- * @example
158
- * await client.creditPools.grantCredits()
159
- */
160
- grantCredits(requestOptions) {
161
- return core.HttpResponsePromise.fromPromise(this.__grantCredits(requestOptions));
162
- }
163
- __grantCredits(requestOptions) {
164
- return __awaiter(this, void 0, void 0, function* () {
165
- var _a, _b;
166
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
167
- const _response = yield core.fetcher({
168
- 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"),
169
- method: "POST",
170
- headers: _headers,
171
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
172
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
173
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
174
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
175
- });
176
- if (_response.ok) {
177
- return { data: undefined, rawResponse: _response.rawResponse };
178
- }
179
- if (_response.error.reason === "status-code") {
180
- throw new errors.LarkError({
181
- statusCode: _response.error.statusCode,
182
- body: _response.error.body,
183
- rawResponse: _response.rawResponse,
184
- });
185
- }
186
- switch (_response.error.reason) {
187
- case "non-json":
188
- throw new errors.LarkError({
189
- statusCode: _response.error.statusCode,
190
- body: _response.error.rawBody,
191
- rawResponse: _response.rawResponse,
192
- });
193
- case "timeout":
194
- throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /credit-grants.");
195
- case "unknown":
196
- throw new errors.LarkError({
197
- message: _response.error.errorMessage,
198
- rawResponse: _response.rawResponse,
199
- });
200
- }
201
- });
202
- }
203
- }
204
- exports.CreditPools = CreditPools;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client/index.js"), exports);
@@ -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.js";
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,305 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.PricingPlans = void 0;
49
- const core = __importStar(require("../../../../core/index.js"));
50
- const headers_js_1 = require("../../../../core/headers.js");
51
- const errors = __importStar(require("../../../../errors/index.js"));
52
- class PricingPlans {
53
- constructor(_options) {
54
- this._options = _options;
55
- }
56
- /**
57
- * @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
58
- *
59
- * @example
60
- * await client.pricingPlans.listPricingPlans()
61
- */
62
- listPricingPlans(requestOptions) {
63
- return core.HttpResponsePromise.fromPromise(this.__listPricingPlans(requestOptions));
64
- }
65
- __listPricingPlans(requestOptions) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- var _a, _b;
68
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
69
- const _response = yield core.fetcher({
70
- 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"),
71
- method: "GET",
72
- headers: _headers,
73
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
74
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
- });
78
- if (_response.ok) {
79
- return { data: undefined, rawResponse: _response.rawResponse };
80
- }
81
- if (_response.error.reason === "status-code") {
82
- throw new errors.LarkError({
83
- statusCode: _response.error.statusCode,
84
- body: _response.error.body,
85
- rawResponse: _response.rawResponse,
86
- });
87
- }
88
- switch (_response.error.reason) {
89
- case "non-json":
90
- throw new errors.LarkError({
91
- statusCode: _response.error.statusCode,
92
- body: _response.error.rawBody,
93
- rawResponse: _response.rawResponse,
94
- });
95
- case "timeout":
96
- throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-plans.");
97
- case "unknown":
98
- throw new errors.LarkError({
99
- message: _response.error.errorMessage,
100
- rawResponse: _response.rawResponse,
101
- });
102
- }
103
- });
104
- }
105
- /**
106
- * @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
107
- *
108
- * @example
109
- * await client.pricingPlans.createPricingPlan()
110
- */
111
- createPricingPlan(requestOptions) {
112
- return core.HttpResponsePromise.fromPromise(this.__createPricingPlan(requestOptions));
113
- }
114
- __createPricingPlan(requestOptions) {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- var _a, _b;
117
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
118
- const _response = yield core.fetcher({
119
- 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"),
120
- method: "POST",
121
- headers: _headers,
122
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
123
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
124
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
125
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
126
- });
127
- if (_response.ok) {
128
- return { data: undefined, rawResponse: _response.rawResponse };
129
- }
130
- if (_response.error.reason === "status-code") {
131
- throw new errors.LarkError({
132
- statusCode: _response.error.statusCode,
133
- body: _response.error.body,
134
- rawResponse: _response.rawResponse,
135
- });
136
- }
137
- switch (_response.error.reason) {
138
- case "non-json":
139
- throw new errors.LarkError({
140
- statusCode: _response.error.statusCode,
141
- body: _response.error.rawBody,
142
- rawResponse: _response.rawResponse,
143
- });
144
- case "timeout":
145
- throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /pricing-plans.");
146
- case "unknown":
147
- throw new errors.LarkError({
148
- message: _response.error.errorMessage,
149
- rawResponse: _response.rawResponse,
150
- });
151
- }
152
- });
153
- }
154
- /**
155
- * @param {string} planId
156
- * @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
157
- *
158
- * @example
159
- * await client.pricingPlans.getPricingPlan("plan_id")
160
- */
161
- getPricingPlan(planId, requestOptions) {
162
- return core.HttpResponsePromise.fromPromise(this.__getPricingPlan(planId, requestOptions));
163
- }
164
- __getPricingPlan(planId, requestOptions) {
165
- return __awaiter(this, void 0, void 0, function* () {
166
- var _a, _b;
167
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
168
- const _response = yield core.fetcher({
169
- 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)}`),
170
- method: "GET",
171
- headers: _headers,
172
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
173
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
174
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
175
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
176
- });
177
- if (_response.ok) {
178
- return { data: undefined, rawResponse: _response.rawResponse };
179
- }
180
- if (_response.error.reason === "status-code") {
181
- throw new errors.LarkError({
182
- statusCode: _response.error.statusCode,
183
- body: _response.error.body,
184
- rawResponse: _response.rawResponse,
185
- });
186
- }
187
- switch (_response.error.reason) {
188
- case "non-json":
189
- throw new errors.LarkError({
190
- statusCode: _response.error.statusCode,
191
- body: _response.error.rawBody,
192
- rawResponse: _response.rawResponse,
193
- });
194
- case "timeout":
195
- throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-plans/{plan_id}.");
196
- case "unknown":
197
- throw new errors.LarkError({
198
- message: _response.error.errorMessage,
199
- rawResponse: _response.rawResponse,
200
- });
201
- }
202
- });
203
- }
204
- /**
205
- * @param {string} planId
206
- * @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
207
- *
208
- * @example
209
- * await client.pricingPlans.updatePricingPlan("plan_id")
210
- */
211
- updatePricingPlan(planId, requestOptions) {
212
- return core.HttpResponsePromise.fromPromise(this.__updatePricingPlan(planId, requestOptions));
213
- }
214
- __updatePricingPlan(planId, requestOptions) {
215
- return __awaiter(this, void 0, void 0, function* () {
216
- var _a, _b;
217
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
218
- const _response = yield core.fetcher({
219
- 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)}`),
220
- method: "PUT",
221
- headers: _headers,
222
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
223
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
224
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
225
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
226
- });
227
- if (_response.ok) {
228
- return { data: undefined, rawResponse: _response.rawResponse };
229
- }
230
- if (_response.error.reason === "status-code") {
231
- throw new errors.LarkError({
232
- statusCode: _response.error.statusCode,
233
- body: _response.error.body,
234
- rawResponse: _response.rawResponse,
235
- });
236
- }
237
- switch (_response.error.reason) {
238
- case "non-json":
239
- throw new errors.LarkError({
240
- statusCode: _response.error.statusCode,
241
- body: _response.error.rawBody,
242
- rawResponse: _response.rawResponse,
243
- });
244
- case "timeout":
245
- throw new errors.LarkTimeoutError("Timeout exceeded when calling PUT /pricing-plans/{plan_id}.");
246
- case "unknown":
247
- throw new errors.LarkError({
248
- message: _response.error.errorMessage,
249
- rawResponse: _response.rawResponse,
250
- });
251
- }
252
- });
253
- }
254
- /**
255
- * @param {string} planId
256
- * @param {PricingPlans.RequestOptions} requestOptions - Request-specific configuration.
257
- *
258
- * @example
259
- * await client.pricingPlans.deletePricingPlan("plan_id")
260
- */
261
- deletePricingPlan(planId, requestOptions) {
262
- return core.HttpResponsePromise.fromPromise(this.__deletePricingPlan(planId, requestOptions));
263
- }
264
- __deletePricingPlan(planId, requestOptions) {
265
- return __awaiter(this, void 0, void 0, function* () {
266
- var _a, _b;
267
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
268
- const _response = yield core.fetcher({
269
- 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)}`),
270
- method: "DELETE",
271
- headers: _headers,
272
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
273
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
274
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
275
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
276
- });
277
- if (_response.ok) {
278
- return { data: undefined, rawResponse: _response.rawResponse };
279
- }
280
- if (_response.error.reason === "status-code") {
281
- throw new errors.LarkError({
282
- statusCode: _response.error.statusCode,
283
- body: _response.error.body,
284
- rawResponse: _response.rawResponse,
285
- });
286
- }
287
- switch (_response.error.reason) {
288
- case "non-json":
289
- throw new errors.LarkError({
290
- statusCode: _response.error.statusCode,
291
- body: _response.error.rawBody,
292
- rawResponse: _response.rawResponse,
293
- });
294
- case "timeout":
295
- throw new errors.LarkTimeoutError("Timeout exceeded when calling DELETE /pricing-plans/{plan_id}.");
296
- case "unknown":
297
- throw new errors.LarkError({
298
- message: _response.error.errorMessage,
299
- rawResponse: _response.rawResponse,
300
- });
301
- }
302
- });
303
- }
304
- }
305
- exports.PricingPlans = PricingPlans;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client/index.js"), exports);