@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.
- package/Client.d.ts +10 -0
- package/Client.js +88 -0
- package/api/resources/accesstokens/client/Client.js +1 -1
- package/api/resources/accounts/client/Client.js +14 -14
- package/api/resources/billing/client/Client.d.ts +61 -0
- package/api/resources/billing/client/Client.js +392 -8
- package/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +16 -0
- package/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
- package/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
- package/api/resources/billing/client/requests/index.d.ts +3 -0
- package/api/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +9 -0
- package/api/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +9 -0
- package/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +9 -0
- package/api/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +9 -0
- package/api/resources/billing/types/index.d.ts +4 -0
- package/api/resources/billing/types/index.js +4 -0
- package/api/resources/companies/client/Client.d.ts +0 -13
- package/api/resources/companies/client/Client.js +31 -136
- package/api/resources/companies/client/requests/index.d.ts +0 -1
- package/api/resources/companies/types/index.d.ts +0 -2
- package/api/resources/companies/types/index.js +0 -2
- package/api/resources/components/client/Client.js +7 -7
- package/api/resources/crm/client/Client.js +5 -5
- package/api/resources/entitlements/client/Client.js +19 -19
- package/api/resources/events/client/Client.js +8 -8
- package/api/resources/features/client/Client.js +19 -19
- package/api/resources/plans/client/Client.d.ts +12 -1
- package/api/resources/plans/client/Client.js +99 -11
- package/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
- package/{dist/api/resources/companies/types/ListCompanyPlansResponse.d.ts → api/resources/plans/types/ListActivePlansResponse.d.ts} +3 -3
- package/api/resources/plans/types/index.d.ts +1 -0
- package/api/resources/plans/types/index.js +1 -0
- package/api/resources/webhooks/client/Client.js +9 -9
- package/api/types/BillingPlan.d.ts +11 -0
- package/api/types/BillingPlan.js +5 -0
- package/api/types/BillingPlanGroupResponseData.d.ts +11 -0
- package/api/types/BillingPlanGroupResponseData.js +5 -0
- package/api/types/BillingProductForSubscriptionResponseData.d.ts +16 -0
- package/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/api/types/BillingProductPricing.d.ts +2 -0
- package/api/types/CompanyDetailResponseData.d.ts +1 -1
- package/api/types/CompanySubscriptionResponseData.d.ts +1 -1
- package/api/types/PlanDetailResponseData.d.ts +0 -1
- package/api/types/PlanResponseData.d.ts +0 -1
- package/api/types/index.d.ts +3 -1
- package/api/types/index.js +3 -1
- package/dist/Client.d.ts +10 -0
- package/dist/Client.js +88 -0
- package/dist/api/resources/accesstokens/client/Client.js +1 -1
- package/dist/api/resources/accounts/client/Client.js +14 -14
- package/dist/api/resources/billing/client/Client.d.ts +61 -0
- package/dist/api/resources/billing/client/Client.js +392 -8
- package/dist/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +16 -0
- package/dist/api/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
- package/dist/api/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/index.d.ts +3 -0
- package/dist/api/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/ChangeSubscriptionWebResponse.js +5 -0
- package/dist/api/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/CreateBillingPlanGroupResponse.js +5 -0
- package/dist/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js +5 -0
- package/dist/api/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/UpdateBillingPlanGroupResponse.js +5 -0
- package/dist/api/resources/billing/types/index.d.ts +4 -0
- package/dist/api/resources/billing/types/index.js +4 -0
- package/dist/api/resources/companies/client/Client.d.ts +0 -13
- package/dist/api/resources/companies/client/Client.js +31 -136
- package/dist/api/resources/companies/client/requests/index.d.ts +0 -1
- package/dist/api/resources/companies/types/index.d.ts +0 -2
- package/dist/api/resources/companies/types/index.js +0 -2
- package/dist/api/resources/components/client/Client.js +7 -7
- package/dist/api/resources/crm/client/Client.js +5 -5
- package/dist/api/resources/entitlements/client/Client.js +19 -19
- package/dist/api/resources/events/client/Client.js +8 -8
- package/dist/api/resources/features/client/Client.js +19 -19
- package/dist/api/resources/plans/client/Client.d.ts +12 -1
- package/dist/api/resources/plans/client/Client.js +99 -11
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
- package/{api/resources/companies/types/ListCompanyPlansResponse.d.ts → dist/api/resources/plans/types/ListActivePlansResponse.d.ts} +3 -3
- package/dist/api/resources/plans/types/ListActivePlansResponse.js +5 -0
- package/dist/api/resources/plans/types/index.d.ts +1 -0
- package/dist/api/resources/plans/types/index.js +1 -0
- package/dist/api/resources/webhooks/client/Client.js +9 -9
- package/dist/api/types/BillingPlan.d.ts +11 -0
- package/dist/api/types/BillingPlan.js +5 -0
- package/dist/api/types/BillingPlanGroupResponseData.d.ts +11 -0
- package/dist/api/types/BillingPlanGroupResponseData.js +5 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.d.ts +16 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingProductPricing.d.ts +2 -0
- package/dist/api/types/CompanyDetailResponseData.d.ts +1 -1
- package/dist/api/types/CompanySubscriptionResponseData.d.ts +1 -1
- package/dist/api/types/PlanDetailResponseData.d.ts +0 -1
- package/dist/api/types/PlanResponseData.d.ts +0 -1
- package/dist/api/types/index.d.ts +3 -1
- package/dist/api/types/index.js +3 -1
- package/dist/events.d.ts +3 -0
- package/dist/events.js +17 -5
- package/dist/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +14 -0
- package/dist/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +35 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +34 -0
- package/dist/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
- package/dist/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +34 -0
- package/dist/serialization/resources/billing/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/billing/client/requests/index.js +7 -1
- package/dist/serialization/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +14 -0
- package/dist/serialization/resources/{companies/types/ListCompanyPlansParams.js → billing/types/ChangeSubscriptionWebResponse.js} +5 -6
- package/dist/serialization/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +14 -0
- package/{serialization/resources/companies/types/ListCompanyPlansParams.js → dist/serialization/resources/billing/types/CreateBillingPlanGroupResponse.js} +5 -6
- package/dist/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +14 -0
- package/dist/serialization/resources/{companies/types/ListCompanyPlansResponse.js → billing/types/GetBillingPlanGroupByAccountIdResponse.js} +5 -6
- package/dist/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +14 -0
- package/{serialization/resources/companies/types/ListCompanyPlansResponse.js → dist/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.js} +5 -6
- package/dist/serialization/resources/billing/types/index.d.ts +4 -0
- package/dist/serialization/resources/billing/types/index.js +4 -0
- package/dist/serialization/resources/companies/types/index.d.ts +0 -2
- package/dist/serialization/resources/companies/types/index.js +0 -2
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
- package/dist/serialization/resources/plans/types/ListActivePlansResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/ListActivePlansResponse.js +35 -0
- package/dist/serialization/resources/plans/types/index.d.ts +1 -0
- package/dist/serialization/resources/plans/types/index.js +1 -0
- package/dist/serialization/types/BillingPlan.d.ts +17 -0
- package/dist/serialization/types/BillingPlan.js +38 -0
- package/dist/serialization/types/BillingPlanGroupResponseData.d.ts +14 -0
- package/dist/serialization/types/BillingPlanGroupResponseData.js +35 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.d.ts +22 -0
- package/{serialization/types/CompanyPlanResponseData.js → dist/serialization/types/BillingProductForSubscriptionResponseData.js} +9 -4
- package/dist/serialization/types/BillingProductPricing.d.ts +2 -0
- package/dist/serialization/types/BillingProductPricing.js +2 -0
- package/dist/serialization/types/CompanyDetailResponseData.d.ts +2 -1
- package/dist/serialization/types/CompanyDetailResponseData.js +2 -1
- package/dist/serialization/types/CompanySubscriptionResponseData.d.ts +2 -2
- package/dist/serialization/types/CompanySubscriptionResponseData.js +2 -2
- package/dist/serialization/types/PlanDetailResponseData.d.ts +0 -1
- package/dist/serialization/types/PlanDetailResponseData.js +0 -1
- package/dist/serialization/types/PlanResponseData.d.ts +0 -1
- package/dist/serialization/types/PlanResponseData.js +0 -1
- package/dist/serialization/types/index.d.ts +3 -1
- package/dist/serialization/types/index.js +3 -1
- package/dist/wrapper.js +20 -15
- package/events.d.ts +3 -0
- package/events.js +17 -5
- package/package.json +1 -1
- package/reference.md +282 -49
- package/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts +14 -0
- package/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.js +35 -0
- package/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.d.ts +13 -0
- package/serialization/resources/billing/client/requests/CreateBillingPlanGroupRequestBody.js +34 -0
- package/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.d.ts +13 -0
- package/serialization/resources/billing/client/requests/UpdateBillingPlanGroupRequestBody.js +34 -0
- package/serialization/resources/billing/client/requests/index.d.ts +3 -0
- package/serialization/resources/billing/client/requests/index.js +7 -1
- package/serialization/resources/billing/types/ChangeSubscriptionWebResponse.d.ts +14 -0
- package/serialization/resources/billing/types/ChangeSubscriptionWebResponse.js +35 -0
- package/serialization/resources/billing/types/CreateBillingPlanGroupResponse.d.ts +14 -0
- package/serialization/resources/billing/types/CreateBillingPlanGroupResponse.js +35 -0
- package/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.d.ts +14 -0
- package/serialization/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js +35 -0
- package/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.d.ts +14 -0
- package/serialization/resources/billing/types/UpdateBillingPlanGroupResponse.js +35 -0
- package/serialization/resources/billing/types/index.d.ts +4 -0
- package/serialization/resources/billing/types/index.js +4 -0
- package/serialization/resources/companies/types/index.d.ts +0 -2
- package/serialization/resources/companies/types/index.js +0 -2
- package/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
- package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
- package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
- package/serialization/resources/plans/types/ListActivePlansResponse.d.ts +14 -0
- package/serialization/resources/plans/types/ListActivePlansResponse.js +35 -0
- package/serialization/resources/plans/types/index.d.ts +1 -0
- package/serialization/resources/plans/types/index.js +1 -0
- package/serialization/types/BillingPlan.d.ts +17 -0
- package/serialization/types/BillingPlan.js +38 -0
- package/serialization/types/BillingPlanGroupResponseData.d.ts +14 -0
- package/serialization/types/BillingPlanGroupResponseData.js +35 -0
- package/serialization/types/BillingProductForSubscriptionResponseData.d.ts +22 -0
- package/{dist/serialization/types/CompanyPlanResponseData.js → serialization/types/BillingProductForSubscriptionResponseData.js} +9 -4
- package/serialization/types/BillingProductPricing.d.ts +2 -0
- package/serialization/types/BillingProductPricing.js +2 -0
- package/serialization/types/CompanyDetailResponseData.d.ts +2 -1
- package/serialization/types/CompanyDetailResponseData.js +2 -1
- package/serialization/types/CompanySubscriptionResponseData.d.ts +2 -2
- package/serialization/types/CompanySubscriptionResponseData.js +2 -2
- package/serialization/types/PlanDetailResponseData.d.ts +0 -1
- package/serialization/types/PlanDetailResponseData.js +0 -1
- package/serialization/types/PlanResponseData.d.ts +0 -1
- package/serialization/types/PlanResponseData.js +0 -1
- package/serialization/types/index.d.ts +3 -1
- package/serialization/types/index.js +3 -1
- package/wrapper.js +20 -15
- package/api/resources/companies/client/requests/ListCompanyPlansRequest.d.ts +0 -19
- package/api/resources/companies/types/ListCompanyPlansParams.d.ts +0 -14
- package/api/types/CompanyPlanResponseData.d.ts +0 -11
- package/dist/api/resources/companies/client/requests/ListCompanyPlansRequest.d.ts +0 -19
- package/dist/api/resources/companies/types/ListCompanyPlansParams.d.ts +0 -14
- package/dist/api/types/CompanyPlanResponseData.d.ts +0 -11
- package/dist/serialization/resources/companies/types/ListCompanyPlansParams.d.ts +0 -15
- package/dist/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
- package/dist/serialization/types/CompanyPlanResponseData.d.ts +0 -17
- package/serialization/resources/companies/types/ListCompanyPlansParams.d.ts +0 -15
- package/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
- package/serialization/types/CompanyPlanResponseData.d.ts +0 -17
- /package/api/resources/{companies/client/requests/ListCompanyPlansRequest.js → billing/client/requests/ChangeSubscriptionRequestBody.js} +0 -0
- /package/api/resources/{companies/types/ListCompanyPlansParams.js → billing/client/requests/CreateBillingPlanGroupRequestBody.js} +0 -0
- /package/api/resources/{companies/types/ListCompanyPlansResponse.js → billing/client/requests/UpdateBillingPlanGroupRequestBody.js} +0 -0
- /package/api/{types/CompanyPlanResponseData.js → resources/billing/types/ChangeSubscriptionWebResponse.js} +0 -0
- /package/{dist/api/resources/companies/client/requests/ListCompanyPlansRequest.js → api/resources/billing/types/CreateBillingPlanGroupResponse.js} +0 -0
- /package/{dist/api/resources/companies/types/ListCompanyPlansParams.js → api/resources/billing/types/GetBillingPlanGroupByAccountIdResponse.js} +0 -0
- /package/{dist/api/resources/companies/types/ListCompanyPlansResponse.js → api/resources/billing/types/UpdateBillingPlanGroupResponse.js} +0 -0
- /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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -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
|
|
5
|
+
export interface ListActivePlansResponse {
|
|
6
6
|
/** The returned resources */
|
|
7
|
-
data: Schematic.
|
|
7
|
+
data: Schematic.PlanDetailResponseData[];
|
|
8
8
|
/** Input parameters */
|
|
9
|
-
params:
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,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
|
+
}
|
|
@@ -12,7 +12,7 @@ export interface CompanyDetailResponseData {
|
|
|
12
12
|
lastSeenAt?: Date;
|
|
13
13
|
logoUrl?: string;
|
|
14
14
|
name: string;
|
|
15
|
-
plan?: Schematic.
|
|
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.
|
|
9
|
+
products: Schematic.BillingProductForSubscriptionResponseData[];
|
|
10
10
|
subscriptionExternalId: string;
|
|
11
11
|
}
|
|
@@ -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";
|
package/dist/api/types/index.js
CHANGED
|
@@ -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/events.d.ts
CHANGED
|
@@ -5,13 +5,16 @@ interface EventBufferOptions {
|
|
|
5
5
|
interval?: number;
|
|
6
6
|
logger?: Logger;
|
|
7
7
|
maxSize?: number;
|
|
8
|
+
offline?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare class EventBuffer {
|
|
10
11
|
private events;
|
|
11
12
|
private eventsApi;
|
|
12
13
|
private interval;
|
|
14
|
+
private intervalId;
|
|
13
15
|
private logger;
|
|
14
16
|
private maxSize;
|
|
17
|
+
private offline;
|
|
15
18
|
private shutdown;
|
|
16
19
|
private stopped;
|
|
17
20
|
constructor(eventsApi: Events, opts?: EventBufferOptions);
|
package/dist/events.js
CHANGED
|
@@ -16,13 +16,15 @@ const DEFAULT_MAX_SIZE = 1000; // 1000 items
|
|
|
16
16
|
class EventBuffer {
|
|
17
17
|
constructor(eventsApi, opts) {
|
|
18
18
|
this.events = [];
|
|
19
|
+
this.intervalId = null;
|
|
19
20
|
this.shutdown = false;
|
|
20
21
|
this.stopped = false;
|
|
21
|
-
const { logger, maxSize, interval } = opts || {};
|
|
22
|
+
const { logger = new logger_1.ConsoleLogger(), maxSize = DEFAULT_MAX_SIZE, interval = DEFAULT_FLUSH_INTERVAL, offline = false, } = opts || {};
|
|
22
23
|
this.eventsApi = eventsApi;
|
|
23
|
-
this.interval = interval
|
|
24
|
-
this.logger = logger
|
|
25
|
-
this.maxSize = maxSize
|
|
24
|
+
this.interval = interval;
|
|
25
|
+
this.logger = logger;
|
|
26
|
+
this.maxSize = maxSize;
|
|
27
|
+
this.offline = offline;
|
|
26
28
|
this.startPeriodicFlush();
|
|
27
29
|
}
|
|
28
30
|
flush() {
|
|
@@ -42,6 +44,9 @@ class EventBuffer {
|
|
|
42
44
|
}
|
|
43
45
|
push(event) {
|
|
44
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
if (this.offline) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
45
50
|
if (this.stopped) {
|
|
46
51
|
this.logger.error("Event buffer is stopped, not accepting new events");
|
|
47
52
|
return;
|
|
@@ -56,11 +61,18 @@ class EventBuffer {
|
|
|
56
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
62
|
this.shutdown = true;
|
|
58
63
|
this.stopped = true;
|
|
64
|
+
if (this.intervalId) {
|
|
65
|
+
clearInterval(this.intervalId);
|
|
66
|
+
this.intervalId = null;
|
|
67
|
+
}
|
|
59
68
|
yield this.flush();
|
|
60
69
|
});
|
|
61
70
|
}
|
|
62
71
|
startPeriodicFlush() {
|
|
63
|
-
|
|
72
|
+
if (this.offline || this.intervalId) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
64
76
|
if (this.shutdown)
|
|
65
77
|
return;
|
|
66
78
|
yield this.flush();
|
package/dist/serialization/resources/billing/client/requests/ChangeSubscriptionRequestBody.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../../index";
|
|
5
|
+
import * as Schematic from "../../../../../api/index";
|
|
6
|
+
import * as core from "../../../../../core";
|
|
7
|
+
export declare const ChangeSubscriptionRequestBody: core.serialization.Schema<serializers.ChangeSubscriptionRequestBody.Raw, Schematic.ChangeSubscriptionRequestBody>;
|
|
8
|
+
export declare namespace ChangeSubscriptionRequestBody {
|
|
9
|
+
interface Raw {
|
|
10
|
+
action: string;
|
|
11
|
+
new_plan_id: string;
|
|
12
|
+
new_price_id: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ChangeSubscriptionRequestBody = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../../core"));
|
|
31
|
+
exports.ChangeSubscriptionRequestBody = core.serialization.object({
|
|
32
|
+
action: core.serialization.string(),
|
|
33
|
+
newPlanId: core.serialization.property("new_plan_id", core.serialization.string()),
|
|
34
|
+
newPriceId: core.serialization.property("new_price_id", core.serialization.string()),
|
|
35
|
+
});
|