orb-billing 2.2.0 → 2.4.0
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/CHANGELOG.md +75 -0
- package/client.d.ts +222 -0
- package/client.d.ts.map +1 -0
- package/client.js +156 -0
- package/client.js.map +1 -0
- package/client.mjs +129 -0
- package/client.mjs.map +1 -0
- package/index.d.mts +5 -217
- package/index.d.ts +5 -217
- package/index.d.ts.map +1 -1
- package/index.js +10 -133
- package/index.js.map +1 -1
- package/index.mjs +5 -130
- package/index.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/coupons/coupons.d.ts +3 -22
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/customers/costs.d.ts +4 -4
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +12 -4
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +16 -6
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +38 -8
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/usage.d.ts +2 -2
- package/resources/customers/usage.d.ts.map +1 -1
- package/resources/customers/usage.js.map +1 -1
- package/resources/customers/usage.mjs.map +1 -1
- package/resources/events/backfills.d.ts +20 -0
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/index.d.ts +2 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -6
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -2
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.ts +1 -1
- package/resources/invoices.js +1 -1
- package/resources/invoices.mjs +1 -1
- package/resources/plans/plans.d.ts +118 -1
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/index.d.ts +1 -1
- package/resources/prices/index.d.ts.map +1 -1
- package/resources/prices/index.js +3 -3
- package/resources/prices/index.js.map +1 -1
- package/resources/prices/index.mjs +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.ts +236 -2
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +26 -0
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +26 -0
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +5 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscriptions.d.ts +353 -19
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +11 -0
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +11 -0
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +4 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -3
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +301 -0
- package/src/index.ts +6 -297
- package/src/resources/coupons/coupons.ts +3 -26
- package/src/resources/customers/costs.ts +6 -6
- package/src/resources/customers/credits/credits.ts +16 -6
- package/src/resources/customers/credits/ledger.ts +20 -8
- package/src/resources/customers/credits/top-ups.ts +46 -10
- package/src/resources/customers/usage.ts +2 -2
- package/src/resources/events/backfills.ts +25 -0
- package/src/resources/index.ts +11 -2
- package/src/resources/invoices.ts +1 -1
- package/src/resources/plans/plans.ts +144 -1
- package/src/resources/prices/index.ts +10 -1
- package/src/resources/prices/prices.ts +333 -2
- package/src/resources/shared.ts +8 -0
- package/src/resources/subscriptions.ts +441 -23
- package/src/resources/webhooks.ts +5 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/beta/beta.d.ts +0 -12
- package/resources/beta/beta.d.ts.map +0 -1
- package/resources/beta/beta.js +0 -40
- package/resources/beta/beta.js.map +0 -1
- package/resources/beta/beta.mjs +0 -13
- package/resources/beta/beta.mjs.map +0 -1
- package/resources/beta/index.d.ts +0 -3
- package/resources/beta/index.d.ts.map +0 -1
- package/resources/beta/index.js +0 -9
- package/resources/beta/index.js.map +0 -1
- package/resources/beta/index.mjs +0 -4
- package/resources/beta/index.mjs.map +0 -1
- package/resources/beta/price.d.ts +0 -82
- package/resources/beta/price.d.ts.map +0 -1
- package/resources/beta/price.js +0 -37
- package/resources/beta/price.js.map +0 -1
- package/resources/beta/price.mjs +0 -33
- package/resources/beta/price.mjs.map +0 -1
- package/src/resources/beta/beta.ts +0 -15
- package/src/resources/beta/index.ts +0 -4
- package/src/resources/beta/price.ts +0 -101
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.0 (2024-05-02)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.3.0...v2.4.0](https://github.com/orbcorp/orb-node/compare/v2.3.0...v2.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add effective_date field ([#163](https://github.com/orbcorp/orb-node/issues/163)) ([7a5d9af](https://github.com/orbcorp/orb-node/commit/7a5d9afe4f578cfc7f1e8a03767f75bad3579751))
|
|
10
|
+
* **api:** add param to backfill create ([#174](https://github.com/orbcorp/orb-node/issues/174)) ([9379644](https://github.com/orbcorp/orb-node/commit/93796449184a9b4823a83ead1fa88b3557459588))
|
|
11
|
+
* **api:** add subscription update endpoint ([#168](https://github.com/orbcorp/orb-node/issues/168)) ([d7ee5ba](https://github.com/orbcorp/orb-node/commit/d7ee5bae793278692eb62159152dd5ad1f015bc9))
|
|
12
|
+
* **api:** add the shared model PaginationMetadata ([#164](https://github.com/orbcorp/orb-node/issues/164)) ([85956fe](https://github.com/orbcorp/orb-node/commit/85956fea41477392b725778e7d8364616236cad9))
|
|
13
|
+
* **api:** price evaluation endpoint generally available ([#169](https://github.com/orbcorp/orb-node/issues/169)) ([c1e2b83](https://github.com/orbcorp/orb-node/commit/c1e2b837cad4c1786ca553b0ea9fbabfc4623880))
|
|
14
|
+
* **api:** updates ([#154](https://github.com/orbcorp/orb-node/issues/154)) ([0f7c989](https://github.com/orbcorp/orb-node/commit/0f7c989eac9d033b1c8a03420efed405d3af4b88))
|
|
15
|
+
* **api:** updates ([#159](https://github.com/orbcorp/orb-node/issues/159)) ([ca602ea](https://github.com/orbcorp/orb-node/commit/ca602eaa69dcf615f4785c41a0c078b9a20af029))
|
|
16
|
+
* **api:** updates ([#179](https://github.com/orbcorp/orb-node/issues/179)) ([86b9015](https://github.com/orbcorp/orb-node/commit/86b9015532a7c165a605f77938c4bbadee24d452))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **api:** add shared model BillingCycleRelativeDate ([#167](https://github.com/orbcorp/orb-node/issues/167)) ([bb6764e](https://github.com/orbcorp/orb-node/commit/bb6764e1eed1bce9f1629e853de6a08eef0166cd))
|
|
22
|
+
* **api:** some path params were incorrectly typed as nullable ([#166](https://github.com/orbcorp/orb-node/issues/166)) ([bafd0a9](https://github.com/orbcorp/orb-node/commit/bafd0a9e007ad993fc129dd18836583074cd6b86))
|
|
23
|
+
* use UTC timezone for verifying webhook signature ([5eb9d2c](https://github.com/orbcorp/orb-node/commit/5eb9d2c50f5312d4ef82bc18bb94f95d1120b906)), closes [#156](https://github.com/orbcorp/orb-node/issues/156)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Chores
|
|
27
|
+
|
|
28
|
+
* **internal:** add link to openapi spec ([#176](https://github.com/orbcorp/orb-node/issues/176)) ([fd77e6a](https://github.com/orbcorp/orb-node/commit/fd77e6a266b2ba7a82821552afa227eb26d69443))
|
|
29
|
+
* **internal:** add scripts/test and scripts/mock ([#173](https://github.com/orbcorp/orb-node/issues/173)) ([495558b](https://github.com/orbcorp/orb-node/commit/495558b5f58d1729e3cc059e1c0acdaa039640af))
|
|
30
|
+
* **internal:** add scripts/test, scripts/mock and add ci job ([#177](https://github.com/orbcorp/orb-node/issues/177)) ([4440933](https://github.com/orbcorp/orb-node/commit/4440933b3f3d51740d8fcfd4ab188856b09967e9))
|
|
31
|
+
* **internal:** formatting ([#161](https://github.com/orbcorp/orb-node/issues/161)) ([b4ae917](https://github.com/orbcorp/orb-node/commit/b4ae9171619c0a23f368c92cc3e4b415859ac6af))
|
|
32
|
+
* **internal:** forward arguments in scripts/test ([#178](https://github.com/orbcorp/orb-node/issues/178)) ([0564bfe](https://github.com/orbcorp/orb-node/commit/0564bfe383da0efbe642ad5801c0ef9484f9f36c))
|
|
33
|
+
* **internal:** move client class to separate file ([#180](https://github.com/orbcorp/orb-node/issues/180)) ([9f56e13](https://github.com/orbcorp/orb-node/commit/9f56e13cce2e88d6a4a95a73215bd348a2685a9e))
|
|
34
|
+
* **internal:** refactor scripts ([#175](https://github.com/orbcorp/orb-node/issues/175)) ([76f4954](https://github.com/orbcorp/orb-node/commit/76f49549e07628aea9747f2190766c6e966c3d2e))
|
|
35
|
+
* **internal:** update gitignore ([#160](https://github.com/orbcorp/orb-node/issues/160)) ([bbd39e8](https://github.com/orbcorp/orb-node/commit/bbd39e830f21ef19b95dc7cd3ff06450906c360e))
|
|
36
|
+
* **internal:** use @swc/jest for running tests ([#165](https://github.com/orbcorp/orb-node/issues/165)) ([50ad2b0](https://github.com/orbcorp/orb-node/commit/50ad2b09e4d415050660adb28b4549c55a0730f1))
|
|
37
|
+
* **internal:** use actions/checkout@v4 for codeflow ([#171](https://github.com/orbcorp/orb-node/issues/171)) ([dcf2157](https://github.com/orbcorp/orb-node/commit/dcf21575dda07240093966cb560585f3eb08643c))
|
|
38
|
+
* use debug instead of console log for webhook signature logging ([590cbf1](https://github.com/orbcorp/orb-node/commit/590cbf17e37a7eb071d6d31295b3f9cc9bb46579))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Build System
|
|
42
|
+
|
|
43
|
+
* configure UTF-8 locale in devcontainer ([#162](https://github.com/orbcorp/orb-node/issues/162)) ([b1b8a5a](https://github.com/orbcorp/orb-node/commit/b1b8a5a1a586305e71183cd0c02f24a70513f3b1))
|
|
44
|
+
|
|
45
|
+
## 2.3.0 (2024-04-24)
|
|
46
|
+
|
|
47
|
+
Full Changelog: [v2.2.0...v2.3.0](https://github.com/orbcorp/orb-node/compare/v2.2.0...v2.3.0)
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* **api:** add effective_date field ([#163](https://github.com/orbcorp/orb-node/issues/163)) ([96a98bd](https://github.com/orbcorp/orb-node/commit/96a98bd315ceb6f2239dee6267bcf0b3a7e84a39))
|
|
52
|
+
* **api:** add subscription update endpoint ([#168](https://github.com/orbcorp/orb-node/issues/168)) ([09b5798](https://github.com/orbcorp/orb-node/commit/09b5798769187bcb18c92210c8b336b169f72343))
|
|
53
|
+
* **api:** add the shared model PaginationMetadata ([#164](https://github.com/orbcorp/orb-node/issues/164)) ([15f5af3](https://github.com/orbcorp/orb-node/commit/15f5af31b39a66ef8a626af50d09abf3202afc8f))
|
|
54
|
+
* **api:** price evaluation endpoint generally available ([#169](https://github.com/orbcorp/orb-node/issues/169)) ([492a728](https://github.com/orbcorp/orb-node/commit/492a72833150267df706054e5d8c1ce998b27999))
|
|
55
|
+
* **api:** updates ([#154](https://github.com/orbcorp/orb-node/issues/154)) ([01aef6d](https://github.com/orbcorp/orb-node/commit/01aef6d41d2fd0f6174eb6116ac2a670cfc96882))
|
|
56
|
+
* **api:** updates ([#159](https://github.com/orbcorp/orb-node/issues/159)) ([5b6287c](https://github.com/orbcorp/orb-node/commit/5b6287c047ed1a5eab7e498690838062c233a1a7))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* **api:** add shared model BillingCycleRelativeDate ([#167](https://github.com/orbcorp/orb-node/issues/167)) ([8677375](https://github.com/orbcorp/orb-node/commit/867737537ddecdfcaaf33bb0bd3fe29532f265c4))
|
|
62
|
+
* **api:** some path params were incorrectly typed as nullable ([#166](https://github.com/orbcorp/orb-node/issues/166)) ([eeb81d4](https://github.com/orbcorp/orb-node/commit/eeb81d4ade556528cf564b850b0d1b932fbfd999))
|
|
63
|
+
* use UTC timezone for verifying webhook signature ([9a0b87a](https://github.com/orbcorp/orb-node/commit/9a0b87a704a84608383c66cb5acb73f55aa97b3c)), closes [#156](https://github.com/orbcorp/orb-node/issues/156)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Chores
|
|
67
|
+
|
|
68
|
+
* **internal:** formatting ([#161](https://github.com/orbcorp/orb-node/issues/161)) ([db765d8](https://github.com/orbcorp/orb-node/commit/db765d86efc540e6301fc15912360ba66218c673))
|
|
69
|
+
* **internal:** update gitignore ([#160](https://github.com/orbcorp/orb-node/issues/160)) ([7a2c39f](https://github.com/orbcorp/orb-node/commit/7a2c39f468ea6aba7133d6fdfd28c632c119e145))
|
|
70
|
+
* **internal:** use @swc/jest for running tests ([#165](https://github.com/orbcorp/orb-node/issues/165)) ([c744e70](https://github.com/orbcorp/orb-node/commit/c744e70bf74385171fea39d73c9611f792661a3c))
|
|
71
|
+
* use debug instead of console log for webhook signature logging ([590cbf1](https://github.com/orbcorp/orb-node/commit/590cbf17e37a7eb071d6d31295b3f9cc9bb46579))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Build System
|
|
75
|
+
|
|
76
|
+
* configure UTF-8 locale in devcontainer ([#162](https://github.com/orbcorp/orb-node/issues/162)) ([aa09c7d](https://github.com/orbcorp/orb-node/commit/aa09c7dfc261b6e05e8e944f23a55463f80d13da))
|
|
77
|
+
|
|
3
78
|
## 2.2.0 (2024-04-08)
|
|
4
79
|
|
|
5
80
|
Full Changelog: [v2.1.2...v2.2.0](https://github.com/orbcorp/orb-node/compare/v2.1.2...v2.2.0)
|
package/client.d.ts
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as Core from "./core.js";
|
|
2
|
+
import * as Errors from "./error.js";
|
|
3
|
+
import { type Agent } from "./_shims/index.js";
|
|
4
|
+
import * as Uploads from "./uploads.js";
|
|
5
|
+
import * as Pagination from 'orb-billing/pagination';
|
|
6
|
+
import * as API from 'orb-billing/resources/index';
|
|
7
|
+
export interface ClientOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Defaults to process.env['ORB_API_KEY'].
|
|
10
|
+
*/
|
|
11
|
+
apiKey?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Defaults to process.env['ORB_WEBHOOK_SECRET'].
|
|
14
|
+
*/
|
|
15
|
+
webhookSecret?: string | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
18
|
+
*
|
|
19
|
+
* Defaults to process.env['ORB_BASE_URL'].
|
|
20
|
+
*/
|
|
21
|
+
baseURL?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
24
|
+
* from the server before timing out a single request.
|
|
25
|
+
*
|
|
26
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
27
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
28
|
+
*/
|
|
29
|
+
timeout?: number;
|
|
30
|
+
/**
|
|
31
|
+
* An HTTP agent used to manage HTTP(S) connections.
|
|
32
|
+
*
|
|
33
|
+
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
34
|
+
* otherwise no agent is used.
|
|
35
|
+
*/
|
|
36
|
+
httpAgent?: Agent;
|
|
37
|
+
/**
|
|
38
|
+
* Specify a custom `fetch` function implementation.
|
|
39
|
+
*
|
|
40
|
+
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
41
|
+
* defined globally.
|
|
42
|
+
*/
|
|
43
|
+
fetch?: Core.Fetch | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
46
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
47
|
+
*
|
|
48
|
+
* @default 2
|
|
49
|
+
*/
|
|
50
|
+
maxRetries?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Default headers to include with every request to the API.
|
|
53
|
+
*
|
|
54
|
+
* These can be removed in individual requests by explicitly setting the
|
|
55
|
+
* header to `undefined` or `null` in request options.
|
|
56
|
+
*/
|
|
57
|
+
defaultHeaders?: Core.Headers;
|
|
58
|
+
/**
|
|
59
|
+
* Default query parameters to include with every request to the API.
|
|
60
|
+
*
|
|
61
|
+
* These can be removed in individual requests by explicitly setting the
|
|
62
|
+
* param to `undefined` in request options.
|
|
63
|
+
*/
|
|
64
|
+
defaultQuery?: Core.DefaultQuery;
|
|
65
|
+
}
|
|
66
|
+
/** API Client for interfacing with the Orb API. */
|
|
67
|
+
export declare class Orb extends Core.APIClient {
|
|
68
|
+
apiKey: string;
|
|
69
|
+
webhookSecret: string | null;
|
|
70
|
+
private _options;
|
|
71
|
+
/**
|
|
72
|
+
* API Client for interfacing with the Orb API.
|
|
73
|
+
*
|
|
74
|
+
* @param {string | undefined} [opts.apiKey=process.env['ORB_API_KEY'] ?? undefined]
|
|
75
|
+
* @param {string | null | undefined} [opts.webhookSecret=process.env['ORB_WEBHOOK_SECRET'] ?? null]
|
|
76
|
+
* @param {string} [opts.baseURL=process.env['ORB_BASE_URL'] ?? https://api.withorb.com/v1] - Override the default base URL for the API.
|
|
77
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
78
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
79
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
80
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
81
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
82
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
83
|
+
*/
|
|
84
|
+
constructor({ baseURL, apiKey, webhookSecret, ...opts }?: ClientOptions);
|
|
85
|
+
topLevel: API.TopLevel;
|
|
86
|
+
coupons: API.Coupons;
|
|
87
|
+
creditNotes: API.CreditNotes;
|
|
88
|
+
customers: API.Customers;
|
|
89
|
+
events: API.Events;
|
|
90
|
+
invoiceLineItems: API.InvoiceLineItems;
|
|
91
|
+
invoices: API.Invoices;
|
|
92
|
+
items: API.Items;
|
|
93
|
+
metrics: API.Metrics;
|
|
94
|
+
plans: API.Plans;
|
|
95
|
+
prices: API.Prices;
|
|
96
|
+
subscriptions: API.Subscriptions;
|
|
97
|
+
webhooks: API.Webhooks;
|
|
98
|
+
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
99
|
+
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
100
|
+
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
101
|
+
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
102
|
+
static Orb: typeof Orb;
|
|
103
|
+
static OrbError: typeof Errors.OrbError;
|
|
104
|
+
static APIError: typeof Errors.APIError;
|
|
105
|
+
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
106
|
+
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
107
|
+
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
108
|
+
static URLNotFound: typeof Errors.URLNotFound;
|
|
109
|
+
static NotFoundError: typeof Errors.NotFoundError;
|
|
110
|
+
static ConflictError: typeof Errors.ConflictError;
|
|
111
|
+
static RateLimitError: typeof Errors.RateLimitError;
|
|
112
|
+
static BadRequestError: typeof Errors.BadRequestError;
|
|
113
|
+
static RequestTooLarge: typeof Errors.RequestTooLarge;
|
|
114
|
+
static TooManyRequests: typeof Errors.TooManyRequests;
|
|
115
|
+
static ResourceNotFound: typeof Errors.ResourceNotFound;
|
|
116
|
+
static ResourceConflict: typeof Errors.ResourceConflict;
|
|
117
|
+
static ResourceTooLarge: typeof Errors.ResourceTooLarge;
|
|
118
|
+
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
119
|
+
static InternalServerError: typeof Errors.InternalServerError;
|
|
120
|
+
static ConstraintViolation: typeof Errors.ConstraintViolation;
|
|
121
|
+
static FeatureNotAvailable: typeof Errors.FeatureNotAvailable;
|
|
122
|
+
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
123
|
+
static RequestValidationError: typeof Errors.RequestValidationError;
|
|
124
|
+
static OrbAuthenticationError: typeof Errors.OrbAuthenticationError;
|
|
125
|
+
static OrbInternalServerError: typeof Errors.OrbInternalServerError;
|
|
126
|
+
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
127
|
+
static DuplicateResourceCreation: typeof Errors.DuplicateResourceCreation;
|
|
128
|
+
static toFile: typeof Uploads.toFile;
|
|
129
|
+
static fileFromPath: typeof Uploads.fileFromPath;
|
|
130
|
+
}
|
|
131
|
+
export declare namespace Orb {
|
|
132
|
+
export import RequestOptions = Core.RequestOptions;
|
|
133
|
+
export import Page = Pagination.Page;
|
|
134
|
+
export import PageParams = Pagination.PageParams;
|
|
135
|
+
export import PageResponse = Pagination.PageResponse;
|
|
136
|
+
export import TopLevel = API.TopLevel;
|
|
137
|
+
export import TopLevelPingResponse = API.TopLevelPingResponse;
|
|
138
|
+
export import Coupons = API.Coupons;
|
|
139
|
+
export import Coupon = API.Coupon;
|
|
140
|
+
export import CouponsPage = API.CouponsPage;
|
|
141
|
+
export import CouponCreateParams = API.CouponCreateParams;
|
|
142
|
+
export import CouponListParams = API.CouponListParams;
|
|
143
|
+
export import CreditNotes = API.CreditNotes;
|
|
144
|
+
export import CreditNote = API.CreditNote;
|
|
145
|
+
export import CreditNotesPage = API.CreditNotesPage;
|
|
146
|
+
export import CreditNoteListParams = API.CreditNoteListParams;
|
|
147
|
+
export import Customers = API.Customers;
|
|
148
|
+
export import Customer = API.Customer;
|
|
149
|
+
export import CustomersPage = API.CustomersPage;
|
|
150
|
+
export import CustomerCreateParams = API.CustomerCreateParams;
|
|
151
|
+
export import CustomerUpdateParams = API.CustomerUpdateParams;
|
|
152
|
+
export import CustomerListParams = API.CustomerListParams;
|
|
153
|
+
export import CustomerUpdateByExternalIDParams = API.CustomerUpdateByExternalIDParams;
|
|
154
|
+
export import Events = API.Events;
|
|
155
|
+
export import EventUpdateResponse = API.EventUpdateResponse;
|
|
156
|
+
export import EventDeprecateResponse = API.EventDeprecateResponse;
|
|
157
|
+
export import EventIngestResponse = API.EventIngestResponse;
|
|
158
|
+
export import EventSearchResponse = API.EventSearchResponse;
|
|
159
|
+
export import EventUpdateParams = API.EventUpdateParams;
|
|
160
|
+
export import EventIngestParams = API.EventIngestParams;
|
|
161
|
+
export import EventSearchParams = API.EventSearchParams;
|
|
162
|
+
export import InvoiceLineItems = API.InvoiceLineItems;
|
|
163
|
+
export import InvoiceLineItemCreateResponse = API.InvoiceLineItemCreateResponse;
|
|
164
|
+
export import InvoiceLineItemCreateParams = API.InvoiceLineItemCreateParams;
|
|
165
|
+
export import Invoices = API.Invoices;
|
|
166
|
+
export import Invoice = API.Invoice;
|
|
167
|
+
export import InvoiceFetchUpcomingResponse = API.InvoiceFetchUpcomingResponse;
|
|
168
|
+
export import InvoicesPage = API.InvoicesPage;
|
|
169
|
+
export import InvoiceCreateParams = API.InvoiceCreateParams;
|
|
170
|
+
export import InvoiceListParams = API.InvoiceListParams;
|
|
171
|
+
export import InvoiceFetchUpcomingParams = API.InvoiceFetchUpcomingParams;
|
|
172
|
+
export import InvoiceMarkPaidParams = API.InvoiceMarkPaidParams;
|
|
173
|
+
export import Items = API.Items;
|
|
174
|
+
export import Item = API.Item;
|
|
175
|
+
export import ItemsPage = API.ItemsPage;
|
|
176
|
+
export import ItemCreateParams = API.ItemCreateParams;
|
|
177
|
+
export import ItemListParams = API.ItemListParams;
|
|
178
|
+
export import Metrics = API.Metrics;
|
|
179
|
+
export import MetricCreateResponse = API.MetricCreateResponse;
|
|
180
|
+
export import MetricListResponse = API.MetricListResponse;
|
|
181
|
+
export import MetricFetchResponse = API.MetricFetchResponse;
|
|
182
|
+
export import MetricListResponsesPage = API.MetricListResponsesPage;
|
|
183
|
+
export import MetricCreateParams = API.MetricCreateParams;
|
|
184
|
+
export import MetricListParams = API.MetricListParams;
|
|
185
|
+
export import Plans = API.Plans;
|
|
186
|
+
export import Plan = API.Plan;
|
|
187
|
+
export import PlansPage = API.PlansPage;
|
|
188
|
+
export import PlanCreateParams = API.PlanCreateParams;
|
|
189
|
+
export import PlanUpdateParams = API.PlanUpdateParams;
|
|
190
|
+
export import PlanListParams = API.PlanListParams;
|
|
191
|
+
export import Prices = API.Prices;
|
|
192
|
+
export import EvaluatePriceGroup = API.EvaluatePriceGroup;
|
|
193
|
+
export import Price = API.Price;
|
|
194
|
+
export import PriceEvaluateResponse = API.PriceEvaluateResponse;
|
|
195
|
+
export import PricesPage = API.PricesPage;
|
|
196
|
+
export import PriceCreateParams = API.PriceCreateParams;
|
|
197
|
+
export import PriceListParams = API.PriceListParams;
|
|
198
|
+
export import PriceEvaluateParams = API.PriceEvaluateParams;
|
|
199
|
+
export import Subscriptions = API.Subscriptions;
|
|
200
|
+
export import Subscription = API.Subscription;
|
|
201
|
+
export import SubscriptionUsage = API.SubscriptionUsage;
|
|
202
|
+
export import SubscriptionFetchCostsResponse = API.SubscriptionFetchCostsResponse;
|
|
203
|
+
export import SubscriptionFetchScheduleResponse = API.SubscriptionFetchScheduleResponse;
|
|
204
|
+
export import SubscriptionsPage = API.SubscriptionsPage;
|
|
205
|
+
export import SubscriptionFetchScheduleResponsesPage = API.SubscriptionFetchScheduleResponsesPage;
|
|
206
|
+
export import SubscriptionCreateParams = API.SubscriptionCreateParams;
|
|
207
|
+
export import SubscriptionUpdateParams = API.SubscriptionUpdateParams;
|
|
208
|
+
export import SubscriptionListParams = API.SubscriptionListParams;
|
|
209
|
+
export import SubscriptionCancelParams = API.SubscriptionCancelParams;
|
|
210
|
+
export import SubscriptionFetchCostsParams = API.SubscriptionFetchCostsParams;
|
|
211
|
+
export import SubscriptionFetchScheduleParams = API.SubscriptionFetchScheduleParams;
|
|
212
|
+
export import SubscriptionFetchUsageParams = API.SubscriptionFetchUsageParams;
|
|
213
|
+
export import SubscriptionPriceIntervalsParams = API.SubscriptionPriceIntervalsParams;
|
|
214
|
+
export import SubscriptionSchedulePlanChangeParams = API.SubscriptionSchedulePlanChangeParams;
|
|
215
|
+
export import SubscriptionTriggerPhaseParams = API.SubscriptionTriggerPhaseParams;
|
|
216
|
+
export import SubscriptionUnscheduleFixedFeeQuantityUpdatesParams = API.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams;
|
|
217
|
+
export import SubscriptionUpdateFixedFeeQuantityParams = API.SubscriptionUpdateFixedFeeQuantityParams;
|
|
218
|
+
export import BillingCycleRelativeDate = API.BillingCycleRelativeDate;
|
|
219
|
+
export import Discount = API.Discount;
|
|
220
|
+
export import PaginationMetadata = API.PaginationMetadata;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=client.d.ts.map
|
package/client.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CA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,wBAAwB,CAAC;IACtE,MAAM,QAAQ,4BAA4B,GAAG,GAAG,CAAC,4BAA4B,CAAC;IAC9E,MAAM,QAAQ,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;IACpF,MAAM,QAAQ,4BAA4B,GAAG,GAAG,CAAC,4BAA4B,CAAC;IAC9E,MAAM,QAAQ,gCAAgC,GAAG,GAAG,CAAC,gCAAgC,CAAC;IACtF,MAAM,QAAQ,oCAAoC,GAAG,GAAG,CAAC,oCAAoC,CAAC;IAC9F,MAAM,QAAQ,8BAA8B,GAAG,GAAG,CAAC,8BAA8B,CAAC;IAClF,MAAM,QAAQ,mDAAmD,GAAG,GAAG,CAAC,mDAAmD,CAAC;IAC5H,MAAM,QAAQ,wCAAwC,GAAG,GAAG,CAAC,wCAAwC,CAAC;IAEtG,MAAM,QAAQ,wBAAwB,GAAG,GAAG,CAAC,wBAAwB,CAAC;IACtE,MAAM,QAAQ,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IACtC,MAAM,QAAQ,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,CAAC;CAC3D"}
|
package/client.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var _a;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Orb = void 0;
|
|
29
|
+
const Core = __importStar(require("./core.js"));
|
|
30
|
+
const Errors = __importStar(require("./error.js"));
|
|
31
|
+
const Uploads = __importStar(require("./uploads.js"));
|
|
32
|
+
const qs = __importStar(require("qs"));
|
|
33
|
+
const Pagination = __importStar(require("orb-billing/pagination"));
|
|
34
|
+
const API = __importStar(require("orb-billing/resources/index"));
|
|
35
|
+
/** API Client for interfacing with the Orb API. */
|
|
36
|
+
class Orb extends Core.APIClient {
|
|
37
|
+
/**
|
|
38
|
+
* API Client for interfacing with the Orb API.
|
|
39
|
+
*
|
|
40
|
+
* @param {string | undefined} [opts.apiKey=process.env['ORB_API_KEY'] ?? undefined]
|
|
41
|
+
* @param {string | null | undefined} [opts.webhookSecret=process.env['ORB_WEBHOOK_SECRET'] ?? null]
|
|
42
|
+
* @param {string} [opts.baseURL=process.env['ORB_BASE_URL'] ?? https://api.withorb.com/v1] - Override the default base URL for the API.
|
|
43
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
44
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
45
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
46
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
47
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
48
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
49
|
+
*/
|
|
50
|
+
constructor({ baseURL = Core.readEnv('ORB_BASE_URL'), apiKey = Core.readEnv('ORB_API_KEY'), webhookSecret = Core.readEnv('ORB_WEBHOOK_SECRET') ?? null, ...opts } = {}) {
|
|
51
|
+
if (apiKey === undefined) {
|
|
52
|
+
throw new Errors.OrbError("The ORB_API_KEY environment variable is missing or empty; either provide it, or instantiate the Orb client with an apiKey option, like new Orb({ apiKey: 'My API Key' }).");
|
|
53
|
+
}
|
|
54
|
+
const options = {
|
|
55
|
+
apiKey,
|
|
56
|
+
webhookSecret,
|
|
57
|
+
...opts,
|
|
58
|
+
baseURL: baseURL || `https://api.withorb.com/v1`,
|
|
59
|
+
};
|
|
60
|
+
super({
|
|
61
|
+
baseURL: options.baseURL,
|
|
62
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
63
|
+
httpAgent: options.httpAgent,
|
|
64
|
+
maxRetries: options.maxRetries,
|
|
65
|
+
fetch: options.fetch,
|
|
66
|
+
});
|
|
67
|
+
this.topLevel = new API.TopLevel(this);
|
|
68
|
+
this.coupons = new API.Coupons(this);
|
|
69
|
+
this.creditNotes = new API.CreditNotes(this);
|
|
70
|
+
this.customers = new API.Customers(this);
|
|
71
|
+
this.events = new API.Events(this);
|
|
72
|
+
this.invoiceLineItems = new API.InvoiceLineItems(this);
|
|
73
|
+
this.invoices = new API.Invoices(this);
|
|
74
|
+
this.items = new API.Items(this);
|
|
75
|
+
this.metrics = new API.Metrics(this);
|
|
76
|
+
this.plans = new API.Plans(this);
|
|
77
|
+
this.prices = new API.Prices(this);
|
|
78
|
+
this.subscriptions = new API.Subscriptions(this);
|
|
79
|
+
this.webhooks = new API.Webhooks(this);
|
|
80
|
+
this._options = options;
|
|
81
|
+
this.idempotencyHeader = 'Idempotency-Key';
|
|
82
|
+
this.apiKey = apiKey;
|
|
83
|
+
this.webhookSecret = webhookSecret;
|
|
84
|
+
}
|
|
85
|
+
defaultQuery() {
|
|
86
|
+
return this._options.defaultQuery;
|
|
87
|
+
}
|
|
88
|
+
defaultHeaders(opts) {
|
|
89
|
+
return {
|
|
90
|
+
...super.defaultHeaders(opts),
|
|
91
|
+
...this._options.defaultHeaders,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
authHeaders(opts) {
|
|
95
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
96
|
+
}
|
|
97
|
+
stringifyQuery(query) {
|
|
98
|
+
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.Orb = Orb;
|
|
102
|
+
_a = Orb;
|
|
103
|
+
Orb.Orb = _a;
|
|
104
|
+
Orb.OrbError = Errors.OrbError;
|
|
105
|
+
Orb.APIError = Errors.APIError;
|
|
106
|
+
Orb.APIConnectionError = Errors.APIConnectionError;
|
|
107
|
+
Orb.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
108
|
+
Orb.APIUserAbortError = Errors.APIUserAbortError;
|
|
109
|
+
Orb.URLNotFound = Errors.URLNotFound;
|
|
110
|
+
Orb.NotFoundError = Errors.NotFoundError;
|
|
111
|
+
Orb.ConflictError = Errors.ConflictError;
|
|
112
|
+
Orb.RateLimitError = Errors.RateLimitError;
|
|
113
|
+
Orb.BadRequestError = Errors.BadRequestError;
|
|
114
|
+
Orb.RequestTooLarge = Errors.RequestTooLarge;
|
|
115
|
+
Orb.TooManyRequests = Errors.TooManyRequests;
|
|
116
|
+
Orb.ResourceNotFound = Errors.ResourceNotFound;
|
|
117
|
+
Orb.ResourceConflict = Errors.ResourceConflict;
|
|
118
|
+
Orb.ResourceTooLarge = Errors.ResourceTooLarge;
|
|
119
|
+
Orb.AuthenticationError = Errors.AuthenticationError;
|
|
120
|
+
Orb.InternalServerError = Errors.InternalServerError;
|
|
121
|
+
Orb.ConstraintViolation = Errors.ConstraintViolation;
|
|
122
|
+
Orb.FeatureNotAvailable = Errors.FeatureNotAvailable;
|
|
123
|
+
Orb.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
124
|
+
Orb.RequestValidationError = Errors.RequestValidationError;
|
|
125
|
+
Orb.OrbAuthenticationError = Errors.OrbAuthenticationError;
|
|
126
|
+
Orb.OrbInternalServerError = Errors.OrbInternalServerError;
|
|
127
|
+
Orb.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
128
|
+
Orb.DuplicateResourceCreation = Errors.DuplicateResourceCreation;
|
|
129
|
+
Orb.toFile = Uploads.toFile;
|
|
130
|
+
Orb.fileFromPath = Uploads.fileFromPath;
|
|
131
|
+
(function (Orb) {
|
|
132
|
+
Orb.Page = Pagination.Page;
|
|
133
|
+
Orb.TopLevel = API.TopLevel;
|
|
134
|
+
Orb.Coupons = API.Coupons;
|
|
135
|
+
Orb.CouponsPage = API.CouponsPage;
|
|
136
|
+
Orb.CreditNotes = API.CreditNotes;
|
|
137
|
+
Orb.CreditNotesPage = API.CreditNotesPage;
|
|
138
|
+
Orb.Customers = API.Customers;
|
|
139
|
+
Orb.CustomersPage = API.CustomersPage;
|
|
140
|
+
Orb.Events = API.Events;
|
|
141
|
+
Orb.InvoiceLineItems = API.InvoiceLineItems;
|
|
142
|
+
Orb.Invoices = API.Invoices;
|
|
143
|
+
Orb.InvoicesPage = API.InvoicesPage;
|
|
144
|
+
Orb.Items = API.Items;
|
|
145
|
+
Orb.ItemsPage = API.ItemsPage;
|
|
146
|
+
Orb.Metrics = API.Metrics;
|
|
147
|
+
Orb.MetricListResponsesPage = API.MetricListResponsesPage;
|
|
148
|
+
Orb.Plans = API.Plans;
|
|
149
|
+
Orb.PlansPage = API.PlansPage;
|
|
150
|
+
Orb.Prices = API.Prices;
|
|
151
|
+
Orb.PricesPage = API.PricesPage;
|
|
152
|
+
Orb.Subscriptions = API.Subscriptions;
|
|
153
|
+
Orb.SubscriptionsPage = API.SubscriptionsPage;
|
|
154
|
+
Orb.SubscriptionFetchScheduleResponsesPage = API.SubscriptionFetchScheduleResponsesPage;
|
|
155
|
+
})(Orb = exports.Orb || (exports.Orb = {}));
|
|
156
|
+
//# sourceMappingURL=client.js.map
|
package/client.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA+B;AAC/B,mDAAkC;AAElC,sDAAqC;AACrC,uCAAyB;AACzB,mEAAqD;AACrD,iEAAmD;AAsEnD,mDAAmD;AACnD,MAAa,GAAI,SAAQ,IAAI,CAAC,SAAS;IAMrC;;;;;;;;;;;;OAYG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EACtC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EACpC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI,EAC1D,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,MAAM,IAAI,MAAM,CAAC,QAAQ,CACvB,2KAA2K,CAC5K,CAAC;SACH;QAED,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,aAAa;YACb,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,4BAA4B;SACjD,CAAC;QAEF,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAQ;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAQL,aAAQ,GA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AU,GAAG,GAAG,CAAC,UAAU,CAAC;IAK5B,iBAAa,GAAG,GAAG,CAAC,aAAa,CAAC;IAKlC,qBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC;IAC1C,0CAAsC,GAAG,GAAG,CAAC,sCAAsC,CAAC;AAiBpG,CAAC,EAxGgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAwGnB"}
|
package/client.mjs
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
var _a;
|
|
3
|
+
import * as Core from "./core.mjs";
|
|
4
|
+
import * as Errors from "./error.mjs";
|
|
5
|
+
import * as Uploads from "./uploads.mjs";
|
|
6
|
+
import * as qs from 'qs';
|
|
7
|
+
import * as Pagination from 'orb-billing/pagination';
|
|
8
|
+
import * as API from 'orb-billing/resources/index';
|
|
9
|
+
/** API Client for interfacing with the Orb API. */
|
|
10
|
+
export class Orb extends Core.APIClient {
|
|
11
|
+
/**
|
|
12
|
+
* API Client for interfacing with the Orb API.
|
|
13
|
+
*
|
|
14
|
+
* @param {string | undefined} [opts.apiKey=process.env['ORB_API_KEY'] ?? undefined]
|
|
15
|
+
* @param {string | null | undefined} [opts.webhookSecret=process.env['ORB_WEBHOOK_SECRET'] ?? null]
|
|
16
|
+
* @param {string} [opts.baseURL=process.env['ORB_BASE_URL'] ?? https://api.withorb.com/v1] - Override the default base URL for the API.
|
|
17
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
18
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
19
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
20
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
21
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
22
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
23
|
+
*/
|
|
24
|
+
constructor({ baseURL = Core.readEnv('ORB_BASE_URL'), apiKey = Core.readEnv('ORB_API_KEY'), webhookSecret = Core.readEnv('ORB_WEBHOOK_SECRET') ?? null, ...opts } = {}) {
|
|
25
|
+
if (apiKey === undefined) {
|
|
26
|
+
throw new Errors.OrbError("The ORB_API_KEY environment variable is missing or empty; either provide it, or instantiate the Orb client with an apiKey option, like new Orb({ apiKey: 'My API Key' }).");
|
|
27
|
+
}
|
|
28
|
+
const options = {
|
|
29
|
+
apiKey,
|
|
30
|
+
webhookSecret,
|
|
31
|
+
...opts,
|
|
32
|
+
baseURL: baseURL || `https://api.withorb.com/v1`,
|
|
33
|
+
};
|
|
34
|
+
super({
|
|
35
|
+
baseURL: options.baseURL,
|
|
36
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
37
|
+
httpAgent: options.httpAgent,
|
|
38
|
+
maxRetries: options.maxRetries,
|
|
39
|
+
fetch: options.fetch,
|
|
40
|
+
});
|
|
41
|
+
this.topLevel = new API.TopLevel(this);
|
|
42
|
+
this.coupons = new API.Coupons(this);
|
|
43
|
+
this.creditNotes = new API.CreditNotes(this);
|
|
44
|
+
this.customers = new API.Customers(this);
|
|
45
|
+
this.events = new API.Events(this);
|
|
46
|
+
this.invoiceLineItems = new API.InvoiceLineItems(this);
|
|
47
|
+
this.invoices = new API.Invoices(this);
|
|
48
|
+
this.items = new API.Items(this);
|
|
49
|
+
this.metrics = new API.Metrics(this);
|
|
50
|
+
this.plans = new API.Plans(this);
|
|
51
|
+
this.prices = new API.Prices(this);
|
|
52
|
+
this.subscriptions = new API.Subscriptions(this);
|
|
53
|
+
this.webhooks = new API.Webhooks(this);
|
|
54
|
+
this._options = options;
|
|
55
|
+
this.idempotencyHeader = 'Idempotency-Key';
|
|
56
|
+
this.apiKey = apiKey;
|
|
57
|
+
this.webhookSecret = webhookSecret;
|
|
58
|
+
}
|
|
59
|
+
defaultQuery() {
|
|
60
|
+
return this._options.defaultQuery;
|
|
61
|
+
}
|
|
62
|
+
defaultHeaders(opts) {
|
|
63
|
+
return {
|
|
64
|
+
...super.defaultHeaders(opts),
|
|
65
|
+
...this._options.defaultHeaders,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
authHeaders(opts) {
|
|
69
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
70
|
+
}
|
|
71
|
+
stringifyQuery(query) {
|
|
72
|
+
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_a = Orb;
|
|
76
|
+
Orb.Orb = _a;
|
|
77
|
+
Orb.OrbError = Errors.OrbError;
|
|
78
|
+
Orb.APIError = Errors.APIError;
|
|
79
|
+
Orb.APIConnectionError = Errors.APIConnectionError;
|
|
80
|
+
Orb.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
81
|
+
Orb.APIUserAbortError = Errors.APIUserAbortError;
|
|
82
|
+
Orb.URLNotFound = Errors.URLNotFound;
|
|
83
|
+
Orb.NotFoundError = Errors.NotFoundError;
|
|
84
|
+
Orb.ConflictError = Errors.ConflictError;
|
|
85
|
+
Orb.RateLimitError = Errors.RateLimitError;
|
|
86
|
+
Orb.BadRequestError = Errors.BadRequestError;
|
|
87
|
+
Orb.RequestTooLarge = Errors.RequestTooLarge;
|
|
88
|
+
Orb.TooManyRequests = Errors.TooManyRequests;
|
|
89
|
+
Orb.ResourceNotFound = Errors.ResourceNotFound;
|
|
90
|
+
Orb.ResourceConflict = Errors.ResourceConflict;
|
|
91
|
+
Orb.ResourceTooLarge = Errors.ResourceTooLarge;
|
|
92
|
+
Orb.AuthenticationError = Errors.AuthenticationError;
|
|
93
|
+
Orb.InternalServerError = Errors.InternalServerError;
|
|
94
|
+
Orb.ConstraintViolation = Errors.ConstraintViolation;
|
|
95
|
+
Orb.FeatureNotAvailable = Errors.FeatureNotAvailable;
|
|
96
|
+
Orb.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
97
|
+
Orb.RequestValidationError = Errors.RequestValidationError;
|
|
98
|
+
Orb.OrbAuthenticationError = Errors.OrbAuthenticationError;
|
|
99
|
+
Orb.OrbInternalServerError = Errors.OrbInternalServerError;
|
|
100
|
+
Orb.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
101
|
+
Orb.DuplicateResourceCreation = Errors.DuplicateResourceCreation;
|
|
102
|
+
Orb.toFile = Uploads.toFile;
|
|
103
|
+
Orb.fileFromPath = Uploads.fileFromPath;
|
|
104
|
+
(function (Orb) {
|
|
105
|
+
Orb.Page = Pagination.Page;
|
|
106
|
+
Orb.TopLevel = API.TopLevel;
|
|
107
|
+
Orb.Coupons = API.Coupons;
|
|
108
|
+
Orb.CouponsPage = API.CouponsPage;
|
|
109
|
+
Orb.CreditNotes = API.CreditNotes;
|
|
110
|
+
Orb.CreditNotesPage = API.CreditNotesPage;
|
|
111
|
+
Orb.Customers = API.Customers;
|
|
112
|
+
Orb.CustomersPage = API.CustomersPage;
|
|
113
|
+
Orb.Events = API.Events;
|
|
114
|
+
Orb.InvoiceLineItems = API.InvoiceLineItems;
|
|
115
|
+
Orb.Invoices = API.Invoices;
|
|
116
|
+
Orb.InvoicesPage = API.InvoicesPage;
|
|
117
|
+
Orb.Items = API.Items;
|
|
118
|
+
Orb.ItemsPage = API.ItemsPage;
|
|
119
|
+
Orb.Metrics = API.Metrics;
|
|
120
|
+
Orb.MetricListResponsesPage = API.MetricListResponsesPage;
|
|
121
|
+
Orb.Plans = API.Plans;
|
|
122
|
+
Orb.PlansPage = API.PlansPage;
|
|
123
|
+
Orb.Prices = API.Prices;
|
|
124
|
+
Orb.PricesPage = API.PricesPage;
|
|
125
|
+
Orb.Subscriptions = API.Subscriptions;
|
|
126
|
+
Orb.SubscriptionsPage = API.SubscriptionsPage;
|
|
127
|
+
Orb.SubscriptionFetchScheduleResponsesPage = API.SubscriptionFetchScheduleResponsesPage;
|
|
128
|
+
})(Orb || (Orb = {}));
|
|
129
|
+
//# sourceMappingURL=client.mjs.map
|
package/client.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAE/E,KAAK,IAAI;OACT,KAAK,MAAM;OAEX,KAAK,OAAO;OACZ,KAAK,EAAE,MAAM,IAAI;OACjB,KAAK,UAAU,MAAM,wBAAwB;OAC7C,KAAK,GAAG,MAAM,6BAA6B;AAsElD,mDAAmD;AACnD,MAAM,OAAO,GAAI,SAAQ,IAAI,CAAC,SAAS;IAMrC;;;;;;;;;;;;OAYG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EACtC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EACpC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI,EAC1D,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,MAAM,IAAI,MAAM,CAAC,QAAQ,CACvB,2KAA2K,CAC5K,CAAC;SACH;QAED,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,aAAa;YACb,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,4BAA4B;SACjD,CAAC;QAEF,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAQ;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAQL,aAAQ,GAAiB,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,YAAO,GAAgB,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC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