@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,10 +1,10 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
- import * as SubscriptionsAPI from "./subscriptions/subscriptions.js";
3
- import { SubscriptionCancelParams, SubscriptionCancelResponse, SubscriptionCheckParams, SubscriptionCheckResponse, SubscriptionCheckoutParams, SubscriptionCheckoutResponse, Subscriptions } from "./subscriptions/subscriptions.js";
2
+ import * as PayAPI from "./pay/pay.js";
3
+ import { Pay, PayCancelParams, PayCancelResponse, PayCheckParams, PayCheckResponse, PayCheckoutParams, PayCheckoutResponse } from "./pay/pay.js";
4
4
  export declare class Beta extends APIResource {
5
- subscriptions: SubscriptionsAPI.Subscriptions;
5
+ pay: PayAPI.Pay;
6
6
  }
7
7
  export declare namespace Beta {
8
- export { Subscriptions as Subscriptions, type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionCheckResponse as SubscriptionCheckResponse, type SubscriptionCheckoutResponse as SubscriptionCheckoutResponse, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionCheckParams as SubscriptionCheckParams, type SubscriptionCheckoutParams as SubscriptionCheckoutParams, };
8
+ export { Pay as Pay, type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
9
9
  }
10
10
  //# sourceMappingURL=beta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACd;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;CAClG;AAID,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
1
+ {"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;CAChD;AAID,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Beta = void 0;
5
5
  const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
- const SubscriptionsAPI = tslib_1.__importStar(require("./subscriptions/subscriptions.js"));
8
- const subscriptions_1 = require("./subscriptions/subscriptions.js");
7
+ const PayAPI = tslib_1.__importStar(require("./pay/pay.js"));
8
+ const pay_1 = require("./pay/pay.js");
9
9
  class Beta extends resource_1.APIResource {
10
10
  constructor() {
11
11
  super(...arguments);
12
- this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
12
+ this.pay = new PayAPI.Pay(this._client);
13
13
  }
14
14
  }
15
15
  exports.Beta = Beta;
16
- Beta.Subscriptions = subscriptions_1.Subscriptions;
16
+ Beta.Pay = pay_1.Pay;
17
17
  //# sourceMappingURL=beta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,2FAAkE;AAClE,oEAQuC;AAEvC,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAFD,oBAEC;AAED,IAAI,CAAC,aAAa,GAAG,6BAAa,CAAC"}
1
+ {"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAQmB;AAEnB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA;AAFD,oBAEC;AAED,IAAI,CAAC,GAAG,GAAG,SAAG,CAAC"}
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
- import * as SubscriptionsAPI from "./subscriptions/subscriptions.mjs";
4
- import { Subscriptions, } from "./subscriptions/subscriptions.mjs";
3
+ import * as PayAPI from "./pay/pay.mjs";
4
+ import { Pay, } from "./pay/pay.mjs";
5
5
  export class Beta extends APIResource {
6
6
  constructor() {
7
7
  super(...arguments);
8
- this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
8
+ this.pay = new PayAPI.Pay(this._client);
9
9
  }
10
10
  }
11
- Beta.Subscriptions = Subscriptions;
11
+ Beta.Pay = Pay;
12
12
  //# sourceMappingURL=beta.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAOL,aAAa,GACd;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC"}
1
+ {"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,GAOJ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA;AAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { Beta } from "./beta.mjs";
2
- export { Subscriptions, type SubscriptionCancelResponse, type SubscriptionCheckResponse, type SubscriptionCheckoutResponse, type SubscriptionCancelParams, type SubscriptionCheckParams, type SubscriptionCheckoutParams, } from "./subscriptions/index.mjs";
2
+ export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.mjs";
3
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,GAChC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
@@ -1,3 +1,3 @@
1
1
  export { Beta } from "./beta.js";
2
- export { Subscriptions, type SubscriptionCancelResponse, type SubscriptionCheckResponse, type SubscriptionCheckoutResponse, type SubscriptionCancelParams, type SubscriptionCheckParams, type SubscriptionCheckoutParams, } from "./subscriptions/index.js";
2
+ export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,GAChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
@@ -1,9 +1,9 @@
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.Subscriptions = exports.Beta = void 0;
4
+ exports.Pay = exports.Beta = void 0;
5
5
  var beta_1 = require("./beta.js");
6
6
  Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
7
- var index_1 = require("./subscriptions/index.js");
8
- Object.defineProperty(exports, "Subscriptions", { enumerable: true, get: function () { return index_1.Subscriptions; } });
7
+ var index_1 = require("./pay/index.js");
8
+ Object.defineProperty(exports, "Pay", { enumerable: true, get: function () { return index_1.Pay; } });
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,kDAQ+B;AAP7B,sGAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,wCAQqB;AAPnB,4FAAA,GAAG,OAAA"}
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { Beta } from "./beta.mjs";
3
- export { Subscriptions, } from "./subscriptions/index.mjs";
3
+ export { Pay, } from "./pay/index.mjs";
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,aAAa,GAOd"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,GAAG,GAOJ"}
@@ -0,0 +1,156 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../../internal/request-options.mjs";
5
+ export declare class Coupons extends APIResource {
6
+ /**
7
+ * Creates a discount coupon with a promo code. Coupons can offer percentage or
8
+ * fixed-amount discounts and can be limited by redemption count or expiration
9
+ * date. Customers can apply coupons during checkout.
10
+ */
11
+ create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
12
+ /**
13
+ * Updates an existing coupon. Use this to modify the display name or deactivate
14
+ * the coupon. Discount amounts and codes cannot be changed after creation.
15
+ */
16
+ update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
17
+ /**
18
+ * Retrieves a paginated list of all coupons. Coupons provide discounts that
19
+ * customers can apply during checkout using a promo code.
20
+ */
21
+ list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
22
+ /**
23
+ * Permanently deletes a coupon. The promo code can no longer be used. Existing
24
+ * discounts applied to active subscriptions are not affected.
25
+ */
26
+ delete(couponID: string, options?: RequestOptions): APIPromise<void>;
27
+ /**
28
+ * Retrieves a coupon by ID. Returns the coupon object including discount details
29
+ * and redemption statistics.
30
+ */
31
+ get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
32
+ }
33
+ export type CouponsCursorIDPage = CursorIDPage<Coupon>;
34
+ /**
35
+ * A discount coupon that customers can apply during checkout using a promo code
36
+ */
37
+ export interface Coupon {
38
+ /**
39
+ * Unique identifier for the entitlement
40
+ */
41
+ id: string;
42
+ /**
43
+ * Whether the coupon is currently active and can be redeemed
44
+ */
45
+ active: boolean;
46
+ /**
47
+ * The promo code customers enter to apply the discount
48
+ */
49
+ code: string;
50
+ /**
51
+ * Timestamp when the coupon was created
52
+ */
53
+ created: string;
54
+ /**
55
+ * How long the discount applies: once (first payment only), repeating (for
56
+ * duration_in_months), or forever
57
+ */
58
+ duration: 'once' | 'repeating' | 'forever';
59
+ /**
60
+ * Number of times this coupon has been successfully redeemed
61
+ */
62
+ times_redeemed: number;
63
+ /**
64
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
65
+ * exclusive with percent_off.
66
+ */
67
+ amount_off?: number | null;
68
+ /**
69
+ * Three-letter ISO currency code for amount_off discounts
70
+ */
71
+ currency?: string | null;
72
+ /**
73
+ * Number of months the discount applies when duration is 'repeating'
74
+ */
75
+ duration_in_months?: number | null;
76
+ /**
77
+ * Maximum number of times this coupon can be redeemed across all customers
78
+ */
79
+ max_redemptions?: number | null;
80
+ /**
81
+ * Display name for the coupon (shown to customers)
82
+ */
83
+ name?: string | null;
84
+ /**
85
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
86
+ */
87
+ percent_off?: number | null;
88
+ /**
89
+ * Expiration date after which the coupon can no longer be redeemed
90
+ */
91
+ redeem_by?: string | null;
92
+ }
93
+ export interface CouponCreateParams {
94
+ /**
95
+ * The promo code customers will enter to apply the discount
96
+ */
97
+ code: string;
98
+ /**
99
+ * Optional custom ID for the coupon. If not provided, one will be generated.
100
+ */
101
+ id?: string;
102
+ /**
103
+ * Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
104
+ * with percent_off.
105
+ */
106
+ amount_off?: number;
107
+ /**
108
+ * Three-letter ISO currency code for amount_off discounts
109
+ */
110
+ currency?: string;
111
+ /**
112
+ * How long the discount applies: once (first payment only), repeating (for
113
+ * duration_in_months), or forever
114
+ */
115
+ duration?: 'once' | 'repeating' | 'forever';
116
+ /**
117
+ * Number of months the discount applies when duration is 'repeating'
118
+ */
119
+ duration_in_months?: number;
120
+ /**
121
+ * Maximum number of times this coupon can be redeemed
122
+ */
123
+ max_redemptions?: number;
124
+ /**
125
+ * Display name for the coupon (shown to customers)
126
+ */
127
+ name?: string;
128
+ /**
129
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
130
+ */
131
+ percent_off?: number;
132
+ /**
133
+ * Expiration date after which the coupon can no longer be redeemed
134
+ */
135
+ redeem_by?: string;
136
+ }
137
+ export interface CouponUpdateParams {
138
+ /**
139
+ * Whether the coupon is active and can be redeemed
140
+ */
141
+ active?: boolean;
142
+ /**
143
+ * Display name for the coupon
144
+ */
145
+ name?: string;
146
+ }
147
+ export interface CouponListParams extends CursorIDPageParams {
148
+ /**
149
+ * Filter by active status
150
+ */
151
+ active?: boolean;
152
+ }
153
+ export declare namespace Coupons {
154
+ export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
155
+ }
156
+ //# sourceMappingURL=coupons.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coupons.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;OAGG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAI3C;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOpE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAGpE;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;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AAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,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,156 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Coupons extends APIResource {
6
+ /**
7
+ * Creates a discount coupon with a promo code. Coupons can offer percentage or
8
+ * fixed-amount discounts and can be limited by redemption count or expiration
9
+ * date. Customers can apply coupons during checkout.
10
+ */
11
+ create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
12
+ /**
13
+ * Updates an existing coupon. Use this to modify the display name or deactivate
14
+ * the coupon. Discount amounts and codes cannot be changed after creation.
15
+ */
16
+ update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
17
+ /**
18
+ * Retrieves a paginated list of all coupons. Coupons provide discounts that
19
+ * customers can apply during checkout using a promo code.
20
+ */
21
+ list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
22
+ /**
23
+ * Permanently deletes a coupon. The promo code can no longer be used. Existing
24
+ * discounts applied to active subscriptions are not affected.
25
+ */
26
+ delete(couponID: string, options?: RequestOptions): APIPromise<void>;
27
+ /**
28
+ * Retrieves a coupon by ID. Returns the coupon object including discount details
29
+ * and redemption statistics.
30
+ */
31
+ get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
32
+ }
33
+ export type CouponsCursorIDPage = CursorIDPage<Coupon>;
34
+ /**
35
+ * A discount coupon that customers can apply during checkout using a promo code
36
+ */
37
+ export interface Coupon {
38
+ /**
39
+ * Unique identifier for the entitlement
40
+ */
41
+ id: string;
42
+ /**
43
+ * Whether the coupon is currently active and can be redeemed
44
+ */
45
+ active: boolean;
46
+ /**
47
+ * The promo code customers enter to apply the discount
48
+ */
49
+ code: string;
50
+ /**
51
+ * Timestamp when the coupon was created
52
+ */
53
+ created: string;
54
+ /**
55
+ * How long the discount applies: once (first payment only), repeating (for
56
+ * duration_in_months), or forever
57
+ */
58
+ duration: 'once' | 'repeating' | 'forever';
59
+ /**
60
+ * Number of times this coupon has been successfully redeemed
61
+ */
62
+ times_redeemed: number;
63
+ /**
64
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
65
+ * exclusive with percent_off.
66
+ */
67
+ amount_off?: number | null;
68
+ /**
69
+ * Three-letter ISO currency code for amount_off discounts
70
+ */
71
+ currency?: string | null;
72
+ /**
73
+ * Number of months the discount applies when duration is 'repeating'
74
+ */
75
+ duration_in_months?: number | null;
76
+ /**
77
+ * Maximum number of times this coupon can be redeemed across all customers
78
+ */
79
+ max_redemptions?: number | null;
80
+ /**
81
+ * Display name for the coupon (shown to customers)
82
+ */
83
+ name?: string | null;
84
+ /**
85
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
86
+ */
87
+ percent_off?: number | null;
88
+ /**
89
+ * Expiration date after which the coupon can no longer be redeemed
90
+ */
91
+ redeem_by?: string | null;
92
+ }
93
+ export interface CouponCreateParams {
94
+ /**
95
+ * The promo code customers will enter to apply the discount
96
+ */
97
+ code: string;
98
+ /**
99
+ * Optional custom ID for the coupon. If not provided, one will be generated.
100
+ */
101
+ id?: string;
102
+ /**
103
+ * Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
104
+ * with percent_off.
105
+ */
106
+ amount_off?: number;
107
+ /**
108
+ * Three-letter ISO currency code for amount_off discounts
109
+ */
110
+ currency?: string;
111
+ /**
112
+ * How long the discount applies: once (first payment only), repeating (for
113
+ * duration_in_months), or forever
114
+ */
115
+ duration?: 'once' | 'repeating' | 'forever';
116
+ /**
117
+ * Number of months the discount applies when duration is 'repeating'
118
+ */
119
+ duration_in_months?: number;
120
+ /**
121
+ * Maximum number of times this coupon can be redeemed
122
+ */
123
+ max_redemptions?: number;
124
+ /**
125
+ * Display name for the coupon (shown to customers)
126
+ */
127
+ name?: string;
128
+ /**
129
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
130
+ */
131
+ percent_off?: number;
132
+ /**
133
+ * Expiration date after which the coupon can no longer be redeemed
134
+ */
135
+ redeem_by?: string;
136
+ }
137
+ export interface CouponUpdateParams {
138
+ /**
139
+ * Whether the coupon is active and can be redeemed
140
+ */
141
+ active?: boolean;
142
+ /**
143
+ * Display name for the coupon
144
+ */
145
+ name?: string;
146
+ }
147
+ export interface CouponListParams extends CursorIDPageParams {
148
+ /**
149
+ * Filter by active status
150
+ */
151
+ active?: boolean;
152
+ }
153
+ export declare namespace Coupons {
154
+ export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
155
+ }
156
+ //# sourceMappingURL=coupons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coupons.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;OAG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ports, "__esModule", { value: true });
4
+ exports.Coupons = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const pagination_1 = require("../../../core/pagination.js");
7
+ const headers_1 = require("../../../internal/headers.js");
8
+ const path_1 = require("../../../internal/utils/path.js");
9
+ class Coupons extends resource_1.APIResource {
10
+ /**
11
+ * Creates a discount coupon with a promo code. Coupons can offer percentage or
12
+ * fixed-amount discounts and can be limited by redemption count or expiration
13
+ * date. Customers can apply coupons during checkout.
14
+ */
15
+ create(body, options) {
16
+ return this._client.post('/v1/pay/coupons', { body, ...options });
17
+ }
18
+ /**
19
+ * Updates an existing coupon. Use this to modify the display name or deactivate
20
+ * the coupon. Discount amounts and codes cannot be changed after creation.
21
+ */
22
+ update(couponID, body = {}, options) {
23
+ return this._client.patch((0, path_1.path) `/v1/pay/coupons/${couponID}`, { body, ...options });
24
+ }
25
+ /**
26
+ * Retrieves a paginated list of all coupons. Coupons provide discounts that
27
+ * customers can apply during checkout using a promo code.
28
+ */
29
+ list(query = {}, options) {
30
+ return this._client.getAPIList('/v1/pay/coupons', (pagination_1.CursorIDPage), { query, ...options });
31
+ }
32
+ /**
33
+ * Permanently deletes a coupon. The promo code can no longer be used. Existing
34
+ * discounts applied to active subscriptions are not affected.
35
+ */
36
+ delete(couponID, options) {
37
+ return this._client.delete((0, path_1.path) `/v1/pay/coupons/${couponID}`, {
38
+ ...options,
39
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
40
+ });
41
+ }
42
+ /**
43
+ * Retrieves a coupon by ID. Returns the coupon object including discount details
44
+ * and redemption statistics.
45
+ */
46
+ get(couponID, options) {
47
+ return this._client.get((0, path_1.path) `/v1/pay/coupons/${couponID}`, options);
48
+ }
49
+ }
50
+ exports.Coupons = Coupons;
51
+ //# sourceMappingURL=coupons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coupons.js","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":";AAAA,sFAAs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// 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 { buildHeaders } from "../../../internal/headers.mjs";
5
+ import { path } from "../../../internal/utils/path.mjs";
6
+ export class Coupons extends APIResource {
7
+ /**
8
+ * Creates a discount coupon with a promo code. Coupons can offer percentage or
9
+ * fixed-amount discounts and can be limited by redemption count or expiration
10
+ * date. Customers can apply coupons during checkout.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v1/pay/coupons', { body, ...options });
14
+ }
15
+ /**
16
+ * Updates an existing coupon. Use this to modify the display name or deactivate
17
+ * the coupon. Discount amounts and codes cannot be changed after creation.
18
+ */
19
+ update(couponID, body = {}, options) {
20
+ return this._client.patch(path `/v1/pay/coupons/${couponID}`, { body, ...options });
21
+ }
22
+ /**
23
+ * Retrieves a paginated list of all coupons. Coupons provide discounts that
24
+ * customers can apply during checkout using a promo code.
25
+ */
26
+ list(query = {}, options) {
27
+ return this._client.getAPIList('/v1/pay/coupons', (CursorIDPage), { query, ...options });
28
+ }
29
+ /**
30
+ * Permanently deletes a coupon. The promo code can no longer be used. Existing
31
+ * discounts applied to active subscriptions are not affected.
32
+ */
33
+ delete(couponID, options) {
34
+ return this._client.delete(path `/v1/pay/coupons/${couponID}`, {
35
+ ...options,
36
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
37
+ });
38
+ }
39
+ /**
40
+ * Retrieves a coupon by ID. Returns the coupon object including discount details
41
+ * and redemption statistics.
42
+ */
43
+ get(couponID, options) {
44
+ return this._client.get(path `/v1/pay/coupons/${couponID}`, options);
45
+ }
46
+ }
47
+ //# sourceMappingURL=coupons.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coupons.mjs","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,E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