@schematichq/schematic-typescript-node 1.1.2 → 1.1.4

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 (222) hide show
  1. package/Client.d.ts +10 -0
  2. package/Client.js +88 -0
  3. package/api/resources/accesstokens/client/Client.js +1 -1
  4. package/api/resources/accounts/client/Client.js +14 -14
  5. package/api/resources/billing/client/Client.d.ts +61 -0
  6. package/api/resources/billing/client/Client.js +392 -8
  7. package/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +16 -0
  8. package/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
  9. package/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
  10. package/api/resources/billing/client/requests/index.d.ts +3 -0
  11. package/api/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +9 -0
  12. package/api/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +9 -0
  13. package/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +9 -0
  14. package/api/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +9 -0
  15. package/api/resources/billing/types/index.d.ts +4 -0
  16. package/api/resources/billing/types/index.js +4 -0
  17. package/api/resources/companies/client/Client.d.ts +0 -13
  18. package/api/resources/companies/client/Client.js +31 -136
  19. package/api/resources/companies/client/requests/index.d.ts +0 -1
  20. package/api/resources/companies/types/index.d.ts +0 -2
  21. package/api/resources/companies/types/index.js +0 -2
  22. package/api/resources/components/client/Client.js +7 -7
  23. package/api/resources/crm/client/Client.js +5 -5
  24. package/api/resources/entitlements/client/Client.js +19 -19
  25. package/api/resources/events/client/Client.js +8 -8
  26. package/api/resources/features/client/Client.js +19 -19
  27. package/api/resources/plans/client/Client.d.ts +12 -1
  28. package/api/resources/plans/client/Client.js +99 -11
  29. package/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
  30. package/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
  31. package/{dist/api/resources/companies/types/ListCompanyPlansResponse.d.ts → api/resources/plans/types/ListActivePlansResponse.d.ts} +3 -3
  32. package/api/resources/plans/types/index.d.ts +1 -0
  33. package/api/resources/plans/types/index.js +1 -0
  34. package/api/resources/webhooks/client/Client.js +9 -9
  35. package/api/types/BillingPlan.d.ts +11 -0
  36. package/api/types/BillingPlan.js +5 -0
  37. package/api/types/BillingPlanGroupResponseData.d.ts +11 -0
  38. package/api/types/BillingPlanGroupResponseData.js +5 -0
  39. package/api/types/BillingProductForSubscriptionResponseData.d.ts +16 -0
  40. package/api/types/BillingProductForSubscriptionResponseData.js +5 -0
  41. package/api/types/BillingProductPricing.d.ts +2 -0
  42. package/api/types/CompanyDetailResponseData.d.ts +1 -1
  43. package/api/types/CompanySubscriptionResponseData.d.ts +1 -1
  44. package/api/types/PlanDetailResponseData.d.ts +0 -1
  45. package/api/types/PlanResponseData.d.ts +0 -1
  46. package/api/types/index.d.ts +3 -1
  47. package/api/types/index.js +3 -1
  48. package/dist/Client.d.ts +10 -0
  49. package/dist/Client.js +88 -0
  50. package/dist/api/resources/accesstokens/client/Client.js +1 -1
  51. package/dist/api/resources/accounts/client/Client.js +14 -14
  52. package/dist/api/resources/billing/client/Client.d.ts +61 -0
  53. package/dist/api/resources/billing/client/Client.js +392 -8
  54. package/dist/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +16 -0
  55. package/dist/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +5 -0
  56. package/dist/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
  57. package/dist/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +5 -0
  58. package/dist/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
  59. package/dist/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +5 -0
  60. package/dist/api/resources/billing/client/requests/index.d.ts +3 -0
  61. package/dist/api/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +9 -0
  62. package/dist/api/resources/billing/types/ChangeSubscriptionWebResponse.js +5 -0
  63. package/dist/api/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +9 -0
  64. package/dist/api/resources/billing/types/CreateBillingPlanGroupResponse.js +5 -0
  65. package/dist/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +9 -0
  66. package/dist/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js +5 -0
  67. package/dist/api/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +9 -0
  68. package/dist/api/resources/billing/types/UpdateBillingPlanGroupResponse.js +5 -0
  69. package/dist/api/resources/billing/types/index.d.ts +4 -0
  70. package/dist/api/resources/billing/types/index.js +4 -0
  71. package/dist/api/resources/companies/client/Client.d.ts +0 -13
  72. package/dist/api/resources/companies/client/Client.js +31 -136
  73. package/dist/api/resources/companies/client/requests/index.d.ts +0 -1
  74. package/dist/api/resources/companies/types/index.d.ts +0 -2
  75. package/dist/api/resources/companies/types/index.js +0 -2
  76. package/dist/api/resources/components/client/Client.js +7 -7
  77. package/dist/api/resources/crm/client/Client.js +5 -5
  78. package/dist/api/resources/entitlements/client/Client.js +19 -19
  79. package/dist/api/resources/events/client/Client.js +8 -8
  80. package/dist/api/resources/features/client/Client.js +19 -19
  81. package/dist/api/resources/plans/client/Client.d.ts +12 -1
  82. package/dist/api/resources/plans/client/Client.js +99 -11
  83. package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
  84. package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
  85. package/{api/resources/companies/types/ListCompanyPlansResponse.d.ts → dist/api/resources/plans/types/ListActivePlansResponse.d.ts} +3 -3
  86. package/dist/api/resources/plans/types/ListActivePlansResponse.js +5 -0
  87. package/dist/api/resources/plans/types/index.d.ts +1 -0
  88. package/dist/api/resources/plans/types/index.js +1 -0
  89. package/dist/api/resources/webhooks/client/Client.js +9 -9
  90. package/dist/api/types/BillingPlan.d.ts +11 -0
  91. package/dist/api/types/BillingPlan.js +5 -0
  92. package/dist/api/types/BillingPlanGroupResponseData.d.ts +11 -0
  93. package/dist/api/types/BillingPlanGroupResponseData.js +5 -0
  94. package/dist/api/types/BillingProductForSubscriptionResponseData.d.ts +16 -0
  95. package/dist/api/types/BillingProductForSubscriptionResponseData.js +5 -0
  96. package/dist/api/types/BillingProductPricing.d.ts +2 -0
  97. package/dist/api/types/CompanyDetailResponseData.d.ts +1 -1
  98. package/dist/api/types/CompanySubscriptionResponseData.d.ts +1 -1
  99. package/dist/api/types/PlanDetailResponseData.d.ts +0 -1
  100. package/dist/api/types/PlanResponseData.d.ts +0 -1
  101. package/dist/api/types/index.d.ts +3 -1
  102. package/dist/api/types/index.js +3 -1
  103. package/dist/events.d.ts +3 -0
  104. package/dist/events.js +17 -5
  105. package/dist/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +14 -0
  106. package/dist/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +35 -0
  107. package/dist/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
  108. package/dist/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +34 -0
  109. package/dist/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
  110. package/dist/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +34 -0
  111. package/dist/serialization/resources/billing/client/requests/index.d.ts +3 -0
  112. package/dist/serialization/resources/billing/client/requests/index.js +7 -1
  113. package/dist/serialization/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +14 -0
  114. package/dist/serialization/resources/{companies/types/ListCompanyPlansParams.js → billing/types/ChangeSubscriptionWebResponse.js} +5 -6
  115. package/dist/serialization/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +14 -0
  116. package/{serialization/resources/companies/types/ListCompanyPlansParams.js → dist/serialization/resources/billing/types/CreateBillingPlanGroupResponse.js} +5 -6
  117. package/dist/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +14 -0
  118. package/dist/serialization/resources/{companies/types/ListCompanyPlansResponse.js → billing/types/GetBillingPlanGroupByAccountIdResponse.js} +5 -6
  119. package/dist/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +14 -0
  120. package/{serialization/resources/companies/types/ListCompanyPlansResponse.js → dist/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.js} +5 -6
  121. package/dist/serialization/resources/billing/types/index.d.ts +4 -0
  122. package/dist/serialization/resources/billing/types/index.js +4 -0
  123. package/dist/serialization/resources/companies/types/index.d.ts +0 -2
  124. package/dist/serialization/resources/companies/types/index.js +0 -2
  125. package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
  126. package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
  127. package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
  128. package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
  129. package/dist/serialization/resources/plans/types/ListActivePlansResponse.d.ts +14 -0
  130. package/dist/serialization/resources/plans/types/ListActivePlansResponse.js +35 -0
  131. package/dist/serialization/resources/plans/types/index.d.ts +1 -0
  132. package/dist/serialization/resources/plans/types/index.js +1 -0
  133. package/dist/serialization/types/BillingPlan.d.ts +17 -0
  134. package/dist/serialization/types/BillingPlan.js +38 -0
  135. package/dist/serialization/types/BillingPlanGroupResponseData.d.ts +14 -0
  136. package/dist/serialization/types/BillingPlanGroupResponseData.js +35 -0
  137. package/dist/serialization/types/BillingProductForSubscriptionResponseData.d.ts +22 -0
  138. package/{serialization/types/CompanyPlanResponseData.js → dist/serialization/types/BillingProductForSubscriptionResponseData.js} +9 -4
  139. package/dist/serialization/types/BillingProductPricing.d.ts +2 -0
  140. package/dist/serialization/types/BillingProductPricing.js +2 -0
  141. package/dist/serialization/types/CompanyDetailResponseData.d.ts +2 -1
  142. package/dist/serialization/types/CompanyDetailResponseData.js +2 -1
  143. package/dist/serialization/types/CompanySubscriptionResponseData.d.ts +2 -2
  144. package/dist/serialization/types/CompanySubscriptionResponseData.js +2 -2
  145. package/dist/serialization/types/PlanDetailResponseData.d.ts +0 -1
  146. package/dist/serialization/types/PlanDetailResponseData.js +0 -1
  147. package/dist/serialization/types/PlanResponseData.d.ts +0 -1
  148. package/dist/serialization/types/PlanResponseData.js +0 -1
  149. package/dist/serialization/types/index.d.ts +3 -1
  150. package/dist/serialization/types/index.js +3 -1
  151. package/dist/wrapper.js +20 -15
  152. package/events.d.ts +3 -0
  153. package/events.js +17 -5
  154. package/package.json +1 -1
  155. package/reference.md +282 -49
  156. package/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +14 -0
  157. package/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +35 -0
  158. package/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
  159. package/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +34 -0
  160. package/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
  161. package/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +34 -0
  162. package/serialization/resources/billing/client/requests/index.d.ts +3 -0
  163. package/serialization/resources/billing/client/requests/index.js +7 -1
  164. package/serialization/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +14 -0
  165. package/serialization/resources/billing/types/ChangeSubscriptionWebResponse.js +35 -0
  166. package/serialization/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +14 -0
  167. package/serialization/resources/billing/types/CreateBillingPlanGroupResponse.js +35 -0
  168. package/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +14 -0
  169. package/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js +35 -0
  170. package/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +14 -0
  171. package/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.js +35 -0
  172. package/serialization/resources/billing/types/index.d.ts +4 -0
  173. package/serialization/resources/billing/types/index.js +4 -0
  174. package/serialization/resources/companies/types/index.d.ts +0 -2
  175. package/serialization/resources/companies/types/index.js +0 -2
  176. package/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
  177. package/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
  178. package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
  179. package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
  180. package/serialization/resources/plans/types/ListActivePlansResponse.d.ts +14 -0
  181. package/serialization/resources/plans/types/ListActivePlansResponse.js +35 -0
  182. package/serialization/resources/plans/types/index.d.ts +1 -0
  183. package/serialization/resources/plans/types/index.js +1 -0
  184. package/serialization/types/BillingPlan.d.ts +17 -0
  185. package/serialization/types/BillingPlan.js +38 -0
  186. package/serialization/types/BillingPlanGroupResponseData.d.ts +14 -0
  187. package/serialization/types/BillingPlanGroupResponseData.js +35 -0
  188. package/serialization/types/BillingProductForSubscriptionResponseData.d.ts +22 -0
  189. package/{dist/serialization/types/CompanyPlanResponseData.js → serialization/types/BillingProductForSubscriptionResponseData.js} +9 -4
  190. package/serialization/types/BillingProductPricing.d.ts +2 -0
  191. package/serialization/types/BillingProductPricing.js +2 -0
  192. package/serialization/types/CompanyDetailResponseData.d.ts +2 -1
  193. package/serialization/types/CompanyDetailResponseData.js +2 -1
  194. package/serialization/types/CompanySubscriptionResponseData.d.ts +2 -2
  195. package/serialization/types/CompanySubscriptionResponseData.js +2 -2
  196. package/serialization/types/PlanDetailResponseData.d.ts +0 -1
  197. package/serialization/types/PlanDetailResponseData.js +0 -1
  198. package/serialization/types/PlanResponseData.d.ts +0 -1
  199. package/serialization/types/PlanResponseData.js +0 -1
  200. package/serialization/types/index.d.ts +3 -1
  201. package/serialization/types/index.js +3 -1
  202. package/wrapper.js +20 -15
  203. package/api/resources/companies/client/requests/ListCompanyPlansRequest.d.ts +0 -19
  204. package/api/resources/companies/types/ListCompanyPlansParams.d.ts +0 -14
  205. package/api/types/CompanyPlanResponseData.d.ts +0 -11
  206. package/dist/api/resources/companies/client/requests/ListCompanyPlansRequest.d.ts +0 -19
  207. package/dist/api/resources/companies/types/ListCompanyPlansParams.d.ts +0 -14
  208. package/dist/api/types/CompanyPlanResponseData.d.ts +0 -11
  209. package/dist/serialization/resources/companies/types/ListCompanyPlansParams.d.ts +0 -15
  210. package/dist/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
  211. package/dist/serialization/types/CompanyPlanResponseData.d.ts +0 -17
  212. package/serialization/resources/companies/types/ListCompanyPlansParams.d.ts +0 -15
  213. package/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
  214. package/serialization/types/CompanyPlanResponseData.d.ts +0 -17
  215. /package/api/resources/{companies/client/requests/ListCompanyPlansRequest.js → billing/client/requests/ChangeSubscriptionRequestBody.js} +0 -0
  216. /package/api/resources/{companies/types/ListCompanyPlansParams.js → billing/client/requests/CreateBillingPlanGroupRequestBody.js} +0 -0
  217. /package/api/resources/{companies/types/ListCompanyPlansResponse.js → billing/client/requests/UpdateBillingPlanGroupRequestBody.js} +0 -0
  218. /package/api/{types/CompanyPlanResponseData.js → resources/billing/types/ChangeSubscriptionWebResponse.js} +0 -0
  219. /package/{dist/api/resources/companies/client/requests/ListCompanyPlansRequest.js → api/resources/billing/types/CreateBillingPlanGroupResponse.js} +0 -0
  220. /package/{dist/api/resources/companies/types/ListCompanyPlansParams.js → api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js} +0 -0
  221. /package/{dist/api/resources/companies/types/ListCompanyPlansResponse.js → api/resources/billing/types/UpdateBillingPlanGroupResponse.js} +0 -0
  222. /package/{dist/api/types/CompanyPlanResponseData.js → api/resources/plans/types/ListActivePlansResponse.js} +0 -0
