@stigg/typescript 0.1.0-alpha.4 → 0.1.0-alpha.7
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 +53 -0
- package/README.md +9 -0
- package/client.d.mts +4 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -6
- package/client.d.ts.map +1 -1
- package/client.js +16 -21
- package/client.js.map +1 -1
- package/client.mjs +16 -21
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/v1/coupons.d.mts +49 -7
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +49 -7
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +4 -3
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +4 -3
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +72 -8
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +72 -8
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +18 -7
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +18 -7
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +4 -2
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +4 -2
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +4 -2
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +4 -2
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +4 -2
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +4 -2
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +4 -2
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +4 -2
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/events.d.mts +2 -1
- package/resources/v1/events.d.mts.map +1 -1
- package/resources/v1/events.d.ts +2 -1
- package/resources/v1/events.d.ts.map +1 -1
- package/resources/v1/events.js +2 -1
- package/resources/v1/events.js.map +1 -1
- package/resources/v1/events.mjs +2 -1
- package/resources/v1/events.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/products.d.mts +126 -0
- package/resources/v1/products.d.mts.map +1 -0
- package/resources/v1/products.d.ts +126 -0
- package/resources/v1/products.d.ts.map +1 -0
- package/resources/v1/products.js +19 -0
- package/resources/v1/products.js.map +1 -0
- package/resources/v1/products.mjs +15 -0
- package/resources/v1/products.mjs.map +1 -0
- package/resources/v1/subscriptions/future-update.d.mts +3 -2
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +3 -2
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +3 -2
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +3 -2
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +158 -34
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +158 -34
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +20 -10
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +20 -10
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/usage.d.mts +3 -2
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +3 -2
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +3 -2
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +3 -2
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +23 -26
- package/src/internal/parse.ts +6 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/resources/v1/coupons.ts +57 -9
- package/src/resources/v1/customers/customers.ts +97 -8
- package/src/resources/v1/customers/index.ts +3 -0
- package/src/resources/v1/customers/payment-method.ts +4 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +4 -2
- package/src/resources/v1/events.ts +2 -1
- package/src/resources/v1/index.ts +9 -0
- package/src/resources/v1/products.ts +162 -0
- package/src/resources/v1/subscriptions/future-update.ts +3 -2
- package/src/resources/v1/subscriptions/subscriptions.ts +218 -36
- package/src/resources/v1/usage.ts +3 -2
- package/src/resources/v1/v1.ts +22 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -10,19 +10,22 @@ export class Subscriptions extends APIResource {
|
|
|
10
10
|
this.futureUpdate = new FutureUpdateAPI.FutureUpdate(this._client);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Retrieves a subscription by its unique identifier, including plan details,
|
|
14
|
+
* billing period, status, and add-ons.
|
|
14
15
|
*/
|
|
15
16
|
retrieve(id, options) {
|
|
16
17
|
return this._client.get(path `/api/v1/subscriptions/${id}`, options);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Updates an active subscription's properties including billing period, add-ons,
|
|
21
|
+
* unit quantities, and discounts.
|
|
20
22
|
*/
|
|
21
23
|
update(id, body, options) {
|
|
22
24
|
return this._client.patch(path `/api/v1/subscriptions/${id}`, { body, ...options });
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* Retrieves a paginated list of subscriptions, with optional filters for customer,
|
|
28
|
+
* status, and plan.
|
|
26
29
|
*/
|
|
27
30
|
list(query = {}, options) {
|
|
28
31
|
return this._client.getAPIList('/api/v1/subscriptions', (MyCursorIDPage), {
|
|
@@ -31,43 +34,50 @@ export class Subscriptions extends APIResource {
|
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* Cancels an active subscription, either immediately or at a specified time such
|
|
38
|
+
* as end of billing period.
|
|
35
39
|
*/
|
|
36
40
|
cancel(id, body, options) {
|
|
37
41
|
return this._client.post(path `/api/v1/subscriptions/${id}/cancel`, { body, ...options });
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
|
-
*
|
|
44
|
+
* Delegates the payment responsibility of a subscription to a different customer.
|
|
45
|
+
* The delegated customer will be billed for this subscription.
|
|
41
46
|
*/
|
|
42
47
|
delegate(id, body, options) {
|
|
43
48
|
return this._client.post(path `/api/v1/subscriptions/${id}/delegate`, { body, ...options });
|
|
44
49
|
}
|
|
45
50
|
/**
|
|
46
|
-
*
|
|
51
|
+
* Imports multiple subscriptions in bulk. Used for migrating subscription data
|
|
52
|
+
* from external systems.
|
|
47
53
|
*/
|
|
48
54
|
import(body, options) {
|
|
49
55
|
return this._client.post('/api/v1/subscriptions/import', { body, ...options });
|
|
50
56
|
}
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
58
|
+
* Migrates a subscription to the latest published version of its plan or add-ons.
|
|
59
|
+
* Handles prorated charges or credits automatically.
|
|
53
60
|
*/
|
|
54
61
|
migrate(id, body, options) {
|
|
55
62
|
return this._client.post(path `/api/v1/subscriptions/${id}/migrate`, { body, ...options });
|
|
56
63
|
}
|
|
57
64
|
/**
|
|
58
|
-
*
|
|
65
|
+
* Previews the pricing impact of creating or updating a subscription without
|
|
66
|
+
* making changes. Returns estimated costs, taxes, and proration details.
|
|
59
67
|
*/
|
|
60
68
|
preview(body, options) {
|
|
61
69
|
return this._client.post('/api/v1/subscriptions/preview', { body, ...options });
|
|
62
70
|
}
|
|
63
71
|
/**
|
|
64
|
-
*
|
|
72
|
+
* Creates a new subscription for an existing customer. When payment is required
|
|
73
|
+
* and no payment method exists, returns a checkout URL.
|
|
65
74
|
*/
|
|
66
75
|
provision(body, options) {
|
|
67
76
|
return this._client.post('/api/v1/subscriptions', { body, ...options });
|
|
68
77
|
}
|
|
69
78
|
/**
|
|
70
|
-
*
|
|
79
|
+
* Transfers a subscription to a different resource ID. Used for multi-resource
|
|
80
|
+
* products where subscriptions apply to specific entities like websites or apps.
|
|
71
81
|
*/
|
|
72
82
|
transfer(id, body, options) {
|
|
73
83
|
return this._client.post(path `/api/v1/subscriptions/${id}/transfer`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;O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,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AA4tHD,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC"}
|
package/resources/v1/usage.d.mts
CHANGED
|
@@ -3,11 +3,12 @@ import { APIPromise } from "../../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
4
|
export declare class Usage extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves historical usage data for a customer's metered feature over time.
|
|
7
7
|
*/
|
|
8
8
|
history(featureID: string, params: UsageHistoryParams, options?: RequestOptions): APIPromise<UsageHistoryResponse>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Reports usage measurements for metered features. The reported usage is used to
|
|
11
|
+
* track, limit, and bill customer consumption.
|
|
11
12
|
*/
|
|
12
13
|
report(body: UsageReportParams, options?: RequestOptions): APIPromise<UsageReportResponse>;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC
|
|
1
|
+
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,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,CAAC;QAElB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAE1D;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;KAClC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/v1/usage.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { APIPromise } from "../../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
4
|
export declare class Usage extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves historical usage data for a customer's metered feature over time.
|
|
7
7
|
*/
|
|
8
8
|
history(featureID: string, params: UsageHistoryParams, options?: RequestOptions): APIPromise<UsageHistoryResponse>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Reports usage measurements for metered features. The reported usage is used to
|
|
11
|
+
* track, limit, and bill customer consumption.
|
|
11
12
|
*/
|
|
12
13
|
report(body: UsageReportParams, options?: RequestOptions): APIPromise<UsageReportResponse>;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc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ACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAE1D;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;KAClC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/v1/usage.js
CHANGED
|
@@ -6,14 +6,15 @@ const resource_1 = require("../../core/resource.js");
|
|
|
6
6
|
const path_1 = require("../../internal/utils/path.js");
|
|
7
7
|
class Usage extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Retrieves historical usage data for a customer's metered feature over time.
|
|
10
10
|
*/
|
|
11
11
|
history(featureID, params, options) {
|
|
12
12
|
const { customerId, ...query } = params;
|
|
13
13
|
return this._client.get((0, path_1.path) `/api/v1/usage/${customerId}/history/${featureID}`, { query, ...options });
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Reports usage measurements for metered features. The reported usage is used to
|
|
17
|
+
* track, limit, and bill customer consumption.
|
|
17
18
|
*/
|
|
18
19
|
report(body, options) {
|
|
19
20
|
return this._client.post('/api/v1/usage', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAiB,EACjB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,YAAY,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAiB,EACjB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,YAAY,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AApBD,sBAoBC"}
|
package/resources/v1/usage.mjs
CHANGED
|
@@ -3,14 +3,15 @@ import { APIResource } from "../../core/resource.mjs";
|
|
|
3
3
|
import { path } from "../../internal/utils/path.mjs";
|
|
4
4
|
export class Usage extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves historical usage data for a customer's metered feature over time.
|
|
7
7
|
*/
|
|
8
8
|
history(featureID, params, options) {
|
|
9
9
|
const { customerId, ...query } = params;
|
|
10
10
|
return this._client.get(path `/api/v1/usage/${customerId}/history/${featureID}`, { query, ...options });
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Reports usage measurements for metered features. The reported usage is used to
|
|
14
|
+
* track, limit, and bill customer consumption.
|
|
14
15
|
*/
|
|
15
16
|
report(body, options) {
|
|
16
17
|
return this._client.post('/api/v1/usage', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAiB,EACjB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,UAAU,YAAY,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,OAAO,CACL,SAAiB,EACjB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,UAAU,YAAY,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF"}
|
package/resources/v1/v1.d.mts
CHANGED
|
@@ -3,10 +3,12 @@ import * as CouponsAPI from "./coupons.mjs";
|
|
|
3
3
|
import { Coupon, CouponCreateParams, CouponListParams, CouponListResponse, CouponListResponsesMyCursorIDPage, Coupons } from "./coupons.mjs";
|
|
4
4
|
import * as EventsAPI from "./events.mjs";
|
|
5
5
|
import { EventReportParams, EventReportResponse, Events } from "./events.mjs";
|
|
6
|
+
import * as ProductsAPI from "./products.mjs";
|
|
7
|
+
import { ProductListProductsParams, ProductListProductsResponse, ProductListProductsResponsesMyCursorIDPage, Products } from "./products.mjs";
|
|
6
8
|
import * as UsageAPI from "./usage.mjs";
|
|
7
9
|
import { Usage, UsageHistoryParams, UsageHistoryResponse, UsageReportParams, UsageReportResponse } from "./usage.mjs";
|
|
8
10
|
import * as CustomersAPI from "./customers/customers.mjs";
|
|
9
|
-
import { CustomerImportParams, CustomerImportResponse, CustomerListParams, CustomerListResponse, CustomerListResponsesMyCursorIDPage, CustomerProvisionParams, CustomerResponse, CustomerUpdateParams, Customers } from "./customers/customers.mjs";
|
|
11
|
+
import { CustomerImportParams, CustomerImportResponse, CustomerListParams, CustomerListResourcesParams, CustomerListResourcesResponse, CustomerListResourcesResponsesMyCursorIDPage, CustomerListResponse, CustomerListResponsesMyCursorIDPage, CustomerProvisionParams, CustomerResponse, CustomerUpdateParams, Customers } from "./customers/customers.mjs";
|
|
10
12
|
import * as SubscriptionsAPI from "./subscriptions/subscriptions.mjs";
|
|
11
13
|
import { Subscription, SubscriptionCancelParams, SubscriptionDelegateParams, SubscriptionImportParams, SubscriptionImportResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesMyCursorIDPage, SubscriptionMigrateParams, SubscriptionPreviewParams, SubscriptionPreviewResponse, SubscriptionProvisionParams, SubscriptionProvisionResponse, SubscriptionTransferParams, SubscriptionUpdateParams, Subscriptions } from "./subscriptions/subscriptions.mjs";
|
|
12
14
|
export declare class V1 extends APIResource {
|
|
@@ -15,12 +17,14 @@ export declare class V1 extends APIResource {
|
|
|
15
17
|
coupons: CouponsAPI.Coupons;
|
|
16
18
|
events: EventsAPI.Events;
|
|
17
19
|
usage: UsageAPI.Usage;
|
|
20
|
+
products: ProductsAPI.Products;
|
|
18
21
|
}
|
|
19
22
|
export declare namespace V1 {
|
|
20
|
-
export { Customers as Customers, type CustomerResponse as CustomerResponse, type CustomerListResponse as CustomerListResponse, type CustomerImportResponse as CustomerImportResponse, type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerImportParams as CustomerImportParams, type CustomerProvisionParams as CustomerProvisionParams, };
|
|
23
|
+
export { Customers as Customers, type CustomerResponse as CustomerResponse, type CustomerListResponse as CustomerListResponse, type CustomerImportResponse as CustomerImportResponse, type CustomerListResourcesResponse as CustomerListResourcesResponse, type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage, type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerImportParams as CustomerImportParams, type CustomerListResourcesParams as CustomerListResourcesParams, type CustomerProvisionParams as CustomerProvisionParams, };
|
|
21
24
|
export { Subscriptions as Subscriptions, type Subscription as Subscription, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionImportResponse as SubscriptionImportResponse, type SubscriptionPreviewResponse as SubscriptionPreviewResponse, type SubscriptionProvisionResponse as SubscriptionProvisionResponse, type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionDelegateParams as SubscriptionDelegateParams, type SubscriptionImportParams as SubscriptionImportParams, type SubscriptionMigrateParams as SubscriptionMigrateParams, type SubscriptionPreviewParams as SubscriptionPreviewParams, type SubscriptionProvisionParams as SubscriptionProvisionParams, type SubscriptionTransferParams as SubscriptionTransferParams, };
|
|
22
25
|
export { Coupons as Coupons, type Coupon as Coupon, type CouponListResponse as CouponListResponse, type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponListParams as CouponListParams, };
|
|
23
26
|
export { Events as Events, type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams, };
|
|
24
27
|
export { Usage as Usage, type UsageHistoryResponse as UsageHistoryResponse, type UsageReportResponse as UsageReportResponse, type UsageHistoryParams as UsageHistoryParams, type UsageReportParams as UsageReportParams, };
|
|
28
|
+
export { Products as Products, type ProductListProductsResponse as ProductListProductsResponse, type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage, type ProductListProductsParams as ProductListProductsParams, };
|
|
25
29
|
}
|
|
26
30
|
//# sourceMappingURL=v1.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iCAAiC,EACjC,OAAO,EACR;OACM,KAAK,SAAS;OACd,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,EAAE;OAClD,KAAK,QAAQ;OACb,EACL,KAAK,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,mCAAmC,EACnC,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACV;OACM,KAAK,gBAAgB;OACrB,EACL,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,uCAAuC,EACvC,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,aAAa,EACd;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAC7E,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IACjG,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IACnE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;
|
|
1
|
+
{"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBA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GAC5C,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
package/resources/v1/v1.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import * as CouponsAPI from "./coupons.js";
|
|
|
3
3
|
import { Coupon, CouponCreateParams, CouponListParams, CouponListResponse, CouponListResponsesMyCursorIDPage, Coupons } from "./coupons.js";
|
|
4
4
|
import * as EventsAPI from "./events.js";
|
|
5
5
|
import { EventReportParams, EventReportResponse, Events } from "./events.js";
|
|
6
|
+
import * as ProductsAPI from "./products.js";
|
|
7
|
+
import { ProductListProductsParams, ProductListProductsResponse, ProductListProductsResponsesMyCursorIDPage, Products } from "./products.js";
|
|
6
8
|
import * as UsageAPI from "./usage.js";
|
|
7
9
|
import { Usage, UsageHistoryParams, UsageHistoryResponse, UsageReportParams, UsageReportResponse } from "./usage.js";
|
|
8
10
|
import * as CustomersAPI from "./customers/customers.js";
|
|
9
|
-
import { CustomerImportParams, CustomerImportResponse, CustomerListParams, CustomerListResponse, CustomerListResponsesMyCursorIDPage, CustomerProvisionParams, CustomerResponse, CustomerUpdateParams, Customers } from "./customers/customers.js";
|
|
11
|
+
import { CustomerImportParams, CustomerImportResponse, CustomerListParams, CustomerListResourcesParams, CustomerListResourcesResponse, CustomerListResourcesResponsesMyCursorIDPage, CustomerListResponse, CustomerListResponsesMyCursorIDPage, CustomerProvisionParams, CustomerResponse, CustomerUpdateParams, Customers } from "./customers/customers.js";
|
|
10
12
|
import * as SubscriptionsAPI from "./subscriptions/subscriptions.js";
|
|
11
13
|
import { Subscription, SubscriptionCancelParams, SubscriptionDelegateParams, SubscriptionImportParams, SubscriptionImportResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesMyCursorIDPage, SubscriptionMigrateParams, SubscriptionPreviewParams, SubscriptionPreviewResponse, SubscriptionProvisionParams, SubscriptionProvisionResponse, SubscriptionTransferParams, SubscriptionUpdateParams, Subscriptions } from "./subscriptions/subscriptions.js";
|
|
12
14
|
export declare class V1 extends APIResource {
|
|
@@ -15,12 +17,14 @@ export declare class V1 extends APIResource {
|
|
|
15
17
|
coupons: CouponsAPI.Coupons;
|
|
16
18
|
events: EventsAPI.Events;
|
|
17
19
|
usage: UsageAPI.Usage;
|
|
20
|
+
products: ProductsAPI.Products;
|
|
18
21
|
}
|
|
19
22
|
export declare namespace V1 {
|
|
20
|
-
export { Customers as Customers, type CustomerResponse as CustomerResponse, type CustomerListResponse as CustomerListResponse, type CustomerImportResponse as CustomerImportResponse, type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerImportParams as CustomerImportParams, type CustomerProvisionParams as CustomerProvisionParams, };
|
|
23
|
+
export { Customers as Customers, type CustomerResponse as CustomerResponse, type CustomerListResponse as CustomerListResponse, type CustomerImportResponse as CustomerImportResponse, type CustomerListResourcesResponse as CustomerListResourcesResponse, type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage, type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerImportParams as CustomerImportParams, type CustomerListResourcesParams as CustomerListResourcesParams, type CustomerProvisionParams as CustomerProvisionParams, };
|
|
21
24
|
export { Subscriptions as Subscriptions, type Subscription as Subscription, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionImportResponse as SubscriptionImportResponse, type SubscriptionPreviewResponse as SubscriptionPreviewResponse, type SubscriptionProvisionResponse as SubscriptionProvisionResponse, type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionDelegateParams as SubscriptionDelegateParams, type SubscriptionImportParams as SubscriptionImportParams, type SubscriptionMigrateParams as SubscriptionMigrateParams, type SubscriptionPreviewParams as SubscriptionPreviewParams, type SubscriptionProvisionParams as SubscriptionProvisionParams, type SubscriptionTransferParams as SubscriptionTransferParams, };
|
|
22
25
|
export { Coupons as Coupons, type Coupon as Coupon, type CouponListResponse as CouponListResponse, type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponListParams as CouponListParams, };
|
|
23
26
|
export { Events as Events, type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams, };
|
|
24
27
|
export { Usage as Usage, type UsageHistoryResponse as UsageHistoryResponse, type UsageReportResponse as UsageReportResponse, type UsageHistoryParams as UsageHistoryParams, type UsageReportParams as UsageReportParams, };
|
|
28
|
+
export { Products as Products, type ProductListProductsResponse as ProductListProductsResponse, type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage, type ProductListProductsParams as ProductListProductsParams, };
|
|
25
29
|
}
|
|
26
30
|
//# sourceMappingURL=v1.d.ts.map
|
package/resources/v1/v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iCAAiC,EACjC,OAAO,EACR;OACM,KAAK,SAAS;OACd,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,EAAE;OAClD,KAAK,QAAQ;OACb,EACL,KAAK,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,mCAAmC,EACnC,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACV;OACM,KAAK,gBAAgB;OACrB,EACL,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,uCAAuC,EACvC,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,aAAa,EACd;AAED,qBAAa,EAAG,SAAQ,WAAW;IACjC,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAC7E,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IACjG,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IACnE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iCAAiC,EACjC,OAAO,EACR;OACM,KAAK,SAAS;OACd,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,EAAE;OAClD,KAAK,WAAW;OAChB,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,0CAA0C,EAC1C,QAAQ,EACT;OACM,KAAK,QAAQ;OACb,EACL,KAAK,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB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,EAC7F,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
package/resources/v1/v1.js
CHANGED
|
@@ -8,6 +8,8 @@ const CouponsAPI = tslib_1.__importStar(require("./coupons.js"));
|
|
|
8
8
|
const coupons_1 = require("./coupons.js");
|
|
9
9
|
const EventsAPI = tslib_1.__importStar(require("./events.js"));
|
|
10
10
|
const events_1 = require("./events.js");
|
|
11
|
+
const ProductsAPI = tslib_1.__importStar(require("./products.js"));
|
|
12
|
+
const products_1 = require("./products.js");
|
|
11
13
|
const UsageAPI = tslib_1.__importStar(require("./usage.js"));
|
|
12
14
|
const usage_1 = require("./usage.js");
|
|
13
15
|
const CustomersAPI = tslib_1.__importStar(require("./customers/customers.js"));
|
|
@@ -22,6 +24,7 @@ class V1 extends resource_1.APIResource {
|
|
|
22
24
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
23
25
|
this.events = new EventsAPI.Events(this._client);
|
|
24
26
|
this.usage = new UsageAPI.Usage(this._client);
|
|
27
|
+
this.products = new ProductsAPI.Products(this._client);
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
exports.V1 = V1;
|
|
@@ -30,4 +33,5 @@ V1.Subscriptions = subscriptions_1.Subscriptions;
|
|
|
30
33
|
V1.Coupons = coupons_1.Coupons;
|
|
31
34
|
V1.Events = events_1.Events;
|
|
32
35
|
V1.Usage = usage_1.Usage;
|
|
36
|
+
V1.Products = products_1.Products;
|
|
33
37
|
//# sourceMappingURL=v1.js.map
|
package/resources/v1/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,0CAOmB;AACnB,+DAAsC;AACtC,wCAA0E;AAC1E,6DAAoC;AACpC,sCAMiB;AACjB,+EAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,0CAOmB;AACnB,+DAAsC;AACtC,wCAA0E;AAC1E,mEAA0C;AAC1C,4CAKoB;AACpB,6DAAoC;AACpC,sCAMiB;AACjB,+EAAsD;AACtD,wDAa+B;AAC/B,2FAAkE;AAClE,oEAiBuC;AAEvC,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAPD,gBAOC;AAED,EAAE,CAAC,SAAS,GAAG,qBAAS,CAAC;AACzB,EAAE,CAAC,aAAa,GAAG,6BAAa,CAAC;AACjC,EAAE,CAAC,OAAO,GAAG,iBAAO,CAAC;AACrB,EAAE,CAAC,MAAM,GAAG,eAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,aAAK,CAAC;AACjB,EAAE,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
package/resources/v1/v1.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import * as CouponsAPI from "./coupons.mjs";
|
|
|
4
4
|
import { Coupons, } from "./coupons.mjs";
|
|
5
5
|
import * as EventsAPI from "./events.mjs";
|
|
6
6
|
import { Events } from "./events.mjs";
|
|
7
|
+
import * as ProductsAPI from "./products.mjs";
|
|
8
|
+
import { Products, } from "./products.mjs";
|
|
7
9
|
import * as UsageAPI from "./usage.mjs";
|
|
8
10
|
import { Usage, } from "./usage.mjs";
|
|
9
11
|
import * as CustomersAPI from "./customers/customers.mjs";
|
|
@@ -18,6 +20,7 @@ export class V1 extends APIResource {
|
|
|
18
20
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
19
21
|
this.events = new EventsAPI.Events(this._client);
|
|
20
22
|
this.usage = new UsageAPI.Usage(this._client);
|
|
23
|
+
this.products = new ProductsAPI.Products(this._client);
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
V1.Customers = Customers;
|
|
@@ -25,4 +28,5 @@ V1.Subscriptions = Subscriptions;
|
|
|
25
28
|
V1.Coupons = Coupons;
|
|
26
29
|
V1.Events = Events;
|
|
27
30
|
V1.Usage = Usage;
|
|
31
|
+
V1.Products = Products;
|
|
28
32
|
//# sourceMappingURL=v1.mjs.map
|
package/resources/v1/v1.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAML,OAAO,GACR;OACM,KAAK,SAAS;OACd,EAA0C,MAAM,EAAE;OAClD,KAAK,QAAQ;OACb,EACL,KAAK,GAKN;OACM,KAAK,YAAY;OACjB,
|
|
1
|
+
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAML,OAAO,GACR;OACM,KAAK,SAAS;OACd,EAA0C,MAAM,EAAE;OAClD,KAAK,WAAW;OAChB,EAIL,QAAQ,GACT;OACM,KAAK,QAAQ;OACb,EACL,KAAK,GAKN;OACM,KAAK,YAAY;OACjB,EAYL,SAAS,GACV;OACM,KAAK,gBAAgB;OACrB,EAgBL,aAAa,GACd;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAED,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AACzB,EAAE,CAAC,aAAa,GAAG,aAAa,CAAC;AACjC,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC;AACrB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC;AACjB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
+
import * as qs from './internal/qs';
|
|
14
15
|
import { VERSION } from './version';
|
|
15
16
|
import * as Errors from './core/error';
|
|
16
17
|
import * as Pagination from './core/pagination';
|
|
@@ -129,7 +130,7 @@ export class Stigg {
|
|
|
129
130
|
* API Client for interfacing with the Stigg API.
|
|
130
131
|
*
|
|
131
132
|
* @param {string | undefined} [opts.apiKey=process.env['STIGG_API_KEY'] ?? undefined]
|
|
132
|
-
* @param {string} [opts.baseURL=process.env['STIGG_BASE_URL'] ?? https://api.
|
|
133
|
+
* @param {string} [opts.baseURL=process.env['STIGG_BASE_URL'] ?? https://api.stigg.io] - Override the default base URL for the API.
|
|
133
134
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
134
135
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
135
136
|
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -151,7 +152,7 @@ export class Stigg {
|
|
|
151
152
|
const options: ClientOptions = {
|
|
152
153
|
apiKey,
|
|
153
154
|
...opts,
|
|
154
|
-
baseURL: baseURL || `https://api.
|
|
155
|
+
baseURL: baseURL || `https://api.stigg.io`,
|
|
155
156
|
};
|
|
156
157
|
|
|
157
158
|
this.baseURL = options.baseURL!;
|
|
@@ -197,7 +198,7 @@ export class Stigg {
|
|
|
197
198
|
* Check whether the base URL is set to its default.
|
|
198
199
|
*/
|
|
199
200
|
#baseURLOverridden(): boolean {
|
|
200
|
-
return this.baseURL !== 'https://api.
|
|
201
|
+
return this.baseURL !== 'https://api.stigg.io';
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
protected defaultQuery(): Record<string, string | undefined> | undefined {
|
|
@@ -212,24 +213,8 @@ export class Stigg {
|
|
|
212
213
|
return buildHeaders([{ 'X-API-KEY': this.apiKey }]);
|
|
213
214
|
}
|
|
214
215
|
|
|
215
|
-
/**
|
|
216
|
-
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
217
|
-
*/
|
|
218
216
|
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
219
|
-
return
|
|
220
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
221
|
-
.map(([key, value]) => {
|
|
222
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
223
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
224
|
-
}
|
|
225
|
-
if (value === null) {
|
|
226
|
-
return `${encodeURIComponent(key)}=`;
|
|
227
|
-
}
|
|
228
|
-
throw new Errors.StiggError(
|
|
229
|
-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
230
|
-
);
|
|
231
|
-
})
|
|
232
|
-
.join('&');
|
|
217
|
+
return qs.stringify(query, { arrayFormat: 'comma' });
|
|
233
218
|
}
|
|
234
219
|
|
|
235
220
|
private getUserAgent(): string {
|
|
@@ -450,7 +435,7 @@ export class Stigg {
|
|
|
450
435
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
451
436
|
|
|
452
437
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
453
|
-
const errJSON = safeJSON(errText);
|
|
438
|
+
const errJSON = safeJSON(errText) as any;
|
|
454
439
|
const errMessage = errJSON ? undefined : errText;
|
|
455
440
|
|
|
456
441
|
loggerFor(this).debug(
|
|
@@ -487,9 +472,14 @@ export class Stigg {
|
|
|
487
472
|
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
488
473
|
path: string,
|
|
489
474
|
Page: new (...args: any[]) => PageClass,
|
|
490
|
-
opts?: RequestOptions
|
|
475
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
491
476
|
): Pagination.PagePromise<PageClass, Item> {
|
|
492
|
-
return this.requestAPIList(
|
|
477
|
+
return this.requestAPIList(
|
|
478
|
+
Page,
|
|
479
|
+
opts && 'then' in opts ?
|
|
480
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
481
|
+
: { method: 'get', path, ...opts },
|
|
482
|
+
);
|
|
493
483
|
}
|
|
494
484
|
|
|
495
485
|
requestAPIList<
|
|
@@ -497,7 +487,7 @@ export class Stigg {
|
|
|
497
487
|
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
498
488
|
>(
|
|
499
489
|
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
500
|
-
options: FinalRequestOptions
|
|
490
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
501
491
|
): Pagination.PagePromise<PageClass, Item> {
|
|
502
492
|
const request = this.makeRequest(options, null, undefined);
|
|
503
493
|
return new Pagination.PagePromise<PageClass, Item>(this as any as Stigg, request, Page);
|
|
@@ -510,9 +500,10 @@ export class Stigg {
|
|
|
510
500
|
controller: AbortController,
|
|
511
501
|
): Promise<Response> {
|
|
512
502
|
const { signal, method, ...options } = init || {};
|
|
513
|
-
|
|
503
|
+
const abort = this._makeAbort(controller);
|
|
504
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
514
505
|
|
|
515
|
-
const timeout = setTimeout(
|
|
506
|
+
const timeout = setTimeout(abort, ms);
|
|
516
507
|
|
|
517
508
|
const isReadableBody =
|
|
518
509
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -679,6 +670,12 @@ export class Stigg {
|
|
|
679
670
|
return headers.values;
|
|
680
671
|
}
|
|
681
672
|
|
|
673
|
+
private _makeAbort(controller: AbortController) {
|
|
674
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
675
|
+
// would capture all request options, and cause a memory leak.
|
|
676
|
+
return () => controller.abort();
|
|
677
|
+
}
|
|
678
|
+
|
|
682
679
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
683
680
|
bodyHeaders: HeadersLike;
|
|
684
681
|
body: BodyInit | undefined;
|
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Stigg, props: APIResponseP
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
10
|
+
|
|
11
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Format } from './types';
|
|
2
|
+
|
|
3
|
+
export const default_format: Format = 'RFC3986';
|
|
4
|
+
export const default_formatter = (v: PropertyKey) => String(v);
|
|
5
|
+
export const formatters: Record<Format, (str: PropertyKey) => string> = {
|
|
6
|
+
RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
|
|
7
|
+
RFC3986: default_formatter,
|
|
8
|
+
};
|
|
9
|
+
export const RFC1738 = 'RFC1738';
|
|
10
|
+
export const RFC3986 = 'RFC3986';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default_format, formatters, RFC1738, RFC3986 } from './formats';
|
|
2
|
+
|
|
3
|
+
const formats = {
|
|
4
|
+
formatters,
|
|
5
|
+
RFC1738,
|
|
6
|
+
RFC3986,
|
|
7
|
+
default: default_format,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { stringify } from './stringify';
|
|
11
|
+
export { formats };
|
|
12
|
+
|
|
13
|
+
export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';
|