@usehercules/sdk 1.1.0 → 1.3.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 +125 -0
- package/README.md +14 -20
- package/client.d.mts +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -3
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -4
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -4
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -4
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -4
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +3 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/pay/coupons.d.mts +156 -0
- package/resources/beta/pay/coupons.d.mts.map +1 -0
- package/resources/beta/pay/coupons.d.ts +156 -0
- package/resources/beta/pay/coupons.d.ts.map +1 -0
- package/resources/beta/pay/coupons.js +51 -0
- package/resources/beta/pay/coupons.js.map +1 -0
- package/resources/beta/pay/coupons.mjs +47 -0
- package/resources/beta/pay/coupons.mjs.map +1 -0
- package/resources/beta/pay/customers.d.mts +160 -0
- package/resources/beta/pay/customers.d.mts.map +1 -0
- package/resources/beta/pay/customers.d.ts +160 -0
- package/resources/beta/pay/customers.d.ts.map +1 -0
- package/resources/beta/pay/customers.js +60 -0
- package/resources/beta/pay/customers.js.map +1 -0
- package/resources/beta/pay/customers.mjs +56 -0
- package/resources/beta/pay/customers.mjs.map +1 -0
- package/resources/beta/pay/entitlements.d.mts +94 -0
- package/resources/beta/pay/entitlements.d.mts.map +1 -0
- package/resources/beta/pay/entitlements.d.ts +94 -0
- package/resources/beta/pay/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/entitlements.js +42 -0
- package/resources/beta/pay/entitlements.js.map +1 -0
- package/resources/beta/pay/entitlements.mjs +38 -0
- package/resources/beta/pay/entitlements.mjs.map +1 -0
- package/resources/beta/pay/index.d.mts +6 -0
- package/resources/beta/pay/index.d.mts.map +1 -0
- package/resources/beta/pay/index.d.ts +6 -0
- package/resources/beta/pay/index.d.ts.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.js +5 -5
- package/resources/beta/pay/index.js.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.mjs +2 -2
- package/resources/beta/pay/index.mjs.map +1 -0
- package/resources/beta/{subscriptions/subscriptions.d.mts → pay/pay.d.mts} +48 -32
- package/resources/beta/pay/pay.d.mts.map +1 -0
- package/resources/beta/{subscriptions/subscriptions.d.ts → pay/pay.d.ts} +48 -32
- package/resources/beta/pay/pay.d.ts.map +1 -0
- package/resources/beta/pay/pay.js +54 -0
- package/resources/beta/pay/pay.js.map +1 -0
- package/resources/beta/pay/pay.mjs +49 -0
- package/resources/beta/pay/pay.mjs.map +1 -0
- package/resources/beta/pay/products/entitlements.d.mts +53 -0
- package/resources/beta/pay/products/entitlements.d.mts.map +1 -0
- package/resources/beta/pay/products/entitlements.d.ts +53 -0
- package/resources/beta/pay/products/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/products/entitlements.js +38 -0
- package/resources/beta/pay/products/entitlements.js.map +1 -0
- package/resources/beta/pay/products/entitlements.mjs +34 -0
- package/resources/beta/pay/products/entitlements.mjs.map +1 -0
- package/resources/beta/pay/products/index.d.mts +3 -0
- package/resources/beta/pay/products/index.d.mts.map +1 -0
- package/resources/beta/pay/products/index.d.ts +3 -0
- package/resources/beta/pay/products/index.d.ts.map +1 -0
- package/resources/beta/{subscriptions/plans → pay/products}/index.js +3 -3
- package/resources/beta/pay/products/index.js.map +1 -0
- package/resources/beta/{subscriptions/plans → pay/products}/index.mjs +1 -1
- package/resources/beta/pay/products/index.mjs.map +1 -0
- package/resources/beta/pay/products/products.d.mts +152 -0
- package/resources/beta/pay/products/products.d.mts.map +1 -0
- package/resources/beta/pay/products/products.d.ts +152 -0
- package/resources/beta/pay/products/products.d.ts.map +1 -0
- package/resources/beta/pay/products/products.js +57 -0
- package/resources/beta/pay/products/products.js.map +1 -0
- package/resources/beta/pay/products/products.mjs +52 -0
- package/resources/beta/pay/products/products.mjs.map +1 -0
- package/resources/beta/pay/products.d.mts +2 -0
- package/resources/beta/pay/products.d.mts.map +1 -0
- package/resources/beta/pay/products.d.ts +2 -0
- package/resources/beta/pay/products.d.ts.map +1 -0
- package/resources/beta/{subscriptions/plans.js → pay/products.js} +2 -2
- package/resources/beta/pay/products.js.map +1 -0
- package/resources/beta/{subscriptions.mjs → pay/products.mjs} +2 -2
- package/resources/beta/pay/products.mjs.map +1 -0
- package/resources/beta/pay.d.mts +2 -0
- package/resources/beta/pay.d.mts.map +1 -0
- package/resources/beta/pay.d.ts +2 -0
- package/resources/beta/pay.d.ts.map +1 -0
- package/resources/beta/{subscriptions.js → pay.js} +2 -2
- package/resources/beta/pay.js.map +1 -0
- package/resources/beta/{subscriptions/plans.mjs → pay.mjs} +2 -2
- package/resources/beta/pay.mjs.map +1 -0
- package/src/client.ts +6 -4
- package/src/resources/beta/beta.ts +18 -18
- package/src/resources/beta/index.ts +8 -8
- package/src/resources/beta/pay/coupons.ts +218 -0
- package/src/resources/beta/pay/customers.ts +229 -0
- package/src/resources/beta/pay/entitlements.ts +135 -0
- package/src/resources/beta/{subscriptions → pay}/index.ts +15 -17
- package/src/resources/beta/{subscriptions/subscriptions.ts → pay/pay.ts} +70 -59
- package/src/resources/beta/{subscriptions/plans → pay/products}/entitlements.ts +26 -21
- package/src/resources/beta/{subscriptions/plans → pay/products}/index.ts +9 -9
- package/src/resources/beta/pay/products/products.ts +224 -0
- package/src/resources/beta/{subscriptions.ts → pay/products.ts} +1 -1
- package/src/resources/beta/{subscriptions/plans.ts → pay.ts} +1 -1
- 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
- package/resources/beta/subscriptions/coupons.d.mts +0 -151
- package/resources/beta/subscriptions/coupons.d.mts.map +0 -1
- package/resources/beta/subscriptions/coupons.d.ts +0 -151
- package/resources/beta/subscriptions/coupons.d.ts.map +0 -1
- package/resources/beta/subscriptions/coupons.js +0 -51
- package/resources/beta/subscriptions/coupons.js.map +0 -1
- package/resources/beta/subscriptions/coupons.mjs +0 -47
- package/resources/beta/subscriptions/coupons.mjs.map +0 -1
- package/resources/beta/subscriptions/customers.d.mts +0 -93
- package/resources/beta/subscriptions/customers.d.mts.map +0 -1
- package/resources/beta/subscriptions/customers.d.ts +0 -93
- package/resources/beta/subscriptions/customers.d.ts.map +0 -1
- package/resources/beta/subscriptions/customers.js +0 -57
- package/resources/beta/subscriptions/customers.js.map +0 -1
- package/resources/beta/subscriptions/customers.mjs +0 -53
- package/resources/beta/subscriptions/customers.mjs.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.mts +0 -70
- package/resources/beta/subscriptions/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.ts +0 -70
- package/resources/beta/subscriptions/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/entitlements.js +0 -38
- package/resources/beta/subscriptions/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/entitlements.mjs +0 -34
- package/resources/beta/subscriptions/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/index.d.mts +0 -6
- package/resources/beta/subscriptions/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/index.d.ts +0 -6
- package/resources/beta/subscriptions/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/index.js.map +0 -1
- package/resources/beta/subscriptions/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.mts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.ts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.js +0 -34
- package/resources/beta/subscriptions/plans/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.mjs +0 -30
- package/resources/beta/subscriptions/plans/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.mts +0 -3
- package/resources/beta/subscriptions/plans/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.ts +0 -3
- package/resources/beta/subscriptions/plans/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/index.js.map +0 -1
- package/resources/beta/subscriptions/plans/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.mts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.ts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.js +0 -49
- package/resources/beta/subscriptions/plans/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans/plans.mjs +0 -44
- package/resources/beta/subscriptions/plans/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/plans.d.mts +0 -2
- package/resources/beta/subscriptions/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans.d.ts +0 -2
- package/resources/beta/subscriptions/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.js +0 -47
- package/resources/beta/subscriptions/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions/subscriptions.mjs +0 -42
- package/resources/beta/subscriptions/subscriptions.mjs.map +0 -1
- package/resources/beta/subscriptions.d.mts +0 -2
- package/resources/beta/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions.d.ts +0 -2
- package/resources/beta/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions.mjs.map +0 -1
- package/src/resources/beta/subscriptions/coupons.ts +0 -221
- package/src/resources/beta/subscriptions/customers.ts +0 -168
- package/src/resources/beta/subscriptions/entitlements.ts +0 -113
- package/src/resources/beta/subscriptions/plans/plans.ts +0 -159
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Entitlements = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
+
class Entitlements extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new feature entitlement. Entitlements represent features or
|
|
11
|
+
* capabilities in your app that can be gated by subscription. After creating an
|
|
12
|
+
* entitlement, attach it to one or more plans to grant access to customers on
|
|
13
|
+
* those plans.
|
|
14
|
+
*/
|
|
15
|
+
create(body, options) {
|
|
16
|
+
return this._client.post('/v1/pay/entitlements', { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates an existing entitlement. Use this to modify the name or deactivate the
|
|
20
|
+
* entitlement. The key cannot be changed after creation.
|
|
21
|
+
*/
|
|
22
|
+
update(entitlementID, body = {}, options) {
|
|
23
|
+
return this._client.patch((0, path_1.path) `/v1/pay/entitlements/${entitlementID}`, { body, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves a paginated list of all entitlements. Entitlements represent features
|
|
27
|
+
* or capabilities in your app that can be gated by subscription. Use the key
|
|
28
|
+
* filter to find a specific entitlement by its key.
|
|
29
|
+
*/
|
|
30
|
+
list(query = {}, options) {
|
|
31
|
+
return this._client.getAPIList('/v1/pay/entitlements', (pagination_1.CursorIDPage), { query, ...options });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves an entitlement by ID. Returns the entitlement object including its
|
|
35
|
+
* lookup key and active status.
|
|
36
|
+
*/
|
|
37
|
+
get(entitlementID, options) {
|
|
38
|
+
return this._client.get((0, path_1.path) `/v1/pay/entitlements/${entitlementID}`, options);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.Entitlements = Entitlements;
|
|
42
|
+
//# sourceMappingURL=entitlements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.js","sourceRoot":"","sources":["../../../src/resources/beta/pay/entitlements.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA8F;AAE9F,0DAAoD;AAEpD,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;OAKG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,wBAAwB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,yBAAyB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,aAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;CACF;AA1CD,oCA0CC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { CursorIDPage } from "../../../core/pagination.mjs";
|
|
4
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
+
export class Entitlements extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new feature entitlement. Entitlements represent features or
|
|
8
|
+
* capabilities in your app that can be gated by subscription. After creating an
|
|
9
|
+
* entitlement, attach it to one or more plans to grant access to customers on
|
|
10
|
+
* those plans.
|
|
11
|
+
*/
|
|
12
|
+
create(body, options) {
|
|
13
|
+
return this._client.post('/v1/pay/entitlements', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Updates an existing entitlement. Use this to modify the name or deactivate the
|
|
17
|
+
* entitlement. The key cannot be changed after creation.
|
|
18
|
+
*/
|
|
19
|
+
update(entitlementID, body = {}, options) {
|
|
20
|
+
return this._client.patch(path `/v1/pay/entitlements/${entitlementID}`, { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a paginated list of all entitlements. Entitlements represent features
|
|
24
|
+
* or capabilities in your app that can be gated by subscription. Use the key
|
|
25
|
+
* filter to find a specific entitlement by its key.
|
|
26
|
+
*/
|
|
27
|
+
list(query = {}, options) {
|
|
28
|
+
return this._client.getAPIList('/v1/pay/entitlements', (CursorIDPage), { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves an entitlement by ID. Returns the entitlement object including its
|
|
32
|
+
* lookup key and active status.
|
|
33
|
+
*/
|
|
34
|
+
get(entitlementID, options) {
|
|
35
|
+
return this._client.get(path `/v1/pay/entitlements/${entitlementID}`, options);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=entitlements.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.mjs","sourceRoot":"","sources":["../../../src/resources/beta/pay/entitlements.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OAEtD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;OAKG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,wBAAwB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,YAAyB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,aAAqB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Coupons, type Coupon, type CouponCreateParams, type CouponUpdateParams, type CouponListParams, type CouponsCursorIDPage, } from "./coupons.mjs";
|
|
2
|
+
export { Customers, type Customer, type CustomerAddress, type CustomerBillingPortalResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomersCursorIDPage, } from "./customers.mjs";
|
|
3
|
+
export { Entitlements, type Entitlement, type EntitlementCreateParams, type EntitlementUpdateParams, type EntitlementListParams, type EntitlementsCursorIDPage, } from "./entitlements.mjs";
|
|
4
|
+
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay.mjs";
|
|
5
|
+
export { Products, type Product, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductsCursorIDPage, } from "./products/index.mjs";
|
|
6
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB;OACM,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAC9B;OACM,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Coupons, type Coupon, type CouponCreateParams, type CouponUpdateParams, type CouponListParams, type CouponsCursorIDPage, } from "./coupons.js";
|
|
2
|
+
export { Customers, type Customer, type CustomerAddress, type CustomerBillingPortalResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomersCursorIDPage, } from "./customers.js";
|
|
3
|
+
export { Entitlements, type Entitlement, type EntitlementCreateParams, type EntitlementUpdateParams, type EntitlementListParams, type EntitlementsCursorIDPage, } from "./entitlements.js";
|
|
4
|
+
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay.js";
|
|
5
|
+
export { Products, type Product, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductsCursorIDPage, } from "./products/index.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/pay/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB;OACM,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAC9B;OACM,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Products = exports.Pay = exports.Entitlements = exports.Customers = exports.Coupons = void 0;
|
|
5
5
|
var coupons_1 = require("./coupons.js");
|
|
6
6
|
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return coupons_1.Coupons; } });
|
|
7
7
|
var customers_1 = require("./customers.js");
|
|
8
8
|
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
|
|
9
9
|
var entitlements_1 = require("./entitlements.js");
|
|
10
10
|
Object.defineProperty(exports, "Entitlements", { enumerable: true, get: function () { return entitlements_1.Entitlements; } });
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "
|
|
11
|
+
var pay_1 = require("./pay.js");
|
|
12
|
+
Object.defineProperty(exports, "Pay", { enumerable: true, get: function () { return pay_1.Pay; } });
|
|
13
|
+
var index_1 = require("./products/index.js");
|
|
14
|
+
Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return index_1.Products; } });
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/pay/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAOmB;AANjB,kGAAA,OAAO,OAAA;AAOT,4CAUqB;AATnB,sGAAA,SAAS,OAAA;AAUX,kDAOwB;AANtB,4GAAA,YAAY,OAAA;AAOd,gCAQe;AAPb,0FAAA,GAAG,OAAA;AAQL,6CAO0B;AANxB,iGAAA,QAAQ,OAAA"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export { Coupons, } from "./coupons.mjs";
|
|
3
3
|
export { Customers, } from "./customers.mjs";
|
|
4
4
|
export { Entitlements, } from "./entitlements.mjs";
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { Pay, } from "./pay.mjs";
|
|
6
|
+
export { Products, } from "./products/index.mjs";
|
|
7
7
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/pay/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,OAAO,GAMR;OACM,EACL,SAAS,GASV;OACM,EACL,YAAY,GAMb;OACM,EACL,GAAG,GAOJ;OACM,EACL,QAAQ,GAMT"}
|
|
@@ -1,44 +1,51 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.mjs";
|
|
2
2
|
import * as CouponsAPI from "./coupons.mjs";
|
|
3
|
-
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams,
|
|
3
|
+
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.mjs";
|
|
4
4
|
import * as CustomersAPI from "./customers.mjs";
|
|
5
5
|
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.mjs";
|
|
6
6
|
import * as EntitlementsAPI from "./entitlements.mjs";
|
|
7
7
|
import { Entitlement, EntitlementCreateParams, EntitlementListParams, EntitlementUpdateParams, Entitlements, EntitlementsCursorIDPage } from "./entitlements.mjs";
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
8
|
+
import * as ProductsAPI from "./products/products.mjs";
|
|
9
|
+
import { Product, ProductCreateParams, ProductListParams, ProductUpdateParams, Products, ProductsCursorIDPage } from "./products/products.mjs";
|
|
10
10
|
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
11
11
|
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class Pay extends APIResource {
|
|
13
13
|
customers: CustomersAPI.Customers;
|
|
14
|
-
|
|
14
|
+
products: ProductsAPI.Products;
|
|
15
15
|
entitlements: EntitlementsAPI.Entitlements;
|
|
16
16
|
coupons: CouponsAPI.Coupons;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Cancels a customer's subscription. By default, the subscription remains active
|
|
19
|
+
* until the end of the current billing period. Set cancellation_timing to
|
|
20
|
+
* 'immediate' to cancel immediately.
|
|
19
21
|
*/
|
|
20
|
-
cancel(body:
|
|
22
|
+
cancel(body: PayCancelParams, options?: RequestOptions): APIPromise<PayCancelResponse>;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* Verifies if a customer has access to a specific feature. Use this to gate
|
|
25
|
+
* features in your app based on the customer's active subscription and the
|
|
26
|
+
* entitlements attached to their product. Hercules recommends calling this before
|
|
27
|
+
* allowing access to premium features.
|
|
23
28
|
*/
|
|
24
|
-
check(body:
|
|
29
|
+
check(body: PayCheckParams, options?: RequestOptions): APIPromise<PayCheckResponse>;
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
32
|
+
* URL to redirect the customer to for payment. After successful payment, the
|
|
33
|
+
* customer is subscribed to the product and gains access to its entitlements.
|
|
27
34
|
*/
|
|
28
|
-
checkout(body:
|
|
35
|
+
checkout(body: PayCheckoutParams, options?: RequestOptions): APIPromise<PayCheckoutResponse>;
|
|
29
36
|
}
|
|
30
37
|
/**
|
|
31
38
|
* Cancel subscription response
|
|
32
39
|
*/
|
|
33
|
-
export interface
|
|
40
|
+
export interface PayCancelResponse {
|
|
34
41
|
/**
|
|
35
42
|
* The subscription ID
|
|
36
43
|
*/
|
|
37
44
|
id: string;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
46
|
+
* When the cancellation takes effect
|
|
40
47
|
*/
|
|
41
|
-
|
|
48
|
+
cancellation_timing: 'immediate' | 'at_billing_period_end';
|
|
42
49
|
/**
|
|
43
50
|
* The subscription status
|
|
44
51
|
*/
|
|
@@ -51,15 +58,15 @@ export interface SubscriptionCancelResponse {
|
|
|
51
58
|
/**
|
|
52
59
|
* Check entitlement response
|
|
53
60
|
*/
|
|
54
|
-
export interface
|
|
61
|
+
export interface PayCheckResponse {
|
|
55
62
|
/**
|
|
56
63
|
* Whether the customer has the entitlement
|
|
57
64
|
*/
|
|
58
65
|
has_entitlement: boolean;
|
|
59
66
|
/**
|
|
60
|
-
* The entitlement
|
|
67
|
+
* The entitlement key that was checked
|
|
61
68
|
*/
|
|
62
|
-
|
|
69
|
+
key: string;
|
|
63
70
|
/**
|
|
64
71
|
* The active entitlement ID if present
|
|
65
72
|
*/
|
|
@@ -68,7 +75,7 @@ export interface SubscriptionCheckResponse {
|
|
|
68
75
|
/**
|
|
69
76
|
* Checkout session response
|
|
70
77
|
*/
|
|
71
|
-
export interface
|
|
78
|
+
export interface PayCheckoutResponse {
|
|
72
79
|
/**
|
|
73
80
|
* The checkout session ID
|
|
74
81
|
*/
|
|
@@ -78,7 +85,7 @@ export interface SubscriptionCheckoutResponse {
|
|
|
78
85
|
*/
|
|
79
86
|
url: string;
|
|
80
87
|
}
|
|
81
|
-
export interface
|
|
88
|
+
export interface PayCancelParams {
|
|
82
89
|
/**
|
|
83
90
|
* The customer ID
|
|
84
91
|
*/
|
|
@@ -88,43 +95,52 @@ export interface SubscriptionCancelParams {
|
|
|
88
95
|
*/
|
|
89
96
|
subscription_id: string;
|
|
90
97
|
/**
|
|
91
|
-
*
|
|
98
|
+
* When to cancel the subscription. Defaults to 'at_billing_period_end' to allow
|
|
99
|
+
* customers to use remaining time.
|
|
92
100
|
*/
|
|
93
|
-
|
|
101
|
+
cancellation_timing?: 'immediate' | 'at_billing_period_end';
|
|
94
102
|
}
|
|
95
|
-
export interface
|
|
103
|
+
export interface PayCheckParams {
|
|
96
104
|
/**
|
|
97
105
|
* The customer ID
|
|
98
106
|
*/
|
|
99
107
|
customer_id: string;
|
|
100
108
|
/**
|
|
101
|
-
* The entitlement
|
|
109
|
+
* The entitlement key to check for access
|
|
102
110
|
*/
|
|
103
|
-
|
|
111
|
+
entitlement_key: string;
|
|
104
112
|
}
|
|
105
|
-
export interface
|
|
113
|
+
export interface PayCheckoutParams {
|
|
106
114
|
/**
|
|
107
115
|
* The customer ID
|
|
108
116
|
*/
|
|
109
117
|
customer_id: string;
|
|
110
118
|
/**
|
|
111
|
-
* The
|
|
119
|
+
* The product ID to subscribe to
|
|
112
120
|
*/
|
|
113
|
-
|
|
121
|
+
product_id: string;
|
|
122
|
+
/**
|
|
123
|
+
* Optional custom ID for the subscription. If not provided, one will be generated.
|
|
124
|
+
*/
|
|
125
|
+
id?: string;
|
|
114
126
|
/**
|
|
115
127
|
* URL to redirect on cancel
|
|
116
128
|
*/
|
|
117
129
|
cancel_url?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Promotion code to apply
|
|
132
|
+
*/
|
|
133
|
+
promotion_code?: string;
|
|
118
134
|
/**
|
|
119
135
|
* URL to redirect on success
|
|
120
136
|
*/
|
|
121
137
|
success_url?: string;
|
|
122
138
|
}
|
|
123
|
-
export declare namespace
|
|
124
|
-
export { type
|
|
139
|
+
export declare namespace Pay {
|
|
140
|
+
export { type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
|
|
125
141
|
export { Customers as Customers, type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
126
|
-
export {
|
|
142
|
+
export { Products as Products, type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
127
143
|
export { Entitlements as Entitlements, type Entitlement as Entitlement, type EntitlementsCursorIDPage as EntitlementsCursorIDPage, type EntitlementCreateParams as EntitlementCreateParams, type EntitlementUpdateParams as EntitlementUpdateParams, type EntitlementListParams as EntitlementListParams, };
|
|
128
|
-
export { Coupons as Coupons, type Coupon as Coupon, type
|
|
144
|
+
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
129
145
|
}
|
|
130
|
-
//# sourceMappingURL=
|
|
146
|
+
//# sourceMappingURL=pay.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/pay.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,QAAQ,EACR,eAAe,EACf,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,qBAAqB,EACtB;OACM,KAAK,eAAe;OACpB,EACL,WAAW,EACX,uBA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AoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -1,44 +1,51 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.js";
|
|
2
2
|
import * as CouponsAPI from "./coupons.js";
|
|
3
|
-
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams,
|
|
3
|
+
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.js";
|
|
4
4
|
import * as CustomersAPI from "./customers.js";
|
|
5
5
|
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.js";
|
|
6
6
|
import * as EntitlementsAPI from "./entitlements.js";
|
|
7
7
|
import { Entitlement, EntitlementCreateParams, EntitlementListParams, EntitlementUpdateParams, Entitlements, EntitlementsCursorIDPage } from "./entitlements.js";
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
8
|
+
import * as ProductsAPI from "./products/products.js";
|
|
9
|
+
import { Product, ProductCreateParams, ProductListParams, ProductUpdateParams, Products, ProductsCursorIDPage } from "./products/products.js";
|
|
10
10
|
import { APIPromise } from "../../../core/api-promise.js";
|
|
11
11
|
import { RequestOptions } from "../../../internal/request-options.js";
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class Pay extends APIResource {
|
|
13
13
|
customers: CustomersAPI.Customers;
|
|
14
|
-
|
|
14
|
+
products: ProductsAPI.Products;
|
|
15
15
|
entitlements: EntitlementsAPI.Entitlements;
|
|
16
16
|
coupons: CouponsAPI.Coupons;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Cancels a customer's subscription. By default, the subscription remains active
|
|
19
|
+
* until the end of the current billing period. Set cancellation_timing to
|
|
20
|
+
* 'immediate' to cancel immediately.
|
|
19
21
|
*/
|
|
20
|
-
cancel(body:
|
|
22
|
+
cancel(body: PayCancelParams, options?: RequestOptions): APIPromise<PayCancelResponse>;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* Verifies if a customer has access to a specific feature. Use this to gate
|
|
25
|
+
* features in your app based on the customer's active subscription and the
|
|
26
|
+
* entitlements attached to their product. Hercules recommends calling this before
|
|
27
|
+
* allowing access to premium features.
|
|
23
28
|
*/
|
|
24
|
-
check(body:
|
|
29
|
+
check(body: PayCheckParams, options?: RequestOptions): APIPromise<PayCheckResponse>;
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
32
|
+
* URL to redirect the customer to for payment. After successful payment, the
|
|
33
|
+
* customer is subscribed to the product and gains access to its entitlements.
|
|
27
34
|
*/
|
|
28
|
-
checkout(body:
|
|
35
|
+
checkout(body: PayCheckoutParams, options?: RequestOptions): APIPromise<PayCheckoutResponse>;
|
|
29
36
|
}
|
|
30
37
|
/**
|
|
31
38
|
* Cancel subscription response
|
|
32
39
|
*/
|
|
33
|
-
export interface
|
|
40
|
+
export interface PayCancelResponse {
|
|
34
41
|
/**
|
|
35
42
|
* The subscription ID
|
|
36
43
|
*/
|
|
37
44
|
id: string;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
46
|
+
* When the cancellation takes effect
|
|
40
47
|
*/
|
|
41
|
-
|
|
48
|
+
cancellation_timing: 'immediate' | 'at_billing_period_end';
|
|
42
49
|
/**
|
|
43
50
|
* The subscription status
|
|
44
51
|
*/
|
|
@@ -51,15 +58,15 @@ export interface SubscriptionCancelResponse {
|
|
|
51
58
|
/**
|
|
52
59
|
* Check entitlement response
|
|
53
60
|
*/
|
|
54
|
-
export interface
|
|
61
|
+
export interface PayCheckResponse {
|
|
55
62
|
/**
|
|
56
63
|
* Whether the customer has the entitlement
|
|
57
64
|
*/
|
|
58
65
|
has_entitlement: boolean;
|
|
59
66
|
/**
|
|
60
|
-
* The entitlement
|
|
67
|
+
* The entitlement key that was checked
|
|
61
68
|
*/
|
|
62
|
-
|
|
69
|
+
key: string;
|
|
63
70
|
/**
|
|
64
71
|
* The active entitlement ID if present
|
|
65
72
|
*/
|
|
@@ -68,7 +75,7 @@ export interface SubscriptionCheckResponse {
|
|
|
68
75
|
/**
|
|
69
76
|
* Checkout session response
|
|
70
77
|
*/
|
|
71
|
-
export interface
|
|
78
|
+
export interface PayCheckoutResponse {
|
|
72
79
|
/**
|
|
73
80
|
* The checkout session ID
|
|
74
81
|
*/
|
|
@@ -78,7 +85,7 @@ export interface SubscriptionCheckoutResponse {
|
|
|
78
85
|
*/
|
|
79
86
|
url: string;
|
|
80
87
|
}
|
|
81
|
-
export interface
|
|
88
|
+
export interface PayCancelParams {
|
|
82
89
|
/**
|
|
83
90
|
* The customer ID
|
|
84
91
|
*/
|
|
@@ -88,43 +95,52 @@ export interface SubscriptionCancelParams {
|
|
|
88
95
|
*/
|
|
89
96
|
subscription_id: string;
|
|
90
97
|
/**
|
|
91
|
-
*
|
|
98
|
+
* When to cancel the subscription. Defaults to 'at_billing_period_end' to allow
|
|
99
|
+
* customers to use remaining time.
|
|
92
100
|
*/
|
|
93
|
-
|
|
101
|
+
cancellation_timing?: 'immediate' | 'at_billing_period_end';
|
|
94
102
|
}
|
|
95
|
-
export interface
|
|
103
|
+
export interface PayCheckParams {
|
|
96
104
|
/**
|
|
97
105
|
* The customer ID
|
|
98
106
|
*/
|
|
99
107
|
customer_id: string;
|
|
100
108
|
/**
|
|
101
|
-
* The entitlement
|
|
109
|
+
* The entitlement key to check for access
|
|
102
110
|
*/
|
|
103
|
-
|
|
111
|
+
entitlement_key: string;
|
|
104
112
|
}
|
|
105
|
-
export interface
|
|
113
|
+
export interface PayCheckoutParams {
|
|
106
114
|
/**
|
|
107
115
|
* The customer ID
|
|
108
116
|
*/
|
|
109
117
|
customer_id: string;
|
|
110
118
|
/**
|
|
111
|
-
* The
|
|
119
|
+
* The product ID to subscribe to
|
|
112
120
|
*/
|
|
113
|
-
|
|
121
|
+
product_id: string;
|
|
122
|
+
/**
|
|
123
|
+
* Optional custom ID for the subscription. If not provided, one will be generated.
|
|
124
|
+
*/
|
|
125
|
+
id?: string;
|
|
114
126
|
/**
|
|
115
127
|
* URL to redirect on cancel
|
|
116
128
|
*/
|
|
117
129
|
cancel_url?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Promotion code to apply
|
|
132
|
+
*/
|
|
133
|
+
promotion_code?: string;
|
|
118
134
|
/**
|
|
119
135
|
* URL to redirect on success
|
|
120
136
|
*/
|
|
121
137
|
success_url?: string;
|
|
122
138
|
}
|
|
123
|
-
export declare namespace
|
|
124
|
-
export { type
|
|
139
|
+
export declare namespace Pay {
|
|
140
|
+
export { type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
|
|
125
141
|
export { Customers as Customers, type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
126
|
-
export {
|
|
142
|
+
export { Products as Products, type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
127
143
|
export { Entitlements as Entitlements, type Entitlement as Entitlement, type EntitlementsCursorIDPage as EntitlementsCursorIDPage, type EntitlementCreateParams as EntitlementCreateParams, type EntitlementUpdateParams as EntitlementUpdateParams, type EntitlementListParams as EntitlementListParams, };
|
|
128
|
-
export { Coupons as Coupons, type Coupon as Coupon, type
|
|
144
|
+
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
129
145
|
}
|
|
130
|
-
//# sourceMappingURL=
|
|
146
|
+
//# sourceMappingURL=pay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/pay/pay.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,QAAQ,EACR,eAAe,EACf,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,qBAAqB,EACtB;OACM,KAAK,eAAe;OACpB,EACL,WAAW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IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Pay = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const CouponsAPI = tslib_1.__importStar(require("./coupons.js"));
|
|
8
|
+
const coupons_1 = require("./coupons.js");
|
|
9
|
+
const CustomersAPI = tslib_1.__importStar(require("./customers.js"));
|
|
10
|
+
const customers_1 = require("./customers.js");
|
|
11
|
+
const EntitlementsAPI = tslib_1.__importStar(require("./entitlements.js"));
|
|
12
|
+
const entitlements_1 = require("./entitlements.js");
|
|
13
|
+
const ProductsAPI = tslib_1.__importStar(require("./products/products.js"));
|
|
14
|
+
const products_1 = require("./products/products.js");
|
|
15
|
+
class Pay extends resource_1.APIResource {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.customers = new CustomersAPI.Customers(this._client);
|
|
19
|
+
this.products = new ProductsAPI.Products(this._client);
|
|
20
|
+
this.entitlements = new EntitlementsAPI.Entitlements(this._client);
|
|
21
|
+
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Cancels a customer's subscription. By default, the subscription remains active
|
|
25
|
+
* until the end of the current billing period. Set cancellation_timing to
|
|
26
|
+
* 'immediate' to cancel immediately.
|
|
27
|
+
*/
|
|
28
|
+
cancel(body, options) {
|
|
29
|
+
return this._client.post('/v1/pay/cancel', { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Verifies if a customer has access to a specific feature. Use this to gate
|
|
33
|
+
* features in your app based on the customer's active subscription and the
|
|
34
|
+
* entitlements attached to their product. Hercules recommends calling this before
|
|
35
|
+
* allowing access to premium features.
|
|
36
|
+
*/
|
|
37
|
+
check(body, options) {
|
|
38
|
+
return this._client.post('/v1/pay/check', { body, ...options });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
42
|
+
* URL to redirect the customer to for payment. After successful payment, the
|
|
43
|
+
* customer is subscribed to the product and gains access to its entitlements.
|
|
44
|
+
*/
|
|
45
|
+
checkout(body, options) {
|
|
46
|
+
return this._client.post('/v1/pay/checkout', { body, ...options });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Pay = Pay;
|
|
50
|
+
Pay.Customers = customers_1.Customers;
|
|
51
|
+
Pay.Products = products_1.Products;
|
|
52
|
+
Pay.Entitlements = entitlements_1.Entitlements;
|
|
53
|
+
Pay.Coupons = coupons_1.Coupons;
|
|
54
|
+
//# sourceMappingURL=pay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../../src/resources/beta/pay/pay.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,iEAAwC;AACxC,0CAOmB;AACnB,qEAA4C;AAC5C,8CAUqB;AACrB,2EAAkD;AAClD,oDAOwB;AACxB,4EAAmD;AACnD,qDAO6B;AAI7B,MAAa,GAAI,SAAQ,sBAAW;IAApC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6BrE,CAAC;IA3BC;;;;OAIG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAuB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;CACF;AAjCD,kBAiCC;AA4HD,GAAG,CAAC,SAAS,GAAG,qBAAS,CAAC;AAC1B,GAAG,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AACxB,GAAG,CAAC,YAAY,GAAG,2BAAY,CAAC;AAChC,GAAG,CAAC,OAAO,GAAG,iBAAO,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as CouponsAPI from "./coupons.mjs";
|
|
4
|
+
import { Coupons, } from "./coupons.mjs";
|
|
5
|
+
import * as CustomersAPI from "./customers.mjs";
|
|
6
|
+
import { Customers, } from "./customers.mjs";
|
|
7
|
+
import * as EntitlementsAPI from "./entitlements.mjs";
|
|
8
|
+
import { Entitlements, } from "./entitlements.mjs";
|
|
9
|
+
import * as ProductsAPI from "./products/products.mjs";
|
|
10
|
+
import { Products, } from "./products/products.mjs";
|
|
11
|
+
export class Pay extends APIResource {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.customers = new CustomersAPI.Customers(this._client);
|
|
15
|
+
this.products = new ProductsAPI.Products(this._client);
|
|
16
|
+
this.entitlements = new EntitlementsAPI.Entitlements(this._client);
|
|
17
|
+
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cancels a customer's subscription. By default, the subscription remains active
|
|
21
|
+
* until the end of the current billing period. Set cancellation_timing to
|
|
22
|
+
* 'immediate' to cancel immediately.
|
|
23
|
+
*/
|
|
24
|
+
cancel(body, options) {
|
|
25
|
+
return this._client.post('/v1/pay/cancel', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Verifies if a customer has access to a specific feature. Use this to gate
|
|
29
|
+
* features in your app based on the customer's active subscription and the
|
|
30
|
+
* entitlements attached to their product. Hercules recommends calling this before
|
|
31
|
+
* allowing access to premium features.
|
|
32
|
+
*/
|
|
33
|
+
check(body, options) {
|
|
34
|
+
return this._client.post('/v1/pay/check', { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
38
|
+
* URL to redirect the customer to for payment. After successful payment, the
|
|
39
|
+
* customer is subscribed to the product and gains access to its entitlements.
|
|
40
|
+
*/
|
|
41
|
+
checkout(body, options) {
|
|
42
|
+
return this._client.post('/v1/pay/checkout', { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
Pay.Customers = Customers;
|
|
46
|
+
Pay.Products = Products;
|
|
47
|
+
Pay.Entitlements = Entitlements;
|
|
48
|
+
Pay.Coupons = Coupons;
|
|
49
|
+
//# sourceMappingURL=pay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pay.mjs","sourceRoot":"","sources":["../../../src/resources/beta/pay/pay.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAKL,OAAO,GAER;OACM,KAAK,YAAY;OACjB,EAQL,SAAS,GAEV;OACM,KAAK,eAAe;OACpB,EAKL,YAAY,GAEb;OACM,KAAK,WAAW;OAChB,EAKL,QAAQ,GAET;AAID,MAAM,OAAO,GAAI,SAAQ,WAAW;IAApC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6BrE,CAAC;IA3BC;;;;OAIG;IACH,MAAM,CAAC,IAA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