@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.
Files changed (199) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +14 -20
  3. package/client.d.mts +6 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +1 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +1 -1
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/beta/beta.d.mts +4 -4
  13. package/resources/beta/beta.d.mts.map +1 -1
  14. package/resources/beta/beta.d.ts +4 -4
  15. package/resources/beta/beta.d.ts.map +1 -1
  16. package/resources/beta/beta.js +4 -4
  17. package/resources/beta/beta.js.map +1 -1
  18. package/resources/beta/beta.mjs +4 -4
  19. package/resources/beta/beta.mjs.map +1 -1
  20. package/resources/beta/index.d.mts +1 -1
  21. package/resources/beta/index.d.mts.map +1 -1
  22. package/resources/beta/index.d.ts +1 -1
  23. package/resources/beta/index.d.ts.map +1 -1
  24. package/resources/beta/index.js +3 -3
  25. package/resources/beta/index.js.map +1 -1
  26. package/resources/beta/index.mjs +1 -1
  27. package/resources/beta/index.mjs.map +1 -1
  28. package/resources/beta/pay/coupons.d.mts +156 -0
  29. package/resources/beta/pay/coupons.d.mts.map +1 -0
  30. package/resources/beta/pay/coupons.d.ts +156 -0
  31. package/resources/beta/pay/coupons.d.ts.map +1 -0
  32. package/resources/beta/pay/coupons.js +51 -0
  33. package/resources/beta/pay/coupons.js.map +1 -0
  34. package/resources/beta/pay/coupons.mjs +47 -0
  35. package/resources/beta/pay/coupons.mjs.map +1 -0
  36. package/resources/beta/pay/customers.d.mts +160 -0
  37. package/resources/beta/pay/customers.d.mts.map +1 -0
  38. package/resources/beta/pay/customers.d.ts +160 -0
  39. package/resources/beta/pay/customers.d.ts.map +1 -0
  40. package/resources/beta/pay/customers.js +60 -0
  41. package/resources/beta/pay/customers.js.map +1 -0
  42. package/resources/beta/pay/customers.mjs +56 -0
  43. package/resources/beta/pay/customers.mjs.map +1 -0
  44. package/resources/beta/pay/entitlements.d.mts +94 -0
  45. package/resources/beta/pay/entitlements.d.mts.map +1 -0
  46. package/resources/beta/pay/entitlements.d.ts +94 -0
  47. package/resources/beta/pay/entitlements.d.ts.map +1 -0
  48. package/resources/beta/pay/entitlements.js +42 -0
  49. package/resources/beta/pay/entitlements.js.map +1 -0
  50. package/resources/beta/pay/entitlements.mjs +38 -0
  51. package/resources/beta/pay/entitlements.mjs.map +1 -0
  52. package/resources/beta/pay/index.d.mts +6 -0
  53. package/resources/beta/pay/index.d.mts.map +1 -0
  54. package/resources/beta/pay/index.d.ts +6 -0
  55. package/resources/beta/pay/index.d.ts.map +1 -0
  56. package/resources/beta/{subscriptions → pay}/index.js +5 -5
  57. package/resources/beta/pay/index.js.map +1 -0
  58. package/resources/beta/{subscriptions → pay}/index.mjs +2 -2
  59. package/resources/beta/pay/index.mjs.map +1 -0
  60. package/resources/beta/{subscriptions/subscriptions.d.mts → pay/pay.d.mts} +48 -32
  61. package/resources/beta/pay/pay.d.mts.map +1 -0
  62. package/resources/beta/{subscriptions/subscriptions.d.ts → pay/pay.d.ts} +48 -32
  63. package/resources/beta/pay/pay.d.ts.map +1 -0
  64. package/resources/beta/pay/pay.js +54 -0
  65. package/resources/beta/pay/pay.js.map +1 -0
  66. package/resources/beta/pay/pay.mjs +49 -0
  67. package/resources/beta/pay/pay.mjs.map +1 -0
  68. package/resources/beta/pay/products/entitlements.d.mts +53 -0
  69. package/resources/beta/pay/products/entitlements.d.mts.map +1 -0
  70. package/resources/beta/pay/products/entitlements.d.ts +53 -0
  71. package/resources/beta/pay/products/entitlements.d.ts.map +1 -0
  72. package/resources/beta/pay/products/entitlements.js +38 -0
  73. package/resources/beta/pay/products/entitlements.js.map +1 -0
  74. package/resources/beta/pay/products/entitlements.mjs +34 -0
  75. package/resources/beta/pay/products/entitlements.mjs.map +1 -0
  76. package/resources/beta/pay/products/index.d.mts +3 -0
  77. package/resources/beta/pay/products/index.d.mts.map +1 -0
  78. package/resources/beta/pay/products/index.d.ts +3 -0
  79. package/resources/beta/pay/products/index.d.ts.map +1 -0
  80. package/resources/beta/{subscriptions/plans → pay/products}/index.js +3 -3
  81. package/resources/beta/pay/products/index.js.map +1 -0
  82. package/resources/beta/{subscriptions/plans → pay/products}/index.mjs +1 -1
  83. package/resources/beta/pay/products/index.mjs.map +1 -0
  84. package/resources/beta/pay/products/products.d.mts +152 -0
  85. package/resources/beta/pay/products/products.d.mts.map +1 -0
  86. package/resources/beta/pay/products/products.d.ts +152 -0
  87. package/resources/beta/pay/products/products.d.ts.map +1 -0
  88. package/resources/beta/pay/products/products.js +57 -0
  89. package/resources/beta/pay/products/products.js.map +1 -0
  90. package/resources/beta/pay/products/products.mjs +52 -0
  91. package/resources/beta/pay/products/products.mjs.map +1 -0
  92. package/resources/beta/pay/products.d.mts +2 -0
  93. package/resources/beta/pay/products.d.mts.map +1 -0
  94. package/resources/beta/pay/products.d.ts +2 -0
  95. package/resources/beta/pay/products.d.ts.map +1 -0
  96. package/resources/beta/{subscriptions/plans.js → pay/products.js} +2 -2
  97. package/resources/beta/pay/products.js.map +1 -0
  98. package/resources/beta/{subscriptions.mjs → pay/products.mjs} +2 -2
  99. package/resources/beta/pay/products.mjs.map +1 -0
  100. package/resources/beta/pay.d.mts +2 -0
  101. package/resources/beta/pay.d.mts.map +1 -0
  102. package/resources/beta/pay.d.ts +2 -0
  103. package/resources/beta/pay.d.ts.map +1 -0
  104. package/resources/beta/{subscriptions.js → pay.js} +2 -2
  105. package/resources/beta/pay.js.map +1 -0
  106. package/resources/beta/{subscriptions/plans.mjs → pay.mjs} +2 -2
  107. package/resources/beta/pay.mjs.map +1 -0
  108. package/src/client.ts +6 -4
  109. package/src/resources/beta/beta.ts +18 -18
  110. package/src/resources/beta/index.ts +8 -8
  111. package/src/resources/beta/pay/coupons.ts +218 -0
  112. package/src/resources/beta/pay/customers.ts +229 -0
  113. package/src/resources/beta/pay/entitlements.ts +135 -0
  114. package/src/resources/beta/{subscriptions → pay}/index.ts +15 -17
  115. package/src/resources/beta/{subscriptions/subscriptions.ts → pay/pay.ts} +70 -59
  116. package/src/resources/beta/{subscriptions/plans → pay/products}/entitlements.ts +26 -21
  117. package/src/resources/beta/{subscriptions/plans → pay/products}/index.ts +9 -9
  118. package/src/resources/beta/pay/products/products.ts +224 -0
  119. package/src/resources/beta/{subscriptions.ts → pay/products.ts} +1 -1
  120. package/src/resources/beta/{subscriptions/plans.ts → pay.ts} +1 -1
  121. package/src/version.ts +1 -1
  122. package/version.d.mts +1 -1
  123. package/version.d.ts +1 -1
  124. package/version.js +1 -1
  125. package/version.mjs +1 -1
  126. package/resources/beta/subscriptions/coupons.d.mts +0 -151
  127. package/resources/beta/subscriptions/coupons.d.mts.map +0 -1
  128. package/resources/beta/subscriptions/coupons.d.ts +0 -151
  129. package/resources/beta/subscriptions/coupons.d.ts.map +0 -1
  130. package/resources/beta/subscriptions/coupons.js +0 -51
  131. package/resources/beta/subscriptions/coupons.js.map +0 -1
  132. package/resources/beta/subscriptions/coupons.mjs +0 -47
  133. package/resources/beta/subscriptions/coupons.mjs.map +0 -1
  134. package/resources/beta/subscriptions/customers.d.mts +0 -93
  135. package/resources/beta/subscriptions/customers.d.mts.map +0 -1
  136. package/resources/beta/subscriptions/customers.d.ts +0 -93
  137. package/resources/beta/subscriptions/customers.d.ts.map +0 -1
  138. package/resources/beta/subscriptions/customers.js +0 -57
  139. package/resources/beta/subscriptions/customers.js.map +0 -1
  140. package/resources/beta/subscriptions/customers.mjs +0 -53
  141. package/resources/beta/subscriptions/customers.mjs.map +0 -1
  142. package/resources/beta/subscriptions/entitlements.d.mts +0 -70
  143. package/resources/beta/subscriptions/entitlements.d.mts.map +0 -1
  144. package/resources/beta/subscriptions/entitlements.d.ts +0 -70
  145. package/resources/beta/subscriptions/entitlements.d.ts.map +0 -1
  146. package/resources/beta/subscriptions/entitlements.js +0 -38
  147. package/resources/beta/subscriptions/entitlements.js.map +0 -1
  148. package/resources/beta/subscriptions/entitlements.mjs +0 -34
  149. package/resources/beta/subscriptions/entitlements.mjs.map +0 -1
  150. package/resources/beta/subscriptions/index.d.mts +0 -6
  151. package/resources/beta/subscriptions/index.d.mts.map +0 -1
  152. package/resources/beta/subscriptions/index.d.ts +0 -6
  153. package/resources/beta/subscriptions/index.d.ts.map +0 -1
  154. package/resources/beta/subscriptions/index.js.map +0 -1
  155. package/resources/beta/subscriptions/index.mjs.map +0 -1
  156. package/resources/beta/subscriptions/plans/entitlements.d.mts +0 -48
  157. package/resources/beta/subscriptions/plans/entitlements.d.mts.map +0 -1
  158. package/resources/beta/subscriptions/plans/entitlements.d.ts +0 -48
  159. package/resources/beta/subscriptions/plans/entitlements.d.ts.map +0 -1
  160. package/resources/beta/subscriptions/plans/entitlements.js +0 -34
  161. package/resources/beta/subscriptions/plans/entitlements.js.map +0 -1
  162. package/resources/beta/subscriptions/plans/entitlements.mjs +0 -30
  163. package/resources/beta/subscriptions/plans/entitlements.mjs.map +0 -1
  164. package/resources/beta/subscriptions/plans/index.d.mts +0 -3
  165. package/resources/beta/subscriptions/plans/index.d.mts.map +0 -1
  166. package/resources/beta/subscriptions/plans/index.d.ts +0 -3
  167. package/resources/beta/subscriptions/plans/index.d.ts.map +0 -1
  168. package/resources/beta/subscriptions/plans/index.js.map +0 -1
  169. package/resources/beta/subscriptions/plans/index.mjs.map +0 -1
  170. package/resources/beta/subscriptions/plans/plans.d.mts +0 -87
  171. package/resources/beta/subscriptions/plans/plans.d.mts.map +0 -1
  172. package/resources/beta/subscriptions/plans/plans.d.ts +0 -87
  173. package/resources/beta/subscriptions/plans/plans.d.ts.map +0 -1
  174. package/resources/beta/subscriptions/plans/plans.js +0 -49
  175. package/resources/beta/subscriptions/plans/plans.js.map +0 -1
  176. package/resources/beta/subscriptions/plans/plans.mjs +0 -44
  177. package/resources/beta/subscriptions/plans/plans.mjs.map +0 -1
  178. package/resources/beta/subscriptions/plans.d.mts +0 -2
  179. package/resources/beta/subscriptions/plans.d.mts.map +0 -1
  180. package/resources/beta/subscriptions/plans.d.ts +0 -2
  181. package/resources/beta/subscriptions/plans.d.ts.map +0 -1
  182. package/resources/beta/subscriptions/plans.js.map +0 -1
  183. package/resources/beta/subscriptions/plans.mjs.map +0 -1
  184. package/resources/beta/subscriptions/subscriptions.d.mts.map +0 -1
  185. package/resources/beta/subscriptions/subscriptions.d.ts.map +0 -1
  186. package/resources/beta/subscriptions/subscriptions.js +0 -47
  187. package/resources/beta/subscriptions/subscriptions.js.map +0 -1
  188. package/resources/beta/subscriptions/subscriptions.mjs +0 -42
  189. package/resources/beta/subscriptions/subscriptions.mjs.map +0 -1
  190. package/resources/beta/subscriptions.d.mts +0 -2
  191. package/resources/beta/subscriptions.d.mts.map +0 -1
  192. package/resources/beta/subscriptions.d.ts +0 -2
  193. package/resources/beta/subscriptions.d.ts.map +0 -1
  194. package/resources/beta/subscriptions.js.map +0 -1
  195. package/resources/beta/subscriptions.mjs.map +0 -1
  196. package/src/resources/beta/subscriptions/coupons.ts +0 -221
  197. package/src/resources/beta/subscriptions/customers.ts +0 -168
  198. package/src/resources/beta/subscriptions/entitlements.ts +0 -113
  199. package/src/resources/beta/subscriptions/plans/plans.ts +0 -159
