@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
@@ -67,7 +67,7 @@ class Plans {
67
67
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
68
68
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plan-audiences/${encodeURIComponent(planAudienceId)}`),
69
69
  method: "GET",
70
- 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())),
70
+ 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())),
71
71
  contentType: "application/json",
72
72
  requestType: "json",
73
73
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -172,7 +172,7 @@ class Plans {
172
172
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
173
173
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plan-audiences/${encodeURIComponent(planAudienceId)}`),
174
174
  method: "PUT",
175
- 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())),
175
+ 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())),
176
176
  contentType: "application/json",
177
177
  requestType: "json",
178
178
  body: serializers.UpdateAudienceRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -271,7 +271,7 @@ class Plans {
271
271
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
272
272
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plan-audiences/${encodeURIComponent(planAudienceId)}`),
273
273
  method: "DELETE",
274
- 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())),
274
+ 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())),
275
275
  contentType: "application/json",
276
276
  requestType: "json",
277
277
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -389,7 +389,7 @@ class Plans {
389
389
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
390
390
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "plans"),
391
391
  method: "GET",
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())),
392
+ 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
393
  contentType: "application/json",
394
394
  queryParameters: _queryParams,
395
395
  requestType: "json",
@@ -484,7 +484,7 @@ class Plans {
484
484
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
485
485
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "plans"),
486
486
  method: "POST",
487
- 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())),
487
+ 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())),
488
488
  contentType: "application/json",
489
489
  requestType: "json",
490
490
  body: serializers.CreatePlanRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -575,7 +575,7 @@ class Plans {
575
575
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
576
576
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plans/${encodeURIComponent(planId)}`),
577
577
  method: "GET",
578
- 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())),
578
+ 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())),
579
579
  contentType: "application/json",
580
580
  requestType: "json",
581
581
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -660,7 +660,6 @@ class Plans {
660
660
  *
661
661
  * @example
662
662
  * await client.plans.updatePlan("plan_id", {
663
- * audienceType: "audience_type",
664
663
  * name: "name"
665
664
  * })
666
665
  */
@@ -670,7 +669,7 @@ class Plans {
670
669
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
671
670
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plans/${encodeURIComponent(planId)}`),
672
671
  method: "PUT",
673
- 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())),
672
+ 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())),
674
673
  contentType: "application/json",
675
674
  requestType: "json",
676
675
  body: serializers.UpdatePlanRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -769,7 +768,7 @@ class Plans {
769
768
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
770
769
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plans/${encodeURIComponent(planId)}`),
771
770
  method: "DELETE",
772
- 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())),
771
+ 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())),
773
772
  contentType: "application/json",
774
773
  requestType: "json",
775
774
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -863,7 +862,7 @@ class Plans {
863
862
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
864
863
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `plans/${encodeURIComponent(planId)}/billing_products`),
865
864
  method: "PUT",
866
- 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())),
865
+ 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())),
867
866
  contentType: "application/json",
868
867
  requestType: "json",
869
868
  body: serializers.UpsertBillingProductRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -944,6 +943,95 @@ class Plans {
944
943
  }
945
944
  });
946
945
  }