@@ -75,7 +75,7 @@ class Billing {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customer/upsert"),
77
77
  method: "POST",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  requestType: "json",
81
81
  body: serializers.CreateBillingCustomerRequestBody.jsonOrThrow(request, {
@@ -185,7 +185,7 @@ class Billing {
185
185
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
186
186
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customers"),
187
187
  method: "GET",
188
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
188
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
189
189
  contentType: "application/json",
190
190
  queryParameters: _queryParams,
191
191
  requestType: "json",
@@ -293,7 +293,7 @@ class Billing {
293
293
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
294
294
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customers/count"),
295
295
  method: "GET",
296
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
296
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
297
297
  contentType: "application/json",
298
298
  queryParameters: _queryParams,
299
299
  requestType: "json",
@@ -366,6 +366,295 @@ class Billing {
366
366
  }
367
367
  });
368
368
  }
369
+ /**
370
+ * @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
371
+ *
372
+ * @throws {@link Schematic.UnauthorizedError}
373
+ * @throws {@link Schematic.ForbiddenError}
374
+ * @throws {@link Schematic.NotFoundError}
375
+ * @throws {@link Schematic.InternalServerError}
376
+ *
377
+ * @example
378
+ * await client.billing.getBillingPlanGroupByAccountId()
379
+ */
380
+ getBillingPlanGroupByAccountId(requestOptions) {
381
+ var _a, _b;
382
+ return __awaiter(this, void 0, void 0, function* () {
383
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/plan-group"),
385
+ method: "GET",
386
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
387
+ contentType: "application/json",
388
+ requestType: "json",
389
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
390
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
391
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
392
+ });
393
+ if (_response.ok) {
394
+ return serializers.GetBillingPlanGroupByAccountIdResponse.parseOrThrow(_response.body, {
395
+ unrecognizedObjectKeys: "passthrough",
396
+ allowUnrecognizedUnionMembers: true,
397
+ allowUnrecognizedEnumValues: true,
398
+ skipValidation: true,
399
+ breadcrumbsPrefix: ["response"],
400
+ });
401
+ }
402
+ if (_response.error.reason === "status-code") {
403
+ switch (_response.error.statusCode) {
404
+ case 401:
405
+ throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
406
+ unrecognizedObjectKeys: "passthrough",
407
+ allowUnrecognizedUnionMembers: true,
408
+ allowUnrecognizedEnumValues: true,
409
+ skipValidation: true,
410
+ breadcrumbsPrefix: ["response"],
411
+ }));
412
+ case 403:
413
+ throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
414
+ unrecognizedObjectKeys: "passthrough",
415
+ allowUnrecognizedUnionMembers: true,
416
+ allowUnrecognizedEnumValues: true,
417
+ skipValidation: true,
418
+ breadcrumbsPrefix: ["response"],
419
+ }));
420
+ case 404:
421
+ throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
422
+ unrecognizedObjectKeys: "passthrough",
423
+ allowUnrecognizedUnionMembers: true,
424
+ allowUnrecognizedEnumValues: true,
425
+ skipValidation: true,
426
+ breadcrumbsPrefix: ["response"],
427
+ }));
428
+ case 500:
429
+ throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
430
+ unrecognizedObjectKeys: "passthrough",
431
+ allowUnrecognizedUnionMembers: true,
432
+ allowUnrecognizedEnumValues: true,
433
+ skipValidation: true,
434
+ breadcrumbsPrefix: ["response"],
435
+ }));
436
+ default:
437
+ throw new errors.SchematicError({
438
+ statusCode: _response.error.statusCode,
439
+ body: _response.error.body,
440
+ });
441
+ }
442
+ }
443
+ switch (_response.error.reason) {
444
+ case "non-json":
445
+ throw new errors.SchematicError({
446
+ statusCode: _response.error.statusCode,
447
+ body: _response.error.rawBody,
448
+ });
449
+ case "timeout":
450
+ throw new errors.SchematicTimeoutError();
451
+ case "unknown":
452
+ throw new errors.SchematicError({
453
+ message: _response.error.errorMessage,
454
+ });
455
+ }
456
+ });
457
+ }
458
+ /**
459
+ * @param {Schematic.CreateBillingPlanGroupRequestBody} request
460
+ * @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
461
+ *
462
+ * @throws {@link Schematic.BadRequestError}
463
+ * @throws {@link Schematic.UnauthorizedError}
464
+ * @throws {@link Schematic.ForbiddenError}
465
+ * @throws {@link Schematic.InternalServerError}
466
+ *
467
+ * @example
468
+ * await client.billing.createBillingPlanGroup({
469
+ * planIds: ["plan_ids"]
470
+ * })
471
+ */
472
+ createBillingPlanGroup(request, requestOptions) {
473
+ var _a, _b;
474
+ return __awaiter(this, void 0, void 0, function* () {
475
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
476
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/plan-group"),
477
+ method: "POST",
478
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
479
+ contentType: "application/json",
480
+ requestType: "json",
481
+ body: serializers.CreateBillingPlanGroupRequestBody.jsonOrThrow(request, {
482
+ unrecognizedObjectKeys: "strip",
483
+ }),
484
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
485
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
486
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
487
+ });
488
+ if (_response.ok) {
489
+ return serializers.CreateBillingPlanGroupResponse.parseOrThrow(_response.body, {
490
+ unrecognizedObjectKeys: "passthrough",
491
+ allowUnrecognizedUnionMembers: true,
492
+ allowUnrecognizedEnumValues: true,
493
+ skipValidation: true,
494
+ breadcrumbsPrefix: ["response"],
495
+ });
496
+ }
497
+ if (_response.error.reason === "status-code") {
498
+ switch (_response.error.statusCode) {
499
+ case 400:
500
+ throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
501
+ unrecognizedObjectKeys: "passthrough",
502
+ allowUnrecognizedUnionMembers: true,
503
+ allowUnrecognizedEnumValues: true,
504
+ skipValidation: true,
505
+ breadcrumbsPrefix: ["response"],
506
+ }));
507
+ case 401:
508
+ throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
509
+ unrecognizedObjectKeys: "passthrough",
510
+ allowUnrecognizedUnionMembers: true,
511
+ allowUnrecognizedEnumValues: true,
512
+ skipValidation: true,
513
+ breadcrumbsPrefix: ["response"],
514
+ }));
515
+ case 403:
516
+ throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
517
+ unrecognizedObjectKeys: "passthrough",
518
+ allowUnrecognizedUnionMembers: true,
519
+ allowUnrecognizedEnumValues: true,
520
+ skipValidation: true,
521
+ breadcrumbsPrefix: ["response"],
522
+ }));
523
+ case 500:
524
+ throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
525
+ unrecognizedObjectKeys: "passthrough",
526
+ allowUnrecognizedUnionMembers: true,
527
+ allowUnrecognizedEnumValues: true,
528
+ skipValidation: true,
529
+ breadcrumbsPrefix: ["response"],
530
+ }));
531
+ default:
532
+ throw new errors.SchematicError({
533
+ statusCode: _response.error.statusCode,
534
+ body: _response.error.body,
535
+ });
536
+ }
537
+ }
538
+ switch (_response.error.reason) {
539
+ case "non-json":
540
+ throw new errors.SchematicError({
541
+ statusCode: _response.error.statusCode,
542
+ body: _response.error.rawBody,
543
+ });
544
+ case "timeout":
545
+ throw new errors.SchematicTimeoutError();
546
+ case "unknown":
547
+ throw new errors.SchematicError({
548
+ message: _response.error.errorMessage,
549
+ });
550
+ }
551
+ });
552
+ }
553
+ /**
554
+ * @param {string} billingId - billing_id
555
+ * @param {Schematic.UpdateBillingPlanGroupRequestBody} request
556
+ * @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
557
+ *
558
+ * @throws {@link Schematic.BadRequestError}
559
+ * @throws {@link Schematic.UnauthorizedError}
560
+ * @throws {@link Schematic.ForbiddenError}
561
+ * @throws {@link Schematic.NotFoundError}
562
+ * @throws {@link Schematic.InternalServerError}
563
+ *
564
+ * @example
565
+ * await client.billing.updateBillingPlanGroup("billing_id", {
566
+ * planIds: ["plan_ids"]
567
+ * })
568
+ */
569
+ updateBillingPlanGroup(billingId, request, requestOptions) {
570
+ var _a, _b;
571
+ return __awaiter(this, void 0, void 0, function* () {
572
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
573
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `billing/plan-group/${encodeURIComponent(billingId)}`),
574
+ method: "PUT",
575
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
576
+ contentType: "application/json",
577
+ requestType: "json",
578
+ body: serializers.UpdateBillingPlanGroupRequestBody.jsonOrThrow(request, {
579
+ unrecognizedObjectKeys: "strip",
580
+ }),
581
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
582
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
583
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
584
+ });
585
+ if (_response.ok) {
586
+ return serializers.UpdateBillingPlanGroupResponse.parseOrThrow(_response.body, {
587
+ unrecognizedObjectKeys: "passthrough",
588
+ allowUnrecognizedUnionMembers: true,
589
+ allowUnrecognizedEnumValues: true,
590
+ skipValidation: true,
591
+ breadcrumbsPrefix: ["response"],
592
+ });
593
+ }
594
+ if (_response.error.reason === "status-code") {
595
+ switch (_response.error.statusCode) {
596
+ case 400:
597
+ throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
598
+ unrecognizedObjectKeys: "passthrough",
599
+ allowUnrecognizedUnionMembers: true,
600
+ allowUnrecognizedEnumValues: true,
601
+ skipValidation: true,
602
+ breadcrumbsPrefix: ["response"],
603
+ }));
604
+ case 401:
605
+ throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
606
+ unrecognizedObjectKeys: "passthrough",
607
+ allowUnrecognizedUnionMembers: true,
608
+ allowUnrecognizedEnumValues: true,
609
+ skipValidation: true,
610
+ breadcrumbsPrefix: ["response"],
611
+ }));
612
+ case 403:
613
+ throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
614
+ unrecognizedObjectKeys: "passthrough",
615
+ allowUnrecognizedUnionMembers: true,
616
+ allowUnrecognizedEnumValues: true,
617
+ skipValidation: true,
618
+ breadcrumbsPrefix: ["response"],
619
+ }));
620
+ case 404:
621
+ throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
622
+ unrecognizedObjectKeys: "passthrough",
623
+ allowUnrecognizedUnionMembers: true,
624
+ allowUnrecognizedEnumValues: true,
625
+ skipValidation: true,
626
+ breadcrumbsPrefix: ["response"],
627
+ }));
628
+ case 500:
629
+ throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
630
+ unrecognizedObjectKeys: "passthrough",
631
+ allowUnrecognizedUnionMembers: true,
632
+ allowUnrecognizedEnumValues: true,
633
+ skipValidation: true,
634
+ breadcrumbsPrefix: ["response"],
635
+ }));
636
+ default:
637
+ throw new errors.SchematicError({
638
+ statusCode: _response.error.statusCode,
639
+ body: _response.error.body,
640
+ });
641
+ }
642
+ }
643
+ switch (_response.error.reason) {
644
+ case "non-json":
645
+ throw new errors.SchematicError({
646
+ statusCode: _response.error.statusCode,
647
+ body: _response.error.rawBody,
648
+ });
649
+ case "timeout":
650
+ throw new errors.SchematicTimeoutError();
651
+ case "unknown":
652
+ throw new errors.SchematicError({
653
+ message: _response.error.errorMessage,
654
+ });
655
+ }
656
+ });
657
+ }
369
658
  /**
370
659
  * @param {Schematic.CreateBillingPriceRequestBody} request
371
660
  * @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
@@ -389,7 +678,7 @@ class Billing {
389
678
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
390
679
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/price/upsert"),
391
680
  method: "POST",
392
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
681
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
393
682
  contentType: "application/json",
394
683
  requestType: "json",
395
684
  body: serializers.CreateBillingPriceRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -502,7 +791,7 @@ class Billing {
502
791
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
503
792
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/product/prices"),
504
793
  method: "GET",
505
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
794
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
506
795
  contentType: "application/json",
507
796
  queryParameters: _queryParams,
508
797
  requestType: "json",
@@ -599,7 +888,7 @@ class Billing {
599
888
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
600
889
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/product/upsert"),
601
890
  method: "POST",
602
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
891
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
603
892
  contentType: "application/json",
604
893
  requestType: "json",
605
894
  body: serializers.CreateBillingProductRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -712,7 +1001,7 @@ class Billing {
712
1001
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
713
1002
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/products"),
714
1003
  method: "GET",
715
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
1004
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
716
1005
  contentType: "application/json",
717
1006
  queryParameters: _queryParams,
718
1007
  requestType: "json",
@@ -812,7 +1101,7 @@ class Billing {
812
1101
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
813
1102
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/subscription/upsert"),
814
1103
  method: "POST",
815
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
1104
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
816
1105
  contentType: "application/json",
817
1106
  requestType: "json",
818
1107
  body: serializers.CreateBillingSubscriptionsRequestBody.jsonOrThrow(request, {
@@ -887,6 +1176,101 @@ class Billing {
887
1176
  }
888
1177
  });
889
1178
  }
1179
+ /**
1180
+ * @param {Schematic.ChangeSubscriptionRequestBody} request
1181
+ * @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
1182
+ *
1183
+ * @throws {@link Schematic.BadRequestError}
1184
+ * @throws {@link Schematic.UnauthorizedError}
1185
+ * @throws {@link Schematic.ForbiddenError}
1186
+ * @throws {@link Schematic.InternalServerError}
1187
+ *
1188
+ * @example
1189
+ * await client.billing.changeSubscriptionWeb({
1190
+ * action: "action",
1191
+ * newPlanId: "new_plan_id",
1192
+ * newPriceId: "new_price_id"
1193
+ * })
1194
+ */
1195
+ changeSubscriptionWeb(request, requestOptions) {
1196
+ var _a, _b;
1197
+ return __awaiter(this, void 0, void 0, function* () {
1198
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
1199
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "checkout"),
1200
+ method: "POST",
1201
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
1202
+ contentType: "application/json",
1203
+ requestType: "json",
1204
+ body: serializers.ChangeSubscriptionRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
1205
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1206
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1207
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1208
+ });
1209
+ if (_response.ok) {
1210
+ return serializers.ChangeSubscriptionWebResponse.parseOrThrow(_response.body, {
1211
+ unrecognizedObjectKeys: "passthrough",
1212
+ allowUnrecognizedUnionMembers: true,
1213
+ allowUnrecognizedEnumValues: true,
1214
+ skipValidation: true,
1215
+ breadcrumbsPrefix: ["response"],
1216
+ });
1217
+ }
1218
+ if (_response.error.reason === "status-code") {
1219
+ switch (_response.error.statusCode) {
1220
+ case 400:
1221
+ throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
1222
+ unrecognizedObjectKeys: "passthrough",
1223
+ allowUnrecognizedUnionMembers: true,
1224
+ allowUnrecognizedEnumValues: true,
1225
+ skipValidation: true,
1226
+ breadcrumbsPrefix: ["response"],
1227
+ }));
1228
+ case 401:
1229
+ throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
1230
+ unrecognizedObjectKeys: "passthrough",
1231
+ allowUnrecognizedUnionMembers: true,
1232
+ allowUnrecognizedEnumValues: true,
1233
+ skipValidation: true,
1234
+ breadcrumbsPrefix: ["response"],
1235
+ }));
1236
+ case 403:
1237
+ throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
1238
+ unrecognizedObjectKeys: "passthrough",
1239
+ allowUnrecognizedUnionMembers: true,
1240
+ allowUnrecognizedEnumValues: true,
1241
+ skipValidation: true,
1242
+ breadcrumbsPrefix: ["response"],
1243
+ }));
1244
+ case 500:
1245
+ throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
1246
+ unrecognizedObjectKeys: "passthrough",
1247
+ allowUnrecognizedUnionMembers: true,
1248
+ allowUnrecognizedEnumValues: true,
1249
+ skipValidation: true,
1250
+ breadcrumbsPrefix: ["response"],
1251
+ }));
1252
+ default:
1253
+ throw new errors.SchematicError({
1254
+ statusCode: _response.error.statusCode,
1255
+ body: _response.error.body,
1256
+ });
1257
+ }
1258
+ }
1259
+ switch (_response.error.reason) {
1260
+ case "non-json":
1261
+ throw new errors.SchematicError({
1262
+ statusCode: _response.error.statusCode,
1263
+ body: _response.error.rawBody,
1264
+ });
1265
+ case "timeout":
1266
+ throw new errors.SchematicTimeoutError();
1267
+ case "unknown":
1268
+ throw new errors.SchematicError({
1269
+ message: _response.error.errorMessage,
1270
+ });
1271
+ }
1272
+ });
1273
+ }
890
1274
  _getCustomAuthorizationHeaders() {
891
1275
  return __awaiter(this, void 0, void 0, function* () {
892
1276
  const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * action: "action",
8
+ * newPlanId: "new_plan_id",
9
+ * newPriceId: "new_price_id"
10
+ * }
11
+ */
12
+ export interface ChangeSubscriptionRequestBody {
13
+ action: string;
14
+ newPlanId: string;
15
+ newPriceId: string;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * planIds: ["plan_ids"]
8
+ * }
9
+ */
10
+ export interface CreateBillingPlanGroupRequestBody {
11
+ defaultPlanId?: string;
12
+ planIds: string[];
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * planIds: ["plan_ids"]
8
+ * }
9
+ */
10
+ export interface UpdateBillingPlanGroupRequestBody {
11
+ defaultPlanId?: string;
12
+ planIds: string[];
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,11 @@
1
1
  export { type CreateBillingCustomerRequestBody } from "./CreateBillingCustomerRequestBody";
2
2
  export { type ListCustomersRequest } from "./ListCustomersRequest";
3
3
  export { type CountCustomersRequest } from "./CountCustomersRequest";
4
+ export { type CreateBillingPlanGroupRequestBody } from "./CreateBillingPlanGroupRequestBody";
5
+ export { type UpdateBillingPlanGroupRequestBody } from "./UpdateBillingPlanGroupRequestBody";
4
6
  export { type CreateBillingPriceRequestBody } from "./CreateBillingPriceRequestBody";
5
7
  export { type ListProductPricesRequest } from "./ListProductPricesRequest";
6
8
  export { type CreateBillingProductRequestBody } from "./CreateBillingProductRequestBody";
7
9
  export { type ListBillingProductsRequest } from "./ListBillingProductsRequest";
8
10
  export { type CreateBillingSubscriptionsRequestBody } from "./CreateBillingSubscriptionsRequestBody";
11
+ export { type ChangeSubscriptionRequestBody } from "./ChangeSubscriptionRequestBody";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Schematic from "../../../index";
5
+ export interface ChangeSubscriptionWebResponse {
6
+ data: Schematic.BillingSubscriptionResponseData;
7
+ /** Input parameters */
8
+ params: Record<string, unknown>;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Schematic from "../../../index";
5
+ export interface CreateBillingPlanGroupResponse {
6
+ data: Schematic.BillingPlanGroupResponseData;
7
+ /** Input parameters */
8
+ params: Record<string, unknown>;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Schematic from "../../../index";
5
+ export interface GetBillingPlanGroupByAccountIdResponse {
6
+ data: Schematic.BillingPlanGroupResponseData;
7
+ /** Input parameters */
8
+ params: Record<string, unknown>;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Schematic from "../../../index";
5
+ export interface UpdateBillingPlanGroupResponse {
6
+ data: Schematic.BillingPlanGroupResponseData;
7
+ /** Input parameters */
8
+ params: Record<string, unknown>;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,9 @@ export * from "./ListCustomersParams";
3
3
  export * from "./ListCustomersResponse";
4
4
  export * from "./CountCustomersParams";
5
5
  export * from "./CountCustomersResponse";
6
+ export * from "./GetBillingPlanGroupByAccountIdResponse";
7
+ export * from "./CreateBillingPlanGroupResponse";
8
+ export * from "./UpdateBillingPlanGroupResponse";
6
9
  export * from "./UpsertBillingPriceResponse";
7
10
  export * from "./ListProductPricesParams";
8
11
  export * from "./ListProductPricesResponse";
@@ -10,3 +13,4 @@ export * from "./UpsertBillingProductResponse";
10
13
  export * from "./ListBillingProductsParams";
11
14
  export * from "./ListBillingProductsResponse";
12
15
  export * from "./UpsertBillingSubscriptionResponse";
16
+ export * from "./ChangeSubscriptionWebResponse";