@@ -1,49 +0,0 @@
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.Plans = void 0;
5
- const tslib_1 = require("../../../../internal/tslib.js");
6
- const resource_1 = require("../../../../core/resource.js");
7
- const EntitlementsAPI = tslib_1.__importStar(require("./entitlements.js"));
8
- const entitlements_1 = require("./entitlements.js");
9
- const pagination_1 = require("../../../../core/pagination.js");
10
- const path_1 = require("../../../../internal/utils/path.js");
11
- class Plans extends resource_1.APIResource {
12
- constructor() {
13
- super(...arguments);
14
- this.entitlements = new EntitlementsAPI.Entitlements(this._client);
15
- }
16
- /**
17
- * Create Plan
18
- */
19
- create(body, options) {
20
- return this._client.post('/v1/subscriptions/plans', { body, ...options });
21
- }
22
- /**
23
- * Update Plan
24
- */
25
- update(planID, body = {}, options) {
26
- return this._client.patch((0, path_1.path) `/v1/subscriptions/plans/${planID}`, { body, ...options });
27
- }
28
- /**
29
- * List Plans
30
- */
31
- list(query = {}, options) {
32
- return this._client.getAPIList('/v1/subscriptions/plans', (pagination_1.CursorIDPage), { query, ...options });
33
- }
34
- /**
35
- * Archive Plan
36
- */
37
- archive(planID, options) {
38
- return this._client.delete((0, path_1.path) `/v1/subscriptions/plans/${planID}`, options);
39
- }
40
- /**
41
- * Get Plan
42
- */
43
- get(planID, options) {
44
- return this._client.get((0, path_1.path) `/v1/subscriptions/plans/${planID}`, options);
45
- }
46
- }
47
- exports.Plans = Plans;
48
- Plans.Entitlements = entitlements_1.Entitlements;
49
- //# sourceMappingURL=plans.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../../src/resources/beta/subscriptions/plans/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,2DAAwD;AACxD,2EAAkD;AAClD,oDAOwB;AAExB,+DAAiG;AAEjG,6DAAuD;AAEvD,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2C9F,CAAC;IAzCC;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,MAAc,EACd,OAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,2BAA2B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAA,yBAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,2BAA2B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,2BAA2B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA5CD,sBA4CC;AA8ED,KAAK,CAAC,YAAY,GAAG,2BAAY,CAAC"}
@@ -1,44 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../../../core/resource.mjs";
3
- import * as EntitlementsAPI from "./entitlements.mjs";
4
- import { Entitlements, } from "./entitlements.mjs";
5
- import { CursorIDPage } from "../../../../core/pagination.mjs";
6
- import { path } from "../../../../internal/utils/path.mjs";
7
- export class Plans extends APIResource {
8
- constructor() {
9
- super(...arguments);
10
- this.entitlements = new EntitlementsAPI.Entitlements(this._client);
11
- }
12
- /**
13
- * Create Plan
14
- */
15
- create(body, options) {
16
- return this._client.post('/v1/subscriptions/plans', { body, ...options });
17
- }
18
- /**
19
- * Update Plan
20
- */
21
- update(planID, body = {}, options) {
22
- return this._client.patch(path `/v1/subscriptions/plans/${planID}`, { body, ...options });
23
- }
24
- /**
25
- * List Plans
26
- */
27
- list(query = {}, options) {
28
- return this._client.getAPIList('/v1/subscriptions/plans', (CursorIDPage), { query, ...options });
29
- }
30
- /**
31
- * Archive Plan
32
- */
33
- archive(planID, options) {
34
- return this._client.delete(path `/v1/subscriptions/plans/${planID}`, options);
35
- }
36
- /**
37
- * Get Plan
38
- */
39
- get(planID, options) {
40
- return this._client.get(path `/v1/subscriptions/plans/${planID}`, options);
41
- }
42
- }
43
- Plans.Entitlements = Entitlements;
44
- //# sourceMappingURL=plans.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../../../src/resources/beta/subscriptions/plans/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,eAAe;OACpB,EAIL,YAAY,GAGb;OAEM,EAAE,YAAY,EAAwC;OAEtD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2C9F,CAAC;IAzCC;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,MAAc,EACd,OAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,2BAA2B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAA,YAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,2BAA2B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,2BAA2B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA8ED,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./plans/index.mjs";
2
- //# sourceMappingURL=plans.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from "./plans/index.js";
2
- //# sourceMappingURL=plans.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EAC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IAAI,6BAA6B,EACnE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,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,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,QAAQ,E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AoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,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,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -1,47 +0,0 @@
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.Subscriptions = 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 PlansAPI = tslib_1.__importStar(require("./plans/plans.js"));
14
- const plans_1 = require("./plans/plans.js");
15
- class Subscriptions extends resource_1.APIResource {
16
- constructor() {
17
- super(...arguments);
18
- this.customers = new CustomersAPI.Customers(this._client);
19
- this.plans = new PlansAPI.Plans(this._client);
20
- this.entitlements = new EntitlementsAPI.Entitlements(this._client);
21
- this.coupons = new CouponsAPI.Coupons(this._client);
22
- }
23
- /**
24
- * Cancel Subscription
25
- */
26
- cancel(body, options) {
27
- return this._client.post('/v1/subscriptions/cancel', { body, ...options });
28
- }
29
- /**
30
- * Check Entitlement
31
- */
32
- check(body, options) {
33
- return this._client.post('/v1/subscriptions/check', { body, ...options });
34
- }
35
- /**
36
- * Create Checkout Session
37
- */
38
- checkout(body, options) {
39
- return this._client.post('/v1/subscriptions/checkout', { body, ...options });
40
- }
41
- }
42
- exports.Subscriptions = Subscriptions;
43
- Subscriptions.Customers = customers_1.Customers;
44
- Subscriptions.Plans = plans_1.Plans;
45
- Subscriptions.Entitlements = entitlements_1.Entitlements;
46
- Subscriptions.Coupons = coupons_1.Coupons;
47
- //# sourceMappingURL=subscriptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,iEAAwC;AACxC,0CASmB;AACnB,qEAA4C;AAC5C,8CAUqB;AACrB,2EAAkD;AAClD,oDAOwB;AACxB,mEAA0C;AAC1C,4CAOuB;AAIvB,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,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;IAyBrE,CAAC;IAvBC;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAA6B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AA7BD,sCA6BC;AAiHD,aAAa,CAAC,SAAS,GAAG,qBAAS,CAAC;AACpC,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC;AAC5B,aAAa,CAAC,YAAY,GAAG,2BAAY,CAAC;AAC1C,aAAa,CAAC,OAAO,GAAG,iBAAO,CAAC"}
@@ -1,42 +0,0 @@
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 PlansAPI from "./plans/plans.mjs";
10
- import { Plans, } from "./plans/plans.mjs";
11
- export class Subscriptions extends APIResource {
12
- constructor() {
13
- super(...arguments);
14
- this.customers = new CustomersAPI.Customers(this._client);
15
- this.plans = new PlansAPI.Plans(this._client);
16
- this.entitlements = new EntitlementsAPI.Entitlements(this._client);
17
- this.coupons = new CouponsAPI.Coupons(this._client);
18
- }
19
- /**
20
- * Cancel Subscription
21
- */
22
- cancel(body, options) {
23
- return this._client.post('/v1/subscriptions/cancel', { body, ...options });
24
- }
25
- /**
26
- * Check Entitlement
27
- */
28
- check(body, options) {
29
- return this._client.post('/v1/subscriptions/check', { body, ...options });
30
- }
31
- /**
32
- * Create Checkout Session
33
- */
34
- checkout(body, options) {
35
- return this._client.post('/v1/subscriptions/checkout', { body, ...options });
36
- }
37
- }
38
- Subscriptions.Customers = Customers;
39
- Subscriptions.Plans = Plans;
40
- Subscriptions.Entitlements = Entitlements;
41
- Subscriptions.Coupons = Coupons;
42
- //# sourceMappingURL=subscriptions.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAOL,OAAO,GAER;OACM,KAAK,YAAY;OACjB,EAQL,SAAS,GAEV;OACM,KAAK,eAAe;OACpB,EAKL,YAAY,GAEb;OACM,KAAK,QAAQ;OACb,EAKL,KAAK,GAEN;AAID,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,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;IAyBrE,CAAC;IAvBC;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAA6B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAiHD,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;AAC1C,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./subscriptions/index.mjs";
2
- //# sourceMappingURL=subscriptions.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from "./subscriptions/index.js";
2
- //# sourceMappingURL=subscriptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mEAAsC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -1,221 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../../core/resource';
4
- import { APIPromise } from '../../../core/api-promise';
5
- import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../core/pagination';
6
- import { buildHeaders } from '../../../internal/headers';
7
- import { RequestOptions } from '../../../internal/request-options';
8
- import { path } from '../../../internal/utils/path';
9
-
10
- export class Coupons extends APIResource {
11
- /**
12
- * Create Coupon
13
- */
14
- create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon> {
15
- return this._client.post('/v1/subscriptions/coupons', { body, ...options });
16
- }
17
-
18
- /**
19
- * Update Coupon
20
- */
21
- update(
22
- couponID: string,
23
- body: CouponUpdateParams | null | undefined = {},
24
- options?: RequestOptions,
25
- ): APIPromise<Coupon> {
26
- return this._client.patch(path`/v1/subscriptions/coupons/${couponID}`, { body, ...options });
27
- }
28
-
29
- /**
30
- * List Coupons
31
- */
32
- list(
33
- query: CouponListParams | null | undefined = {},
34
- options?: RequestOptions,
35
- ): PagePromise<CouponsCursorIDPage, Coupon> {
36
- return this._client.getAPIList('/v1/subscriptions/coupons', CursorIDPage<Coupon>, { query, ...options });
37
- }
38
-
39
- /**
40
- * Delete Coupon
41
- */
42
- delete(couponID: string, options?: RequestOptions): APIPromise<void> {
43
- return this._client.delete(path`/v1/subscriptions/coupons/${couponID}`, {
44
- ...options,
45
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
46
- });
47
- }
48
-
49
- /**
50
- * Get Coupon
51
- */
52
- get(couponID: string, options?: RequestOptions): APIPromise<Coupon> {
53
- return this._client.get(path`/v1/subscriptions/coupons/${couponID}`, options);
54
- }
55
-
56
- /**
57
- * Validate Promo Code
58
- */
59
- validate(body: CouponValidateParams, options?: RequestOptions): APIPromise<CouponValidateResponse> {
60
- return this._client.post('/v1/subscriptions/coupons/validate', { body, ...options });
61
- }
62
- }
63
-
64
- export type CouponsCursorIDPage = CursorIDPage<Coupon>;
65
-
66
- /**
67
- * A coupon/promo code for discounts
68
- */
69
- export interface Coupon {
70
- /**
71
- * An id for a data item
72
- */
73
- id: string;
74
-
75
- active: boolean;
76
-
77
- /**
78
- * The promo code
79
- */
80
- code: string;
81
-
82
- created: string;
83
-
84
- duration: 'once' | 'repeating' | 'forever';
85
-
86
- /**
87
- * Number of times this coupon has been redeemed
88
- */
89
- times_redeemed: number;
90
-
91
- /**
92
- * Fixed amount discount in cents
93
- */
94
- amount_off?: number | null;
95
-
96
- /**
97
- * Currency for amount_off
98
- */
99
- currency?: string | null;
100
-
101
- /**
102
- * Number of months for repeating duration
103
- */
104
- duration_in_months?: number | null;
105
-
106
- /**
107
- * Maximum number of times this coupon can be redeemed
108
- */
109
- max_redemptions?: number | null;
110
-
111
- name?: string | null;
112
-
113
- /**
114
- * Percentage discount (1-100)
115
- */
116
- percent_off?: number | null;
117
-
118
- /**
119
- * Date after which the coupon can no longer be redeemed
120
- */
121
- redeem_by?: string | null;
122
- }
123
-
124
- /**
125
- * Validate promo code response
126
- */
127
- export interface CouponValidateResponse {
128
- /**
129
- * Whether the promo code is valid
130
- */
131
- valid: boolean;
132
-
133
- /**
134
- * A coupon/promo code for discounts
135
- */
136
- coupon?: Coupon | null;
137
-
138
- /**
139
- * Error message if invalid
140
- */
141
- error?: string | null;
142
- }
143
-
144
- export interface CouponCreateParams {
145
- /**
146
- * The promo code customers will enter
147
- */
148
- code: string;
149
-
150
- /**
151
- * Fixed amount discount in cents
152
- */
153
- amount_off?: number;
154
-
155
- /**
156
- * Currency for amount_off
157
- */
158
- currency?: string;
159
-
160
- duration?: 'once' | 'repeating' | 'forever';
161
-
162
- /**
163
- * Number of months for repeating duration
164
- */
165
- duration_in_months?: number;
166
-
167
- /**
168
- * Maximum number of redemptions
169
- */
170
- max_redemptions?: number;
171
-
172
- /**
173
- * Display name for the coupon
174
- */
175
- name?: string;
176
-
177
- /**
178
- * Percentage discount (1-100)
179
- */
180
- percent_off?: number;
181
-
182
- /**
183
- * Expiration date for the coupon
184
- */
185
- redeem_by?: string;
186
- }
187
-
188
- export interface CouponUpdateParams {
189
- /**
190
- * Whether the coupon is active
191
- */
192
- active?: boolean;
193
-
194
- /**
195
- * Display name for the coupon
196
- */
197
- name?: string;
198
- }
199
-
200
- export interface CouponListParams extends CursorIDPageParams {
201
- active?: boolean;
202
- }
203
-
204
- export interface CouponValidateParams {
205
- /**
206
- * The promo code to validate
207
- */
208
- code: string;
209
- }
210
-
211
- export declare namespace Coupons {
212
- export {
213
- type Coupon as Coupon,
214
- type CouponValidateResponse as CouponValidateResponse,
215
- type CouponsCursorIDPage as CouponsCursorIDPage,
216
- type CouponCreateParams as CouponCreateParams,
217
- type CouponUpdateParams as CouponUpdateParams,
218
- type CouponListParams as CouponListParams,
219
- type CouponValidateParams as CouponValidateParams,
220
- };
221
- }
@@ -1,168 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../../core/resource';
4
- import { APIPromise } from '../../../core/api-promise';
5
- import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../core/pagination';
6
- import { buildHeaders } from '../../../internal/headers';
7
- import { RequestOptions } from '../../../internal/request-options';
8
- import { path } from '../../../internal/utils/path';
9
-
10
- export class Customers extends APIResource {
11
- /**
12
- * Create Customer
13
- */
14
- create(body: CustomerCreateParams | null | undefined = {}, options?: RequestOptions): APIPromise<Customer> {
15
- return this._client.post('/v1/subscriptions/customers', { body, ...options });
16
- }
17
-
18
- /**
19
- * Update Customer
20
- */
21
- update(
22
- customerID: string,
23
- body: CustomerUpdateParams | null | undefined = {},
24
- options?: RequestOptions,
25
- ): APIPromise<Customer> {
26
- return this._client.patch(path`/v1/subscriptions/customers/${customerID}`, { body, ...options });
27
- }
28
-
29
- /**
30
- * List Customers
31
- */
32
- list(
33
- query: CustomerListParams | null | undefined = {},
34
- options?: RequestOptions,
35
- ): PagePromise<CustomersCursorIDPage, Customer> {
36
- return this._client.getAPIList('/v1/subscriptions/customers', CursorIDPage<Customer>, {
37
- query,
38
- ...options,
39
- });
40
- }
41
-
42
- /**
43
- * Delete Customer
44
- */
45
- delete(customerID: string, options?: RequestOptions): APIPromise<void> {
46
- return this._client.delete(path`/v1/subscriptions/customers/${customerID}`, {
47
- ...options,
48
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
49
- });
50
- }
51
-
52
- /**
53
- * Open Customer Portal
54
- */
55
- billingPortal(
56
- customerID: string,
57
- body: CustomerBillingPortalParams | null | undefined = {},
58
- options?: RequestOptions,
59
- ): APIPromise<CustomerBillingPortalResponse> {
60
- return this._client.post(path`/v1/subscriptions/customers/${customerID}/billing_portal`, {
61
- body,
62
- ...options,
63
- });
64
- }
65
-
66
- /**
67
- * Get Customer
68
- */
69
- get(customerID: string, options?: RequestOptions): APIPromise<Customer> {
70
- return this._client.get(path`/v1/subscriptions/customers/${customerID}`, options);
71
- }
72
- }
73
-
74
- export type CustomersCursorIDPage = CursorIDPage<Customer>;
75
-
76
- /**
77
- * A subscription customer
78
- */
79
- export interface Customer {
80
- /**
81
- * An id for a data item
82
- */
83
- id: string;
84
-
85
- created: string;
86
-
87
- /**
88
- * Customer billing address
89
- */
90
- address?: CustomerAddress | null;
91
-
92
- email?: string | null;
93
-
94
- name?: string | null;
95
-
96
- phone?: string | null;
97
-
98
- stripe_id?: string | null;
99
- }
100
-
101
- /**
102
- * Customer billing address
103
- */
104
- export interface CustomerAddress {
105
- city?: string | null;
106
-
107
- country?: string | null;
108
-
109
- line1?: string | null;
110
-
111
- line2?: string | null;
112
-
113
- postal_code?: string | null;
114
-
115
- state?: string | null;
116
- }
117
-
118
- /**
119
- * Billing portal session URL
120
- */
121
- export interface CustomerBillingPortalResponse {
122
- url: string;
123
- }
124
-
125
- export interface CustomerCreateParams {
126
- /**
127
- * Customer billing address
128
- */
129
- address?: CustomerAddress;
130
-
131
- email?: string;
132
-
133
- name?: string;
134
-
135
- phone?: string;
136
- }
137
-
138
- export interface CustomerUpdateParams {
139
- /**
140
- * Customer billing address
141
- */
142
- address?: CustomerAddress;
143
-
144
- email?: string;
145
-
146
- name?: string;
147
-
148
- phone?: string;
149
- }
150
-
151
- export interface CustomerListParams extends CursorIDPageParams {}
152
-
153
- export interface CustomerBillingPortalParams {
154
- return_url?: string;
155
- }
156
-
157
- export declare namespace Customers {
158
- export {
159
- type Customer as Customer,
160
- type CustomerAddress as CustomerAddress,
161
- type CustomerBillingPortalResponse as CustomerBillingPortalResponse,
162
- type CustomersCursorIDPage as CustomersCursorIDPage,
163
- type CustomerCreateParams as CustomerCreateParams,
164
- type CustomerUpdateParams as CustomerUpdateParams,
165
- type CustomerListParams as CustomerListParams,
166
- type CustomerBillingPortalParams as CustomerBillingPortalParams,
167
- };
168
- }