946
+ /**
947
+ * @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
948
+ *
949
+ * @throws {@link Schematic.BadRequestError}
950
+ * @throws {@link Schematic.UnauthorizedError}
951
+ * @throws {@link Schematic.ForbiddenError}
952
+ * @throws {@link Schematic.InternalServerError}
953
+ *
954
+ * @example
955
+ * await client.plans.listActivePlans()
956
+ */
957
+ listActivePlans(requestOptions) {
958
+ var _a, _b;
959
+ return __awaiter(this, void 0, void 0, function* () {
960
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
961
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "plans/active"),
962
+ method: "GET",
963
+ 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())),
964
+ contentType: "application/json",
965
+ requestType: "json",
966
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
967
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
968
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
969
+ });
970
+ if (_response.ok) {
971
+ return serializers.ListActivePlansResponse.parseOrThrow(_response.body, {
972
+ unrecognizedObjectKeys: "passthrough",
973
+ allowUnrecognizedUnionMembers: true,
974
+ allowUnrecognizedEnumValues: true,
975
+ skipValidation: true,
976
+ breadcrumbsPrefix: ["response"],
977
+ });
978
+ }
979
+ if (_response.error.reason === "status-code") {
980
+ switch (_response.error.statusCode) {
981
+ case 400:
982
+ throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
983
+ unrecognizedObjectKeys: "passthrough",
984
+ allowUnrecognizedUnionMembers: true,
985
+ allowUnrecognizedEnumValues: true,
986
+ skipValidation: true,
987
+ breadcrumbsPrefix: ["response"],
988
+ }));
989
+ case 401:
990
+ throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
991
+ unrecognizedObjectKeys: "passthrough",
992
+ allowUnrecognizedUnionMembers: true,
993
+ allowUnrecognizedEnumValues: true,
994
+ skipValidation: true,
995
+ breadcrumbsPrefix: ["response"],
996
+ }));
997
+ case 403:
998
+ throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
999
+ unrecognizedObjectKeys: "passthrough",
1000
+ allowUnrecognizedUnionMembers: true,
1001
+ allowUnrecognizedEnumValues: true,
1002
+ skipValidation: true,
1003
+ breadcrumbsPrefix: ["response"],
1004
+ }));
1005
+ case 500:
1006
+ throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
1007
+ unrecognizedObjectKeys: "passthrough",
1008
+ allowUnrecognizedUnionMembers: true,
1009
+ allowUnrecognizedEnumValues: true,
1010
+ skipValidation: true,
1011
+ breadcrumbsPrefix: ["response"],
1012
+ }));
1013
+ default:
1014
+ throw new errors.SchematicError({
1015
+ statusCode: _response.error.statusCode,
1016
+ body: _response.error.body,
1017
+ });
1018
+ }
1019
+ }
1020
+ switch (_response.error.reason) {
1021
+ case "non-json":
1022
+ throw new errors.SchematicError({
1023
+ statusCode: _response.error.statusCode,
1024
+ body: _response.error.rawBody,
1025
+ });
1026
+ case "timeout":
1027
+ throw new errors.SchematicTimeoutError();
1028
+ case "unknown":
1029
+ throw new errors.SchematicError({
1030
+ message: _response.error.errorMessage,
1031
+ });
1032
+ }
1033
+ });
1034
+ }
947
1035
  /**
948
1036
  * @param {Schematic.CountPlansRequest} request
949
1037
  * @param {Plans.RequestOptions} requestOptions - Request-specific configuration.
@@ -990,7 +1078,7 @@ class Plans {
990
1078
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
991
1079
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "plans/count"),
992
1080
  method: "GET",
993
- 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())),
1081
+ 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())),
994
1082
  contentType: "application/json",
995
1083
  queryParameters: _queryParams,
996
1084
  requestType: "json",
@@ -11,7 +11,6 @@ import * as Schematic from "../../../../index";
11
11
  * }
12
12
  */
13
13
  export interface CreatePlanRequestBody {
14
- audienceType?: string;
15
14
  description: string;
16
15
  icon?: string;
17
16
  name: string;
@@ -4,12 +4,10 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * audienceType: "audience_type",
8
7
  * name: "name"
9
8
  * }
10
9
  */
11
10
  export interface UpdatePlanRequestBody {
12
- audienceType: string;
13
11
  description?: string;
14
12
  icon?: string;
15
13
  name: string;
@@ -2,9 +2,9 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Schematic from "../../../index";
5
- export interface ListCompanyPlansResponse {
5
+ export interface ListActivePlansResponse {
6
6
  /** The returned resources */
7
- data: Schematic.CompanyPlanResponseData[];
7
+ data: Schematic.PlanDetailResponseData[];
8
8
  /** Input parameters */
9
- params: Schematic.ListCompanyPlansParams;
9
+ params: Record<string, unknown>;
10
10
  }
@@ -11,6 +11,7 @@ export * from "./GetPlanResponse";
11
11
  export * from "./UpdatePlanResponse";
12
12
  export * from "./DeletePlanResponse";
13
13
  export * from "./UpsertBillingProductPlanResponse";
14
+ export * from "./ListActivePlansResponse";
14
15
  export * from "./CountPlansRequestPlanType";
15
16
  export * from "./CountPlansResponseParamsPlanType";
16
17
  export * from "./CountPlansParams";
@@ -27,6 +27,7 @@ __exportStar(require("./GetPlanResponse"), exports);
27
27
  __exportStar(require("./UpdatePlanResponse"), exports);
28
28
  __exportStar(require("./DeletePlanResponse"), exports);
29
29
  __exportStar(require("./UpsertBillingProductPlanResponse"), exports);
30
+ __exportStar(require("./ListActivePlansResponse"), exports);
30
31
  __exportStar(require("./CountPlansRequestPlanType"), exports);
31
32
  __exportStar(require("./CountPlansResponseParamsPlanType"), exports);
32
33
  __exportStar(require("./CountPlansParams"), exports);
@@ -89,7 +89,7 @@ class Webhooks {
89
89
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
90
90
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "webhook-events"),
91
91
  method: "GET",
92
- 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())),
92
+ 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())),
93
93
  contentType: "application/json",
94
94
  queryParameters: _queryParams,
95
95
  requestType: "json",
@@ -180,7 +180,7 @@ class Webhooks {
180
180
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
181
181
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `webhook-events/${encodeURIComponent(webhookEventId)}`),
182
182
  method: "GET",
183
- 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())),
183
+ 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())),
184
184
  contentType: "application/json",
185
185
  requestType: "json",
186
186
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -292,7 +292,7 @@ class Webhooks {
292
292
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
293
293
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "webhook-events/count"),
294
294
  method: "GET",
295
- 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())),
295
+ 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())),
296
296
  contentType: "application/json",
297
297
  queryParameters: _queryParams,
298
298
  requestType: "json",
@@ -394,7 +394,7 @@ class Webhooks {
394
394
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
395
395
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "webhooks"),
396
396
  method: "GET",
397
- 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())),
397
+ 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())),
398
398
  contentType: "application/json",
399
399
  queryParameters: _queryParams,
400
400
  requestType: "json",
@@ -489,7 +489,7 @@ class Webhooks {
489
489
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
490
490
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "webhooks"),
491
491
  method: "POST",
492
- 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())),
492
+ 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())),
493
493
  contentType: "application/json",
494
494
  requestType: "json",
495
495
  body: serializers.CreateWebhookRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -580,7 +580,7 @@ class Webhooks {
580
580
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
581
581
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `webhooks/${encodeURIComponent(webhookId)}`),
582
582
  method: "GET",
583
- 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())),
583
+ 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())),
584
584
  contentType: "application/json",
585
585
  requestType: "json",
586
586
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -672,7 +672,7 @@ class Webhooks {
672
672
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
673
673
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `webhooks/${encodeURIComponent(webhookId)}`),
674
674
  method: "PUT",
675
- 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())),
675
+ 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())),
676
676
  contentType: "application/json",
677
677
  requestType: "json",
678
678
  body: serializers.UpdateWebhookRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -771,7 +771,7 @@ class Webhooks {
771
771
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
772
772
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `webhooks/${encodeURIComponent(webhookId)}`),
773
773
  method: "DELETE",
774
- 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())),
774
+ 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())),
775
775
  contentType: "application/json",
776
776
  requestType: "json",
777
777
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -872,7 +872,7 @@ class Webhooks {
872
872
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
873
873
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "webhooks/count"),
874
874
  method: "GET",
875
- 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())),
875
+ 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())),
876
876
  contentType: "application/json",
877
877
  queryParameters: _queryParams,
878
878
  requestType: "json",
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface BillingPlan {
5
+ description?: string;
6
+ id: string;
7
+ imageUrl?: string;
8
+ name: string;
9
+ planPeriod?: string;
10
+ planPrice?: number;
11
+ }
@@ -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,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * The updated resource
6
+ */
7
+ export interface BillingPlanGroupResponseData {
8
+ defaultPlanId?: string;
9
+ id: string;
10
+ planIds: string[];
11
+ }
@@ -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,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface BillingProductForSubscriptionResponseData {
5
+ accountId: string;
6
+ createdAt: Date;
7
+ currency: string;
8
+ environmentId: string;
9
+ externalId: string;
10
+ id: string;
11
+ interval?: string;
12
+ name: string;
13
+ price: number;
14
+ quantity: number;
15
+ updatedAt: Date;
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 });
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface BillingProductPricing {
5
+ interval?: string;
5
6
  price: number;
7
+ priceExternalId?: string;
6
8
  productExternalId: string;
7
9
  }
@@ -12,7 +12,7 @@ export interface CompanyDetailResponseData {
12
12
  lastSeenAt?: Date;
13
13
  logoUrl?: string;
14
14
  name: string;
15
- plan?: Schematic.PreviewObject;
15
+ plan?: Schematic.BillingPlan;
16
16
  plans: Schematic.PreviewObject[];
17
17
  /** A map of trait names to trait values */
18
18
  traits?: Record<string, unknown>;
@@ -6,6 +6,6 @@ export interface CompanySubscriptionResponseData {
6
6
  customerExternalId: string;
7
7
  expiredAt?: Date;
8
8
  interval: string;
9
- products: Schematic.BillingProductResponseData[];
9
+ products: Schematic.BillingProductForSubscriptionResponseData[];
10
10
  subscriptionExternalId: string;
11
11
  }
@@ -6,7 +6,6 @@ import * as Schematic from "../index";
6
6
  * The updated resource
7
7
  */
8
8
  export interface PlanDetailResponseData {
9
- audienceType: string;
10
9
  billingProduct?: Schematic.BillingProductDetailResponseData;
11
10
  companyCount: number;
12
11
  createdAt: Date;
@@ -2,7 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface PlanResponseData {
5
- audienceType: string;
6
5
  createdAt: Date;
7
6
  description: string;
8
7
  icon: string;
@@ -7,8 +7,11 @@ export * from "./AudienceRequestBody";
7
7
  export * from "./BillingCustomerResponseData";
8
8
  export * from "./BillingCustomerSubscription";
9
9
  export * from "./BillingCustomerWithSubscriptionsResponseData";
10
+ export * from "./BillingPlan";
11
+ export * from "./BillingPlanGroupResponseData";
10
12
  export * from "./BillingPriceResponseData";
11
13
  export * from "./BillingProductDetailResponseData";
14
+ export * from "./BillingProductForSubscriptionResponseData";
12
15
  export * from "./BillingProductPlanResponseData";
13
16
  export * from "./BillingProductPricing";
14
17
  export * from "./BillingProductResponseData";
@@ -22,7 +25,6 @@ export * from "./CompanyDetailResponseData";
22
25
  export * from "./CompanyMembershipDetailResponseData";
23
26
  export * from "./CompanyMembershipResponseData";
24
27
  export * from "./CompanyOverrideResponseData";
25
- export * from "./CompanyPlanResponseData";
26
28
  export * from "./CompanyResponseData";
27
29
  export * from "./CompanySubscriptionResponseData";
28
30
  export * from "./ComponentHydrateResponseData";
@@ -23,8 +23,11 @@ __exportStar(require("./AudienceRequestBody"), exports);
23
23
  __exportStar(require("./BillingCustomerResponseData"), exports);
24
24
  __exportStar(require("./BillingCustomerSubscription"), exports);
25
25
  __exportStar(require("./BillingCustomerWithSubscriptionsResponseData"), exports);
26
+ __exportStar(require("./BillingPlan"), exports);
27
+ __exportStar(require("./BillingPlanGroupResponseData"), exports);
26
28
  __exportStar(require("./BillingPriceResponseData"), exports);
27
29
  __exportStar(require("./BillingProductDetailResponseData"), exports);
30
+ __exportStar(require("./BillingProductForSubscriptionResponseData"), exports);
28
31
  __exportStar(require("./BillingProductPlanResponseData"), exports);
29
32
  __exportStar(require("./BillingProductPricing"), exports);
30
33
  __exportStar(require("./BillingProductResponseData"), exports);
@@ -38,7 +41,6 @@ __exportStar(require("./CompanyDetailResponseData"), exports);
38
41
  __exportStar(require("./CompanyMembershipDetailResponseData"), exports);
39
42
  __exportStar(require("./CompanyMembershipResponseData"), exports);
40
43
  __exportStar(require("./CompanyOverrideResponseData"), exports);
41
- __exportStar(require("./CompanyPlanResponseData"), exports);
42
44
  __exportStar(require("./CompanyResponseData"), exports);
43
45
  __exportStar(require("./CompanySubscriptionResponseData"), exports);
44
46
  __exportStar(require("./ComponentHydrateResponseData"), exports);
package/dist/Client.d.ts CHANGED
@@ -32,6 +32,13 @@ export declare namespace SchematicClient {
32
32
  export declare class SchematicClient {
33
33
  protected readonly _options: SchematicClient.Options;
34
34
  constructor(_options: SchematicClient.Options);
35
+ /**
36
+ * @param {SchematicClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @example
39
+ * await client.getCompanyPlans()
40
+ */
41
+ getCompanyPlans(requestOptions?: SchematicClient.RequestOptions): Promise<void>;
35
42
  protected _accounts: Accounts | undefined;
36
43
  get accounts(): Accounts;
37
44
  protected _features: Features | undefined;
@@ -54,4 +61,7 @@ export declare class SchematicClient {
54
61
  get accesstokens(): Accesstokens;
55
62
  protected _webhooks: Webhooks | undefined;
56
63
  get webhooks(): Webhooks;
64
+ protected _getCustomAuthorizationHeaders(): Promise<{
65
+ "X-Schematic-Api-Key": string;
66
+ }>;
57
67
  }
package/dist/Client.js CHANGED
@@ -2,8 +2,47 @@
2
2
  /**
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
5
40
  Object.defineProperty(exports, "__esModule", { value: true });
6
41
  exports.SchematicClient = void 0;
42
+ const environments = __importStar(require("./environments"));
43
+ const core = __importStar(require("./core"));
44
+ const url_join_1 = __importDefault(require("url-join"));
45
+ const errors = __importStar(require("./errors/index"));
7
46
  const Client_1 = require("./api/resources/accounts/client/Client");
8
47
  const Client_2 = require("./api/resources/features/client/Client");
9
48
  const Client_3 = require("./api/resources/billing/client/Client");
@@ -19,6 +58,49 @@ class SchematicClient {
19
58
  constructor(_options) {
20
59
  this._options = _options;
21
60
  }
61
+ /**
62
+ * @param {SchematicClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @example
65
+ * await client.getCompanyPlans()
66
+ */
67
+ getCompanyPlans(requestOptions) {
68
+ var _a, _b;
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "company-plans"),
72
+ method: "GET",
73
+ 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())),
74
+ contentType: "application/json",
75
+ requestType: "json",
76
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
77
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
78
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
+ });
80
+ if (_response.ok) {
81
+ return;
82
+ }
83
+ if (_response.error.reason === "status-code") {
84
+ throw new errors.SchematicError({
85
+ statusCode: _response.error.statusCode,
86
+ body: _response.error.body,
87
+ });
88
+ }
89
+ switch (_response.error.reason) {
90
+ case "non-json":
91
+ throw new errors.SchematicError({
92
+ statusCode: _response.error.statusCode,
93
+ body: _response.error.rawBody,
94
+ });
95
+ case "timeout":
96
+ throw new errors.SchematicTimeoutError();
97
+ case "unknown":
98
+ throw new errors.SchematicError({
99
+ message: _response.error.errorMessage,
100
+ });
101
+ }
102
+ });
103
+ }
22
104
  get accounts() {
23
105
  var _a;
24
106
  return ((_a = this._accounts) !== null && _a !== void 0 ? _a : (this._accounts = new Client_1.Accounts(this._options)));
@@ -63,5 +145,11 @@ class SchematicClient {
63
145
  var _a;
64
146
  return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_11.Webhooks(this._options)));
65
147
  }
148
+ _getCustomAuthorizationHeaders() {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
151
+ return { "X-Schematic-Api-Key": apiKeyValue };
152
+ });
153
+ }
66
154
  }
67
155
  exports.SchematicClient = SchematicClient;