diff --git a/.fern/metadata.json b/.fern/metadata.json index 06bdfedd..fa723cd9 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.24.4", + "cliVersion": "4.43.1", "generatorName": "fernapi/fern-typescript-node-sdk", - "generatorVersion": "3.42.7", + "generatorVersion": "3.59.4", "generatorConfig": { "allowCustomFetcher": true, "includeApiReference": true, @@ -46,5 +46,6 @@ "files": ["dist/**/*.js", "dist/**/*.d.ts", "!dist/**/*.js.map", "!dist/**/*.test.*", "README.md"] } }, - "sdkVersion": "1.4.4" + "originGitCommit": "f6da3f47e1ccc938dd397950a59c4d166cd228b4", + "sdkVersion": "1.4.5" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa273df3..4957856b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,10 @@ name: ci on: [push] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: compile: runs-on: ubuntu-latest @@ -63,7 +67,15 @@ jobs: elif [[ ${GITHUB_REF} == *beta* ]]; then publish --access public --tag beta else - publish --access public + PKG_NAME=$(node -p "require('./package.json').name") + PKG_VERSION=$(node -p "require('./package.json').version") + CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0") + if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then + echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})" + publish --access public --tag backport + else + publish --access public + fi fi env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/biome.json b/biome.json index a777468e..5084b70a 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index 449251b4..717a7f44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@schematichq/schematic-typescript-node", - "version": "1.4.4", + "version": "1.4.5", "private": false, "repository": { "type": "git", @@ -16,7 +16,7 @@ "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", "build": "node build.js", - "prepack": "cp -rv dist/. .", + "prepack": "", "test": "jest --config jest.config.mjs", "test:unit": "jest --selectProjects unit", "test:wire": "jest --selectProjects wire", @@ -45,7 +45,7 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1", + "@biomejs/biome": "2.4.3", "esbuild": "^0.25.9", "miniflare": "^4.20260305.0" }, diff --git a/reference.md b/reference.md index 006b83ce..5d344e88 100644 --- a/reference.md +++ b/reference.md @@ -114,8 +114,8 @@ await client.deletePlanAudiencesPlanAudienceId("plan_audience_id"); await client.accounts.listApiKeys({ environmentId: "environment_id", requireEnvironment: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -374,8 +374,8 @@ await client.accounts.deleteApiKey("api_key_id"); await client.accounts.countApiKeys({ environmentId: "environment_id", requireEnvironment: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -431,8 +431,8 @@ await client.accounts.listAuditLogs({ environmentId: "environment_id", q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -537,8 +537,8 @@ await client.accounts.countAuditLogs({ environmentId: "environment_id", q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -589,8 +589,8 @@ await client.accounts.countAuditLogs({ ```typescript await client.accounts.listEnvironments({ - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -933,8 +933,8 @@ await client.accounts.getWhoAmI(); await client.billing.listCoupons({ isActive: true, q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -985,14 +985,14 @@ await client.billing.listCoupons({ ```typescript await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1 + timesRedeemed: 1000000 }); ``` @@ -1102,8 +1102,8 @@ await client.billing.listCustomersWithSubscriptions({ name: "name", providerType: "schematic", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1157,8 +1157,8 @@ await client.billing.countCustomers({ name: "name", providerType: "schematic", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1212,8 +1212,8 @@ await client.billing.listInvoices({ companyId: "company_id", customerExternalId: "customer_external_id", subscriptionExternalId: "subscription_external_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1264,13 +1264,13 @@ await client.billing.listInvoices({ ```typescript await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1 + subtotal: 1000000 }); ``` @@ -1322,8 +1322,8 @@ await client.billing.upsertInvoice({ ```typescript await client.billing.listMeters({ displayName: "display_name", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1430,8 +1430,8 @@ await client.billing.upsertBillingMeter({ await client.billing.listPaymentMethods({ companyId: "company_id", customerExternalId: "customer_external_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1539,15 +1539,15 @@ await client.billing.listBillingPrices({ forTrialExpiryPlan: true, interval: "interval", isActive: true, - price: 1, + price: 1000000, productId: "product_id", providerType: "schematic", q: "q", tiersMode: "graduated", usageType: "licensed", withMeter: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1603,7 +1603,7 @@ await client.billing.upsertBillingPrice({ externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [{ priceExternalId: "price_external_id" @@ -1713,15 +1713,15 @@ await client.billing.listBillingProductPrices({ forTrialExpiryPlan: true, interval: "interval", isActive: true, - price: 1, + price: 1000000, productId: "product_id", providerType: "schematic", q: "q", tiersMode: "graduated", usageType: "licensed", withMeter: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1882,8 +1882,8 @@ await client.billing.listBillingProducts({ withPricesOnly: true, withZeroPrice: true, withoutLinkedToPlan: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -1943,8 +1943,8 @@ await client.billing.countBillingProducts({ withPricesOnly: true, withZeroPrice: true, withoutLinkedToPlan: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2008,14 +2008,14 @@ await client.billing.upsertBillingSubscription({ productExternalIds: [{ currency: "currency", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed" }], subscriptionExternalId: "subscription_external_id", - totalPrice: 1 + totalPrice: 1000000 }); ``` @@ -2068,8 +2068,8 @@ await client.billing.upsertBillingSubscription({ ```typescript await client.credits.listBillingCredits({ name: "name", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2334,8 +2334,8 @@ await client.credits.listCreditBundles({ creditId: "credit_id", status: "active", bundleType: "fixed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2389,7 +2389,7 @@ await client.credits.createCreditBundle({ bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1 + pricePerUnit: 1000000 }); ``` @@ -2490,7 +2490,7 @@ await client.credits.getCreditBundle("bundle_id"); ```typescript await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1 + pricePerUnit: 1000000 }); ``` @@ -2601,8 +2601,8 @@ await client.credits.countCreditBundles({ creditId: "credit_id", status: "active", bundleType: "fixed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2654,8 +2654,8 @@ await client.credits.countCreditBundles({ ```typescript await client.credits.countBillingCredits({ name: "name", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2765,7 +2765,7 @@ await client.credits.zeroOutGrant("grant_id"); await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup" }); @@ -2820,8 +2820,8 @@ await client.credits.countCompanyGrants({ companyId: "company_id", order: "created_at", dir: "asc", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2875,8 +2875,8 @@ await client.credits.listCompanyGrants({ companyId: "company_id", order: "created_at", dir: "asc", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2928,8 +2928,8 @@ await client.credits.listCompanyGrants({ ```typescript await client.credits.countBillingCreditsGrants({ creditId: "credit_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -2981,8 +2981,8 @@ await client.credits.countBillingCreditsGrants({ ```typescript await client.credits.listGrantsForCredit({ creditId: "credit_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3039,8 +3039,8 @@ await client.credits.getEnrichedCreditLedger({ period: "daily", startTime: "start_time", endTime: "end_time", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3097,8 +3097,8 @@ await client.credits.countCreditLedger({ period: "daily", startTime: "start_time", endTime: "end_time", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3152,8 +3152,8 @@ await client.credits.listBillingPlanCreditGrants({ creditId: "credit_id", planId: "plan_id", planVersionId: "plan_version_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3204,7 +3204,7 @@ await client.credits.listBillingPlanCreditGrants({ ```typescript await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -3381,8 +3381,8 @@ await client.credits.countBillingPlanCreditGrants({ creditId: "credit_id", planId: "plan_id", planVersionId: "plan_version_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3439,8 +3439,8 @@ await client.credits.listCreditEventLedger({ eventType: "grant", featureId: "feature_id", startTime: "start_time", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3497,8 +3497,8 @@ await client.credits.countCreditEventLedger({ eventType: "grant", featureId: "feature_id", startTime: "start_time", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -3557,13 +3557,13 @@ await client.checkout.internal({ companyId: "company_id", creditBundles: [{ bundleId: "bundle_id", - quantity: 1 + quantity: 1000000 }], newPlanId: "new_plan_id", newPriceId: "new_price_id", payInAdvance: [{ priceId: "price_id", - quantity: 1 + quantity: 1000000 }], skipTrial: true }); @@ -3674,13 +3674,13 @@ await client.checkout.previewCheckoutInternal({ companyId: "company_id", creditBundles: [{ bundleId: "bundle_id", - quantity: 1 + quantity: 1000000 }], newPlanId: "new_plan_id", newPriceId: "new_price_id", payInAdvance: [{ priceId: "price_id", - quantity: 1 + quantity: 1000000 }], skipTrial: true }); @@ -3739,11 +3739,11 @@ await client.checkout.managePlan({ companyId: "company_id", creditBundles: [{ bundleId: "bundle_id", - quantity: 1 + quantity: 1000000 }], payInAdvanceEntitlements: [{ priceId: "price_id", - quantity: 1 + quantity: 1000000 }] }); @@ -3801,11 +3801,11 @@ await client.checkout.previewManagePlan({ companyId: "company_id", creditBundles: [{ bundleId: "bundle_id", - quantity: 1 + quantity: 1000000 }], payInAdvanceEntitlements: [{ priceId: "price_id", - quantity: 1 + quantity: 1000000 }] }); @@ -3977,8 +3977,8 @@ await client.companies.listCompanies({ withoutPlan: true, withoutSubscription: true, withSubscription: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4202,8 +4202,8 @@ await client.companies.countCompanies({ withoutPlan: true, withoutSubscription: true, withSubscription: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4350,6 +4350,24 @@ await client.companies.deleteCompanyByKeys({
+#### 📝 Description + +
+
+ +
+
+ +Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work. +The following approaches will all work to resolve a company and any of them are appropriate: +1. `/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}` +2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz` +2. `/companies/lookup?foo=bar&fizz=buzz` +
+
+
+
+ #### 🔌 Usage
@@ -4415,8 +4433,8 @@ await client.companies.lookupCompany({ await client.companies.listCompanyMemberships({ companyId: "company_id", userId: "user_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4569,8 +4587,8 @@ await client.companies.deleteCompanyMembership("company_membership_id"); ```typescript await client.companies.getActiveCompanySubscription({ companyId: "company_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4677,8 +4695,8 @@ await client.companies.upsertCompanyTrait({ await client.companies.listEntityKeyDefinitions({ entityType: "company", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4731,8 +4749,8 @@ await client.companies.listEntityKeyDefinitions({ await client.companies.countEntityKeyDefinitions({ entityType: "company", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -4786,8 +4804,8 @@ await client.companies.listEntityTraitDefinitions({ entityType: "company", q: "q", traitType: "boolean", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5002,8 +5020,8 @@ await client.companies.countEntityTraitDefinitions({ entityType: "company", q: "q", traitType: "boolean", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5056,8 +5074,8 @@ await client.companies.countEntityTraitDefinitions({ await client.companies.getEntityTraitValues({ definitionId: "definition_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5111,8 +5129,8 @@ await client.companies.listPlanChanges({ action: "action", basePlanAction: "base_plan_action", companyId: "company_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5214,8 +5232,8 @@ await client.companies.getPlanChange("plan_change_id"); await client.companies.listPlanTraits({ planId: "plan_id", traitId: "trait_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5535,8 +5553,8 @@ await client.companies.updatePlanTraitsBulk({ await client.companies.countPlanTraits({ planId: "plan_id", traitId: "trait_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5644,8 +5662,8 @@ await client.companies.listUsers({ companyId: "company_id", planId: "plan_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -5850,8 +5868,8 @@ await client.companies.countUsers({ companyId: "company_id", planId: "plan_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6066,8 +6084,8 @@ await client.entitlements.listCompanyOverrides({ featureId: "feature_id", withoutExpired: true, q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6332,8 +6350,8 @@ await client.entitlements.countCompanyOverrides({ featureId: "feature_id", withoutExpired: true, q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6386,8 +6404,8 @@ await client.entitlements.countCompanyOverrides({ await client.entitlements.listFeatureCompanies({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6440,8 +6458,8 @@ await client.entitlements.listFeatureCompanies({ await client.entitlements.countFeatureCompanies({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6496,8 +6514,8 @@ await client.entitlements.listFeatureUsage({ includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6607,8 +6625,8 @@ await client.entitlements.countFeatureUsage({ includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6661,8 +6679,8 @@ await client.entitlements.countFeatureUsage({ await client.entitlements.listFeatureUsers({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6715,8 +6733,8 @@ await client.entitlements.listFeatureUsers({ await client.entitlements.countFeatureUsers({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -6772,8 +6790,8 @@ await client.entitlements.listPlanEntitlements({ planVersionId: "plan_version_id", q: "q", withMeteredProducts: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -7039,8 +7057,8 @@ await client.entitlements.countPlanEntitlements({ planVersionId: "plan_version_id", q: "q", withMeteredProducts: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -7261,12 +7279,13 @@ await client.plans.listPlans({ forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + includeDraftVersions: true, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", withoutPaidProductId: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -7602,12 +7621,13 @@ await client.plans.countPlans({ forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + includeDraftVersions: true, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", withoutPaidProductId: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -7821,8 +7841,8 @@ await client.plans.publishPlanVersion("plan_id", { ```typescript await client.components.listComponents({ q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8081,8 +8101,8 @@ await client.components.deleteComponent("component_id"); ```typescript await client.components.countComponents({ q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8341,8 +8361,8 @@ await client.events.createEventBatch({ ```typescript await client.events.getEventSummaries({ q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8397,8 +8417,8 @@ await client.events.listEvents({ eventSubtype: "event_subtype", flagId: "flag_id", userId: "user_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8596,8 +8616,8 @@ await client.features.listFeatures({ planVersionId: "plan_version_id", withoutPlanEntitlementFor: "without_plan_entitlement_for", booleanRequireEvent: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8861,8 +8881,8 @@ await client.features.countFeatures({ planVersionId: "plan_version_id", withoutPlanEntitlementFor: "without_plan_entitlement_for", booleanRequireEvent: true, - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -8915,8 +8935,8 @@ await client.features.countFeatures({ await client.features.listFlags({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -9197,7 +9217,7 @@ await client.features.updateFlagRules("flag_id", { resourceIds: ["resource_ids"] }], name: "name", - priority: 1, + priority: 1000000, value: true }] }); @@ -9417,8 +9437,8 @@ await client.features.checkFlagsBulk({ await client.features.countFlags({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -9796,8 +9816,8 @@ await client.planmigrations.listCompanyMigrations({ migrationId: "migration_id", q: "q", status: "completed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -9851,8 +9871,8 @@ await client.planmigrations.countCompanyMigrations({ migrationId: "migration_id", q: "q", status: "completed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -9905,8 +9925,8 @@ await client.planmigrations.countCompanyMigrations({ await client.planmigrations.listMigrations({ planVersionId: "plan_version_id", status: "completed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10008,8 +10028,8 @@ await client.planmigrations.getMigration("plan_version_migration_id"); await client.planmigrations.countMigrations({ planVersionId: "plan_version_id", status: "completed", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10105,8 +10125,8 @@ await client.componentspublic.getPublicPlans(); await client.scheduledcheckout.listScheduledCheckouts({ companyId: "company_id", status: "cancelled", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10374,8 +10394,8 @@ await client.accesstokens.issueTemporaryAccessToken({ await client.webhooks.listWebhookEvents({ q: "q", webhookId: "webhook_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10477,8 +10497,8 @@ await client.webhooks.getWebhookEvent("webhook_event_id"); await client.webhooks.countWebhookEvents({ q: "q", webhookId: "webhook_id", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10530,8 +10550,8 @@ await client.webhooks.countWebhookEvents({ ```typescript await client.webhooks.listWebhooks({ q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10791,8 +10811,8 @@ await client.webhooks.deleteWebhook("webhook_id"); ```typescript await client.webhooks.countWebhooks({ q: "q", - limit: 1, - offset: 1 + limit: 1000000, + offset: 1000000 }); ``` @@ -10828,3 +10848,4 @@ await client.webhooks.countWebhooks({
+ diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 691a4853..ca92313d 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js"; +import { HeaderAuthProvider } from "./auth/HeaderAuthProvider"; import * as core from "./core"; import { mergeHeaders } from "./core/headers"; import type * as environments from "./environments"; @@ -52,8 +52,8 @@ export function normalizeClientOptions} A standard Response object. + */ + public async fetch( + input: Request | string | URL, + init?: RequestInit, + requestOptions?: core.PassthroughRequest.RequestOptions, + ): Promise { + return core.makePassthroughRequest( + input, + init, + { + baseUrl: this._options.baseUrl ?? this._options.environment, + headers: this._options.headers, + timeoutInSeconds: this._options.timeoutInSeconds, + maxRetries: this._options.maxRetries, + fetch: this._options.fetch, + logging: this._options.logging, + getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers, + }, + requestOptions, + ); + } } diff --git a/src/api/resources/accesstokens/exports.ts b/src/api/resources/accesstokens/exports.ts new file mode 100644 index 00000000..04f1f8db --- /dev/null +++ b/src/api/resources/accesstokens/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { AccesstokensClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/accounts/client/Client.ts b/src/api/resources/accounts/client/Client.ts index 8892b3c7..64ead638 100644 --- a/src/api/resources/accounts/client/Client.ts +++ b/src/api/resources/accounts/client/Client.ts @@ -37,8 +37,8 @@ export class AccountsClient { * await client.accounts.listApiKeys({ * environmentId: "environment_id", * requireEnvironment: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listApiKeys( @@ -53,20 +53,12 @@ export class AccountsClient { requestOptions?: AccountsClient.RequestOptions, ): Promise> { const { environmentId, requireEnvironment, limit, offset } = request; - const _queryParams: Record = {}; - if (environmentId != null) { - _queryParams.environment_id = environmentId; - } - - _queryParams.require_environment = requireEnvironment.toString(); - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + environment_id: environmentId, + require_environment: requireEnvironment, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -696,8 +688,8 @@ export class AccountsClient { * await client.accounts.countApiKeys({ * environmentId: "environment_id", * requireEnvironment: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countApiKeys( @@ -712,20 +704,12 @@ export class AccountsClient { requestOptions?: AccountsClient.RequestOptions, ): Promise> { const { environmentId, requireEnvironment, limit, offset } = request; - const _queryParams: Record = {}; - if (environmentId != null) { - _queryParams.environment_id = environmentId; - } - - _queryParams.require_environment = requireEnvironment.toString(); - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + environment_id: environmentId, + require_environment: requireEnvironment, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -847,8 +831,8 @@ export class AccountsClient { * environmentId: "environment_id", * q: "q", * startTime: new Date("2024-01-15T09:30:00.000Z"), - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listAuditLogs( @@ -863,35 +847,18 @@ export class AccountsClient { requestOptions?: AccountsClient.RequestOptions, ): Promise> { const { actorType, endTime, environmentId, q, startTime, limit, offset } = request; - const _queryParams: Record = {}; - if (actorType != null) { - _queryParams.actor_type = serializers.ActorType.jsonOrThrow(actorType, { unrecognizedObjectKeys: "strip" }); - } - - if (endTime != null) { - _queryParams.end_time = endTime.toISOString(); - } - - if (environmentId != null) { - _queryParams.environment_id = environmentId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (startTime != null) { - _queryParams.start_time = startTime.toISOString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + actor_type: + actorType != null + ? serializers.ActorType.jsonOrThrow(actorType, { unrecognizedObjectKeys: "strip" }) + : undefined, + end_time: endTime != null ? endTime?.toISOString() : undefined, + environment_id: environmentId, + q, + start_time: startTime != null ? startTime?.toISOString() : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1129,8 +1096,8 @@ export class AccountsClient { * environmentId: "environment_id", * q: "q", * startTime: new Date("2024-01-15T09:30:00.000Z"), - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countAuditLogs( @@ -1145,35 +1112,18 @@ export class AccountsClient { requestOptions?: AccountsClient.RequestOptions, ): Promise> { const { actorType, endTime, environmentId, q, startTime, limit, offset } = request; - const _queryParams: Record = {}; - if (actorType != null) { - _queryParams.actor_type = serializers.ActorType.jsonOrThrow(actorType, { unrecognizedObjectKeys: "strip" }); - } - - if (endTime != null) { - _queryParams.end_time = endTime.toISOString(); - } - - if (environmentId != null) { - _queryParams.environment_id = environmentId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (startTime != null) { - _queryParams.start_time = startTime.toISOString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + actor_type: + actorType != null + ? serializers.ActorType.jsonOrThrow(actorType, { unrecognizedObjectKeys: "strip" }) + : undefined, + end_time: endTime != null ? endTime?.toISOString() : undefined, + environment_id: environmentId, + q, + start_time: startTime != null ? startTime?.toISOString() : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1290,8 +1240,8 @@ export class AccountsClient { * * @example * await client.accounts.listEnvironments({ - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listEnvironments( @@ -1306,23 +1256,11 @@ export class AccountsClient { requestOptions?: AccountsClient.RequestOptions, ): Promise> { const { ids, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/accounts/client/requests/CountApiKeysRequest.ts b/src/api/resources/accounts/client/requests/CountApiKeysRequest.ts index 8f018d4d..1855e68f 100644 --- a/src/api/resources/accounts/client/requests/CountApiKeysRequest.ts +++ b/src/api/resources/accounts/client/requests/CountApiKeysRequest.ts @@ -5,8 +5,8 @@ * { * environmentId: "environment_id", * requireEnvironment: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountApiKeysRequest { diff --git a/src/api/resources/accounts/client/requests/CountAuditLogsRequest.ts b/src/api/resources/accounts/client/requests/CountAuditLogsRequest.ts index af9470d1..ca0d87c9 100644 --- a/src/api/resources/accounts/client/requests/CountAuditLogsRequest.ts +++ b/src/api/resources/accounts/client/requests/CountAuditLogsRequest.ts @@ -10,8 +10,8 @@ import type * as Schematic from "../../../../index"; * environmentId: "environment_id", * q: "q", * startTime: new Date("2024-01-15T09:30:00.000Z"), - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountAuditLogsRequest { diff --git a/src/api/resources/accounts/client/requests/ListApiKeysRequest.ts b/src/api/resources/accounts/client/requests/ListApiKeysRequest.ts index 2a4183eb..c1423bca 100644 --- a/src/api/resources/accounts/client/requests/ListApiKeysRequest.ts +++ b/src/api/resources/accounts/client/requests/ListApiKeysRequest.ts @@ -5,8 +5,8 @@ * { * environmentId: "environment_id", * requireEnvironment: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListApiKeysRequest { diff --git a/src/api/resources/accounts/client/requests/ListAuditLogsRequest.ts b/src/api/resources/accounts/client/requests/ListAuditLogsRequest.ts index 1648f00f..1417a644 100644 --- a/src/api/resources/accounts/client/requests/ListAuditLogsRequest.ts +++ b/src/api/resources/accounts/client/requests/ListAuditLogsRequest.ts @@ -10,8 +10,8 @@ import type * as Schematic from "../../../../index"; * environmentId: "environment_id", * q: "q", * startTime: new Date("2024-01-15T09:30:00.000Z"), - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListAuditLogsRequest { diff --git a/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts b/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts index 1f1f02c5..baffe355 100644 --- a/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts +++ b/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts @@ -3,8 +3,8 @@ /** * @example * { - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListEnvironmentsRequest { diff --git a/src/api/resources/accounts/exports.ts b/src/api/resources/accounts/exports.ts new file mode 100644 index 00000000..11698f7e --- /dev/null +++ b/src/api/resources/accounts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { AccountsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/billing/client/Client.ts b/src/api/resources/billing/client/Client.ts index 7e01f949..41c540eb 100644 --- a/src/api/resources/billing/client/Client.ts +++ b/src/api/resources/billing/client/Client.ts @@ -37,8 +37,8 @@ export class BillingClient { * await client.billing.listCoupons({ * isActive: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCoupons( @@ -53,23 +53,12 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { isActive, q, limit, offset } = request; - const _queryParams: Record = {}; - if (isActive != null) { - _queryParams.is_active = isActive.toString(); - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + is_active: isActive, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -186,14 +175,14 @@ export class BillingClient { * * @example * await client.billing.upsertBillingCoupon({ - * amountOff: 1, + * amountOff: 1000000, * duration: "duration", - * durationInMonths: 1, + * durationInMonths: 1000000, * externalId: "external_id", - * maxRedemptions: 1, + * maxRedemptions: 1000000, * name: "name", * percentOff: 1.1, - * timesRedeemed: 1 + * timesRedeemed: 1000000 * }) */ public upsertBillingCoupon( @@ -469,8 +458,8 @@ export class BillingClient { * name: "name", * providerType: "schematic", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCustomersWithSubscriptions( @@ -485,37 +474,17 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { companyIds, name, providerType, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_ids: companyIds, + name, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -635,8 +604,8 @@ export class BillingClient { * name: "name", * providerType: "schematic", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCustomers( @@ -651,37 +620,17 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { companyIds, name, providerType, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_ids: companyIds, + name, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -801,8 +750,8 @@ export class BillingClient { * companyId: "company_id", * customerExternalId: "customer_external_id", * subscriptionExternalId: "subscription_external_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listInvoices( @@ -817,21 +766,13 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { companyId, customerExternalId, subscriptionExternalId, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - _queryParams.customer_external_id = customerExternalId; - _queryParams.subscription_external_id = subscriptionExternalId; - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + customer_external_id: customerExternalId, + subscription_external_id: subscriptionExternalId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -948,13 +889,13 @@ export class BillingClient { * * @example * await client.billing.upsertInvoice({ - * amountDue: 1, - * amountPaid: 1, - * amountRemaining: 1, + * amountDue: 1000000, + * amountPaid: 1000000, + * amountRemaining: 1000000, * collectionMethod: "collection_method", * currency: "currency", * customerExternalId: "customer_external_id", - * subtotal: 1 + * subtotal: 1000000 * }) */ public upsertInvoice( @@ -1088,8 +1029,8 @@ export class BillingClient { * @example * await client.billing.listMeters({ * displayName: "display_name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listMeters( @@ -1104,19 +1045,11 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { displayName, limit, offset } = request; - const _queryParams: Record = {}; - if (displayName != null) { - _queryParams.display_name = displayName; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + display_name: displayName, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1371,8 +1304,8 @@ export class BillingClient { * await client.billing.listPaymentMethods({ * companyId: "company_id", * customerExternalId: "customer_external_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listPaymentMethods( @@ -1387,20 +1320,12 @@ export class BillingClient { requestOptions?: BillingClient.RequestOptions, ): Promise> { const { companyId, customerExternalId, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - _queryParams.customer_external_id = customerExternalId; - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + customer_external_id: customerExternalId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1656,15 +1581,15 @@ export class BillingClient { * forTrialExpiryPlan: true, * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * productId: "product_id", * providerType: "schematic", * q: "q", * tiersMode: "graduated", * usageType: "licensed", * withMeter: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listBillingPrices( @@ -1695,81 +1620,32 @@ export class BillingClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (forInitialPlan != null) { - _queryParams.for_initial_plan = forInitialPlan.toString(); - } - - if (forTrialExpiryPlan != null) { - _queryParams.for_trial_expiry_plan = forTrialExpiryPlan.toString(); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (interval != null) { - _queryParams.interval = interval; - } - - if (isActive != null) { - _queryParams.is_active = isActive.toString(); - } - - if (price != null) { - _queryParams.price = price.toString(); - } - - if (productId != null) { - _queryParams.product_id = productId; - } - - if (productIds != null) { - if (Array.isArray(productIds)) { - _queryParams.product_ids = productIds.map((item) => item); - } else { - _queryParams.product_ids = productIds; - } - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (tiersMode != null) { - _queryParams.tiers_mode = serializers.BillingTiersMode.jsonOrThrow(tiersMode, { - unrecognizedObjectKeys: "strip", - }); - } - - if (usageType != null) { - _queryParams.usage_type = serializers.BillingPriceUsageType.jsonOrThrow(usageType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (withMeter != null) { - _queryParams.with_meter = withMeter.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + for_initial_plan: forInitialPlan, + for_trial_expiry_plan: forTrialExpiryPlan, + ids, + interval, + is_active: isActive, + price, + product_id: productId, + product_ids: productIds, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + tiers_mode: + tiersMode != null + ? serializers.BillingTiersMode.jsonOrThrow(tiersMode, { unrecognizedObjectKeys: "strip" }) + : undefined, + usage_type: + usageType != null + ? serializers.BillingPriceUsageType.jsonOrThrow(usageType, { unrecognizedObjectKeys: "strip" }) + : undefined, + with_meter: withMeter, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1891,7 +1767,7 @@ export class BillingClient { * externalAccountId: "external_account_id", * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * priceExternalId: "price_external_id", * priceTiers: [{ * priceExternalId: "price_external_id" @@ -2167,15 +2043,15 @@ export class BillingClient { * forTrialExpiryPlan: true, * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * productId: "product_id", * providerType: "schematic", * q: "q", * tiersMode: "graduated", * usageType: "licensed", * withMeter: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listBillingProductPrices( @@ -2206,81 +2082,32 @@ export class BillingClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (forInitialPlan != null) { - _queryParams.for_initial_plan = forInitialPlan.toString(); - } - - if (forTrialExpiryPlan != null) { - _queryParams.for_trial_expiry_plan = forTrialExpiryPlan.toString(); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (interval != null) { - _queryParams.interval = interval; - } - - if (isActive != null) { - _queryParams.is_active = isActive.toString(); - } - - if (price != null) { - _queryParams.price = price.toString(); - } - - if (productId != null) { - _queryParams.product_id = productId; - } - - if (productIds != null) { - if (Array.isArray(productIds)) { - _queryParams.product_ids = productIds.map((item) => item); - } else { - _queryParams.product_ids = productIds; - } - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (tiersMode != null) { - _queryParams.tiers_mode = serializers.BillingTiersMode.jsonOrThrow(tiersMode, { - unrecognizedObjectKeys: "strip", - }); - } - - if (usageType != null) { - _queryParams.usage_type = serializers.BillingPriceUsageType.jsonOrThrow(usageType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (withMeter != null) { - _queryParams.with_meter = withMeter.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + for_initial_plan: forInitialPlan, + for_trial_expiry_plan: forTrialExpiryPlan, + ids, + interval, + is_active: isActive, + price, + product_id: productId, + product_ids: productIds, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + tiers_mode: + tiersMode != null + ? serializers.BillingTiersMode.jsonOrThrow(tiersMode, { unrecognizedObjectKeys: "strip" }) + : undefined, + usage_type: + usageType != null + ? serializers.BillingPriceUsageType.jsonOrThrow(usageType, { unrecognizedObjectKeys: "strip" }) + : undefined, + with_meter: withMeter, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2673,8 +2500,8 @@ export class BillingClient { * withPricesOnly: true, * withZeroPrice: true, * withoutLinkedToPlan: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listBillingProducts( @@ -2702,63 +2529,26 @@ export class BillingClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (isActive != null) { - _queryParams.is_active = isActive.toString(); - } - - if (name != null) { - _queryParams.name = name; - } - - if (priceUsageType != null) { - _queryParams.price_usage_type = serializers.BillingPriceUsageType.jsonOrThrow(priceUsageType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withOneTimeCharges != null) { - _queryParams.with_one_time_charges = withOneTimeCharges.toString(); - } - - if (withPricesOnly != null) { - _queryParams.with_prices_only = withPricesOnly.toString(); - } - - if (withZeroPrice != null) { - _queryParams.with_zero_price = withZeroPrice.toString(); - } - - if (withoutLinkedToPlan != null) { - _queryParams.without_linked_to_plan = withoutLinkedToPlan.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + is_active: isActive, + name, + price_usage_type: + priceUsageType != null + ? serializers.BillingPriceUsageType.jsonOrThrow(priceUsageType, { unrecognizedObjectKeys: "strip" }) + : undefined, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + with_one_time_charges: withOneTimeCharges, + with_prices_only: withPricesOnly, + with_zero_price: withZeroPrice, + without_linked_to_plan: withoutLinkedToPlan, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2884,8 +2674,8 @@ export class BillingClient { * withPricesOnly: true, * withZeroPrice: true, * withoutLinkedToPlan: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countBillingProducts( @@ -2913,63 +2703,26 @@ export class BillingClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (isActive != null) { - _queryParams.is_active = isActive.toString(); - } - - if (name != null) { - _queryParams.name = name; - } - - if (priceUsageType != null) { - _queryParams.price_usage_type = serializers.BillingPriceUsageType.jsonOrThrow(priceUsageType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (providerType != null) { - _queryParams.provider_type = serializers.BillingProviderType.jsonOrThrow(providerType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withOneTimeCharges != null) { - _queryParams.with_one_time_charges = withOneTimeCharges.toString(); - } - - if (withPricesOnly != null) { - _queryParams.with_prices_only = withPricesOnly.toString(); - } - - if (withZeroPrice != null) { - _queryParams.with_zero_price = withZeroPrice.toString(); - } - - if (withoutLinkedToPlan != null) { - _queryParams.without_linked_to_plan = withoutLinkedToPlan.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + is_active: isActive, + name, + price_usage_type: + priceUsageType != null + ? serializers.BillingPriceUsageType.jsonOrThrow(priceUsageType, { unrecognizedObjectKeys: "strip" }) + : undefined, + provider_type: + providerType != null + ? serializers.BillingProviderType.jsonOrThrow(providerType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + with_one_time_charges: withOneTimeCharges, + with_prices_only: withPricesOnly, + with_zero_price: withZeroPrice, + without_linked_to_plan: withoutLinkedToPlan, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3099,14 +2852,14 @@ export class BillingClient { * productExternalIds: [{ * currency: "currency", * interval: "interval", - * price: 1, + * price: 1000000, * priceExternalId: "price_external_id", * productExternalId: "product_external_id", - * quantity: 1, + * quantity: 1000000, * usageType: "licensed" * }], * subscriptionExternalId: "subscription_external_id", - * totalPrice: 1 + * totalPrice: 1000000 * }) */ public upsertBillingSubscription( diff --git a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts index f17d758f..bf41f5da 100644 --- a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts @@ -14,8 +14,8 @@ import type * as Schematic from "../../../../index"; * withPricesOnly: true, * withZeroPrice: true, * withoutLinkedToPlan: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountBillingProductsRequest { diff --git a/src/api/resources/billing/client/requests/CountCustomersRequest.ts b/src/api/resources/billing/client/requests/CountCustomersRequest.ts index e6be6d43..e872185a 100644 --- a/src/api/resources/billing/client/requests/CountCustomersRequest.ts +++ b/src/api/resources/billing/client/requests/CountCustomersRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * name: "name", * providerType: "schematic", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCustomersRequest { diff --git a/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts b/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts index fc53b0c9..e8b11ba3 100644 --- a/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts @@ -10,7 +10,7 @@ import type * as Schematic from "../../../../index"; * externalAccountId: "external_account_id", * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * priceExternalId: "price_external_id", * priceTiers: [{ * priceExternalId: "price_external_id" diff --git a/src/api/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.ts b/src/api/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.ts index c19610c4..4f401959 100644 --- a/src/api/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.ts @@ -18,14 +18,14 @@ import type * as Schematic from "../../../../index"; * productExternalIds: [{ * currency: "currency", * interval: "interval", - * price: 1, + * price: 1000000, * priceExternalId: "price_external_id", * productExternalId: "product_external_id", - * quantity: 1, + * quantity: 1000000, * usageType: "licensed" * }], * subscriptionExternalId: "subscription_external_id", - * totalPrice: 1 + * totalPrice: 1000000 * } */ export interface CreateBillingSubscriptionRequestBody { diff --git a/src/api/resources/billing/client/requests/CreateCouponRequestBody.ts b/src/api/resources/billing/client/requests/CreateCouponRequestBody.ts index 94d17188..ff1416ce 100644 --- a/src/api/resources/billing/client/requests/CreateCouponRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateCouponRequestBody.ts @@ -3,14 +3,14 @@ /** * @example * { - * amountOff: 1, + * amountOff: 1000000, * duration: "duration", - * durationInMonths: 1, + * durationInMonths: 1000000, * externalId: "external_id", - * maxRedemptions: 1, + * maxRedemptions: 1000000, * name: "name", * percentOff: 1.1, - * timesRedeemed: 1 + * timesRedeemed: 1000000 * } */ export interface CreateCouponRequestBody { diff --git a/src/api/resources/billing/client/requests/CreateInvoiceRequestBody.ts b/src/api/resources/billing/client/requests/CreateInvoiceRequestBody.ts index 5c5c966e..87012018 100644 --- a/src/api/resources/billing/client/requests/CreateInvoiceRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateInvoiceRequestBody.ts @@ -5,13 +5,13 @@ import type * as Schematic from "../../../../index"; /** * @example * { - * amountDue: 1, - * amountPaid: 1, - * amountRemaining: 1, + * amountDue: 1000000, + * amountPaid: 1000000, + * amountRemaining: 1000000, * collectionMethod: "collection_method", * currency: "currency", * customerExternalId: "customer_external_id", - * subtotal: 1 + * subtotal: 1000000 * } */ export interface CreateInvoiceRequestBody { diff --git a/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts b/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts index b631e36b..93c1a24e 100644 --- a/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts @@ -9,15 +9,15 @@ import type * as Schematic from "../../../../index"; * forTrialExpiryPlan: true, * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * productId: "product_id", * providerType: "schematic", * q: "q", * tiersMode: "graduated", * usageType: "licensed", * withMeter: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListBillingPricesRequest { diff --git a/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts b/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts index 66c67f0f..babf2b66 100644 --- a/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts @@ -9,15 +9,15 @@ import type * as Schematic from "../../../../index"; * forTrialExpiryPlan: true, * interval: "interval", * isActive: true, - * price: 1, + * price: 1000000, * productId: "product_id", * providerType: "schematic", * q: "q", * tiersMode: "graduated", * usageType: "licensed", * withMeter: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListBillingProductPricesRequest { diff --git a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts index 9e8d9b74..5b52d029 100644 --- a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts @@ -14,8 +14,8 @@ import type * as Schematic from "../../../../index"; * withPricesOnly: true, * withZeroPrice: true, * withoutLinkedToPlan: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListBillingProductsRequest { diff --git a/src/api/resources/billing/client/requests/ListCouponsRequest.ts b/src/api/resources/billing/client/requests/ListCouponsRequest.ts index 9aaee271..f38867ad 100644 --- a/src/api/resources/billing/client/requests/ListCouponsRequest.ts +++ b/src/api/resources/billing/client/requests/ListCouponsRequest.ts @@ -5,8 +5,8 @@ * { * isActive: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCouponsRequest { diff --git a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts index 79a9b8a2..020f3c13 100644 --- a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts +++ b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * name: "name", * providerType: "schematic", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCustomersWithSubscriptionsRequest { diff --git a/src/api/resources/billing/client/requests/ListInvoicesRequest.ts b/src/api/resources/billing/client/requests/ListInvoicesRequest.ts index 2d3d0dd2..a998e2f1 100644 --- a/src/api/resources/billing/client/requests/ListInvoicesRequest.ts +++ b/src/api/resources/billing/client/requests/ListInvoicesRequest.ts @@ -6,8 +6,8 @@ * companyId: "company_id", * customerExternalId: "customer_external_id", * subscriptionExternalId: "subscription_external_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListInvoicesRequest { diff --git a/src/api/resources/billing/client/requests/ListMetersRequest.ts b/src/api/resources/billing/client/requests/ListMetersRequest.ts index c2cc3114..db4b0509 100644 --- a/src/api/resources/billing/client/requests/ListMetersRequest.ts +++ b/src/api/resources/billing/client/requests/ListMetersRequest.ts @@ -4,8 +4,8 @@ * @example * { * displayName: "display_name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListMetersRequest { diff --git a/src/api/resources/billing/client/requests/ListPaymentMethodsRequest.ts b/src/api/resources/billing/client/requests/ListPaymentMethodsRequest.ts index 01fa6bff..ab61e4f7 100644 --- a/src/api/resources/billing/client/requests/ListPaymentMethodsRequest.ts +++ b/src/api/resources/billing/client/requests/ListPaymentMethodsRequest.ts @@ -5,8 +5,8 @@ * { * companyId: "company_id", * customerExternalId: "customer_external_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListPaymentMethodsRequest { diff --git a/src/api/resources/billing/exports.ts b/src/api/resources/billing/exports.ts new file mode 100644 index 00000000..3df14eb2 --- /dev/null +++ b/src/api/resources/billing/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BillingClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index 8491f53b..1211364c 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -42,13 +42,13 @@ export class CheckoutClient { * companyId: "company_id", * creditBundles: [{ * bundleId: "bundle_id", - * quantity: 1 + * quantity: 1000000 * }], * newPlanId: "new_plan_id", * newPriceId: "new_price_id", * payInAdvance: [{ * priceId: "price_id", - * quantity: 1 + * quantity: 1000000 * }], * skipTrial: true * }) @@ -325,13 +325,13 @@ export class CheckoutClient { * companyId: "company_id", * creditBundles: [{ * bundleId: "bundle_id", - * quantity: 1 + * quantity: 1000000 * }], * newPlanId: "new_plan_id", * newPriceId: "new_price_id", * payInAdvance: [{ * priceId: "price_id", - * quantity: 1 + * quantity: 1000000 * }], * skipTrial: true * }) @@ -474,11 +474,11 @@ export class CheckoutClient { * companyId: "company_id", * creditBundles: [{ * bundleId: "bundle_id", - * quantity: 1 + * quantity: 1000000 * }], * payInAdvanceEntitlements: [{ * priceId: "price_id", - * quantity: 1 + * quantity: 1000000 * }] * }) */ @@ -618,11 +618,11 @@ export class CheckoutClient { * companyId: "company_id", * creditBundles: [{ * bundleId: "bundle_id", - * quantity: 1 + * quantity: 1000000 * }], * payInAdvanceEntitlements: [{ * priceId: "price_id", - * quantity: 1 + * quantity: 1000000 * }] * }) */ diff --git a/src/api/resources/checkout/exports.ts b/src/api/resources/checkout/exports.ts new file mode 100644 index 00000000..aa634073 --- /dev/null +++ b/src/api/resources/checkout/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CheckoutClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index 621dd958..26795087 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -47,8 +47,8 @@ export class CompaniesClient { * withoutPlan: true, * withoutSubscription: true, * withSubscription: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCompanies( @@ -82,109 +82,43 @@ export class CompaniesClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (creditTypeIds != null) { - if (Array.isArray(creditTypeIds)) { - _queryParams.credit_type_ids = creditTypeIds.map((item) => item); - } else { - _queryParams.credit_type_ids = creditTypeIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (monetizedSubscriptions != null) { - _queryParams.monetized_subscriptions = monetizedSubscriptions.toString(); - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (sortOrderColumn != null) { - _queryParams.sort_order_column = sortOrderColumn; - } - - if (sortOrderDirection != null) { - _queryParams.sort_order_direction = serializers.SortDirection.jsonOrThrow(sortOrderDirection, { - unrecognizedObjectKeys: "strip", - }); - } - - if (subscriptionStatuses != null) { - if (Array.isArray(subscriptionStatuses)) { - _queryParams.subscription_statuses = subscriptionStatuses.map((item) => - serializers.SubscriptionStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.subscription_statuses = serializers.SubscriptionStatus.jsonOrThrow(subscriptionStatuses, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (subscriptionTypes != null) { - if (Array.isArray(subscriptionTypes)) { - _queryParams.subscription_types = subscriptionTypes.map((item) => - serializers.SubscriptionType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.subscription_types = serializers.SubscriptionType.jsonOrThrow(subscriptionTypes, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (withEntitlementFor != null) { - _queryParams.with_entitlement_for = withEntitlementFor; - } - - if (withoutFeatureOverrideFor != null) { - _queryParams.without_feature_override_for = withoutFeatureOverrideFor; - } - - if (withoutPlan != null) { - _queryParams.without_plan = withoutPlan.toString(); - } - - if (withoutSubscription != null) { - _queryParams.without_subscription = withoutSubscription.toString(); - } - - if (withSubscription != null) { - _queryParams.with_subscription = withSubscription.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_type_ids: creditTypeIds, + ids, + monetized_subscriptions: monetizedSubscriptions, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + q, + sort_order_column: sortOrderColumn, + sort_order_direction: + sortOrderDirection != null + ? serializers.SortDirection.jsonOrThrow(sortOrderDirection, { unrecognizedObjectKeys: "strip" }) + : undefined, + subscription_statuses: Array.isArray(subscriptionStatuses) + ? subscriptionStatuses.map((item) => + serializers.SubscriptionStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : subscriptionStatuses != null + ? serializers.SubscriptionStatus.jsonOrThrow(subscriptionStatuses, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + subscription_types: Array.isArray(subscriptionTypes) + ? subscriptionTypes.map((item) => + serializers.SubscriptionType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : subscriptionTypes != null + ? serializers.SubscriptionType.jsonOrThrow(subscriptionTypes, { unrecognizedObjectKeys: "strip" }) + : undefined, + with_entitlement_for: withEntitlementFor, + without_feature_override_for: withoutFeatureOverrideFor, + without_plan: withoutPlan, + without_subscription: withoutSubscription, + with_subscription: withSubscription, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -571,15 +505,10 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { cancelSubscription, prorate } = request; - const _queryParams: Record = {}; - if (cancelSubscription != null) { - _queryParams.cancel_subscription = cancelSubscription.toString(); - } - - if (prorate != null) { - _queryParams.prorate = prorate.toString(); - } - + const _queryParams: Record = { + cancel_subscription: cancelSubscription, + prorate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -707,8 +636,8 @@ export class CompaniesClient { * withoutPlan: true, * withoutSubscription: true, * withSubscription: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCompanies( @@ -742,109 +671,43 @@ export class CompaniesClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (creditTypeIds != null) { - if (Array.isArray(creditTypeIds)) { - _queryParams.credit_type_ids = creditTypeIds.map((item) => item); - } else { - _queryParams.credit_type_ids = creditTypeIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (monetizedSubscriptions != null) { - _queryParams.monetized_subscriptions = monetizedSubscriptions.toString(); - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (sortOrderColumn != null) { - _queryParams.sort_order_column = sortOrderColumn; - } - - if (sortOrderDirection != null) { - _queryParams.sort_order_direction = serializers.SortDirection.jsonOrThrow(sortOrderDirection, { - unrecognizedObjectKeys: "strip", - }); - } - - if (subscriptionStatuses != null) { - if (Array.isArray(subscriptionStatuses)) { - _queryParams.subscription_statuses = subscriptionStatuses.map((item) => - serializers.SubscriptionStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.subscription_statuses = serializers.SubscriptionStatus.jsonOrThrow(subscriptionStatuses, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (subscriptionTypes != null) { - if (Array.isArray(subscriptionTypes)) { - _queryParams.subscription_types = subscriptionTypes.map((item) => - serializers.SubscriptionType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.subscription_types = serializers.SubscriptionType.jsonOrThrow(subscriptionTypes, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (withEntitlementFor != null) { - _queryParams.with_entitlement_for = withEntitlementFor; - } - - if (withoutFeatureOverrideFor != null) { - _queryParams.without_feature_override_for = withoutFeatureOverrideFor; - } - - if (withoutPlan != null) { - _queryParams.without_plan = withoutPlan.toString(); - } - - if (withoutSubscription != null) { - _queryParams.without_subscription = withoutSubscription.toString(); - } - - if (withSubscription != null) { - _queryParams.with_subscription = withSubscription.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_type_ids: creditTypeIds, + ids, + monetized_subscriptions: monetizedSubscriptions, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + q, + sort_order_column: sortOrderColumn, + sort_order_direction: + sortOrderDirection != null + ? serializers.SortDirection.jsonOrThrow(sortOrderDirection, { unrecognizedObjectKeys: "strip" }) + : undefined, + subscription_statuses: Array.isArray(subscriptionStatuses) + ? subscriptionStatuses.map((item) => + serializers.SubscriptionStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : subscriptionStatuses != null + ? serializers.SubscriptionStatus.jsonOrThrow(subscriptionStatuses, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + subscription_types: Array.isArray(subscriptionTypes) + ? subscriptionTypes.map((item) => + serializers.SubscriptionType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : subscriptionTypes != null + ? serializers.SubscriptionType.jsonOrThrow(subscriptionTypes, { unrecognizedObjectKeys: "strip" }) + : undefined, + with_entitlement_for: withEntitlementFor, + without_feature_override_for: withoutFeatureOverrideFor, + without_plan: withoutPlan, + without_subscription: withoutSubscription, + with_subscription: withSubscription, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1220,6 +1083,12 @@ export class CompaniesClient { } /** + * Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work. + * The following approaches will all work to resolve a company and any of them are appropriate: + * 1. `/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}` + * 2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz` + * 2. `/companies/lookup?foo=bar&fizz=buzz` + * * @param {Schematic.LookupCompanyRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1247,8 +1116,9 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { keys } = request; - const _queryParams: Record = {}; - _queryParams.keys = toJson(keys); + const _queryParams: Record = { + keys: toJson(keys), + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1356,8 +1226,8 @@ export class CompaniesClient { * await client.companies.listCompanyMemberships({ * companyId: "company_id", * userId: "user_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCompanyMemberships( @@ -1372,23 +1242,12 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { companyId, userId, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (userId != null) { - _queryParams.user_id = userId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + user_id: userId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1777,8 +1636,8 @@ export class CompaniesClient { * @example * await client.companies.getActiveCompanySubscription({ * companyId: "company_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public getActiveCompanySubscription( @@ -1793,27 +1652,12 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { companyId, companyIds, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + company_ids: companyIds, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2068,8 +1912,8 @@ export class CompaniesClient { * await client.companies.listEntityKeyDefinitions({ * entityType: "company", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listEntityKeyDefinitions( @@ -2084,33 +1928,16 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { entityType, ids, q, limit, offset } = request; - const _queryParams: Record = {}; - if (entityType != null) { - _queryParams.entity_type = serializers.EntityType.jsonOrThrow(entityType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + entity_type: + entityType != null + ? serializers.EntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" }) + : undefined, + ids, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2229,8 +2056,8 @@ export class CompaniesClient { * await client.companies.countEntityKeyDefinitions({ * entityType: "company", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countEntityKeyDefinitions( @@ -2245,33 +2072,16 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { entityType, ids, q, limit, offset } = request; - const _queryParams: Record = {}; - if (entityType != null) { - _queryParams.entity_type = serializers.EntityType.jsonOrThrow(entityType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + entity_type: + entityType != null + ? serializers.EntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" }) + : undefined, + ids, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2391,8 +2201,8 @@ export class CompaniesClient { * entityType: "company", * q: "q", * traitType: "boolean", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listEntityTraitDefinitions( @@ -2407,49 +2217,25 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { entityType, ids, q, traitType, traitTypes, limit, offset } = request; - const _queryParams: Record = {}; - if (entityType != null) { - _queryParams.entity_type = serializers.EntityType.jsonOrThrow(entityType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (traitType != null) { - _queryParams.trait_type = serializers.TraitType.jsonOrThrow(traitType, { unrecognizedObjectKeys: "strip" }); - } - - if (traitTypes != null) { - if (Array.isArray(traitTypes)) { - _queryParams.trait_types = traitTypes.map((item) => - serializers.TraitType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.trait_types = serializers.TraitType.jsonOrThrow(traitTypes, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + entity_type: + entityType != null + ? serializers.EntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" }) + : undefined, + ids, + q, + trait_type: + traitType != null + ? serializers.TraitType.jsonOrThrow(traitType, { unrecognizedObjectKeys: "strip" }) + : undefined, + trait_types: Array.isArray(traitTypes) + ? traitTypes.map((item) => serializers.TraitType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })) + : traitTypes != null + ? serializers.TraitType.jsonOrThrow(traitTypes, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2974,8 +2760,8 @@ export class CompaniesClient { * entityType: "company", * q: "q", * traitType: "boolean", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countEntityTraitDefinitions( @@ -2990,49 +2776,25 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { entityType, ids, q, traitType, traitTypes, limit, offset } = request; - const _queryParams: Record = {}; - if (entityType != null) { - _queryParams.entity_type = serializers.EntityType.jsonOrThrow(entityType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (traitType != null) { - _queryParams.trait_type = serializers.TraitType.jsonOrThrow(traitType, { unrecognizedObjectKeys: "strip" }); - } - - if (traitTypes != null) { - if (Array.isArray(traitTypes)) { - _queryParams.trait_types = traitTypes.map((item) => - serializers.TraitType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.trait_types = serializers.TraitType.jsonOrThrow(traitTypes, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + entity_type: + entityType != null + ? serializers.EntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" }) + : undefined, + ids, + q, + trait_type: + traitType != null + ? serializers.TraitType.jsonOrThrow(traitType, { unrecognizedObjectKeys: "strip" }) + : undefined, + trait_types: Array.isArray(traitTypes) + ? traitTypes.map((item) => serializers.TraitType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })) + : traitTypes != null + ? serializers.TraitType.jsonOrThrow(traitTypes, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3156,8 +2918,8 @@ export class CompaniesClient { * await client.companies.getEntityTraitValues({ * definitionId: "definition_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public getEntityTraitValues( @@ -3172,20 +2934,12 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { definitionId, q, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.definition_id = definitionId; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + definition_id: definitionId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3305,8 +3059,8 @@ export class CompaniesClient { * action: "action", * basePlanAction: "base_plan_action", * companyId: "company_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listPlanChanges( @@ -3321,43 +3075,15 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { action, basePlanAction, companyId, companyIds, planIds, limit, offset } = request; - const _queryParams: Record = {}; - if (action != null) { - _queryParams.action = action; - } - - if (basePlanAction != null) { - _queryParams.base_plan_action = basePlanAction; - } - - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + action, + base_plan_action: basePlanAction, + company_id: companyId, + company_ids: companyIds, + plan_ids: planIds, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3597,8 +3323,8 @@ export class CompaniesClient { * await client.companies.listPlanTraits({ * planId: "plan_id", * traitId: "trait_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listPlanTraits( @@ -3613,39 +3339,14 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { ids, planId, traitId, traitIds, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (traitId != null) { - _queryParams.trait_id = traitId; - } - - if (traitIds != null) { - if (Array.isArray(traitIds)) { - _queryParams.trait_ids = traitIds.map((item) => item); - } else { - _queryParams.trait_ids = traitIds; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + plan_id: planId, + trait_id: traitId, + trait_ids: traitIds, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4423,8 +4124,8 @@ export class CompaniesClient { * await client.companies.countPlanTraits({ * planId: "plan_id", * traitId: "trait_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countPlanTraits( @@ -4439,39 +4140,14 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { ids, planId, traitId, traitIds, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (traitId != null) { - _queryParams.trait_id = traitId; - } - - if (traitIds != null) { - if (Array.isArray(traitIds)) { - _queryParams.trait_ids = traitIds.map((item) => item); - } else { - _queryParams.trait_ids = traitIds; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + plan_id: planId, + trait_id: traitId, + trait_ids: traitIds, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4727,8 +4403,8 @@ export class CompaniesClient { * companyId: "company_id", * planId: "plan_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listUsers( @@ -4743,35 +4419,14 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { companyId, ids, planId, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + ids, + plan_id: planId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5270,8 +4925,8 @@ export class CompaniesClient { * companyId: "company_id", * planId: "plan_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countUsers( @@ -5286,35 +4941,14 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { companyId, ids, planId, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + ids, + plan_id: planId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5717,8 +5351,9 @@ export class CompaniesClient { requestOptions?: CompaniesClient.RequestOptions, ): Promise> { const { keys } = request; - const _queryParams: Record = {}; - _queryParams.keys = toJson(keys); + const _queryParams: Record = { + keys: toJson(keys), + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/companies/client/requests/CountCompaniesRequest.ts b/src/api/resources/companies/client/requests/CountCompaniesRequest.ts index a7b50442..6a863c39 100644 --- a/src/api/resources/companies/client/requests/CountCompaniesRequest.ts +++ b/src/api/resources/companies/client/requests/CountCompaniesRequest.ts @@ -16,8 +16,8 @@ import type * as Schematic from "../../../../index"; * withoutPlan: true, * withoutSubscription: true, * withSubscription: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCompaniesRequest { diff --git a/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts b/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts index e38d9308..1e798207 100644 --- a/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts @@ -7,8 +7,8 @@ import type * as Schematic from "../../../../index"; * { * entityType: "company", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountEntityKeyDefinitionsRequest { diff --git a/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts b/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts index 9cc8fcd0..8da73346 100644 --- a/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * entityType: "company", * q: "q", * traitType: "boolean", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountEntityTraitDefinitionsRequest { diff --git a/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts b/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts index 506c9eea..53e6ebc3 100644 --- a/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts +++ b/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts @@ -5,8 +5,8 @@ * { * planId: "plan_id", * traitId: "trait_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountPlanTraitsRequest { diff --git a/src/api/resources/companies/client/requests/CountUsersRequest.ts b/src/api/resources/companies/client/requests/CountUsersRequest.ts index 0f2ec114..fc4fab7c 100644 --- a/src/api/resources/companies/client/requests/CountUsersRequest.ts +++ b/src/api/resources/companies/client/requests/CountUsersRequest.ts @@ -6,8 +6,8 @@ * companyId: "company_id", * planId: "plan_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountUsersRequest { diff --git a/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts b/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts index 9fe68ba3..868e7ccc 100644 --- a/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts +++ b/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts @@ -4,8 +4,8 @@ * @example * { * companyId: "company_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface GetActiveCompanySubscriptionRequest { diff --git a/src/api/resources/companies/client/requests/GetEntityTraitValuesRequest.ts b/src/api/resources/companies/client/requests/GetEntityTraitValuesRequest.ts index 303f2492..a9655e09 100644 --- a/src/api/resources/companies/client/requests/GetEntityTraitValuesRequest.ts +++ b/src/api/resources/companies/client/requests/GetEntityTraitValuesRequest.ts @@ -5,8 +5,8 @@ * { * definitionId: "definition_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface GetEntityTraitValuesRequest { diff --git a/src/api/resources/companies/client/requests/ListCompaniesRequest.ts b/src/api/resources/companies/client/requests/ListCompaniesRequest.ts index 52153529..ad335867 100644 --- a/src/api/resources/companies/client/requests/ListCompaniesRequest.ts +++ b/src/api/resources/companies/client/requests/ListCompaniesRequest.ts @@ -16,8 +16,8 @@ import type * as Schematic from "../../../../index"; * withoutPlan: true, * withoutSubscription: true, * withSubscription: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCompaniesRequest { diff --git a/src/api/resources/companies/client/requests/ListCompanyMembershipsRequest.ts b/src/api/resources/companies/client/requests/ListCompanyMembershipsRequest.ts index 238c9c20..a0494111 100644 --- a/src/api/resources/companies/client/requests/ListCompanyMembershipsRequest.ts +++ b/src/api/resources/companies/client/requests/ListCompanyMembershipsRequest.ts @@ -5,8 +5,8 @@ * { * companyId: "company_id", * userId: "user_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCompanyMembershipsRequest { diff --git a/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts b/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts index 98c0d1aa..c978f5c8 100644 --- a/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts @@ -7,8 +7,8 @@ import type * as Schematic from "../../../../index"; * { * entityType: "company", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListEntityKeyDefinitionsRequest { diff --git a/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts b/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts index c36e557a..87b1734a 100644 --- a/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * entityType: "company", * q: "q", * traitType: "boolean", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListEntityTraitDefinitionsRequest { diff --git a/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts b/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts index b16f5e2e..c7632ec1 100644 --- a/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts +++ b/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts @@ -6,8 +6,8 @@ * action: "action", * basePlanAction: "base_plan_action", * companyId: "company_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListPlanChangesRequest { diff --git a/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts b/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts index 4f47507f..cc824c94 100644 --- a/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts +++ b/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts @@ -5,8 +5,8 @@ * { * planId: "plan_id", * traitId: "trait_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListPlanTraitsRequest { diff --git a/src/api/resources/companies/client/requests/ListUsersRequest.ts b/src/api/resources/companies/client/requests/ListUsersRequest.ts index 3ae25a5a..8b778d36 100644 --- a/src/api/resources/companies/client/requests/ListUsersRequest.ts +++ b/src/api/resources/companies/client/requests/ListUsersRequest.ts @@ -6,8 +6,8 @@ * companyId: "company_id", * planId: "plan_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListUsersRequest { diff --git a/src/api/resources/companies/exports.ts b/src/api/resources/companies/exports.ts new file mode 100644 index 00000000..b2ff6b6a --- /dev/null +++ b/src/api/resources/companies/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CompaniesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index cb01fc0b..b07288db 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -36,8 +36,8 @@ export class ComponentsClient { * @example * await client.components.listComponents({ * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listComponents( @@ -52,19 +52,11 @@ export class ComponentsClient { requestOptions?: ComponentsClient.RequestOptions, ): Promise> { const { q, limit, offset } = request; - const _queryParams: Record = {}; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -694,8 +686,8 @@ export class ComponentsClient { * @example * await client.components.countComponents({ * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countComponents( @@ -710,19 +702,11 @@ export class ComponentsClient { requestOptions?: ComponentsClient.RequestOptions, ): Promise> { const { q, limit, offset } = request; - const _queryParams: Record = {}; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -854,15 +838,10 @@ export class ComponentsClient { requestOptions?: ComponentsClient.RequestOptions, ): Promise> { const { companyId, componentId } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (componentId != null) { - _queryParams.component_id = componentId; - } - + const _queryParams: Record = { + company_id: companyId, + component_id: componentId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/components/client/requests/CountComponentsRequest.ts b/src/api/resources/components/client/requests/CountComponentsRequest.ts index 581450a5..7068c453 100644 --- a/src/api/resources/components/client/requests/CountComponentsRequest.ts +++ b/src/api/resources/components/client/requests/CountComponentsRequest.ts @@ -4,8 +4,8 @@ * @example * { * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountComponentsRequest { diff --git a/src/api/resources/components/client/requests/ListComponentsRequest.ts b/src/api/resources/components/client/requests/ListComponentsRequest.ts index 3f5c6863..2a0b583c 100644 --- a/src/api/resources/components/client/requests/ListComponentsRequest.ts +++ b/src/api/resources/components/client/requests/ListComponentsRequest.ts @@ -4,8 +4,8 @@ * @example * { * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListComponentsRequest { diff --git a/src/api/resources/components/exports.ts b/src/api/resources/components/exports.ts new file mode 100644 index 00000000..fbca1f00 --- /dev/null +++ b/src/api/resources/components/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ComponentsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/componentspublic/exports.ts b/src/api/resources/componentspublic/exports.ts new file mode 100644 index 00000000..b0e85451 --- /dev/null +++ b/src/api/resources/componentspublic/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ComponentspublicClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/credits/client/Client.ts b/src/api/resources/credits/client/Client.ts index ac30a64e..8ebad160 100644 --- a/src/api/resources/credits/client/Client.ts +++ b/src/api/resources/credits/client/Client.ts @@ -36,8 +36,8 @@ export class CreditsClient { * @example * await client.credits.listBillingCredits({ * name: "name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listBillingCredits( @@ -52,27 +52,12 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { ids, name, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + name, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -713,8 +698,8 @@ export class CreditsClient { * creditId: "credit_id", * status: "active", * bundleType: "fixed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCreditBundles( @@ -729,39 +714,20 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { ids, creditId, status, bundleType, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (status != null) { - _queryParams.status = serializers.BillingCreditBundleStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (bundleType != null) { - _queryParams.bundle_type = serializers.BillingCreditBundleType.jsonOrThrow(bundleType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + credit_id: creditId, + status: + status != null + ? serializers.BillingCreditBundleStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + bundle_type: + bundleType != null + ? serializers.BillingCreditBundleType.jsonOrThrow(bundleType, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -881,7 +847,7 @@ export class CreditsClient { * bundleName: "bundle_name", * creditId: "credit_id", * currency: "currency", - * pricePerUnit: 1 + * pricePerUnit: 1000000 * }) */ public createCreditBundle( @@ -1137,7 +1103,7 @@ export class CreditsClient { * @example * await client.credits.updateCreditBundleDetails("bundle_id", { * bundleName: "bundle_name", - * pricePerUnit: 1 + * pricePerUnit: 1000000 * }) */ public updateCreditBundleDetails( @@ -1417,8 +1383,8 @@ export class CreditsClient { * creditId: "credit_id", * status: "active", * bundleType: "fixed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCreditBundles( @@ -1433,39 +1399,20 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { ids, creditId, status, bundleType, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (status != null) { - _queryParams.status = serializers.BillingCreditBundleStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (bundleType != null) { - _queryParams.bundle_type = serializers.BillingCreditBundleType.jsonOrThrow(bundleType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + credit_id: creditId, + status: + status != null + ? serializers.BillingCreditBundleStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + bundle_type: + bundleType != null + ? serializers.BillingCreditBundleType.jsonOrThrow(bundleType, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1588,8 +1535,8 @@ export class CreditsClient { * @example * await client.credits.countBillingCredits({ * name: "name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countBillingCredits( @@ -1604,27 +1551,12 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { ids, name, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + name, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1882,7 +1814,7 @@ export class CreditsClient { * await client.credits.grantBillingCreditsToCompany({ * companyId: "company_id", * creditId: "credit_id", - * quantity: 1, + * quantity: 1000000, * reason: "billing_credit_auto_topup" * }) */ @@ -2024,8 +1956,8 @@ export class CreditsClient { * companyId: "company_id", * order: "created_at", * dir: "asc", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCompanyGrants( @@ -2040,29 +1972,19 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { companyId, order, dir, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (order != null) { - _queryParams.order = serializers.CreditGrantSortOrder.jsonOrThrow(order, { - unrecognizedObjectKeys: "strip", - }); - } - - if (dir != null) { - _queryParams.dir = serializers.SortDirection.jsonOrThrow(dir, { unrecognizedObjectKeys: "strip" }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + order: + order != null + ? serializers.CreditGrantSortOrder.jsonOrThrow(order, { unrecognizedObjectKeys: "strip" }) + : undefined, + dir: + dir != null + ? serializers.SortDirection.jsonOrThrow(dir, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2187,8 +2109,8 @@ export class CreditsClient { * companyId: "company_id", * order: "created_at", * dir: "asc", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCompanyGrants( @@ -2203,29 +2125,19 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { companyId, order, dir, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (order != null) { - _queryParams.order = serializers.CreditGrantSortOrder.jsonOrThrow(order, { - unrecognizedObjectKeys: "strip", - }); - } - - if (dir != null) { - _queryParams.dir = serializers.SortDirection.jsonOrThrow(dir, { unrecognizedObjectKeys: "strip" }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + order: + order != null + ? serializers.CreditGrantSortOrder.jsonOrThrow(order, { unrecognizedObjectKeys: "strip" }) + : undefined, + dir: + dir != null + ? serializers.SortDirection.jsonOrThrow(dir, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2348,8 +2260,8 @@ export class CreditsClient { * @example * await client.credits.countBillingCreditsGrants({ * creditId: "credit_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countBillingCreditsGrants( @@ -2364,27 +2276,12 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { creditId, ids, limit, offset } = request; - const _queryParams: Record = {}; - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_id: creditId, + ids, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2502,8 +2399,8 @@ export class CreditsClient { * @example * await client.credits.listGrantsForCredit({ * creditId: "credit_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listGrantsForCredit( @@ -2518,27 +2415,12 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { creditId, ids, limit, offset } = request; - const _queryParams: Record = {}; - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_id: creditId, + ids, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2661,8 +2543,8 @@ export class CreditsClient { * period: "daily", * startTime: "start_time", * endTime: "end_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public getEnrichedCreditLedger( @@ -2677,33 +2559,16 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { companyId, billingCreditId, featureId, period, startTime, endTime, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.company_id = companyId; - if (billingCreditId != null) { - _queryParams.billing_credit_id = billingCreditId; - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - _queryParams.period = serializers.CreditLedgerPeriod.jsonOrThrow(period, { unrecognizedObjectKeys: "strip" }); - if (startTime != null) { - _queryParams.start_time = startTime; - } - - if (endTime != null) { - _queryParams.end_time = endTime; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + billing_credit_id: billingCreditId, + feature_id: featureId, + period: serializers.CreditLedgerPeriod.jsonOrThrow(period, { unrecognizedObjectKeys: "strip" }), + start_time: startTime, + end_time: endTime, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2826,8 +2691,8 @@ export class CreditsClient { * period: "daily", * startTime: "start_time", * endTime: "end_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCreditLedger( @@ -2842,33 +2707,16 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { companyId, billingCreditId, featureId, period, startTime, endTime, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.company_id = companyId; - if (billingCreditId != null) { - _queryParams.billing_credit_id = billingCreditId; - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - _queryParams.period = serializers.CreditLedgerPeriod.jsonOrThrow(period, { unrecognizedObjectKeys: "strip" }); - if (startTime != null) { - _queryParams.start_time = startTime; - } - - if (endTime != null) { - _queryParams.end_time = endTime; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + billing_credit_id: billingCreditId, + feature_id: featureId, + period: serializers.CreditLedgerPeriod.jsonOrThrow(period, { unrecognizedObjectKeys: "strip" }), + start_time: startTime, + end_time: endTime, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2988,8 +2836,8 @@ export class CreditsClient { * creditId: "credit_id", * planId: "plan_id", * planVersionId: "plan_version_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listBillingPlanCreditGrants( @@ -3004,43 +2852,15 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { creditId, ids, planId, planIds, planVersionId, limit, offset } = request; - const _queryParams: Record = {}; - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_id: creditId, + ids, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3157,7 +2977,7 @@ export class CreditsClient { * * @example * await client.credits.createBillingPlanCreditGrant({ - * creditAmount: 1, + * creditAmount: 1000000, * creditId: "credit_id", * planId: "plan_id", * resetCadence: "daily", @@ -3462,11 +3282,9 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { applyToExisting } = request; - const _queryParams: Record = {}; - if (applyToExisting != null) { - _queryParams.apply_to_existing = applyToExisting.toString(); - } - + const _queryParams: Record = { + apply_to_existing: applyToExisting, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3591,8 +3409,8 @@ export class CreditsClient { * creditId: "credit_id", * planId: "plan_id", * planVersionId: "plan_version_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countBillingPlanCreditGrants( @@ -3607,43 +3425,15 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { creditId, ids, planId, planIds, planVersionId, limit, offset } = request; - const _queryParams: Record = {}; - if (creditId != null) { - _queryParams.credit_id = creditId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + credit_id: creditId, + ids, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3771,8 +3561,8 @@ export class CreditsClient { * eventType: "grant", * featureId: "feature_id", * startTime: "start_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCreditEventLedger( @@ -3787,38 +3577,19 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { billingCreditId, companyId, endTime, eventType, featureId, startTime, limit, offset } = request; - const _queryParams: Record = {}; - if (billingCreditId != null) { - _queryParams.billing_credit_id = billingCreditId; - } - - _queryParams.company_id = companyId; - if (endTime != null) { - _queryParams.end_time = endTime; - } - - if (eventType != null) { - _queryParams.event_type = serializers.CreditEventType.jsonOrThrow(eventType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (startTime != null) { - _queryParams.start_time = startTime; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + billing_credit_id: billingCreditId, + company_id: companyId, + end_time: endTime, + event_type: + eventType != null + ? serializers.CreditEventType.jsonOrThrow(eventType, { unrecognizedObjectKeys: "strip" }) + : undefined, + feature_id: featureId, + start_time: startTime, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3941,8 +3712,8 @@ export class CreditsClient { * eventType: "grant", * featureId: "feature_id", * startTime: "start_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCreditEventLedger( @@ -3957,38 +3728,19 @@ export class CreditsClient { requestOptions?: CreditsClient.RequestOptions, ): Promise> { const { billingCreditId, companyId, endTime, eventType, featureId, startTime, limit, offset } = request; - const _queryParams: Record = {}; - if (billingCreditId != null) { - _queryParams.billing_credit_id = billingCreditId; - } - - _queryParams.company_id = companyId; - if (endTime != null) { - _queryParams.end_time = endTime; - } - - if (eventType != null) { - _queryParams.event_type = serializers.CreditEventType.jsonOrThrow(eventType, { - unrecognizedObjectKeys: "strip", - }); - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (startTime != null) { - _queryParams.start_time = startTime; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + billing_credit_id: billingCreditId, + company_id: companyId, + end_time: endTime, + event_type: + eventType != null + ? serializers.CreditEventType.jsonOrThrow(eventType, { unrecognizedObjectKeys: "strip" }) + : undefined, + feature_id: featureId, + start_time: startTime, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts b/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts index 22150c12..7c9a9f9d 100644 --- a/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts @@ -4,8 +4,8 @@ * @example * { * creditId: "credit_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountBillingCreditsGrantsRequest { diff --git a/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts b/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts index 3aa5a665..d6582fd1 100644 --- a/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts @@ -4,8 +4,8 @@ * @example * { * name: "name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountBillingCreditsRequest { diff --git a/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts b/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts index bde368e2..bde0d9cf 100644 --- a/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts @@ -6,8 +6,8 @@ * creditId: "credit_id", * planId: "plan_id", * planVersionId: "plan_version_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountBillingPlanCreditGrantsRequest { diff --git a/src/api/resources/credits/client/requests/CountCompanyGrantsRequest.ts b/src/api/resources/credits/client/requests/CountCompanyGrantsRequest.ts index ef05481b..664ccf36 100644 --- a/src/api/resources/credits/client/requests/CountCompanyGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/CountCompanyGrantsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * companyId: "company_id", * order: "created_at", * dir: "asc", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCompanyGrantsRequest { diff --git a/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts b/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts index d32757ab..895363d8 100644 --- a/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts +++ b/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * creditId: "credit_id", * status: "active", * bundleType: "fixed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCreditBundlesRequest { diff --git a/src/api/resources/credits/client/requests/CountCreditEventLedgerRequest.ts b/src/api/resources/credits/client/requests/CountCreditEventLedgerRequest.ts index e1679ffa..fe2107c4 100644 --- a/src/api/resources/credits/client/requests/CountCreditEventLedgerRequest.ts +++ b/src/api/resources/credits/client/requests/CountCreditEventLedgerRequest.ts @@ -11,8 +11,8 @@ import type * as Schematic from "../../../../index"; * eventType: "grant", * featureId: "feature_id", * startTime: "start_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCreditEventLedgerRequest { diff --git a/src/api/resources/credits/client/requests/CountCreditLedgerRequest.ts b/src/api/resources/credits/client/requests/CountCreditLedgerRequest.ts index 0ae76ca9..d1f8513c 100644 --- a/src/api/resources/credits/client/requests/CountCreditLedgerRequest.ts +++ b/src/api/resources/credits/client/requests/CountCreditLedgerRequest.ts @@ -11,8 +11,8 @@ import type * as Schematic from "../../../../index"; * period: "daily", * startTime: "start_time", * endTime: "end_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCreditLedgerRequest { diff --git a/src/api/resources/credits/client/requests/CreateCompanyCreditGrant.ts b/src/api/resources/credits/client/requests/CreateCompanyCreditGrant.ts index dbf478af..7f3b7dc0 100644 --- a/src/api/resources/credits/client/requests/CreateCompanyCreditGrant.ts +++ b/src/api/resources/credits/client/requests/CreateCompanyCreditGrant.ts @@ -7,7 +7,7 @@ import type * as Schematic from "../../../../index"; * { * companyId: "company_id", * creditId: "credit_id", - * quantity: 1, + * quantity: 1000000, * reason: "billing_credit_auto_topup" * } */ diff --git a/src/api/resources/credits/client/requests/CreateCreditBundleRequestBody.ts b/src/api/resources/credits/client/requests/CreateCreditBundleRequestBody.ts index 655d7fd4..4f8bc5a6 100644 --- a/src/api/resources/credits/client/requests/CreateCreditBundleRequestBody.ts +++ b/src/api/resources/credits/client/requests/CreateCreditBundleRequestBody.ts @@ -8,7 +8,7 @@ import type * as Schematic from "../../../../index"; * bundleName: "bundle_name", * creditId: "credit_id", * currency: "currency", - * pricePerUnit: 1 + * pricePerUnit: 1000000 * } */ export interface CreateCreditBundleRequestBody { diff --git a/src/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.ts b/src/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.ts index 4973c2a4..cba1ed2c 100644 --- a/src/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.ts +++ b/src/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.ts @@ -11,8 +11,8 @@ import type * as Schematic from "../../../../index"; * period: "daily", * startTime: "start_time", * endTime: "end_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface GetEnrichedCreditLedgerRequest { diff --git a/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts b/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts index 38798198..1e7eb865 100644 --- a/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts +++ b/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts @@ -4,8 +4,8 @@ * @example * { * name: "name", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListBillingCreditsRequest { diff --git a/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts b/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts index bb748a1f..1d3b0982 100644 --- a/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts @@ -6,8 +6,8 @@ * creditId: "credit_id", * planId: "plan_id", * planVersionId: "plan_version_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListBillingPlanCreditGrantsRequest { diff --git a/src/api/resources/credits/client/requests/ListCompanyGrantsRequest.ts b/src/api/resources/credits/client/requests/ListCompanyGrantsRequest.ts index d2c2735b..1102ae8b 100644 --- a/src/api/resources/credits/client/requests/ListCompanyGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/ListCompanyGrantsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * companyId: "company_id", * order: "created_at", * dir: "asc", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCompanyGrantsRequest { diff --git a/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts b/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts index eee69fce..7261f0c6 100644 --- a/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts +++ b/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * creditId: "credit_id", * status: "active", * bundleType: "fixed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCreditBundlesRequest { diff --git a/src/api/resources/credits/client/requests/ListCreditEventLedgerRequest.ts b/src/api/resources/credits/client/requests/ListCreditEventLedgerRequest.ts index 780d1c65..7c25124b 100644 --- a/src/api/resources/credits/client/requests/ListCreditEventLedgerRequest.ts +++ b/src/api/resources/credits/client/requests/ListCreditEventLedgerRequest.ts @@ -11,8 +11,8 @@ import type * as Schematic from "../../../../index"; * eventType: "grant", * featureId: "feature_id", * startTime: "start_time", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCreditEventLedgerRequest { diff --git a/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts b/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts index f2ec4c72..c1139d58 100644 --- a/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts +++ b/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts @@ -4,8 +4,8 @@ * @example * { * creditId: "credit_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListGrantsForCreditRequest { diff --git a/src/api/resources/credits/client/requests/UpdateCreditBundleDetailsRequestBody.ts b/src/api/resources/credits/client/requests/UpdateCreditBundleDetailsRequestBody.ts index 892c7836..57710f95 100644 --- a/src/api/resources/credits/client/requests/UpdateCreditBundleDetailsRequestBody.ts +++ b/src/api/resources/credits/client/requests/UpdateCreditBundleDetailsRequestBody.ts @@ -6,7 +6,7 @@ import type * as Schematic from "../../../../index"; * @example * { * bundleName: "bundle_name", - * pricePerUnit: 1 + * pricePerUnit: 1000000 * } */ export interface UpdateCreditBundleDetailsRequestBody { diff --git a/src/api/resources/credits/exports.ts b/src/api/resources/credits/exports.ts new file mode 100644 index 00000000..0b1c3f20 --- /dev/null +++ b/src/api/resources/credits/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CreditsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/dataexports/exports.ts b/src/api/resources/dataexports/exports.ts new file mode 100644 index 00000000..d36343bb --- /dev/null +++ b/src/api/resources/dataexports/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DataexportsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/entitlements/client/Client.ts b/src/api/resources/entitlements/client/Client.ts index e94c2dd1..4777a57f 100644 --- a/src/api/resources/entitlements/client/Client.ts +++ b/src/api/resources/entitlements/client/Client.ts @@ -40,8 +40,8 @@ export class EntitlementsClient { * featureId: "feature_id", * withoutExpired: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCompanyOverrides( @@ -56,55 +56,17 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { companyId, companyIds, featureId, featureIds, ids, withoutExpired, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (withoutExpired != null) { - _queryParams.without_expired = withoutExpired.toString(); - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + company_ids: companyIds, + feature_id: featureId, + feature_ids: featureIds, + ids, + without_expired: withoutExpired, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -761,8 +723,8 @@ export class EntitlementsClient { * featureId: "feature_id", * withoutExpired: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCompanyOverrides( @@ -777,55 +739,17 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { companyId, companyIds, featureId, featureIds, ids, withoutExpired, q, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyIds != null) { - if (Array.isArray(companyIds)) { - _queryParams.company_ids = companyIds.map((item) => item); - } else { - _queryParams.company_ids = companyIds; - } - } - - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (withoutExpired != null) { - _queryParams.without_expired = withoutExpired.toString(); - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + company_ids: companyIds, + feature_id: featureId, + feature_ids: featureIds, + ids, + without_expired: withoutExpired, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -944,8 +868,8 @@ export class EntitlementsClient { * await client.entitlements.listFeatureCompanies({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listFeatureCompanies( @@ -960,20 +884,12 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { featureId, q, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.feature_id = featureId; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1092,8 +1008,8 @@ export class EntitlementsClient { * await client.entitlements.countFeatureCompanies({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countFeatureCompanies( @@ -1108,20 +1024,12 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { featureId, q, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.feature_id = featureId; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1242,8 +1150,8 @@ export class EntitlementsClient { * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listFeatureUsage( @@ -1267,43 +1175,16 @@ export class EntitlementsClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyKeys != null) { - _queryParams.company_keys = toJson(companyKeys); - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (includeUsageAggregation != null) { - _queryParams.include_usage_aggregation = includeUsageAggregation.toString(); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutNegativeEntitlements != null) { - _queryParams.without_negative_entitlements = withoutNegativeEntitlements.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + company_keys: companyKeys != null ? toJson(companyKeys) : undefined, + feature_ids: featureIds, + include_usage_aggregation: includeUsageAggregation, + q, + without_negative_entitlements: withoutNegativeEntitlements, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1438,17 +1319,16 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { companyId, endTime, featureId, granularity, startTime } = request; - const _queryParams: Record = {}; - _queryParams.company_id = companyId; - _queryParams.end_time = endTime.toISOString(); - _queryParams.feature_id = featureId; - if (granularity != null) { - _queryParams.granularity = serializers.TimeSeriesGranularity.jsonOrThrow(granularity, { - unrecognizedObjectKeys: "strip", - }); - } - - _queryParams.start_time = startTime.toISOString(); + const _queryParams: Record = { + company_id: companyId, + end_time: endTime.toISOString(), + feature_id: featureId, + granularity: + granularity != null + ? serializers.TimeSeriesGranularity.jsonOrThrow(granularity, { unrecognizedObjectKeys: "strip" }) + : undefined, + start_time: startTime.toISOString(), + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1558,8 +1438,8 @@ export class EntitlementsClient { * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countFeatureUsage( @@ -1583,43 +1463,16 @@ export class EntitlementsClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (companyKeys != null) { - _queryParams.company_keys = toJson(companyKeys); - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (includeUsageAggregation != null) { - _queryParams.include_usage_aggregation = includeUsageAggregation.toString(); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutNegativeEntitlements != null) { - _queryParams.without_negative_entitlements = withoutNegativeEntitlements.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + company_keys: companyKeys != null ? toJson(companyKeys) : undefined, + feature_ids: featureIds, + include_usage_aggregation: includeUsageAggregation, + q, + without_negative_entitlements: withoutNegativeEntitlements, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1738,8 +1591,8 @@ export class EntitlementsClient { * await client.entitlements.listFeatureUsers({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listFeatureUsers( @@ -1754,20 +1607,12 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { featureId, q, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.feature_id = featureId; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1886,8 +1731,8 @@ export class EntitlementsClient { * await client.entitlements.countFeatureUsers({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countFeatureUsers( @@ -1902,20 +1747,12 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { featureId, q, limit, offset } = request; - const _queryParams: Record = {}; - _queryParams.feature_id = featureId; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2037,8 +1874,8 @@ export class EntitlementsClient { * planVersionId: "plan_version_id", * q: "q", * withMeteredProducts: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listPlanEntitlements( @@ -2065,67 +1902,19 @@ export class EntitlementsClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (planVersionIds != null) { - if (Array.isArray(planVersionIds)) { - _queryParams.plan_version_ids = planVersionIds.map((item) => item); - } else { - _queryParams.plan_version_ids = planVersionIds; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (withMeteredProducts != null) { - _queryParams.with_metered_products = withMeteredProducts.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + feature_ids: featureIds, + ids, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + plan_version_ids: planVersionIds, + q, + with_metered_products: withMeteredProducts, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2783,8 +2572,8 @@ export class EntitlementsClient { * planVersionId: "plan_version_id", * q: "q", * withMeteredProducts: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countPlanEntitlements( @@ -2811,67 +2600,19 @@ export class EntitlementsClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (featureIds != null) { - if (Array.isArray(featureIds)) { - _queryParams.feature_ids = featureIds.map((item) => item); - } else { - _queryParams.feature_ids = featureIds; - } - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planId != null) { - _queryParams.plan_id = planId; - } - - if (planIds != null) { - if (Array.isArray(planIds)) { - _queryParams.plan_ids = planIds.map((item) => item); - } else { - _queryParams.plan_ids = planIds; - } - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (planVersionIds != null) { - if (Array.isArray(planVersionIds)) { - _queryParams.plan_version_ids = planVersionIds.map((item) => item); - } else { - _queryParams.plan_version_ids = planVersionIds; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (withMeteredProducts != null) { - _queryParams.with_metered_products = withMeteredProducts.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + feature_ids: featureIds, + ids, + plan_id: planId, + plan_ids: planIds, + plan_version_id: planVersionId, + plan_version_ids: planVersionIds, + q, + with_metered_products: withMeteredProducts, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3140,8 +2881,9 @@ export class EntitlementsClient { requestOptions?: EntitlementsClient.RequestOptions, ): Promise> { const { keys } = request; - const _queryParams: Record = {}; - _queryParams.keys = toJson(keys); + const _queryParams: Record = { + keys: toJson(keys), + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts b/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts index 6759c392..f13f47ea 100644 --- a/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts @@ -7,8 +7,8 @@ * featureId: "feature_id", * withoutExpired: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCompanyOverridesRequest { diff --git a/src/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.ts b/src/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.ts index 6d81638e..93132401 100644 --- a/src/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountFeatureCompaniesRequest { diff --git a/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts b/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts index 7ca8fe54..f59ef172 100644 --- a/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts @@ -7,8 +7,8 @@ * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountFeatureUsageRequest { diff --git a/src/api/resources/entitlements/client/requests/CountFeatureUsersRequest.ts b/src/api/resources/entitlements/client/requests/CountFeatureUsersRequest.ts index 038f4415..5aea4d92 100644 --- a/src/api/resources/entitlements/client/requests/CountFeatureUsersRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountFeatureUsersRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountFeatureUsersRequest { diff --git a/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts b/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts index 431d12c0..9e82d641 100644 --- a/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts @@ -8,8 +8,8 @@ * planVersionId: "plan_version_id", * q: "q", * withMeteredProducts: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountPlanEntitlementsRequest { diff --git a/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts b/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts index a699ae22..c8a9e0cf 100644 --- a/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts @@ -7,8 +7,8 @@ * featureId: "feature_id", * withoutExpired: true, * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCompanyOverridesRequest { diff --git a/src/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.ts b/src/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.ts index e8394357..c0729f28 100644 --- a/src/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListFeatureCompaniesRequest { diff --git a/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts b/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts index 7aca89a6..f331f8d7 100644 --- a/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts @@ -7,8 +7,8 @@ * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListFeatureUsageRequest { diff --git a/src/api/resources/entitlements/client/requests/ListFeatureUsersRequest.ts b/src/api/resources/entitlements/client/requests/ListFeatureUsersRequest.ts index fd4691d1..ed1f4dad 100644 --- a/src/api/resources/entitlements/client/requests/ListFeatureUsersRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListFeatureUsersRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListFeatureUsersRequest { diff --git a/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts b/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts index a61a2d4d..cf0ba70b 100644 --- a/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts @@ -8,8 +8,8 @@ * planVersionId: "plan_version_id", * q: "q", * withMeteredProducts: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListPlanEntitlementsRequest { diff --git a/src/api/resources/entitlements/exports.ts b/src/api/resources/entitlements/exports.ts new file mode 100644 index 00000000..c605d765 --- /dev/null +++ b/src/api/resources/entitlements/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EntitlementsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index c36facbf..784b4b4c 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -171,8 +171,8 @@ export class EventsClient { * @example * await client.events.getEventSummaries({ * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public getEventSummaries( @@ -187,27 +187,12 @@ export class EventsClient { requestOptions?: EventsClient.RequestOptions, ): Promise> { const { q, eventSubtypes, limit, offset } = request; - const _queryParams: Record = {}; - if (q != null) { - _queryParams.q = q; - } - - if (eventSubtypes != null) { - if (Array.isArray(eventSubtypes)) { - _queryParams.event_subtypes = eventSubtypes.map((item) => item); - } else { - _queryParams.event_subtypes = eventSubtypes; - } - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + q, + event_subtypes: eventSubtypes, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -328,8 +313,8 @@ export class EventsClient { * eventSubtype: "event_subtype", * flagId: "flag_id", * userId: "user_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listEvents( @@ -344,43 +329,19 @@ export class EventsClient { requestOptions?: EventsClient.RequestOptions, ): Promise> { const { companyId, eventSubtype, eventTypes, flagId, userId, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (eventSubtype != null) { - _queryParams.event_subtype = eventSubtype; - } - - if (eventTypes != null) { - if (Array.isArray(eventTypes)) { - _queryParams.event_types = eventTypes.map((item) => - serializers.EventType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.event_types = serializers.EventType.jsonOrThrow(eventTypes, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (flagId != null) { - _queryParams.flag_id = flagId; - } - - if (userId != null) { - _queryParams.user_id = userId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + event_subtype: eventSubtype, + event_types: Array.isArray(eventTypes) + ? eventTypes.map((item) => serializers.EventType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })) + : eventTypes != null + ? serializers.EventType.jsonOrThrow(eventTypes, { unrecognizedObjectKeys: "strip" }) + : undefined, + flag_id: flagId, + user_id: userId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/events/client/requests/GetEventSummariesRequest.ts b/src/api/resources/events/client/requests/GetEventSummariesRequest.ts index 7499b37c..8c6c0e28 100644 --- a/src/api/resources/events/client/requests/GetEventSummariesRequest.ts +++ b/src/api/resources/events/client/requests/GetEventSummariesRequest.ts @@ -4,8 +4,8 @@ * @example * { * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface GetEventSummariesRequest { diff --git a/src/api/resources/events/client/requests/ListEventsRequest.ts b/src/api/resources/events/client/requests/ListEventsRequest.ts index aa96b004..f7ea057c 100644 --- a/src/api/resources/events/client/requests/ListEventsRequest.ts +++ b/src/api/resources/events/client/requests/ListEventsRequest.ts @@ -9,8 +9,8 @@ import type * as Schematic from "../../../../index"; * eventSubtype: "event_subtype", * flagId: "flag_id", * userId: "user_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListEventsRequest { diff --git a/src/api/resources/events/exports.ts b/src/api/resources/events/exports.ts new file mode 100644 index 00000000..4cfbd2f8 --- /dev/null +++ b/src/api/resources/events/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EventsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/features/client/Client.ts b/src/api/resources/features/client/Client.ts index 7884ae3f..6c365930 100644 --- a/src/api/resources/features/client/Client.ts +++ b/src/api/resources/features/client/Client.ts @@ -40,8 +40,8 @@ export class FeaturesClient { * planVersionId: "plan_version_id", * withoutPlanEntitlementFor: "without_plan_entitlement_for", * booleanRequireEvent: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listFeatures( @@ -66,55 +66,23 @@ export class FeaturesClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutCompanyOverrideFor != null) { - _queryParams.without_company_override_for = withoutCompanyOverrideFor; - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (withoutPlanEntitlementFor != null) { - _queryParams.without_plan_entitlement_for = withoutPlanEntitlementFor; - } - - if (featureType != null) { - if (Array.isArray(featureType)) { - _queryParams.feature_type = featureType.map((item) => - serializers.FeatureType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.feature_type = serializers.FeatureType.jsonOrThrow(featureType, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (booleanRequireEvent != null) { - _queryParams.boolean_require_event = booleanRequireEvent.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + q, + without_company_override_for: withoutCompanyOverrideFor, + plan_version_id: planVersionId, + without_plan_entitlement_for: withoutPlanEntitlementFor, + feature_type: Array.isArray(featureType) + ? featureType.map((item) => + serializers.FeatureType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : featureType != null + ? serializers.FeatureType.jsonOrThrow(featureType, { unrecognizedObjectKeys: "strip" }) + : undefined, + boolean_require_event: booleanRequireEvent, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -749,8 +717,8 @@ export class FeaturesClient { * planVersionId: "plan_version_id", * withoutPlanEntitlementFor: "without_plan_entitlement_for", * booleanRequireEvent: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countFeatures( @@ -775,55 +743,23 @@ export class FeaturesClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutCompanyOverrideFor != null) { - _queryParams.without_company_override_for = withoutCompanyOverrideFor; - } - - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (withoutPlanEntitlementFor != null) { - _queryParams.without_plan_entitlement_for = withoutPlanEntitlementFor; - } - - if (featureType != null) { - if (Array.isArray(featureType)) { - _queryParams.feature_type = featureType.map((item) => - serializers.FeatureType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.feature_type = serializers.FeatureType.jsonOrThrow(featureType, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (booleanRequireEvent != null) { - _queryParams.boolean_require_event = booleanRequireEvent.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + q, + without_company_override_for: withoutCompanyOverrideFor, + plan_version_id: planVersionId, + without_plan_entitlement_for: withoutPlanEntitlementFor, + feature_type: Array.isArray(featureType) + ? featureType.map((item) => + serializers.FeatureType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : featureType != null + ? serializers.FeatureType.jsonOrThrow(featureType, { unrecognizedObjectKeys: "strip" }) + : undefined, + boolean_require_event: booleanRequireEvent, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -942,8 +878,8 @@ export class FeaturesClient { * await client.features.listFlags({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listFlags( @@ -958,31 +894,13 @@ export class FeaturesClient { requestOptions?: FeaturesClient.RequestOptions, ): Promise> { const { featureId, ids, q, limit, offset } = request; - const _queryParams: Record = {}; - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + ids, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1635,7 +1553,7 @@ export class FeaturesClient { * resourceIds: ["resource_ids"] * }], * name: "name", - * priority: 1, + * priority: 1000000, * value: true * }] * }) @@ -2172,8 +2090,8 @@ export class FeaturesClient { * await client.features.countFlags({ * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countFlags( @@ -2188,31 +2106,13 @@ export class FeaturesClient { requestOptions?: FeaturesClient.RequestOptions, ): Promise> { const { featureId, ids, q, limit, offset } = request; - const _queryParams: Record = {}; - if (featureId != null) { - _queryParams.feature_id = featureId; - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + feature_id: featureId, + ids, + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/features/client/requests/CountFeaturesRequest.ts b/src/api/resources/features/client/requests/CountFeaturesRequest.ts index fdc9966d..52862967 100644 --- a/src/api/resources/features/client/requests/CountFeaturesRequest.ts +++ b/src/api/resources/features/client/requests/CountFeaturesRequest.ts @@ -10,8 +10,8 @@ import type * as Schematic from "../../../../index"; * planVersionId: "plan_version_id", * withoutPlanEntitlementFor: "without_plan_entitlement_for", * booleanRequireEvent: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountFeaturesRequest { diff --git a/src/api/resources/features/client/requests/CountFlagsRequest.ts b/src/api/resources/features/client/requests/CountFlagsRequest.ts index 1be72e36..8e207682 100644 --- a/src/api/resources/features/client/requests/CountFlagsRequest.ts +++ b/src/api/resources/features/client/requests/CountFlagsRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountFlagsRequest { diff --git a/src/api/resources/features/client/requests/ListFeaturesRequest.ts b/src/api/resources/features/client/requests/ListFeaturesRequest.ts index 1876cf94..6e387bf3 100644 --- a/src/api/resources/features/client/requests/ListFeaturesRequest.ts +++ b/src/api/resources/features/client/requests/ListFeaturesRequest.ts @@ -10,8 +10,8 @@ import type * as Schematic from "../../../../index"; * planVersionId: "plan_version_id", * withoutPlanEntitlementFor: "without_plan_entitlement_for", * booleanRequireEvent: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListFeaturesRequest { diff --git a/src/api/resources/features/client/requests/ListFlagsRequest.ts b/src/api/resources/features/client/requests/ListFlagsRequest.ts index bc0699e7..6b5bf659 100644 --- a/src/api/resources/features/client/requests/ListFlagsRequest.ts +++ b/src/api/resources/features/client/requests/ListFlagsRequest.ts @@ -5,8 +5,8 @@ * { * featureId: "feature_id", * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListFlagsRequest { diff --git a/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts b/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts index 7dd586b5..bf262e9f 100644 --- a/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts +++ b/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts @@ -19,7 +19,7 @@ import type * as Schematic from "../../../../index"; * resourceIds: ["resource_ids"] * }], * name: "name", - * priority: 1, + * priority: 1000000, * value: true * }] * } diff --git a/src/api/resources/features/exports.ts b/src/api/resources/features/exports.ts new file mode 100644 index 00000000..f8626f3d --- /dev/null +++ b/src/api/resources/features/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { FeaturesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/planbundle/exports.ts b/src/api/resources/planbundle/exports.ts new file mode 100644 index 00000000..163b94f3 --- /dev/null +++ b/src/api/resources/planbundle/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PlanbundleClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/plangroups/client/Client.ts b/src/api/resources/plangroups/client/Client.ts index ea8710d5..02616f92 100644 --- a/src/api/resources/plangroups/client/Client.ts +++ b/src/api/resources/plangroups/client/Client.ts @@ -49,11 +49,9 @@ export class PlangroupsClient { requestOptions?: PlangroupsClient.RequestOptions, ): Promise> { const { includeCompanyCounts } = request; - const _queryParams: Record = {}; - if (includeCompanyCounts != null) { - _queryParams.include_company_counts = includeCompanyCounts.toString(); - } - + const _queryParams: Record = { + include_company_counts: includeCompanyCounts, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/plangroups/exports.ts b/src/api/resources/plangroups/exports.ts new file mode 100644 index 00000000..f4897cd3 --- /dev/null +++ b/src/api/resources/plangroups/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PlangroupsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/planmigrations/client/Client.ts b/src/api/resources/planmigrations/client/Client.ts index 58ed6b11..71e34926 100644 --- a/src/api/resources/planmigrations/client/Client.ts +++ b/src/api/resources/planmigrations/client/Client.ts @@ -38,8 +38,8 @@ export class PlanmigrationsClient { * migrationId: "migration_id", * q: "q", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listCompanyMigrations( @@ -54,29 +54,18 @@ export class PlanmigrationsClient { requestOptions?: PlanmigrationsClient.RequestOptions, ): Promise> { const { migrationId, q, status, limit, offset } = request; - const _queryParams: Record = {}; - if (migrationId != null) { - _queryParams.migration_id = migrationId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (status != null) { - _queryParams.status = serializers.PlanVersionCompanyMigrationStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + migration_id: migrationId, + q, + status: + status != null + ? serializers.PlanVersionCompanyMigrationStatus.jsonOrThrow(status, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -201,8 +190,8 @@ export class PlanmigrationsClient { * migrationId: "migration_id", * q: "q", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countCompanyMigrations( @@ -217,29 +206,18 @@ export class PlanmigrationsClient { requestOptions?: PlanmigrationsClient.RequestOptions, ): Promise> { const { migrationId, q, status, limit, offset } = request; - const _queryParams: Record = {}; - if (migrationId != null) { - _queryParams.migration_id = migrationId; - } - - if (q != null) { - _queryParams.q = q; - } - - if (status != null) { - _queryParams.status = serializers.PlanVersionCompanyMigrationStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + migration_id: migrationId, + q, + status: + status != null + ? serializers.PlanVersionCompanyMigrationStatus.jsonOrThrow(status, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -363,8 +341,8 @@ export class PlanmigrationsClient { * await client.planmigrations.listMigrations({ * planVersionId: "plan_version_id", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listMigrations( @@ -379,25 +357,15 @@ export class PlanmigrationsClient { requestOptions?: PlanmigrationsClient.RequestOptions, ): Promise> { const { planVersionId, status, limit, offset } = request; - const _queryParams: Record = {}; - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (status != null) { - _queryParams.status = serializers.PlanVersionMigrationStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + plan_version_id: planVersionId, + status: + status != null + ? serializers.PlanVersionMigrationStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -637,8 +605,8 @@ export class PlanmigrationsClient { * await client.planmigrations.countMigrations({ * planVersionId: "plan_version_id", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countMigrations( @@ -653,25 +621,15 @@ export class PlanmigrationsClient { requestOptions?: PlanmigrationsClient.RequestOptions, ): Promise> { const { planVersionId, status, limit, offset } = request; - const _queryParams: Record = {}; - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - - if (status != null) { - _queryParams.status = serializers.PlanVersionMigrationStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + plan_version_id: planVersionId, + status: + status != null + ? serializers.PlanVersionMigrationStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/planmigrations/client/requests/CountCompanyMigrationsRequest.ts b/src/api/resources/planmigrations/client/requests/CountCompanyMigrationsRequest.ts index 36d8256f..ae9b0371 100644 --- a/src/api/resources/planmigrations/client/requests/CountCompanyMigrationsRequest.ts +++ b/src/api/resources/planmigrations/client/requests/CountCompanyMigrationsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * migrationId: "migration_id", * q: "q", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountCompanyMigrationsRequest { diff --git a/src/api/resources/planmigrations/client/requests/CountMigrationsRequest.ts b/src/api/resources/planmigrations/client/requests/CountMigrationsRequest.ts index e8cde787..f2db100e 100644 --- a/src/api/resources/planmigrations/client/requests/CountMigrationsRequest.ts +++ b/src/api/resources/planmigrations/client/requests/CountMigrationsRequest.ts @@ -7,8 +7,8 @@ import type * as Schematic from "../../../../index"; * { * planVersionId: "plan_version_id", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountMigrationsRequest { diff --git a/src/api/resources/planmigrations/client/requests/ListCompanyMigrationsRequest.ts b/src/api/resources/planmigrations/client/requests/ListCompanyMigrationsRequest.ts index 2c682e9b..6e38cfa4 100644 --- a/src/api/resources/planmigrations/client/requests/ListCompanyMigrationsRequest.ts +++ b/src/api/resources/planmigrations/client/requests/ListCompanyMigrationsRequest.ts @@ -8,8 +8,8 @@ import type * as Schematic from "../../../../index"; * migrationId: "migration_id", * q: "q", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListCompanyMigrationsRequest { diff --git a/src/api/resources/planmigrations/client/requests/ListMigrationsRequest.ts b/src/api/resources/planmigrations/client/requests/ListMigrationsRequest.ts index 4a738ed7..0ed6f2b9 100644 --- a/src/api/resources/planmigrations/client/requests/ListMigrationsRequest.ts +++ b/src/api/resources/planmigrations/client/requests/ListMigrationsRequest.ts @@ -7,8 +7,8 @@ import type * as Schematic from "../../../../index"; * { * planVersionId: "plan_version_id", * status: "completed", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListMigrationsRequest { diff --git a/src/api/resources/planmigrations/exports.ts b/src/api/resources/planmigrations/exports.ts new file mode 100644 index 00000000..7c8209f3 --- /dev/null +++ b/src/api/resources/planmigrations/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PlanmigrationsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/plans/client/Client.ts b/src/api/resources/plans/client/Client.ts index 294dd4c4..075ff8b7 100644 --- a/src/api/resources/plans/client/Client.ts +++ b/src/api/resources/plans/client/Client.ts @@ -183,12 +183,13 @@ export class PlansClient { * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * includeDraftVersions: true, * planType: "plan", * q: "q", * withoutEntitlementFor: "without_entitlement_for", * withoutPaidProductId: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listPlans( @@ -209,6 +210,7 @@ export class PlansClient { forTrialExpiryPlan, hasProductId, ids, + includeDraftVersions, planType, q, withoutEntitlementFor, @@ -216,59 +218,24 @@ export class PlansClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (forFallbackPlan != null) { - _queryParams.for_fallback_plan = forFallbackPlan.toString(); - } - - if (forInitialPlan != null) { - _queryParams.for_initial_plan = forInitialPlan.toString(); - } - - if (forTrialExpiryPlan != null) { - _queryParams.for_trial_expiry_plan = forTrialExpiryPlan.toString(); - } - - if (hasProductId != null) { - _queryParams.has_product_id = hasProductId.toString(); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planType != null) { - _queryParams.plan_type = serializers.PlanType.jsonOrThrow(planType, { unrecognizedObjectKeys: "strip" }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutEntitlementFor != null) { - _queryParams.without_entitlement_for = withoutEntitlementFor; - } - - if (withoutPaidProductId != null) { - _queryParams.without_paid_product_id = withoutPaidProductId.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + for_fallback_plan: forFallbackPlan, + for_initial_plan: forInitialPlan, + for_trial_expiry_plan: forTrialExpiryPlan, + has_product_id: hasProductId, + ids, + include_draft_versions: includeDraftVersions, + plan_type: + planType != null + ? serializers.PlanType.jsonOrThrow(planType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + without_entitlement_for: withoutEntitlementFor, + without_paid_product_id: withoutPaidProductId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -537,11 +504,9 @@ export class PlansClient { requestOptions?: PlansClient.RequestOptions, ): Promise> { const { planVersionId } = request; - const _queryParams: Record = {}; - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - + const _queryParams: Record = { + plan_version_id: planVersionId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1058,12 +1023,13 @@ export class PlansClient { * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * includeDraftVersions: true, * planType: "plan", * q: "q", * withoutEntitlementFor: "without_entitlement_for", * withoutPaidProductId: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countPlans( @@ -1084,6 +1050,7 @@ export class PlansClient { forTrialExpiryPlan, hasProductId, ids, + includeDraftVersions, planType, q, withoutEntitlementFor, @@ -1091,59 +1058,24 @@ export class PlansClient { limit, offset, } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (forFallbackPlan != null) { - _queryParams.for_fallback_plan = forFallbackPlan.toString(); - } - - if (forInitialPlan != null) { - _queryParams.for_initial_plan = forInitialPlan.toString(); - } - - if (forTrialExpiryPlan != null) { - _queryParams.for_trial_expiry_plan = forTrialExpiryPlan.toString(); - } - - if (hasProductId != null) { - _queryParams.has_product_id = hasProductId.toString(); - } - - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (planType != null) { - _queryParams.plan_type = serializers.PlanType.jsonOrThrow(planType, { unrecognizedObjectKeys: "strip" }); - } - - if (q != null) { - _queryParams.q = q; - } - - if (withoutEntitlementFor != null) { - _queryParams.without_entitlement_for = withoutEntitlementFor; - } - - if (withoutPaidProductId != null) { - _queryParams.without_paid_product_id = withoutPaidProductId.toString(); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + for_fallback_plan: forFallbackPlan, + for_initial_plan: forInitialPlan, + for_trial_expiry_plan: forTrialExpiryPlan, + has_product_id: hasProductId, + ids, + include_draft_versions: includeDraftVersions, + plan_type: + planType != null + ? serializers.PlanType.jsonOrThrow(planType, { unrecognizedObjectKeys: "strip" }) + : undefined, + q, + without_entitlement_for: withoutEntitlementFor, + without_paid_product_id: withoutPaidProductId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1276,12 +1208,10 @@ export class PlansClient { requestOptions?: PlansClient.RequestOptions, ): Promise> { const { planId, planVersionId } = request; - const _queryParams: Record = {}; - _queryParams.plan_id = planId; - if (planVersionId != null) { - _queryParams.plan_version_id = planVersionId; - } - + const _queryParams: Record = { + plan_id: planId, + plan_version_id: planVersionId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/plans/client/requests/CountPlansRequest.ts b/src/api/resources/plans/client/requests/CountPlansRequest.ts index 51bb18cf..4f5d5336 100644 --- a/src/api/resources/plans/client/requests/CountPlansRequest.ts +++ b/src/api/resources/plans/client/requests/CountPlansRequest.ts @@ -10,12 +10,13 @@ import type * as Schematic from "../../../../index"; * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * includeDraftVersions: true, * planType: "plan", * q: "q", * withoutEntitlementFor: "without_entitlement_for", * withoutPaidProductId: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountPlansRequest { @@ -29,6 +30,8 @@ export interface CountPlansRequest { /** Filter out plans that do not have a billing product ID */ hasProductId?: boolean; ids?: string | string[]; + /** Include billing settings from draft versions for plans which have draft version */ + includeDraftVersions?: boolean; /** Filter by plan type */ planType?: Schematic.PlanType; q?: string; diff --git a/src/api/resources/plans/client/requests/ListPlansRequest.ts b/src/api/resources/plans/client/requests/ListPlansRequest.ts index 31b743be..bd8e26c8 100644 --- a/src/api/resources/plans/client/requests/ListPlansRequest.ts +++ b/src/api/resources/plans/client/requests/ListPlansRequest.ts @@ -10,12 +10,13 @@ import type * as Schematic from "../../../../index"; * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * includeDraftVersions: true, * planType: "plan", * q: "q", * withoutEntitlementFor: "without_entitlement_for", * withoutPaidProductId: true, - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListPlansRequest { @@ -29,6 +30,8 @@ export interface ListPlansRequest { /** Filter out plans that do not have a billing product ID */ hasProductId?: boolean; ids?: string | string[]; + /** Include billing settings from draft versions for plans which have draft version */ + includeDraftVersions?: boolean; /** Filter by plan type */ planType?: Schematic.PlanType; q?: string; diff --git a/src/api/resources/plans/exports.ts b/src/api/resources/plans/exports.ts new file mode 100644 index 00000000..114f6861 --- /dev/null +++ b/src/api/resources/plans/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PlansClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/plans/types/CountPlansParams.ts b/src/api/resources/plans/types/CountPlansParams.ts index 686a0982..e3a1f3ec 100644 --- a/src/api/resources/plans/types/CountPlansParams.ts +++ b/src/api/resources/plans/types/CountPlansParams.ts @@ -16,6 +16,8 @@ export interface CountPlansParams { /** Filter out plans that do not have a billing product ID */ hasProductId?: boolean; ids?: string[]; + /** Include billing settings from draft versions for plans which have draft version */ + includeDraftVersions?: boolean; /** Page limit (default 100) */ limit?: number; /** Page offset (default 0) */ diff --git a/src/api/resources/plans/types/ListPlansParams.ts b/src/api/resources/plans/types/ListPlansParams.ts index ef07954c..02d059ea 100644 --- a/src/api/resources/plans/types/ListPlansParams.ts +++ b/src/api/resources/plans/types/ListPlansParams.ts @@ -16,6 +16,8 @@ export interface ListPlansParams { /** Filter out plans that do not have a billing product ID */ hasProductId?: boolean; ids?: string[]; + /** Include billing settings from draft versions for plans which have draft version */ + includeDraftVersions?: boolean; /** Page limit (default 100) */ limit?: number; /** Page offset (default 0) */ diff --git a/src/api/resources/scheduledcheckout/client/Client.ts b/src/api/resources/scheduledcheckout/client/Client.ts index b8dd48d5..196d7dd4 100644 --- a/src/api/resources/scheduledcheckout/client/Client.ts +++ b/src/api/resources/scheduledcheckout/client/Client.ts @@ -37,8 +37,8 @@ export class ScheduledcheckoutClient { * await client.scheduledcheckout.listScheduledCheckouts({ * companyId: "company_id", * status: "cancelled", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listScheduledCheckouts( @@ -53,25 +53,15 @@ export class ScheduledcheckoutClient { requestOptions?: ScheduledcheckoutClient.RequestOptions, ): Promise> { const { companyId, status, limit, offset } = request; - const _queryParams: Record = {}; - if (companyId != null) { - _queryParams.company_id = companyId; - } - - if (status != null) { - _queryParams.status = serializers.ScheduledCheckoutStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + company_id: companyId, + status: + status != null + ? serializers.ScheduledCheckoutStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/scheduledcheckout/client/requests/ListScheduledCheckoutsRequest.ts b/src/api/resources/scheduledcheckout/client/requests/ListScheduledCheckoutsRequest.ts index a641e49b..56096d33 100644 --- a/src/api/resources/scheduledcheckout/client/requests/ListScheduledCheckoutsRequest.ts +++ b/src/api/resources/scheduledcheckout/client/requests/ListScheduledCheckoutsRequest.ts @@ -7,8 +7,8 @@ import type * as Schematic from "../../../../index"; * { * companyId: "company_id", * status: "cancelled", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListScheduledCheckoutsRequest { diff --git a/src/api/resources/scheduledcheckout/exports.ts b/src/api/resources/scheduledcheckout/exports.ts new file mode 100644 index 00000000..6dc97e47 --- /dev/null +++ b/src/api/resources/scheduledcheckout/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ScheduledcheckoutClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index fd8cf3e7..fb9874ea 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -37,8 +37,8 @@ export class WebhooksClient { * await client.webhooks.listWebhookEvents({ * q: "q", * webhookId: "webhook_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listWebhookEvents( @@ -53,31 +53,13 @@ export class WebhooksClient { requestOptions?: WebhooksClient.RequestOptions, ): Promise> { const { ids, q, webhookId, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (webhookId != null) { - _queryParams.webhook_id = webhookId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + q, + webhook_id: webhookId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -317,8 +299,8 @@ export class WebhooksClient { * await client.webhooks.countWebhookEvents({ * q: "q", * webhookId: "webhook_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countWebhookEvents( @@ -333,31 +315,13 @@ export class WebhooksClient { requestOptions?: WebhooksClient.RequestOptions, ): Promise> { const { ids, q, webhookId, limit, offset } = request; - const _queryParams: Record = {}; - if (ids != null) { - if (Array.isArray(ids)) { - _queryParams.ids = ids.map((item) => item); - } else { - _queryParams.ids = ids; - } - } - - if (q != null) { - _queryParams.q = q; - } - - if (webhookId != null) { - _queryParams.webhook_id = webhookId; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + ids, + q, + webhook_id: webhookId, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -475,8 +439,8 @@ export class WebhooksClient { * @example * await client.webhooks.listWebhooks({ * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public listWebhooks( @@ -491,19 +455,11 @@ export class WebhooksClient { requestOptions?: WebhooksClient.RequestOptions, ): Promise> { const { q, limit, offset } = request; - const _queryParams: Record = {}; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1134,8 +1090,8 @@ export class WebhooksClient { * @example * await client.webhooks.countWebhooks({ * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * }) */ public countWebhooks( @@ -1150,19 +1106,11 @@ export class WebhooksClient { requestOptions?: WebhooksClient.RequestOptions, ): Promise> { const { q, limit, offset } = request; - const _queryParams: Record = {}; - if (q != null) { - _queryParams.q = q; - } - - if (limit != null) { - _queryParams.limit = limit.toString(); - } - - if (offset != null) { - _queryParams.offset = offset.toString(); - } - + const _queryParams: Record = { + q, + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts b/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts index b15ca5e5..e2726ef7 100644 --- a/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts +++ b/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts @@ -5,8 +5,8 @@ * { * q: "q", * webhookId: "webhook_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountWebhookEventsRequest { diff --git a/src/api/resources/webhooks/client/requests/CountWebhooksRequest.ts b/src/api/resources/webhooks/client/requests/CountWebhooksRequest.ts index 0babebba..e8738c56 100644 --- a/src/api/resources/webhooks/client/requests/CountWebhooksRequest.ts +++ b/src/api/resources/webhooks/client/requests/CountWebhooksRequest.ts @@ -4,8 +4,8 @@ * @example * { * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface CountWebhooksRequest { diff --git a/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts b/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts index ee4c1738..e90b964b 100644 --- a/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts +++ b/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts @@ -5,8 +5,8 @@ * { * q: "q", * webhookId: "webhook_id", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListWebhookEventsRequest { diff --git a/src/api/resources/webhooks/client/requests/ListWebhooksRequest.ts b/src/api/resources/webhooks/client/requests/ListWebhooksRequest.ts index da3f80b7..6096324c 100644 --- a/src/api/resources/webhooks/client/requests/ListWebhooksRequest.ts +++ b/src/api/resources/webhooks/client/requests/ListWebhooksRequest.ts @@ -4,8 +4,8 @@ * @example * { * q: "q", - * limit: 1, - * offset: 1 + * limit: 1000000, + * offset: 1000000 * } */ export interface ListWebhooksRequest { diff --git a/src/api/resources/webhooks/exports.ts b/src/api/resources/webhooks/exports.ts new file mode 100644 index 00000000..c6d1afdd --- /dev/null +++ b/src/api/resources/webhooks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WebhooksClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/types/ConditionGroupResponseData.ts b/src/api/types/ConditionGroupResponseData.ts index 9054097e..d8871a85 100644 --- a/src/api/types/ConditionGroupResponseData.ts +++ b/src/api/types/ConditionGroupResponseData.ts @@ -6,7 +6,6 @@ export interface ConditionGroupResponseData { environmentId: string; flagId?: string; id: string; - planVersionId?: string; ruleId: string; updatedAt: Date; } diff --git a/src/api/types/ConditionGroupView.ts b/src/api/types/ConditionGroupView.ts index f232d447..3d29ef4f 100644 --- a/src/api/types/ConditionGroupView.ts +++ b/src/api/types/ConditionGroupView.ts @@ -9,7 +9,6 @@ export interface ConditionGroupView { environmentId: string; flagId?: string; id: string; - planVersionId?: string; ruleId: string; updatedAt: Date; } diff --git a/src/api/types/ConditionResponseData.ts b/src/api/types/ConditionResponseData.ts index b6f520dd..bf95d384 100644 --- a/src/api/types/ConditionResponseData.ts +++ b/src/api/types/ConditionResponseData.ts @@ -18,7 +18,6 @@ export interface ConditionResponseData { metricPeriodMonthReset?: string; metricValue?: number; operator: string; - planVersionId?: string; resourceUnspecifiedIds: string[]; ruleId: string; traitEntityType?: Schematic.EntityType; diff --git a/src/api/types/ConditionView.ts b/src/api/types/ConditionView.ts index 6f0406ef..019df55c 100644 --- a/src/api/types/ConditionView.ts +++ b/src/api/types/ConditionView.ts @@ -21,7 +21,6 @@ export interface ConditionView { metricPeriodMonthReset?: string; metricValue?: number; operator: string; - planVersionId?: string; planVersions: Schematic.GenericPreviewObject[]; plans: Schematic.GenericPreviewObject[]; resourceUnspecifiedIds: string[]; diff --git a/src/api/types/ManagePlanRequest.ts b/src/api/types/ManagePlanRequest.ts index b801d3e4..ad156a26 100644 --- a/src/api/types/ManagePlanRequest.ts +++ b/src/api/types/ManagePlanRequest.ts @@ -6,6 +6,7 @@ export interface ManagePlanRequest { addOnSelections: Schematic.PlanSelection[]; basePlanId?: string; basePlanPriceId?: string; + basePlanVersionId?: string; /** If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true. */ cancelImmediately?: boolean; companyId: string; diff --git a/src/api/types/PlanSelection.ts b/src/api/types/PlanSelection.ts index 65dab8b1..e9a157bb 100644 --- a/src/api/types/PlanSelection.ts +++ b/src/api/types/PlanSelection.ts @@ -3,4 +3,5 @@ export interface PlanSelection { planId: string; priceId?: string; + versionId?: string; } diff --git a/src/api/types/RuleView.ts b/src/api/types/RuleView.ts index db618087..dbd35078 100644 --- a/src/api/types/RuleView.ts +++ b/src/api/types/RuleView.ts @@ -11,7 +11,6 @@ export interface RuleView { flagId?: string; id: string; name: string; - planVersionId?: string; priority: number; ruleType: string; updatedAt: Date; diff --git a/src/api/types/RulesEngineSchemaVersion.ts b/src/api/types/RulesEngineSchemaVersion.ts index 07b0325a..ae347715 100644 --- a/src/api/types/RulesEngineSchemaVersion.ts +++ b/src/api/types/RulesEngineSchemaVersion.ts @@ -2,7 +2,7 @@ /** The current schema version hash for rules engine types. The first enum value is always the current version. */ export const RulesEngineSchemaVersion = { - V0F048Dd3: "v0f048dd3", + V5F633Cc3: "v5f633cc3", PlaceholderForFernCompatibility: "placeholder-for-fern-compatibility", } as const; export type RulesEngineSchemaVersion = (typeof RulesEngineSchemaVersion)[keyof typeof RulesEngineSchemaVersion]; diff --git a/src/api/types/WebScheduledDowngradeWebhookOutput.ts b/src/api/types/WebScheduledDowngradeWebhookOutput.ts new file mode 100644 index 00000000..0fd8249b --- /dev/null +++ b/src/api/types/WebScheduledDowngradeWebhookOutput.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface WebScheduledDowngradeWebhookOutput { + company?: Schematic.CompanyResponseData; + executeAfter: Date; + fromPlan?: Schematic.PlanSnapshotView; + id: string; + scheduledInterval?: string; + scheduledPrice?: number; + toPlan?: Schematic.PlanSnapshotView; +} diff --git a/src/api/types/WebhookRequestType.ts b/src/api/types/WebhookRequestType.ts index a9789bf1..02b83cf9 100644 --- a/src/api/types/WebhookRequestType.ts +++ b/src/api/types/WebhookRequestType.ts @@ -9,6 +9,7 @@ export const WebhookRequestType = { CompanyOverrideExpired: "company.override.expired", CompanyOverrideUpdated: "company.override.updated", CompanyPlanChanged: "company.plan_changed", + CompanyScheduledDowngrade: "company.scheduled_downgrade", CompanyUpdated: "company.updated", CreditLimitReached: "credit.limit.reached", CreditLimitWarning: "credit.limit.warning", diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 4421c2dd..a7fad6ed 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -329,4 +329,5 @@ export * from "./WebhookEventStatus"; export * from "./WebhookRequestType"; export * from "./WebhookResponseData"; export * from "./WebhookStatus"; +export * from "./WebScheduledDowngradeWebhookOutput"; export * from "./WhoAmIResponseData"; diff --git a/src/auth/HeaderAuthProvider.ts b/src/auth/HeaderAuthProvider.ts index 652387e1..1c429d44 100644 --- a/src/auth/HeaderAuthProvider.ts +++ b/src/auth/HeaderAuthProvider.ts @@ -3,37 +3,46 @@ import * as core from "../core"; import * as errors from "../errors/index"; -export namespace HeaderAuthProvider { - export interface AuthOptions { - apiKey: core.Supplier; - } - - export interface Options extends AuthOptions {} -} +const PARAM_KEY = "apiKey" as const; +const HEADER_NAME = "X-Schematic-Api-Key" as const; export class HeaderAuthProvider implements core.AuthProvider { - private readonly headerValue: core.Supplier; + private readonly options: HeaderAuthProvider.Options; constructor(options: HeaderAuthProvider.Options) { - this.headerValue = options.apiKey; + this.options = options; } - public static canCreate(options: HeaderAuthProvider.Options): boolean { - return options.apiKey != null; + public static canCreate(options: Partial): boolean { + return options?.[PARAM_KEY] != null; } - public async getAuthRequest(_arg?: { endpointMetadata?: core.EndpointMetadata }): Promise { - const apiKey = await core.Supplier.get(this.headerValue); - if (apiKey == null) { + public async getAuthRequest({ + endpointMetadata, + }: { + endpointMetadata?: core.EndpointMetadata; + } = {}): Promise { + const headerValue = await core.Supplier.get(this.options[PARAM_KEY]); + if (headerValue == null) { throw new errors.SchematicError({ - message: "Please specify a apiKey by passing it in to the constructor", + message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE, }); } - const headerValue = apiKey; - return { - headers: { "X-Schematic-Api-Key": headerValue }, + headers: { [HEADER_NAME]: headerValue }, }; } } + +export namespace HeaderAuthProvider { + export const AUTH_SCHEME = "ApiKeyAuth" as const; + export const AUTH_CONFIG_ERROR_MESSAGE: string = + `Please provide '${PARAM_KEY}' when initializing the client` as const; + export type Options = AuthOptions; + export type AuthOptions = { [PARAM_KEY]: core.Supplier }; + + export function createInstance(options: Options): core.AuthProvider { + return new HeaderAuthProvider(options); + } +} diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts index bca7f4c7..b9e40fb6 100644 --- a/src/core/fetcher/BinaryResponse.ts +++ b/src/core/fetcher/BinaryResponse.ts @@ -14,7 +14,7 @@ export type BinaryResponse = { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) * Some versions of the Fetch API may not support this method. */ - bytes?(): ReturnType; + bytes?(): Promise; }; export function getBinaryResponse(response: Response): BinaryResponse { diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts index f4a99783..cbb4ff68 100644 --- a/src/core/fetcher/EndpointSupplier.ts +++ b/src/core/fetcher/EndpointSupplier.ts @@ -1,10 +1,10 @@ import type { EndpointMetadata } from "./EndpointMetadata"; import type { Supplier } from "./Supplier"; -type EndpointSupplierFn = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise; +type EndpointSupplierFn = (arg: { endpointMetadata?: EndpointMetadata }) => T | Promise; export type EndpointSupplier = Supplier | EndpointSupplierFn; export const EndpointSupplier = { - get: async (supplier: EndpointSupplier, arg: { endpointMetadata: EndpointMetadata }): Promise => { + get: async (supplier: EndpointSupplier, arg: { endpointMetadata?: EndpointMetadata }): Promise => { if (typeof supplier === "function") { return (supplier as EndpointSupplierFn)(arg); } else { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 555be657..0858d135 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -20,7 +20,7 @@ export declare namespace Fetcher { url: string; method: string; contentType?: string; - headers?: Record | null | undefined>; + headers?: Record; queryParameters?: Record; body?: unknown; timeoutMs?: number; @@ -218,7 +218,13 @@ async function getHeaders(args: Fetcher.Args): Promise { newHeaders.set( "Accept", - args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", + args.responseType === "json" + ? "application/json" + : args.responseType === "text" + ? "text/plain" + : args.responseType === "sse" + ? "text/event-stream" + : "*/*", ); if (args.body !== undefined && args.contentType != null) { newHeaders.set("Content-Type", args.contentType); @@ -276,6 +282,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise; + /** Abort signal for this request. */ + abortSignal?: AbortSignal; + } + + /** + * SDK client configuration used by the passthrough fetch method. + */ + export interface ClientOptions { + /** The base URL or environment for the client. */ + environment?: Supplier; + /** Override the base URL. */ + baseUrl?: Supplier; + /** Default headers to include in requests. */ + headers?: Record; + /** Default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** Default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A custom fetch function. */ + fetch?: typeof fetch; + /** Logging configuration. */ + logging?: LogConfig | Logger; + /** A function that returns auth headers. */ + getAuthHeaders?: () => Promise>; + } +} + +/** + * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.) + * while mimicking the standard `fetch` API. + * + * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL. + * @param init - Standard RequestInit options (method, headers, body, signal, etc.) + * @param clientOptions - SDK client options (auth, default headers, logging, etc.) + * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal). + * @returns A standard Response object. + */ +export async function makePassthroughRequest( + input: Request | string | URL, + init: RequestInit | undefined, + clientOptions: PassthroughRequest.ClientOptions, + requestOptions?: PassthroughRequest.RequestOptions, +): Promise { + const logger = createLogger(clientOptions.logging); + + // Extract URL and default init properties from Request object if provided + let url: string; + let effectiveInit: RequestInit | undefined = init; + if (input instanceof Request) { + url = input.url; + // If no explicit init provided, extract properties from the Request object + if (init == null) { + effectiveInit = { + method: input.method, + headers: Object.fromEntries(input.headers.entries()), + body: input.body, + signal: input.signal, + credentials: input.credentials, + cache: input.cache as RequestCache, + redirect: input.redirect, + referrer: input.referrer, + integrity: input.integrity, + mode: input.mode, + }; + } + } else { + url = input instanceof URL ? input.toString() : input; + } + + // Resolve the base URL + const baseUrl = + (clientOptions.baseUrl != null ? await Supplier.get(clientOptions.baseUrl) : undefined) ?? + (clientOptions.environment != null ? await Supplier.get(clientOptions.environment) : undefined); + + // Determine the full URL + let fullUrl: string; + if (url.startsWith("http://") || url.startsWith("https://")) { + fullUrl = url; + } else if (baseUrl != null) { + fullUrl = join(baseUrl, url); + } else { + fullUrl = url; + } + + // Merge headers: SDK default headers -> auth headers -> user-provided headers + const mergedHeaders: Record = {}; + + // Apply SDK default headers (resolve suppliers) + if (clientOptions.headers != null) { + for (const [key, value] of Object.entries(clientOptions.headers)) { + const resolved = await EndpointSupplier.get(value, { endpointMetadata: {} }); + if (resolved != null) { + mergedHeaders[key.toLowerCase()] = `${resolved}`; + } + } + } + + // Apply auth headers + if (clientOptions.getAuthHeaders != null) { + const authHeaders = await clientOptions.getAuthHeaders(); + for (const [key, value] of Object.entries(authHeaders)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + // Apply user-provided headers from init + if (effectiveInit?.headers != null) { + const initHeaders = + effectiveInit.headers instanceof Headers + ? Object.fromEntries(effectiveInit.headers.entries()) + : Array.isArray(effectiveInit.headers) + ? Object.fromEntries(effectiveInit.headers) + : effectiveInit.headers; + for (const [key, value] of Object.entries(initHeaders)) { + if (value != null) { + mergedHeaders[key.toLowerCase()] = value; + } + } + } + + // Apply per-request option headers (highest priority) + if (requestOptions?.headers != null) { + for (const [key, value] of Object.entries(requestOptions.headers)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + const method = effectiveInit?.method ?? "GET"; + const body = effectiveInit?.body; + const timeoutInSeconds = requestOptions?.timeoutInSeconds ?? clientOptions.timeoutInSeconds; + const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined; + const maxRetries = requestOptions?.maxRetries ?? clientOptions.maxRetries; + const abortSignal = requestOptions?.abortSignal ?? effectiveInit?.signal ?? undefined; + const fetchFn = clientOptions.fetch ?? (await getFetchFn()); + + if (logger.isDebug()) { + logger.debug("Making passthrough HTTP request", { + method, + url: fullUrl, + hasBody: body != null, + }); + } + + const response = await requestWithRetries( + async () => + makeRequest( + fetchFn, + fullUrl, + method, + mergedHeaders, + body ?? undefined, + timeoutMs, + abortSignal, + effectiveInit?.credentials === "include", + undefined, // duplex + false, // disableCache + ), + maxRetries, + ); + + if (logger.isDebug()) { + logger.debug("Passthrough HTTP request completed", { + method, + url: fullUrl, + statusCode: response.status, + }); + } + + return response; +} diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index a00ac2e2..821101b5 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -1,5 +1,31 @@ import { anySignal, getTimeoutSignal } from "./signals"; +/** + * Cached result of checking whether the current runtime supports + * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers) + * throw a TypeError when this option is used. + */ +let _cacheNoStoreSupported: boolean | undefined; +export function isCacheNoStoreSupported(): boolean { + if (_cacheNoStoreSupported != null) { + return _cacheNoStoreSupported; + } + try { + new Request("http://localhost", { cache: "no-store" }); + _cacheNoStoreSupported = true; + } catch { + _cacheNoStoreSupported = false; + } + return _cacheNoStoreSupported; +} + +/** + * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only. + */ +export function resetCacheNoStoreSupported(): void { + _cacheNoStoreSupported = undefined; +} + export const makeRequest = async ( fetchFn: (url: string, init: RequestInit) => Promise, url: string, @@ -10,6 +36,7 @@ export const makeRequest = async ( abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", + disableCache?: boolean, ): Promise => { const signals: AbortSignal[] = []; @@ -32,6 +59,7 @@ export const makeRequest = async ( credentials: withCredentials ? "include" : undefined, // @ts-ignore duplex, + ...(disableCache && isCacheNoStoreSupported() ? { cache: "no-store" as RequestCache } : {}), }); if (timeoutAbortId != null) { diff --git a/src/core/headers.ts b/src/core/headers.ts index 78ed8b50..be45c455 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,7 +1,5 @@ -export function mergeHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +export function mergeHeaders(...headersArray: (Record | null | undefined)[]): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) @@ -17,10 +15,10 @@ export function mergeHeaders( return result; } -export function mergeOnlyDefinedHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index 56ebbb87..e6e66b2a 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -113,18 +113,18 @@ function evaluateRuntime(): Runtime { /** * A constant that indicates whether the environment the code is running is Node.JS. + * + * We assign `process` to a local variable first to avoid being flagged by + * bundlers that perform static analysis on `process.versions` (e.g. Next.js + * Edge Runtime warns about Node.js APIs even when they are guarded). */ - const isNode = - typeof process !== "undefined" && - "version" in process && - !!process.version && - "versions" in process && - !!process.versions?.node; + const _process = typeof process !== "undefined" ? process : undefined; + const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; if (isNode) { return { type: "node", - version: process.versions.node, - parsedVersion: Number(process.versions.node.split(".")[0]), + version: _process.versions.node, + parsedVersion: Number(_process.versions.node.split(".")[0]), }; } diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index 7c8fd6e8..191922f1 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -44,30 +44,20 @@ function validateAndTransformArray( }; } - const maybeValidItems = value.map((item, index) => transformItem(item, index)); + const result: Parsed[] = []; + const errors: ValidationError[] = []; - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } + for (let i = 0; i < value.length; i++) { + const item = transformItem(value[i], i); + if (item.ok) { + result.push(item.value); + } else { + errors.push(...item.errors); + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index ed96cf77..9f2777f6 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -5,6 +5,9 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { getSchemaUtils } from "../schema-utils/index"; import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { withParsedProperties: (properties) => withParsedProperties(schema, properties), @@ -26,15 +29,14 @@ export function withParsedProperties>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {}, - ); + const additionalProperties: Record = {}; + for (const key in properties) { + if (_hasOwn.call(properties, key)) { + const value = properties[key as keyof Properties]; + additionalProperties[key] = + typeof value === "function" ? (value as Function)(parsedObject.value) : value; + } + } return { ok: true, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index bdad8076..eb48a111 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -19,6 +19,9 @@ import type { PropertySchemas, } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + interface ObjectPropertyWithRawKey { rawKey: string; parsedKey: string; @@ -28,79 +31,128 @@ interface ObjectPropertyWithRawKey { export function object>( schemas: T, ): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + // All property metadata is lazily computed on first use. + // This keeps schema construction free of iteration, which matters when + // many schemas are defined but only some are exercised at runtime. + // Required-key computation is also deferred because lazy() schemas may + // not be resolved at construction time. - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; + let _rawKeyToProperty: Record | undefined; + function getRawKeyToProperty(): Record { + if (_rawKeyToProperty == null) { + _rawKeyToProperty = {}; for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); const valueSchema: Schema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty; - const property: ObjectPropertyWithRawKey = { + _rawKeyToProperty[rawKey] = { rawKey, parsedKey: parsedKey as string, valueSchema, }; + } + } + return _rawKeyToProperty; + } - rawKeyToProperty[rawKey] = property; + let _parseRequiredKeys: string[] | undefined; + let _jsonRequiredKeys: string[] | undefined; + let _parseRequiredKeysSet: Set | undefined; + let _jsonRequiredKeysSet: Set | undefined; + function getParseRequiredKeys(): string[] { + if (_parseRequiredKeys == null) { + _parseRequiredKeys = []; + _jsonRequiredKeys = []; + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); + _parseRequiredKeys.push(rawKey); + _jsonRequiredKeys.push(parsedKey as string); } } + _parseRequiredKeysSet = new Set(_parseRequiredKeys); + _jsonRequiredKeysSet = new Set(_jsonRequiredKeys); + } + return _parseRequiredKeys; + } + function getJsonRequiredKeys(): string[] { + if (_jsonRequiredKeys == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeys!; + } + + function getParseRequiredKeysSet(): Set { + if (_parseRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _parseRequiredKeysSet!; + } + + function getJsonRequiredKeysSet(): Set { + if (_jsonRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeysSet!; + } + + const baseSchema: BaseObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas + > = { + _getRawProperties: () => + Object.entries(schemas).map(([parsedKey, propertySchema]) => + isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, + ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], + _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + + parse: (raw, opts) => { + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: raw, - requiredKeys, + requiredKeys: getParseRequiredKeys(), + requiredKeysSet: getParseRequiredKeysSet(), getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; + const property = getRawKeyToProperty()[rawKey]; if (property == null) { return undefined; } return { transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, rawKey]; + return property.valueSchema.parse(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: parsed, - requiredKeys, + requiredKeys: getJsonRequiredKeys(), + requiredKeysSet: getJsonRequiredKeysSet(), getProperty: ( parsedKey, ): { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined => { @@ -114,26 +166,30 @@ export function object - property.valueSchema.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.valueSchema.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } else { return { transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, @@ -152,6 +208,7 @@ export function object({ value, requiredKeys, + requiredKeysSet, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, @@ -159,6 +216,7 @@ function validateAndTransformObject({ }: { value: unknown; requiredKeys: string[]; + requiredKeysSet: Set; getProperty: ( preTransformedKey: string, ) => { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined; @@ -179,15 +237,23 @@ function validateAndTransformObject({ }; } - const missingRequiredKeys = new Set(requiredKeys); + // Track which required keys have been seen. + // Use a counter instead of copying the Set to avoid per-call allocation. + let missingRequiredCount = requiredKeys.length; const errors: ValidationError[] = []; const transformed: Record = {}; - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { + for (const preTransformedKey in value) { + if (!_hasOwn.call(value, preTransformedKey)) { + continue; + } + const preTransformedItemValue = value[preTransformedKey]; const property = getProperty(preTransformedKey); if (property != null) { - missingRequiredKeys.delete(preTransformedKey); + if (missingRequiredCount > 0 && requiredKeysSet.has(preTransformedKey)) { + missingRequiredCount--; + } const value = property.transform(preTransformedItemValue as object); if (value.ok) { @@ -213,14 +279,16 @@ function validateAndTransformObject({ } } - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })), - ); + if (missingRequiredCount > 0) { + for (const key of requiredKeys) { + if (!(key in (value as Record))) { + errors.push({ + path: breadcrumbsPrefix, + message: `Missing required key "${key}"`, + }); + } + } + } if (errors.length === 0 || skipValidation) { return { @@ -270,6 +338,8 @@ export function getObjectUtils(schema: BaseObjectSchema { + const knownRawKeys = new Set(schema._getRawProperties() as string[]); + const knownParsedKeys = new Set(schema._getParsedProperties() as string[]); const baseSchema: BaseObjectSchema = { _getParsedProperties: () => schema._getParsedProperties(), @@ -279,10 +349,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof raw === "object" && raw != null) { + for (const [key, value] of Object.entries(raw)) { + if (!knownRawKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(raw as any), + ...extraProperties, ...transformed.value, }, }; @@ -292,10 +370,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof parsed === "object" && parsed != null) { + for (const [key, value] of Object.entries(parsed)) { + if (!knownParsedKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(parsed as any), + ...extraProperties, ...transformed.value, }, }; diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index 57f87486..2ed5e473 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -23,9 +23,8 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; +export type inferParsedObject> = + O extends ObjectSchema ? Parsed : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -47,25 +46,11 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; +export type inferRawPropertySchema

| Schema> = + P extends Property ? Raw : P extends Schema ? inferRaw

: never; -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; +export type inferParsedPropertySchema

| Schema> = + P extends Property ? Parsed : P extends Schema ? inferParsed

: never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/record/index.ts b/src/core/schemas/builders/record/index.ts index 82e25c5c..cbd9b7e6 100644 --- a/src/core/schemas/builders/record/index.ts +++ b/src/core/schemas/builders/record/index.ts @@ -1,2 +1,2 @@ -export { record } from "./record"; -export type { BaseRecordSchema, RecordSchema } from "./types"; +export { partialRecord, record } from "./record"; +export type { BasePartialRecordSchema, BaseRecordSchema, PartialRecordSchema, RecordSchema } from "./types"; diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index ba5307a6..446f690b 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,12 @@ import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { getSchemaUtils } from "../schema-utils/index"; -import type { BaseRecordSchema, RecordSchema } from "./types"; +import type { BasePartialRecordSchema, BaseRecordSchema, PartialRecordSchema, RecordSchema } from "./types"; + +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; export function record( keySchema: Schema, @@ -54,6 +56,54 @@ export function record( + keySchema: Schema, + valueSchema: Schema, +): PartialRecordSchema { + const baseSchema: BasePartialRecordSchema = { + parse: (raw, opts) => { + return validateAndTransformRecord({ + value: raw, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.parse(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.parse(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: (parsed, opts) => { + return validateAndTransformRecord({ + value: parsed, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.json(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.json(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.RECORD, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + function validateAndTransformRecord({ value, isKeyNumeric, @@ -79,51 +129,42 @@ function validateAndTransformRecord>>( - (accPromise, [stringKey, value]) => { - if (value === undefined) { - return accPromise; - } + const result = {} as Record; + const errors: ValidationError[] = []; - const acc = accPromise; + for (const stringKey in value) { + if (!_hasOwn.call(value, stringKey)) { + continue; + } + const entryValue = (value as Record)[stringKey]; + if (entryValue === undefined) { + continue; + } - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!Number.isNaN(numberKey)) { - key = numberKey; - } + let key: string | number = stringKey; + if (isKeyNumeric) { + const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; + if (!Number.isNaN(numberKey)) { + key = numberKey; } - const transformedKey = transformKey(key); - - const transformedValue = transformValue(value, key); + } + const transformedKey = transformKey(key); + const transformedValue = transformValue(entryValue, key); - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } + if (transformedKey.ok && transformedValue.ok) { + result[transformedKey.value] = transformedValue.value; + } else { if (!transformedKey.ok) { errors.push(...transformedKey.errors); } if (!transformedValue.ok) { errors.push(...transformedValue.errors); } + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index b99bb9d8..2216e2e6 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -15,3 +15,18 @@ export type BaseRecordSchema< ParsedKey extends string | number, ParsedValue, > = BaseSchema, Record>; + +export type PartialRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue, +> = BasePartialRecordSchema & + SchemaUtils, Partial>>; + +export type BasePartialRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue, +> = BaseSchema, Partial>>; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index 7da4271a..b324fa2d 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -16,6 +16,9 @@ import type { UnionSubtypes, } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function union, U extends UnionSubtypes>( discriminant: D, union: U, @@ -112,7 +115,13 @@ function transformAndValidateUnion< }; } - const { [discriminant]: discriminantValue, ...additionalProperties } = value; + const discriminantValue = value[discriminant]; + const additionalProperties: Record = {}; + for (const key in value) { + if (_hasOwn.call(value, key) && key !== discriminant) { + additionalProperties[key] = value[key]; + } + } if (discriminantValue == null) { return { diff --git a/src/core/schemas/utils/isPlainObject.ts b/src/core/schemas/utils/isPlainObject.ts index db82a722..32a17e05 100644 --- a/src/core/schemas/utils/isPlainObject.ts +++ b/src/core/schemas/utils/isPlainObject.ts @@ -4,14 +4,11 @@ export function isPlainObject(value: unknown): value is Record return false; } - if (Object.getPrototypeOf(value) === null) { + const proto = Object.getPrototypeOf(value); + if (proto === null) { return true; } - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; + // Check that the prototype chain has exactly one level (i.e., proto is Object.prototype) + return Object.getPrototypeOf(proto) === null; } diff --git a/src/serialization/resources/plans/types/CountPlansParams.ts b/src/serialization/resources/plans/types/CountPlansParams.ts index e1bb125f..42320760 100644 --- a/src/serialization/resources/plans/types/CountPlansParams.ts +++ b/src/serialization/resources/plans/types/CountPlansParams.ts @@ -15,6 +15,10 @@ export const CountPlansParams: core.serialization.ObjectSchema< forTrialExpiryPlan: core.serialization.property("for_trial_expiry_plan", core.serialization.boolean().optional()), hasProductId: core.serialization.property("has_product_id", core.serialization.boolean().optional()), ids: core.serialization.list(core.serialization.string()).optional(), + includeDraftVersions: core.serialization.property( + "include_draft_versions", + core.serialization.boolean().optional(), + ), limit: core.serialization.number().optional(), offset: core.serialization.number().optional(), planType: core.serialization.property("plan_type", PlanType.optional()), @@ -37,6 +41,7 @@ export declare namespace CountPlansParams { for_trial_expiry_plan?: boolean | null; has_product_id?: boolean | null; ids?: string[] | null; + include_draft_versions?: boolean | null; limit?: number | null; offset?: number | null; plan_type?: PlanType.Raw | null; diff --git a/src/serialization/resources/plans/types/ListPlansParams.ts b/src/serialization/resources/plans/types/ListPlansParams.ts index b385d3d5..93af4599 100644 --- a/src/serialization/resources/plans/types/ListPlansParams.ts +++ b/src/serialization/resources/plans/types/ListPlansParams.ts @@ -15,6 +15,10 @@ export const ListPlansParams: core.serialization.ObjectSchema< forTrialExpiryPlan: core.serialization.property("for_trial_expiry_plan", core.serialization.boolean().optional()), hasProductId: core.serialization.property("has_product_id", core.serialization.boolean().optional()), ids: core.serialization.list(core.serialization.string()).optional(), + includeDraftVersions: core.serialization.property( + "include_draft_versions", + core.serialization.boolean().optional(), + ), limit: core.serialization.number().optional(), offset: core.serialization.number().optional(), planType: core.serialization.property("plan_type", PlanType.optional()), @@ -37,6 +41,7 @@ export declare namespace ListPlansParams { for_trial_expiry_plan?: boolean | null; has_product_id?: boolean | null; ids?: string[] | null; + include_draft_versions?: boolean | null; limit?: number | null; offset?: number | null; plan_type?: PlanType.Raw | null; diff --git a/src/serialization/types/ConditionGroupResponseData.ts b/src/serialization/types/ConditionGroupResponseData.ts index 1094ba30..a0e5152e 100644 --- a/src/serialization/types/ConditionGroupResponseData.ts +++ b/src/serialization/types/ConditionGroupResponseData.ts @@ -13,7 +13,6 @@ export const ConditionGroupResponseData: core.serialization.ObjectSchema< environmentId: core.serialization.property("environment_id", core.serialization.string()), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), id: core.serialization.string(), - planVersionId: core.serialization.property("plan_version_id", core.serialization.string().optional()), ruleId: core.serialization.property("rule_id", core.serialization.string()), updatedAt: core.serialization.property("updated_at", core.serialization.date()), }); @@ -25,7 +24,6 @@ export declare namespace ConditionGroupResponseData { environment_id: string; flag_id?: string | null; id: string; - plan_version_id?: string | null; rule_id: string; updated_at: string; } diff --git a/src/serialization/types/ConditionGroupView.ts b/src/serialization/types/ConditionGroupView.ts index 144b48cb..6ef7722d 100644 --- a/src/serialization/types/ConditionGroupView.ts +++ b/src/serialization/types/ConditionGroupView.ts @@ -15,7 +15,6 @@ export const ConditionGroupView: core.serialization.ObjectSchema< environmentId: core.serialization.property("environment_id", core.serialization.string()), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), id: core.serialization.string(), - planVersionId: core.serialization.property("plan_version_id", core.serialization.string().optional()), ruleId: core.serialization.property("rule_id", core.serialization.string()), updatedAt: core.serialization.property("updated_at", core.serialization.date()), }); @@ -28,7 +27,6 @@ export declare namespace ConditionGroupView { environment_id: string; flag_id?: string | null; id: string; - plan_version_id?: string | null; rule_id: string; updated_at: string; } diff --git a/src/serialization/types/ConditionResponseData.ts b/src/serialization/types/ConditionResponseData.ts index e47ff18b..e4c79833 100644 --- a/src/serialization/types/ConditionResponseData.ts +++ b/src/serialization/types/ConditionResponseData.ts @@ -27,7 +27,6 @@ export const ConditionResponseData: core.serialization.ObjectSchema< ), metricValue: core.serialization.property("metric_value", core.serialization.number().optional()), operator: core.serialization.string(), - planVersionId: core.serialization.property("plan_version_id", core.serialization.string().optional()), resourceUnspecifiedIds: core.serialization.property( "resource_unspecified_ids", core.serialization.list(core.serialization.string()), @@ -59,7 +58,6 @@ export declare namespace ConditionResponseData { metric_period_month_reset?: string | null; metric_value?: number | null; operator: string; - plan_version_id?: string | null; resource_unspecified_ids: string[]; rule_id: string; trait_entity_type?: EntityType.Raw | null; diff --git a/src/serialization/types/ConditionView.ts b/src/serialization/types/ConditionView.ts index 35e5b6d0..8532dfc4 100644 --- a/src/serialization/types/ConditionView.ts +++ b/src/serialization/types/ConditionView.ts @@ -30,7 +30,6 @@ export const ConditionView: core.serialization.ObjectSchema = core.serialization.enum_(["v0f048dd3", "placeholder-for-fern-compatibility"]); +> = core.serialization.enum_(["v5f633cc3", "placeholder-for-fern-compatibility"]); export declare namespace RulesEngineSchemaVersion { - export type Raw = "v0f048dd3" | "placeholder-for-fern-compatibility"; + export type Raw = "v5f633cc3" | "placeholder-for-fern-compatibility"; } diff --git a/src/serialization/types/WebScheduledDowngradeWebhookOutput.ts b/src/serialization/types/WebScheduledDowngradeWebhookOutput.ts new file mode 100644 index 00000000..06bd605e --- /dev/null +++ b/src/serialization/types/WebScheduledDowngradeWebhookOutput.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { CompanyResponseData } from "./CompanyResponseData"; +import { PlanSnapshotView } from "./PlanSnapshotView"; + +export const WebScheduledDowngradeWebhookOutput: core.serialization.ObjectSchema< + serializers.WebScheduledDowngradeWebhookOutput.Raw, + Schematic.WebScheduledDowngradeWebhookOutput +> = core.serialization.object({ + company: CompanyResponseData.optional(), + executeAfter: core.serialization.property("execute_after", core.serialization.date()), + fromPlan: core.serialization.property("from_plan", PlanSnapshotView.optional()), + id: core.serialization.string(), + scheduledInterval: core.serialization.property("scheduled_interval", core.serialization.string().optional()), + scheduledPrice: core.serialization.property("scheduled_price", core.serialization.number().optional()), + toPlan: core.serialization.property("to_plan", PlanSnapshotView.optional()), +}); + +export declare namespace WebScheduledDowngradeWebhookOutput { + export interface Raw { + company?: CompanyResponseData.Raw | null; + execute_after: string; + from_plan?: PlanSnapshotView.Raw | null; + id: string; + scheduled_interval?: string | null; + scheduled_price?: number | null; + to_plan?: PlanSnapshotView.Raw | null; + } +} diff --git a/src/serialization/types/WebhookRequestType.ts b/src/serialization/types/WebhookRequestType.ts index 56b2144f..d3104b3a 100644 --- a/src/serialization/types/WebhookRequestType.ts +++ b/src/serialization/types/WebhookRequestType.ts @@ -16,6 +16,7 @@ export const WebhookRequestType: core.serialization.Schema< "company.override.expired", "company.override.updated", "company.plan_changed", + "company.scheduled_downgrade", "company.updated", "credit.limit.reached", "credit.limit.warning", @@ -58,6 +59,7 @@ export declare namespace WebhookRequestType { | "company.override.expired" | "company.override.updated" | "company.plan_changed" + | "company.scheduled_downgrade" | "company.updated" | "credit.limit.reached" | "credit.limit.warning" diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 4421c2dd..a7fad6ed 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -329,4 +329,5 @@ export * from "./WebhookEventStatus"; export * from "./WebhookRequestType"; export * from "./WebhookResponseData"; export * from "./WebhookStatus"; +export * from "./WebScheduledDowngradeWebhookOutput"; export * from "./WhoAmIResponseData"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index e1a90f7f..d7d891a2 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -103,4 +103,4 @@ class MockServerPool { } } -export const mockServerPool = new MockServerPool(); +export const mockServerPool: MockServerPool = new MockServerPool(); diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 1b0e5107..3e8540a3 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -2,9 +2,9 @@ import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponse import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { withFormUrlEncoded } from "./withFormUrlEncoded"; +import { type WithFormUrlEncodedOptions, withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; -import { withJson } from "./withJson"; +import { type WithJsonOptions, withJson } from "./withJson"; type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head"; @@ -26,8 +26,8 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { } interface RequestBodyStage extends ResponseStage { - jsonBody(body: unknown): ResponseStage; - formUrlEncodedBody(body: unknown): ResponseStage; + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage; } interface ResponseStage { @@ -44,6 +44,7 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; + sseBody(body: string): BuildStage; } interface BuildStage { @@ -129,21 +130,21 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - jsonBody(body: unknown): ResponseStage { + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage { if (body === undefined) { throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); } - this.predicates.push((resolver) => withJson(body, resolver)); + this.predicates.push((resolver) => withJson(body, resolver, options)); return this; } - formUrlEncodedBody(body: unknown): ResponseStage { + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage { if (body === undefined) { throw new Error( "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", ); } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver, options)); return this; } @@ -201,6 +202,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } + public sseBody(body: string): BuildStage { + this.responseHeaders["Content-Type"] = "text/event-stream"; + this.responseBody = body; + return this; + } + public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts index e250cb3c..2b23448e 100644 --- a/tests/mock-server/withFormUrlEncoded.ts +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { toJson } from "../../src/core/json"; +export interface WithFormUrlEncodedOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withFormUrlEncoded( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithFormUrlEncodedOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -41,7 +55,8 @@ export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponse } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index b627638b..3e8800a0 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; +export interface WithJsonOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request JSON body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withJson( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithJsonOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -28,7 +42,8 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/tsconfig.json b/tests/tsconfig.json index fe83070d..bc43b6c4 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -2,8 +2,7 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": null, - "rootDir": "..", - "baseUrl": ".." + "rootDir": ".." }, "include": ["../src", "../tests"], "exclude": [] diff --git a/tests/unit/events.test.ts b/tests/unit/events.test.ts deleted file mode 100644 index 40683751..00000000 --- a/tests/unit/events.test.ts +++ /dev/null @@ -1,284 +0,0 @@ -/* eslint @typescript-eslint/no-explicit-any: 0 */ - -import { EventBuffer } from "../../src/events"; -import { EventsClient } from "../../src/api/resources/events/client/Client"; -import { CreateEventRequestBody } from "../../src/api"; -import { Logger } from "../../src/logger"; - -process.env.NODE_ENV = "test"; - -jest.useFakeTimers(); - -describe("EventBuffer", () => { - let mockEventsApi: jest.Mocked; - let mockLogger: jest.Mocked; - - beforeEach(() => { - const mockResponse = { - data: { - events: [], - }, - params: {}, - }; - - mockEventsApi = { - createEventBatch: jest.fn().mockResolvedValue(mockResponse), - } as any; - - mockLogger = { - error: jest.fn(), - log: jest.fn(), - warn: jest.fn(), - info: jest.fn(), - debug: jest.fn(), - } as any; - }); - - it("should push and flush events correctly", async () => { - const event1: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - const event2: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event-2", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - const buffer = new EventBuffer(mockEventsApi, { - logger: mockLogger, - maxSize: 1, // Set max size to 1 item - interval: 1000, - }); - - await buffer.push(event1); - - expect(mockEventsApi.createEventBatch).not.toHaveBeenCalled(); - - // Force first flush by exceeding max size - await buffer.push(event2); - - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(1); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledWith({ - events: [event1], - }); - - // Wait for the next periodic flush - jest.advanceTimersByTime(1001); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(2); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledWith({ - events: [event2], - }); - }); - - // The rest of the tests remain unchanged as they don't directly test the maxSize behavior - it("should log error if flushing fails", async () => { - mockEventsApi.createEventBatch.mockRejectedValue(new Error("Flush error")); - - const buffer = new EventBuffer(mockEventsApi, { - logger: mockLogger, - interval: 1000, - maxRetries: 1, - initialRetryDelay: 1, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - await buffer.push(event); - await buffer.push(event); - - // Since we're skipping delays in test environment, - // we can just call flush directly - await buffer.flush(); - - expect(mockLogger.error).toHaveBeenCalledWith( - "Event batch submission failed after 1 retries:", - expect.any(Error) - ); - }); - - it("should stop accepting events after stop is called", async () => { - const buffer = new EventBuffer(mockEventsApi, { - interval: 1000, - logger: mockLogger, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - await buffer.push(event); - - await buffer.stop(); - - await buffer.push(event); - - expect(mockLogger.error).toHaveBeenCalledWith("Event buffer is stopped, not accepting new events"); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(1); - }); - - it("should periodically flush events", async () => { - const buffer = new EventBuffer(mockEventsApi, { - interval: 1000, - logger: mockLogger, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - await buffer.push(event); - - jest.advanceTimersByTime(1000); - - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(1); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledWith({ - events: [event], - }); - }); - - it("should not flush events if shutdown", async () => { - const buffer = new EventBuffer(mockEventsApi, { - interval: 1000, - logger: mockLogger, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - await buffer.push(event); - - buffer["shutdown"] = true; - - jest.advanceTimersByTime(1000); - - expect(mockEventsApi.createEventBatch).not.toHaveBeenCalled(); - }); - - it("should handle track events with quantity", async () => { - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - quantity: 5, - }, - eventType: "track", - sentAt: new Date(), - }; - const buffer = new EventBuffer(mockEventsApi, { - logger: mockLogger, - interval: 1000, - }); - - await buffer.push(event); - - jest.advanceTimersByTime(1000); - - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(1); - expect(mockEventsApi.createEventBatch).toHaveBeenCalledWith({ - events: [event], - }); - - const sentEvents = mockEventsApi.createEventBatch.mock.calls[0][0].events; - expect(sentEvents[0].body).toHaveProperty("quantity", 5); - }); - - it("should drop events silently in offline mode", async () => { - const buffer = new EventBuffer(mockEventsApi, { - logger: mockLogger, - interval: 1000, - offline: true, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - - // push() should not throw in offline mode - await expect(buffer.push(event)).resolves.not.toThrow(); - - jest.advanceTimersByTime(1000); - - // Events should never be sent in offline mode - expect(mockEventsApi.createEventBatch).not.toHaveBeenCalled(); - }); - - it("should retry and succeed after a failure", async () => { - const mockResponse = { - data: { - events: [], - }, - params: {}, - }; - - // First call fails, second succeeds - mockEventsApi.createEventBatch - .mockRejectedValueOnce(new Error("Temporary failure")) - .mockResolvedValueOnce(mockResponse); - - const buffer = new EventBuffer(mockEventsApi, { - logger: mockLogger, - interval: 1000, - maxRetries: 3, - initialRetryDelay: 1, - }); - - const event: CreateEventRequestBody = { - body: { - company: { id: "test-company" }, - event: "test-event", - user: { id: "test-user" }, - }, - eventType: "track", - sentAt: new Date(), - }; - await buffer.push(event); - - // Since we're skipping delays in test environment, - // we can just call flush directly - await buffer.flush(); - - // Verify that the createEventBatch was called twice (once failed, once succeeded) - expect(mockEventsApi.createEventBatch).toHaveBeenCalledTimes(2); - - expect(mockLogger.info).toHaveBeenCalledWith("Event batch submission succeeded after 1 retries"); - }); -}); diff --git a/tests/unit/fetcher/makePassthroughRequest.test.ts b/tests/unit/fetcher/makePassthroughRequest.test.ts new file mode 100644 index 00000000..91e21e0c --- /dev/null +++ b/tests/unit/fetcher/makePassthroughRequest.test.ts @@ -0,0 +1,397 @@ +import { makePassthroughRequest } from "../../../src/core/fetcher/makePassthroughRequest"; + +describe("makePassthroughRequest", () => { + let mockFetch: jest.Mock; + + beforeEach(() => { + mockFetch = jest.fn(); + mockFetch.mockResolvedValue(new Response(JSON.stringify({ ok: true }), { status: 200 })); + }); + + describe("URL resolution", () => { + it("should use absolute URL directly", async () => { + await makePassthroughRequest("https://api.example.com/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against baseUrl", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://api.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against environment when baseUrl is not set", async () => { + await makePassthroughRequest("/v1/users", undefined, { + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://env.example.com/v1/users"); + }); + + it("should prefer baseUrl over environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://base.example.com", + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://base.example.com/v1/users"); + }); + + it("should pass relative URL through as-is when no baseUrl or environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("/v1/users"); + }); + + it("should resolve baseUrl supplier", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: () => "https://dynamic.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://dynamic.example.com/v1/users"); + }); + + it("should ignore absolute URL even when baseUrl is set", async () => { + await makePassthroughRequest("https://other.example.com/path", undefined, { + baseUrl: "https://base.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://other.example.com/path"); + }); + + it("should accept a URL object", async () => { + await makePassthroughRequest(new URL("https://api.example.com/v1/users"), undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + }); + + describe("header merge order", () => { + it("should merge headers in correct priority: SDK defaults < auth < init < requestOptions", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "X-Custom": "from-init", Authorization: "from-init" }, + }, + { + headers: { + "X-Custom": "from-sdk", + "X-SDK-Only": "sdk-value", + Authorization: "from-sdk", + }, + getAuthHeaders: async () => ({ + Authorization: "Bearer auth-token", + "X-Auth-Only": "auth-value", + }), + fetch: mockFetch, + }, + { + headers: { Authorization: "from-request-options" }, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + + // requestOptions.headers wins for Authorization (highest priority) + expect(headers.authorization).toBe("from-request-options"); + // init.headers wins over SDK defaults for X-Custom + expect(headers["x-custom"]).toBe("from-init"); + // SDK-only header is preserved + expect(headers["x-sdk-only"]).toBe("sdk-value"); + // Auth-only header is preserved + expect(headers["x-auth-only"]).toBe("auth-value"); + }); + + it("should lowercase all header keys", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "Content-Type": "application/json" }, + }, + { + headers: { "X-Fern-Language": "JavaScript" }, + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + expect(headers["content-type"]).toBe("application/json"); + expect(headers["x-fern-language"]).toBe("JavaScript"); + expect(headers["Content-Type"]).toBeUndefined(); + expect(headers["X-Fern-Language"]).toBeUndefined(); + }); + + it("should handle Headers object in init", async () => { + const initHeaders = new Headers(); + initHeaders.set("X-From-Headers-Object", "value"); + await makePassthroughRequest("https://api.example.com", { headers: initHeaders }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-headers-object"]).toBe("value"); + }); + + it("should handle array-style headers in init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: [["X-Array-Header", "array-value"]] }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-array-header"]).toBe("array-value"); + }); + + it("should skip null SDK default header values", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { "X-Present": "value", "X-Null": null }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-present"]).toBe("value"); + expect(calledOptions.headers["x-null"]).toBeUndefined(); + }); + }); + + describe("auth headers", () => { + it("should include auth headers when getAuthHeaders is provided", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should work without auth headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should allow init headers to override auth headers", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: { Authorization: "Bearer override" } }, + { + getAuthHeaders: async () => ({ Authorization: "Bearer sdk-auth" }), + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer override"); + }); + }); + + describe("method and body", () => { + it("should default to GET when no method specified", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("GET"); + }); + + it("should use the method from init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { method: "POST", body: JSON.stringify({ key: "value" }) }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("POST"); + expect(calledOptions.body).toBe(JSON.stringify({ key: "value" })); + }); + + it("should pass body as undefined when not provided", async () => { + await makePassthroughRequest("https://api.example.com", { method: "GET" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.body).toBeUndefined(); + }); + }); + + describe("timeout and retries", () => { + it("should use requestOptions timeout over client timeout", async () => { + await makePassthroughRequest( + "https://api.example.com", + undefined, + { timeoutInSeconds: 30, fetch: mockFetch }, + { timeoutInSeconds: 10 }, + ); + // The timeout is passed to makeRequest which converts to ms + // We verify via the signal timing behavior (indirectly tested through makeRequest) + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use client timeout when requestOptions timeout is not set", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + timeoutInSeconds: 30, + fetch: mockFetch, + }); + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use requestOptions maxRetries over client maxRetries", async () => { + mockFetch.mockResolvedValue(new Response("", { status: 500 })); + jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + await makePassthroughRequest( + "https://api.example.com", + undefined, + { maxRetries: 5, fetch: mockFetch }, + { maxRetries: 1 }, + ); + // 1 initial + 1 retry = 2 calls + expect(mockFetch).toHaveBeenCalledTimes(2); + + jest.restoreAllMocks(); + }); + }); + + describe("abort signal", () => { + it("should use requestOptions.abortSignal over init.signal", async () => { + const initController = new AbortController(); + const requestController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + { abortSignal: requestController.signal }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + // The signal passed to makeRequest is combined with timeout signal via anySignal, + // but the requestOptions.abortSignal should be the one that's used (not init.signal) + expect(calledOptions.signal).toBeDefined(); + }); + + it("should use init.signal when requestOptions.abortSignal is not set", async () => { + const initController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.signal).toBeDefined(); + }); + }); + + describe("credentials", () => { + it("should pass credentials include when set", async () => { + await makePassthroughRequest("https://api.example.com", { credentials: "include" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBe("include"); + }); + + it("should not pass credentials when not set to include", async () => { + await makePassthroughRequest( + "https://api.example.com", + { credentials: "same-origin" }, + { + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBeUndefined(); + }); + }); + + describe("response", () => { + it("should return the Response object from fetch", async () => { + const mockResponse = new Response(JSON.stringify({ data: "test" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + mockFetch.mockResolvedValue(mockResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response).toBe(mockResponse); + expect(response.status).toBe(200); + }); + + it("should return error responses without throwing", async () => { + const errorResponse = new Response("Not Found", { status: 404 }); + mockFetch.mockResolvedValue(errorResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response.status).toBe(404); + }); + }); + + describe("Request object input", () => { + it("should extract URL from Request object", async () => { + const request = new Request("https://api.example.com/v1/resource", { method: "POST" }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/resource"); + expect(calledOptions.method).toBe("POST"); + }); + + it("should extract headers from Request object when no init provided", async () => { + const request = new Request("https://api.example.com", { + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-request"]).toBe("request-value"); + }); + + it("should use explicit init over Request object properties", async () => { + const request = new Request("https://api.example.com", { + method: "POST", + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest( + request, + { method: "PUT", headers: { "X-From-Init": "init-value" } }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("PUT"); + expect(calledOptions.headers["x-from-init"]).toBe("init-value"); + // Request headers should NOT be present since explicit init was provided + expect(calledOptions.headers["x-from-request"]).toBeUndefined(); + }); + }); + + describe("SDK default header suppliers", () => { + it("should resolve supplier functions for SDK default headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { + "X-Static": "static-value", + "X-Dynamic": () => "dynamic-value", + }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-static"]).toBe("static-value"); + expect(calledOptions.headers["x-dynamic"]).toBe("dynamic-value"); + }); + }); +}); diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index 43ed9d11..f6f039a2 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,4 +1,8 @@ -import { makeRequest } from "../../../src/core/fetcher/makeRequest"; +import { + isCacheNoStoreSupported, + makeRequest, + resetCacheNoStoreSupported, +} from "../../../src/core/fetcher/makeRequest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; @@ -11,6 +15,7 @@ describe("Test makeRequest", () => { beforeEach(() => { mockFetch = jest.fn(); mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); + resetCacheNoStoreSupported(); }); it("should handle POST request correctly", async () => { @@ -50,4 +55,103 @@ describe("Test makeRequest", () => { expect(calledOptions.signal).toBeDefined(); expect(calledOptions.signal).toBeInstanceOf(AbortSignal); }); + + it("should not include cache option when disableCache is not set", async () => { + await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should not include cache option when disableCache is false", async () => { + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + false, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should include cache: no-store when disableCache is true and runtime supports it", async () => { + // In Node.js test environment, Request supports the cache option + expect(isCacheNoStoreSupported()).toBe(true); + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBe("no-store"); + }); + + it("should cache the result of isCacheNoStoreSupported", () => { + const first = isCacheNoStoreSupported(); + const second = isCacheNoStoreSupported(); + expect(first).toBe(second); + }); + + it("should reset cache detection state with resetCacheNoStoreSupported", () => { + // First call caches the result + const first = isCacheNoStoreSupported(); + expect(first).toBe(true); + + // Reset clears the cache + resetCacheNoStoreSupported(); + + // After reset, it should re-detect (and still return true in Node.js) + const second = isCacheNoStoreSupported(); + expect(second).toBe(true); + }); + + it("should not include cache option when runtime does not support it (e.g. Cloudflare Workers)", async () => { + // Mock Request constructor to throw when cache option is passed, + // simulating runtimes like Cloudflare Workers + const OriginalRequest = globalThis.Request; + globalThis.Request = class MockRequest { + constructor(_url: string, init?: RequestInit) { + if (init?.cache != null) { + throw new TypeError("The 'cache' field on 'RequestInitializerDict' is not implemented."); + } + } + } as unknown as typeof Request; + + try { + // Reset so the detection runs fresh with the mocked Request + resetCacheNoStoreSupported(); + expect(isCacheNoStoreSupported()).toBe(false); + + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + } finally { + // Restore original Request + globalThis.Request = OriginalRequest; + resetCacheNoStoreSupported(); + } + }); }); diff --git a/tests/unit/wrapper.test.ts b/tests/unit/wrapper.test.ts deleted file mode 100644 index 0333c8d7..00000000 --- a/tests/unit/wrapper.test.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { SchematicClient } from "../../src/wrapper"; -import type { CacheProvider } from "../../src/cache"; -import type { CheckFlagWithEntitlementResponse } from "../../src/wrapper"; - -// Mock the features.checkFlag API call -const mockCheckFlag = jest.fn(); - -jest.mock("../../src/Client", () => { - class MockBaseClient { - features = { - checkFlag: mockCheckFlag, - checkFlags: jest.fn().mockResolvedValue({ - data: { flags: [] }, - }), - }; - events = {}; - } - return { SchematicClient: MockBaseClient }; -}); - -// Mock the EventBuffer to avoid side effects -jest.mock("../../src/events", () => { - return { - EventBuffer: jest.fn().mockImplementation(() => ({ - push: jest.fn(), - stop: jest.fn().mockResolvedValue(undefined), - })), - }; -}); - -describe("SchematicClient wrapper - flag checking behavior", () => { - const mockLogger = { - error: jest.fn(), - warn: jest.fn(), - info: jest.fn(), - debug: jest.fn(), - }; - - afterEach(() => { - jest.clearAllMocks(); - }); - - describe("offline mode", () => { - it("should return configured default in offline mode", async () => { - const client = new SchematicClient({ - offline: true, - flagDefaults: { "test-flag": true }, - logger: mockLogger, - }); - - const result = await client.checkFlag({}, "test-flag"); - - expect(result).toBe(true); - expect(mockCheckFlag).not.toHaveBeenCalled(); - - await client.close(); - }); - - it("should return false in offline mode when no default configured", async () => { - const client = new SchematicClient({ - offline: true, - logger: mockLogger, - }); - - const result = await client.checkFlag({}, "unknown-flag"); - - expect(result).toBe(false); - expect(mockCheckFlag).not.toHaveBeenCalled(); - - await client.close(); - }); - }); - - describe("API error handling", () => { - it("should return false when API errors and no default configured", async () => { - mockCheckFlag.mockRejectedValue(new Error("API unavailable")); - - const client = new SchematicClient({ - apiKey: "test-api-key", - cacheProviders: { flagChecks: [] }, - logger: mockLogger, - }); - - const result = await client.checkFlag( - { company: { id: "comp-1" } }, - "test-flag", - ); - - expect(result).toBe(false); - - await client.close(); - }); - - it("should return configured default when API errors", async () => { - mockCheckFlag.mockRejectedValue(new Error("API unavailable")); - - const client = new SchematicClient({ - apiKey: "test-api-key", - flagDefaults: { "test-flag": true }, - cacheProviders: { flagChecks: [] }, - logger: mockLogger, - }); - - const result = await client.checkFlag( - { company: { id: "comp-1" } }, - "test-flag", - ); - - expect(result).toBe(true); - - await client.close(); - }); - }); - - describe("caching behavior", () => { - it("should use different cache keys for different contexts", async () => { - mockCheckFlag.mockResolvedValue({ - data: { - value: true, - flag: "test-flag", - reason: "match", - }, - }); - - const mockCacheProvider: CacheProvider = { - get: jest.fn().mockResolvedValue(null), - set: jest.fn().mockResolvedValue(undefined), - delete: jest.fn().mockResolvedValue(undefined), - }; - - const client = new SchematicClient({ - apiKey: "test-api-key", - cacheProviders: { flagChecks: [mockCacheProvider] }, - logger: mockLogger, - }); - - await client.checkFlag( - { company: { id: "comp-1" } }, - "test-flag", - ); - await client.checkFlag( - { company: { id: "comp-2" } }, - "test-flag", - ); - - // Two different contexts should produce two cache get calls with different keys - expect(mockCacheProvider.get).toHaveBeenCalledTimes(2); - const firstKey = (mockCacheProvider.get as jest.Mock).mock.calls[0][0]; - const secondKey = (mockCacheProvider.get as jest.Mock).mock.calls[1][0]; - expect(firstKey).not.toEqual(secondKey); - - // Two API calls should have been made since cache returned null both times - expect(mockCheckFlag).toHaveBeenCalledTimes(2); - - await client.close(); - }); - - it("should return API value when cache is disabled", async () => { - mockCheckFlag.mockResolvedValue({ - data: { - value: true, - flag: "test-flag", - reason: "match", - }, - }); - - const client = new SchematicClient({ - apiKey: "test-api-key", - cacheProviders: { flagChecks: [] }, - logger: mockLogger, - }); - - const result1 = await client.checkFlag( - { company: { id: "comp-1" } }, - "test-flag", - ); - const result2 = await client.checkFlag( - { company: { id: "comp-1" } }, - "test-flag", - ); - - expect(result1).toBe(true); - expect(result2).toBe(true); - - // With no cache providers, every call should hit the API - expect(mockCheckFlag).toHaveBeenCalledTimes(2); - - await client.close(); - }); - }); -}); diff --git a/tests/wire/accesstokens.test.ts b/tests/wire/accesstokens.test.ts index 1003a7f0..9490e829 100644 --- a/tests/wire/accesstokens.test.ts +++ b/tests/wire/accesstokens.test.ts @@ -22,6 +22,7 @@ describe("AccesstokensClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/temporary-access-tokens") @@ -58,6 +59,7 @@ describe("AccesstokensClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { lookup: { lookup: "lookup" }, resource_type: "company" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/temporary-access-tokens") @@ -81,6 +83,7 @@ describe("AccesstokensClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { lookup: { lookup: "lookup" }, resource_type: "company" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/temporary-access-tokens") @@ -104,6 +107,7 @@ describe("AccesstokensClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { lookup: { lookup: "lookup" }, resource_type: "company" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/temporary-access-tokens") @@ -127,6 +131,7 @@ describe("AccesstokensClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { lookup: { lookup: "lookup" }, resource_type: "company" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/temporary-access-tokens") @@ -150,6 +155,7 @@ describe("AccesstokensClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { lookup: { lookup: "lookup" }, resource_type: "company" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/temporary-access-tokens") diff --git a/tests/wire/accounts.test.ts b/tests/wire/accounts.test.ts index b5c0e0a2..186e8653 100644 --- a/tests/wire/accounts.test.ts +++ b/tests/wire/accounts.test.ts @@ -23,15 +23,16 @@ describe("AccountsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { environment_id: "environment_id", limit: 1, offset: 1, require_environment: true }, + params: { environment_id: "environment_id", limit: 1000000, offset: 1000000, require_environment: true }, }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.listApiKeys({ environmentId: "environment_id", requireEnvironment: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -49,8 +50,8 @@ describe("AccountsClient", () => { ], params: { environmentId: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, requireEnvironment: true, }, }); @@ -61,6 +62,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -75,6 +77,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -89,6 +92,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -103,6 +107,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -117,6 +122,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -145,6 +151,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/api-keys") @@ -181,6 +188,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/api-keys") @@ -202,6 +210,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/api-keys") @@ -223,6 +232,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/api-keys") @@ -244,6 +254,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/api-keys") @@ -265,6 +276,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/api-keys") @@ -299,6 +311,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/api-keys/api_key_id") @@ -331,6 +344,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/api-keys/api_key_id") @@ -349,6 +363,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/api-keys/api_key_id") @@ -367,6 +382,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/api-keys/api_key_id") @@ -385,6 +401,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/api-keys/api_key_id") @@ -416,6 +433,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -449,6 +467,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -468,6 +487,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -487,6 +507,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -506,6 +527,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -525,6 +547,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/api-keys/api_key_id") @@ -544,6 +567,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -568,6 +592,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -586,6 +611,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -604,6 +630,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -622,6 +649,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -640,6 +668,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/api-keys/api_key_id") @@ -659,15 +688,16 @@ describe("AccountsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { environment_id: "environment_id", limit: 1, offset: 1, require_environment: true }, + params: { environment_id: "environment_id", limit: 1000000, offset: 1000000, require_environment: true }, }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.countApiKeys({ environmentId: "environment_id", requireEnvironment: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -675,8 +705,8 @@ describe("AccountsClient", () => { }, params: { environmentId: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, requireEnvironment: true, }, }); @@ -687,6 +717,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -701,6 +732,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -715,6 +747,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -729,6 +762,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -743,6 +777,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/api-keys/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -765,11 +800,11 @@ describe("AccountsClient", () => { environment_id: "environment_id", id: "id", method: "method", - resource_id: 1, + resource_id: 1000000, resource_id_string: "resource_id_string", resource_name: "resource_name", resource_type: "resource_type", - resp_code: 1, + resp_code: 1000000, secondary_resource: "secondary_resource", started_at: "2024-01-15T09:30:00Z", url: "url", @@ -780,12 +815,13 @@ describe("AccountsClient", () => { actor_type: "api_key", end_time: "2024-01-15T09:30:00Z", environment_id: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", start_time: "2024-01-15T09:30:00Z", }, }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.listAuditLogs({ @@ -794,8 +830,8 @@ describe("AccountsClient", () => { environmentId: "environment_id", q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -806,11 +842,11 @@ describe("AccountsClient", () => { environmentId: "environment_id", id: "id", method: "method", - resourceId: 1, + resourceId: 1000000, resourceIdString: "resource_id_string", resourceName: "resource_name", resourceType: "resource_type", - respCode: 1, + respCode: 1000000, secondaryResource: "secondary_resource", startedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", @@ -821,8 +857,8 @@ describe("AccountsClient", () => { actorType: "api_key", endTime: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), }, @@ -834,6 +870,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -846,6 +883,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -858,6 +896,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -870,6 +909,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -882,6 +922,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -902,12 +943,12 @@ describe("AccountsClient", () => { id: "id", method: "method", req_body: "req_body", - resource_id: 1, + resource_id: 1000000, resource_id_string: "resource_id_string", resource_name: "resource_name", resource_type: "resource_type", resp_body: "resp_body", - resp_code: 1, + resp_code: 1000000, secondary_resource: "secondary_resource", started_at: "2024-01-15T09:30:00Z", url: "url", @@ -916,6 +957,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/audit-log/audit_log_id") @@ -934,12 +976,12 @@ describe("AccountsClient", () => { id: "id", method: "method", reqBody: "req_body", - resourceId: 1, + resourceId: 1000000, resourceIdString: "resource_id_string", resourceName: "resource_name", resourceType: "resource_type", respBody: "resp_body", - respCode: 1, + respCode: 1000000, secondaryResource: "secondary_resource", startedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", @@ -957,6 +999,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/audit-log/audit_log_id") @@ -975,6 +1018,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/audit-log/audit_log_id") @@ -993,6 +1037,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/audit-log/audit_log_id") @@ -1011,6 +1056,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/audit-log/audit_log_id") @@ -1034,12 +1080,13 @@ describe("AccountsClient", () => { actor_type: "api_key", end_time: "2024-01-15T09:30:00Z", environment_id: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", start_time: "2024-01-15T09:30:00Z", }, }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.countAuditLogs({ @@ -1048,8 +1095,8 @@ describe("AccountsClient", () => { environmentId: "environment_id", q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -1059,8 +1106,8 @@ describe("AccountsClient", () => { actorType: "api_key", endTime: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", startTime: new Date("2024-01-15T09:30:00.000Z"), }, @@ -1072,6 +1119,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1084,6 +1132,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1096,6 +1145,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1108,6 +1158,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1120,6 +1171,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/audit-log/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1141,13 +1193,14 @@ describe("AccountsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { ids: ["ids"], limit: 1, offset: 1 }, + params: { ids: ["ids"], limit: 1000000, offset: 1000000 }, }; + server.mockEndpoint().get("/environments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.listEnvironments({ - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -1161,8 +1214,8 @@ describe("AccountsClient", () => { ], params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -1172,6 +1225,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/environments").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1184,6 +1238,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/environments").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1196,6 +1251,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/environments").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1208,6 +1264,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/environments").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1220,6 +1277,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/environments").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1251,6 +1309,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/environments") @@ -1293,6 +1352,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { environment_type: "development", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/environments") @@ -1315,6 +1375,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { environment_type: "development", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/environments") @@ -1337,6 +1398,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { environment_type: "development", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/environments") @@ -1359,6 +1421,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { environment_type: "development", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/environments") @@ -1381,6 +1444,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { environment_type: "development", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/environments") @@ -1412,6 +1476,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/environments/environment_id") @@ -1440,6 +1505,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/environments/environment_id") @@ -1458,6 +1524,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/environments/environment_id") @@ -1476,6 +1543,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/environments/environment_id") @@ -1494,6 +1562,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/environments/environment_id") @@ -1521,6 +1590,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1550,6 +1620,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1569,6 +1640,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1588,6 +1660,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1607,6 +1680,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1626,6 +1700,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/environments/environment_id") @@ -1645,6 +1720,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1669,6 +1745,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1687,6 +1764,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1705,6 +1783,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1723,6 +1802,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1741,6 +1821,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/environments/environment_id") @@ -1759,6 +1840,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { ok: true }, params: { key: "value" } }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.quickstart(); @@ -1777,6 +1859,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1789,6 +1872,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1801,6 +1885,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1813,6 +1898,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1825,6 +1911,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().post("/quickstart").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1858,6 +1945,7 @@ describe("AccountsClient", () => { }, params: { key: "value" }, }; + server.mockEndpoint().get("/whoami").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.getWhoAmI(); @@ -1892,6 +1980,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/whoami").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1904,6 +1993,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/whoami").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1916,6 +2006,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/whoami").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1928,6 +2019,7 @@ describe("AccountsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/whoami").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/billing.test.ts b/tests/wire/billing.test.ts index 2753b9f5..93c524f0 100644 --- a/tests/wire/billing.test.ts +++ b/tests/wire/billing.test.ts @@ -13,62 +13,63 @@ describe("BillingClient", () => { data: [ { account_id: "account_id", - amount_off: 1, + amount_off: 1000000, currency: "currency", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, environment_id: "environment_id", external_id: "external_id", id: "id", is_active: true, - max_redemptions: 1, + max_redemptions: 1000000, metadata: { key: "value" }, name: "name", percent_off: 1.1, provider_type: "schematic", - times_redeemed: 1, + times_redeemed: 1000000, valid_from: "2024-01-15T09:30:00Z", valid_until: "2024-01-15T09:30:00Z", }, ], - params: { is_active: true, limit: 1, offset: 1, q: "q" }, + params: { is_active: true, limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listCoupons({ isActive: true, q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { accountId: "account_id", - amountOff: 1, + amountOff: 1000000, currency: "currency", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, environmentId: "environment_id", externalId: "external_id", id: "id", isActive: true, - maxRedemptions: 1, + maxRedemptions: 1000000, metadata: { key: "value", }, name: "name", percentOff: 1.1, providerType: "schematic", - timesRedeemed: 1, + timesRedeemed: 1000000, validFrom: new Date("2024-01-15T09:30:00.000Z"), validUntil: new Date("2024-01-15T09:30:00.000Z"), }, ], params: { isActive: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -79,6 +80,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -91,6 +93,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -103,6 +106,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -115,6 +119,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -127,6 +132,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/coupons").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -138,37 +144,38 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { data: { account_id: "account_id", - amount_off: 1, + amount_off: 1000000, currency: "currency", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, environment_id: "environment_id", external_id: "external_id", id: "id", is_active: true, - max_redemptions: 1, + max_redemptions: 1000000, metadata: { key: "value" }, name: "name", percent_off: 1.1, provider_type: "schematic", - times_redeemed: 1, + times_redeemed: 1000000, valid_from: "2024-01-15T09:30:00Z", valid_until: "2024-01-15T09:30:00Z", }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/coupons") @@ -179,34 +186,34 @@ describe("BillingClient", () => { .build(); const response = await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); expect(response).toEqual({ data: { accountId: "account_id", - amountOff: 1, + amountOff: 1000000, currency: "currency", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, environmentId: "environment_id", externalId: "external_id", id: "id", isActive: true, - maxRedemptions: 1, + maxRedemptions: 1000000, metadata: { key: "value", }, name: "name", percentOff: 1.1, providerType: "schematic", - timesRedeemed: 1, + timesRedeemed: 1000000, validFrom: new Date("2024-01-15T09:30:00.000Z"), validUntil: new Date("2024-01-15T09:30:00.000Z"), }, @@ -220,16 +227,17 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/coupons") @@ -241,14 +249,14 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -257,16 +265,17 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/coupons") @@ -278,14 +287,14 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -294,16 +303,17 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/coupons") @@ -315,14 +325,14 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -331,16 +341,17 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/coupons") @@ -352,14 +363,14 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -368,16 +379,17 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_off: 1, + amount_off: 1000000, duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, external_id: "external_id", - max_redemptions: 1, + max_redemptions: 1000000, name: "name", percent_off: 1.1, - times_redeemed: 1, + times_redeemed: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/coupons") @@ -389,14 +401,14 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertBillingCoupon({ - amountOff: 1, + amountOff: 1000000, duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, externalId: "external_id", - maxRedemptions: 1, + maxRedemptions: 1000000, name: "name", percentOff: 1.1, - timesRedeemed: 1, + timesRedeemed: 1000000, }); }).rejects.toThrow(Schematic.InternalServerError); }); @@ -418,6 +430,7 @@ describe("BillingClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -457,6 +470,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -483,6 +497,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -509,6 +524,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -535,6 +551,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -561,6 +578,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/customer/upsert") @@ -601,8 +619,8 @@ describe("BillingClient", () => { currency: "currency", interval: "interval", metered_usage: true, - per_unit_price: 1, - total_price: 1, + per_unit_price: 1000000, + total_price: 1000000, }, ], updated_at: "2024-01-15T09:30:00Z", @@ -610,21 +628,22 @@ describe("BillingClient", () => { ], params: { company_ids: ["company_ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, provider_type: "schematic", q: "q", }, }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listCustomersWithSubscriptions({ name: "name", providerType: "schematic", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -641,8 +660,8 @@ describe("BillingClient", () => { currency: "currency", interval: "interval", meteredUsage: true, - perUnitPrice: 1, - totalPrice: 1, + perUnitPrice: 1000000, + totalPrice: 1000000, }, ], updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -650,9 +669,9 @@ describe("BillingClient", () => { ], params: { companyIds: ["company_ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, providerType: "schematic", q: "q", }, @@ -664,6 +683,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -676,6 +696,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -688,6 +709,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -700,6 +722,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -712,6 +735,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/customers").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -727,13 +751,14 @@ describe("BillingClient", () => { data: { count: 1 }, params: { company_ids: ["company_ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, provider_type: "schematic", q: "q", }, }; + server .mockEndpoint() .get("/billing/customers/count") @@ -746,8 +771,8 @@ describe("BillingClient", () => { name: "name", providerType: "schematic", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -755,9 +780,9 @@ describe("BillingClient", () => { }, params: { companyIds: ["company_ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, providerType: "schematic", q: "q", }, @@ -769,6 +794,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/customers/count") @@ -787,6 +813,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/customers/count") @@ -805,6 +832,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/customers/count") @@ -823,6 +851,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/customers/count") @@ -841,6 +870,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/customers/count") @@ -861,9 +891,9 @@ describe("BillingClient", () => { const rawResponseBody = { data: [ { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -877,7 +907,7 @@ describe("BillingClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, @@ -885,26 +915,27 @@ describe("BillingClient", () => { params: { company_id: "company_id", customer_external_id: "customer_external_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, subscription_external_id: "subscription_external_id", }, }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listInvoices({ companyId: "company_id", customerExternalId: "customer_external_id", subscriptionExternalId: "subscription_external_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -918,7 +949,7 @@ describe("BillingClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -926,8 +957,8 @@ describe("BillingClient", () => { params: { companyId: "company_id", customerExternalId: "customer_external_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, subscriptionExternalId: "subscription_external_id", }, }); @@ -938,6 +969,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -953,6 +985,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -968,6 +1001,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -983,6 +1017,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -998,6 +1033,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/invoices").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1012,19 +1048,19 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { data: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1038,12 +1074,13 @@ describe("BillingClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/invoices") @@ -1054,19 +1091,19 @@ describe("BillingClient", () => { .build(); const response = await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); expect(response).toEqual({ data: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1080,7 +1117,7 @@ describe("BillingClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -1094,15 +1131,16 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/invoices") @@ -1114,13 +1152,13 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -1129,15 +1167,16 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/invoices") @@ -1149,13 +1188,13 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -1164,15 +1203,16 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/invoices") @@ -1184,13 +1224,13 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -1199,15 +1239,16 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/invoices") @@ -1219,13 +1260,13 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -1234,15 +1275,16 @@ describe("BillingClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", currency: "currency", customer_external_id: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/invoices") @@ -1254,13 +1296,13 @@ describe("BillingClient", () => { await expect(async () => { return await client.billing.upsertInvoice({ - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", currency: "currency", customerExternalId: "customer_external_id", - subtotal: 1, + subtotal: 1000000, }); }).rejects.toThrow(Schematic.InternalServerError); }); @@ -1280,14 +1322,15 @@ describe("BillingClient", () => { provider_type: "schematic", }, ], - params: { display_name: "display_name", limit: 1, offset: 1 }, + params: { display_name: "display_name", limit: 1000000, offset: 1000000 }, }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listMeters({ displayName: "display_name", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -1302,8 +1345,8 @@ describe("BillingClient", () => { ], params: { displayName: "display_name", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -1313,6 +1356,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1325,6 +1369,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1337,6 +1382,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1349,6 +1395,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1361,6 +1408,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/meter").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1388,6 +1436,7 @@ describe("BillingClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1428,6 +1477,7 @@ describe("BillingClient", () => { external_id: "external_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1457,6 +1507,7 @@ describe("BillingClient", () => { external_id: "external_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1486,6 +1537,7 @@ describe("BillingClient", () => { external_id: "external_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1515,6 +1567,7 @@ describe("BillingClient", () => { external_id: "external_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1544,6 +1597,7 @@ describe("BillingClient", () => { external_id: "external_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/meter/upsert") @@ -1576,8 +1630,8 @@ describe("BillingClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1590,8 +1644,14 @@ describe("BillingClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { company_id: "company_id", customer_external_id: "customer_external_id", limit: 1, offset: 1 }, + params: { + company_id: "company_id", + customer_external_id: "customer_external_id", + limit: 1000000, + offset: 1000000, + }, }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1603,8 +1663,8 @@ describe("BillingClient", () => { const response = await client.billing.listPaymentMethods({ companyId: "company_id", customerExternalId: "customer_external_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -1615,8 +1675,8 @@ describe("BillingClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1632,8 +1692,8 @@ describe("BillingClient", () => { params: { companyId: "company_id", customerExternalId: "customer_external_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -1643,6 +1703,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1663,6 +1724,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1683,6 +1745,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1703,6 +1766,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1723,6 +1787,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/payment-methods") @@ -1754,8 +1819,8 @@ describe("BillingClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1769,6 +1834,7 @@ describe("BillingClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1791,8 +1857,8 @@ describe("BillingClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1819,6 +1885,7 @@ describe("BillingClient", () => { payment_method_type: "payment_method_type", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1846,6 +1913,7 @@ describe("BillingClient", () => { payment_method_type: "payment_method_type", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1873,6 +1941,7 @@ describe("BillingClient", () => { payment_method_type: "payment_method_type", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1900,6 +1969,7 @@ describe("BillingClient", () => { payment_method_type: "payment_method_type", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1927,6 +1997,7 @@ describe("BillingClient", () => { payment_method_type: "payment_method_type", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/payment-methods") @@ -1961,8 +2032,8 @@ describe("BillingClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -1982,9 +2053,9 @@ describe("BillingClient", () => { ids: ["ids"], interval: "interval", is_active: true, - limit: 1, - offset: 1, - price: 1, + limit: 1000000, + offset: 1000000, + price: 1000000, product_id: "product_id", product_ids: ["product_ids"], provider_type: "schematic", @@ -1994,6 +2065,7 @@ describe("BillingClient", () => { with_meter: true, }, }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listBillingPrices({ @@ -2001,15 +2073,15 @@ describe("BillingClient", () => { forTrialExpiryPlan: true, interval: "interval", isActive: true, - price: 1, + price: 1000000, productId: "product_id", providerType: "schematic", q: "q", tiersMode: "graduated", usageType: "licensed", withMeter: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -2023,8 +2095,8 @@ describe("BillingClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -2044,9 +2116,9 @@ describe("BillingClient", () => { ids: ["ids"], interval: "interval", isActive: true, - limit: 1, - offset: 1, - price: 1, + limit: 1000000, + offset: 1000000, + price: 1000000, productId: "product_id", productIds: ["product_ids"], providerType: "schematic", @@ -2063,6 +2135,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2075,6 +2148,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2087,6 +2161,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2099,6 +2174,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2111,6 +2187,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/price").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2127,7 +2204,7 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }], product_external_id: "product_external_id", @@ -2139,13 +2216,14 @@ describe("BillingClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2161,7 +2239,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2177,7 +2255,7 @@ describe("BillingClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -2197,13 +2275,14 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }, { price_external_id: "price_external_id" }], product_external_id: "product_external_id", usage_type: "licensed", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2220,7 +2299,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2245,13 +2324,14 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }, { price_external_id: "price_external_id" }], product_external_id: "product_external_id", usage_type: "licensed", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2268,7 +2348,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2293,13 +2373,14 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }, { price_external_id: "price_external_id" }], product_external_id: "product_external_id", usage_type: "licensed", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2316,7 +2397,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2341,13 +2422,14 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }, { price_external_id: "price_external_id" }], product_external_id: "product_external_id", usage_type: "licensed", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2364,7 +2446,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2389,13 +2471,14 @@ describe("BillingClient", () => { external_account_id: "external_account_id", interval: "interval", is_active: true, - price: 1, + price: 1000000, price_external_id: "price_external_id", price_tiers: [{ price_external_id: "price_external_id" }, { price_external_id: "price_external_id" }], product_external_id: "product_external_id", usage_type: "licensed", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/price/upsert") @@ -2412,7 +2495,7 @@ describe("BillingClient", () => { externalAccountId: "external_account_id", interval: "interval", isActive: true, - price: 1, + price: 1000000, priceExternalId: "price_external_id", priceTiers: [ { @@ -2433,6 +2516,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2457,6 +2541,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2475,6 +2560,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2493,6 +2579,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2511,6 +2598,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2529,6 +2617,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/billing_id") @@ -2558,8 +2647,8 @@ describe("BillingClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -2579,9 +2668,9 @@ describe("BillingClient", () => { ids: ["ids"], interval: "interval", is_active: true, - limit: 1, - offset: 1, - price: 1, + limit: 1000000, + offset: 1000000, + price: 1000000, product_id: "product_id", product_ids: ["product_ids"], provider_type: "schematic", @@ -2591,6 +2680,7 @@ describe("BillingClient", () => { with_meter: true, }, }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2604,15 +2694,15 @@ describe("BillingClient", () => { forTrialExpiryPlan: true, interval: "interval", isActive: true, - price: 1, + price: 1000000, productId: "product_id", providerType: "schematic", q: "q", tiersMode: "graduated", usageType: "licensed", withMeter: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -2626,8 +2716,8 @@ describe("BillingClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -2647,9 +2737,9 @@ describe("BillingClient", () => { ids: ["ids"], interval: "interval", isActive: true, - limit: 1, - offset: 1, - price: 1, + limit: 1000000, + offset: 1000000, + price: 1000000, productId: "product_id", productIds: ["product_ids"], providerType: "schematic", @@ -2666,6 +2756,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2684,6 +2775,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2702,6 +2794,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2720,6 +2813,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2738,6 +2832,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/product/prices") @@ -2756,6 +2851,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2780,6 +2876,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2798,6 +2895,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2816,6 +2914,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2834,6 +2933,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2852,6 +2952,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/product/prices/billing_id") @@ -2886,6 +2987,7 @@ describe("BillingClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -2925,6 +3027,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { external_id: "external_id", price: 1.1 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -2947,6 +3050,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { external_id: "external_id", price: 1.1 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -2969,6 +3073,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { external_id: "external_id", price: 1.1 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -2991,6 +3096,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { external_id: "external_id", price: 1.1 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -3013,6 +3119,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { external_id: "external_id", price: 1.1 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/product/upsert") @@ -3051,7 +3158,7 @@ describe("BillingClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -3059,16 +3166,16 @@ describe("BillingClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, ], params: { ids: ["ids"], is_active: true, - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, price_usage_type: "licensed", provider_type: "schematic", q: "q", @@ -3078,6 +3185,7 @@ describe("BillingClient", () => { without_linked_to_plan: true, }, }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listBillingProducts({ @@ -3090,8 +3198,8 @@ describe("BillingClient", () => { withPricesOnly: true, withZeroPrice: true, withoutLinkedToPlan: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -3110,7 +3218,7 @@ describe("BillingClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -3118,16 +3226,16 @@ describe("BillingClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], params: { ids: ["ids"], isActive: true, - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, priceUsageType: "licensed", providerType: "schematic", q: "q", @@ -3144,6 +3252,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3156,6 +3265,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3168,6 +3278,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3180,6 +3291,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3192,6 +3304,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/products").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3208,9 +3321,9 @@ describe("BillingClient", () => { params: { ids: ["ids"], is_active: true, - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, price_usage_type: "licensed", provider_type: "schematic", q: "q", @@ -3220,6 +3333,7 @@ describe("BillingClient", () => { without_linked_to_plan: true, }, }; + server .mockEndpoint() .get("/billing/products/count") @@ -3238,8 +3352,8 @@ describe("BillingClient", () => { withPricesOnly: true, withZeroPrice: true, withoutLinkedToPlan: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -3248,9 +3362,9 @@ describe("BillingClient", () => { params: { ids: ["ids"], isActive: true, - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, priceUsageType: "licensed", providerType: "schematic", q: "q", @@ -3267,6 +3381,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/products/count") @@ -3285,6 +3400,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/products/count") @@ -3303,6 +3419,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/products/count") @@ -3321,6 +3438,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/products/count") @@ -3339,6 +3457,7 @@ describe("BillingClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/products/count") @@ -3372,20 +3491,20 @@ describe("BillingClient", () => { { currency: "currency", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { data: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3396,17 +3515,18 @@ describe("BillingClient", () => { id: "id", interval: "interval", metadata: { key: "value" }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3433,20 +3553,20 @@ describe("BillingClient", () => { { currency: "currency", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); expect(response).toEqual({ data: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3459,13 +3579,13 @@ describe("BillingClient", () => { metadata: { key: "value", }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, params: { @@ -3500,26 +3620,27 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3553,24 +3674,24 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -3601,26 +3722,27 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3654,24 +3776,24 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -3702,26 +3824,27 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3755,24 +3878,24 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -3803,26 +3926,27 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3856,24 +3980,24 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -3904,26 +4028,27 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, price_external_id: "price_external_id", product_external_id: "product_external_id", - quantity: 1, + quantity: 1000000, usage_type: "licensed", }, ], subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/subscription/upsert") @@ -3957,24 +4082,24 @@ describe("BillingClient", () => { { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, { currency: "foo", interval: "interval", - price: 1, + price: 1000000, priceExternalId: "price_external_id", productExternalId: "product_external_id", - quantity: 1, + quantity: 1000000, usageType: "licensed", }, ], subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }); }).rejects.toThrow(Schematic.InternalServerError); }); diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index fe3645c4..dcb407e1 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -11,16 +11,16 @@ describe("CheckoutClient", () => { const rawRequestBody = { add_on_ids: [{ add_on_id: "add_on_id", price_id: "price_id" }], company_id: "company_id", - credit_bundles: [{ bundle_id: "bundle_id", quantity: 1 }], + credit_bundles: [{ bundle_id: "bundle_id", quantity: 1000000 }], new_plan_id: "new_plan_id", new_price_id: "new_price_id", - pay_in_advance: [{ price_id: "price_id", quantity: 1 }], + pay_in_advance: [{ price_id: "price_id", quantity: 1000000 }], skip_trial: true, }; const rawResponseBody = { data: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", confirm_payment_intent_client_secret: "confirm_payment_intent_client_secret", @@ -33,17 +33,18 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", metadata: { key: "value" }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, params: { key: "value" }, }; + server .mockEndpoint() .post("/checkout-internal") @@ -64,7 +65,7 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -72,7 +73,7 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -80,7 +81,7 @@ describe("CheckoutClient", () => { expect(response).toEqual({ data: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", confirmPaymentIntentClientSecret: "confirm_payment_intent_client_secret", @@ -95,13 +96,13 @@ describe("CheckoutClient", () => { metadata: { key: "value", }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, params: { @@ -120,18 +121,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal") @@ -157,11 +159,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -169,11 +171,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -191,18 +193,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal") @@ -228,11 +231,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -240,11 +243,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -262,18 +265,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal") @@ -299,11 +303,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -311,11 +315,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -333,18 +337,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal") @@ -370,11 +375,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -382,11 +387,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -404,18 +409,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal") @@ -441,11 +447,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -453,11 +459,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -474,7 +480,7 @@ describe("CheckoutClient", () => { active_add_ons: [ { charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -535,7 +541,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -570,7 +576,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -586,7 +592,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -602,7 +608,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -610,11 +616,11 @@ describe("CheckoutClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -628,7 +634,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -687,7 +693,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -709,7 +715,7 @@ describe("CheckoutClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -726,7 +732,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -736,12 +742,12 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -754,7 +760,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -762,7 +768,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -791,7 +797,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -823,8 +829,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -835,8 +841,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -850,7 +856,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -871,8 +877,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -883,8 +889,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -898,7 +904,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -951,7 +957,7 @@ describe("CheckoutClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -973,7 +979,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1018,7 +1024,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -1028,7 +1034,7 @@ describe("CheckoutClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -1036,7 +1042,7 @@ describe("CheckoutClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_usage: { features: [ @@ -1048,7 +1054,7 @@ describe("CheckoutClient", () => { }, ], }, - selected_credit_bundles: [{ quantity: 1, total: 1 }], + selected_credit_bundles: [{ quantity: 1000000, total: 1000000 }], selected_plan: { active_version: { created_at: "2024-01-15T09:30:00Z", @@ -1060,7 +1066,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -1076,7 +1082,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1084,11 +1090,11 @@ describe("CheckoutClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -1102,7 +1108,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -1161,7 +1167,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1183,7 +1189,7 @@ describe("CheckoutClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1200,7 +1206,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1210,12 +1216,12 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -1228,7 +1234,7 @@ describe("CheckoutClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -1236,7 +1242,7 @@ describe("CheckoutClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1261,9 +1267,9 @@ describe("CheckoutClient", () => { expired_at: "2024-01-15T09:30:00Z", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -1271,7 +1277,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, payment_method: { @@ -1294,8 +1300,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1308,12 +1314,13 @@ describe("CheckoutClient", () => { ], status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, trial_end: "2024-01-15T09:30:00Z", }, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -1331,7 +1338,7 @@ describe("CheckoutClient", () => { activeAddOns: [ { chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -1402,7 +1409,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1442,7 +1449,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -1458,7 +1465,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1474,7 +1481,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1482,11 +1489,11 @@ describe("CheckoutClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -1500,7 +1507,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -1569,7 +1576,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1596,7 +1603,7 @@ describe("CheckoutClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1613,7 +1620,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1623,12 +1630,12 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -1641,7 +1648,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -1649,7 +1656,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1683,7 +1690,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1717,8 +1724,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1729,8 +1736,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1744,7 +1751,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -1765,8 +1772,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1777,8 +1784,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1792,7 +1799,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1851,7 +1858,7 @@ describe("CheckoutClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1873,7 +1880,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1923,7 +1930,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -1933,7 +1940,7 @@ describe("CheckoutClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -1943,7 +1950,7 @@ describe("CheckoutClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureUsage: { features: [ @@ -1957,8 +1964,8 @@ describe("CheckoutClient", () => { }, selectedCreditBundles: [ { - quantity: 1, - total: 1, + quantity: 1000000, + total: 1000000, }, ], selectedPlan: { @@ -1972,7 +1979,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1988,7 +1995,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1996,11 +2003,11 @@ describe("CheckoutClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -2014,7 +2021,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -2083,7 +2090,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2110,7 +2117,7 @@ describe("CheckoutClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2127,7 +2134,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2137,12 +2144,12 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2155,7 +2162,7 @@ describe("CheckoutClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2163,7 +2170,7 @@ describe("CheckoutClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2193,9 +2200,9 @@ describe("CheckoutClient", () => { expiredAt: new Date("2024-01-15T09:30:00.000Z"), interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -2203,7 +2210,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, paymentMethod: { @@ -2226,8 +2233,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2240,7 +2247,7 @@ describe("CheckoutClient", () => { ], status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, trialEnd: new Date("2024-01-15T09:30:00.000Z"), }, }, @@ -2255,6 +2262,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -2276,6 +2284,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -2297,6 +2306,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -2318,6 +2328,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -2339,6 +2350,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/data") @@ -2361,40 +2373,46 @@ describe("CheckoutClient", () => { const rawRequestBody = { add_on_ids: [{ add_on_id: "add_on_id", price_id: "price_id" }], company_id: "company_id", - credit_bundles: [{ bundle_id: "bundle_id", quantity: 1 }], + credit_bundles: [{ bundle_id: "bundle_id", quantity: 1000000 }], new_plan_id: "new_plan_id", new_price_id: "new_price_id", - pay_in_advance: [{ price_id: "price_id", quantity: 1 }], + pay_in_advance: [{ price_id: "price_id", quantity: 1000000 }], skip_trial: true, }; const rawResponseBody = { data: { - amount_off: 1, - due_now: 1, + amount_off: 1000000, + due_now: 1000000, finance: { - amount_off: 1, - due_now: 1, - new_charges: 1, + amount_off: 1000000, + due_now: 1000000, + new_charges: 1000000, percent_off: 1.1, period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, - proration: 1, - tax_amount: 1, + proration: 1000000, + tax_amount: 1000000, tax_display_name: "tax_display_name", tax_require_billing_details: true, - total_per_billing_period: 1, + total_per_billing_period: 1000000, trial_end: "2024-01-15T09:30:00Z", upcoming_invoice_line_items: [ - { amount: 1, description: "description", price_id: "price_id", proration: true, quantity: 1 }, + { + amount: 1000000, + description: "description", + price_id: "price_id", + proration: true, + quantity: 1000000, + }, ], }, is_scheduled_downgrade: true, - new_charges: 1, + new_charges: 1000000, payment_method_required: true, percent_off: 1.1, period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, - proration: 1, + proration: 1000000, scheduled_change_time: "2024-01-15T09:30:00Z", usage_violations: [ { @@ -2407,6 +2425,7 @@ describe("CheckoutClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2427,7 +2446,7 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2435,45 +2454,45 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, }); expect(response).toEqual({ data: { - amountOff: 1, - dueNow: 1, + amountOff: 1000000, + dueNow: 1000000, finance: { - amountOff: 1, - dueNow: 1, - newCharges: 1, + amountOff: 1000000, + dueNow: 1000000, + newCharges: 1000000, percentOff: 1.1, periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, - proration: 1, - taxAmount: 1, + proration: 1000000, + taxAmount: 1000000, taxDisplayName: "tax_display_name", taxRequireBillingDetails: true, - totalPerBillingPeriod: 1, + totalPerBillingPeriod: 1000000, trialEnd: new Date("2024-01-15T09:30:00.000Z"), upcomingInvoiceLineItems: [ { - amount: 1, + amount: 1000000, description: "description", priceId: "price_id", proration: true, - quantity: 1, + quantity: 1000000, }, ], }, isScheduledDowngrade: true, - newCharges: 1, + newCharges: 1000000, paymentMethodRequired: true, percentOff: 1.1, periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, - proration: 1, + proration: 1000000, scheduledChangeTime: new Date("2024-01-15T09:30:00.000Z"), usageViolations: [ { @@ -2500,18 +2519,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2537,11 +2557,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2549,11 +2569,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -2571,18 +2591,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2608,11 +2629,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2620,11 +2641,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -2642,18 +2663,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2679,11 +2701,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2691,11 +2713,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -2713,18 +2735,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2750,11 +2773,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2762,11 +2785,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -2784,18 +2807,19 @@ describe("CheckoutClient", () => { ], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], new_plan_id: "new_plan_id", new_price_id: "new_price_id", pay_in_advance: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], skip_trial: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/checkout-internal/preview") @@ -2821,11 +2845,11 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], newPlanId: "new_plan_id", @@ -2833,11 +2857,11 @@ describe("CheckoutClient", () => { payInAdvance: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], skipTrial: true, @@ -2851,8 +2875,8 @@ describe("CheckoutClient", () => { const rawRequestBody = { add_on_selections: [{ plan_id: "plan_id" }], company_id: "company_id", - credit_bundles: [{ bundle_id: "bundle_id", quantity: 1 }], - pay_in_advance_entitlements: [{ price_id: "price_id", quantity: 1 }], + credit_bundles: [{ bundle_id: "bundle_id", quantity: 1000000 }], + pay_in_advance_entitlements: [{ price_id: "price_id", quantity: 1000000 }], }; const rawResponseBody = { data: { @@ -2864,7 +2888,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -2896,8 +2920,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2908,8 +2932,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2923,7 +2947,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -2944,8 +2968,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2956,8 +2980,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2971,7 +2995,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -3024,7 +3048,7 @@ describe("CheckoutClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -3046,7 +3070,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -3091,7 +3115,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -3101,7 +3125,7 @@ describe("CheckoutClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -3109,12 +3133,13 @@ describe("CheckoutClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, success: true, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/manage-plan") @@ -3134,13 +3159,13 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3154,7 +3179,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -3188,8 +3213,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -3200,8 +3225,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3215,7 +3240,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -3236,8 +3261,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -3248,8 +3273,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3263,7 +3288,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3322,7 +3347,7 @@ describe("CheckoutClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -3344,7 +3369,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -3394,7 +3419,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -3404,7 +3429,7 @@ describe("CheckoutClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -3414,7 +3439,7 @@ describe("CheckoutClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, success: true, }, @@ -3431,15 +3456,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan") @@ -3463,21 +3489,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3491,15 +3517,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan") @@ -3523,21 +3550,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3551,15 +3578,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan") @@ -3583,21 +3611,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3611,15 +3639,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan") @@ -3643,21 +3672,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3671,15 +3700,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan") @@ -3703,21 +3733,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3730,41 +3760,41 @@ describe("CheckoutClient", () => { const rawRequestBody = { add_on_selections: [{ plan_id: "plan_id" }], company_id: "company_id", - credit_bundles: [{ bundle_id: "bundle_id", quantity: 1 }], - pay_in_advance_entitlements: [{ price_id: "price_id", quantity: 1 }], + credit_bundles: [{ bundle_id: "bundle_id", quantity: 1000000 }], + pay_in_advance_entitlements: [{ price_id: "price_id", quantity: 1000000 }], }; const rawResponseBody = { data: { subscription_change_preview: { - amount_off: 1, - due_now: 1, + amount_off: 1000000, + due_now: 1000000, finance: { - amount_off: 1, - due_now: 1, - new_charges: 1, + amount_off: 1000000, + due_now: 1000000, + new_charges: 1000000, percent_off: 1.1, period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, - proration: 1, + proration: 1000000, tax_require_billing_details: true, - total_per_billing_period: 1, + total_per_billing_period: 1000000, upcoming_invoice_line_items: [ { - amount: 1, + amount: 1000000, description: "description", price_id: "price_id", proration: true, - quantity: 1, + quantity: 1000000, }, ], }, is_scheduled_downgrade: true, - new_charges: 1, + new_charges: 1000000, payment_method_required: true, percent_off: 1.1, period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, - proration: 1, + proration: 1000000, scheduled_change_time: "2024-01-15T09:30:00Z", usage_violations: [ { @@ -3778,6 +3808,7 @@ describe("CheckoutClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -3797,48 +3828,48 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); expect(response).toEqual({ data: { subscriptionChangePreview: { - amountOff: 1, - dueNow: 1, + amountOff: 1000000, + dueNow: 1000000, finance: { - amountOff: 1, - dueNow: 1, - newCharges: 1, + amountOff: 1000000, + dueNow: 1000000, + newCharges: 1000000, percentOff: 1.1, periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, - proration: 1, + proration: 1000000, taxRequireBillingDetails: true, - totalPerBillingPeriod: 1, + totalPerBillingPeriod: 1000000, upcomingInvoiceLineItems: [ { - amount: 1, + amount: 1000000, description: "description", priceId: "price_id", proration: true, - quantity: 1, + quantity: 1000000, }, ], }, isScheduledDowngrade: true, - newCharges: 1, + newCharges: 1000000, paymentMethodRequired: true, percentOff: 1.1, periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, - proration: 1, + proration: 1000000, scheduledChangeTime: new Date("2024-01-15T09:30:00.000Z"), usageViolations: [ { @@ -3863,15 +3894,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -3895,21 +3927,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3923,15 +3955,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -3955,21 +3988,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -3983,15 +4016,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -4015,21 +4049,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -4043,15 +4077,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -4075,21 +4110,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -4103,15 +4138,16 @@ describe("CheckoutClient", () => { add_on_selections: [{ plan_id: "plan_id" }, { plan_id: "plan_id" }], company_id: "company_id", credit_bundles: [ - { bundle_id: "bundle_id", quantity: 1 }, - { bundle_id: "bundle_id", quantity: 1 }, + { bundle_id: "bundle_id", quantity: 1000000 }, + { bundle_id: "bundle_id", quantity: 1000000 }, ], pay_in_advance_entitlements: [ - { price_id: "price_id", quantity: 1 }, - { price_id: "price_id", quantity: 1 }, + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/preview") @@ -4135,21 +4171,21 @@ describe("CheckoutClient", () => { creditBundles: [ { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, { bundleId: "bundle_id", - quantity: 1, + quantity: 1000000, }, ], payInAdvanceEntitlements: [ { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, { priceId: "price_id", - quantity: 1, + quantity: 1000000, }, ], }); @@ -4170,7 +4206,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -4202,8 +4238,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -4214,8 +4250,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4229,7 +4265,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -4250,8 +4286,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -4262,8 +4298,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4277,7 +4313,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -4330,7 +4366,7 @@ describe("CheckoutClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -4352,7 +4388,7 @@ describe("CheckoutClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -4397,7 +4433,7 @@ describe("CheckoutClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -4407,7 +4443,7 @@ describe("CheckoutClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -4415,12 +4451,13 @@ describe("CheckoutClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, success: true, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4443,7 +4480,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -4477,8 +4514,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -4489,8 +4526,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -4504,7 +4541,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -4525,8 +4562,8 @@ describe("CheckoutClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -4537,8 +4574,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -4552,7 +4589,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4611,7 +4648,7 @@ describe("CheckoutClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -4633,7 +4670,7 @@ describe("CheckoutClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -4683,7 +4720,7 @@ describe("CheckoutClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -4693,7 +4730,7 @@ describe("CheckoutClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -4703,7 +4740,7 @@ describe("CheckoutClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, success: true, }, @@ -4718,6 +4755,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4739,6 +4777,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4760,6 +4799,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4781,6 +4821,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4802,6 +4843,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/manage-plan/subscription/cancel") @@ -4825,7 +4867,7 @@ describe("CheckoutClient", () => { const rawResponseBody = { data: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4847,9 +4889,9 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4863,7 +4905,7 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, @@ -4875,8 +4917,8 @@ describe("CheckoutClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4888,8 +4930,8 @@ describe("CheckoutClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -4900,8 +4942,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4915,12 +4957,13 @@ describe("CheckoutClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, params: { key: "value" }, }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") @@ -4934,7 +4977,7 @@ describe("CheckoutClient", () => { expect(response).toEqual({ data: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4956,9 +4999,9 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4972,7 +5015,7 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -4986,8 +5029,8 @@ describe("CheckoutClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4999,8 +5042,8 @@ describe("CheckoutClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -5011,8 +5054,8 @@ describe("CheckoutClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -5026,8 +5069,8 @@ describe("CheckoutClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, params: { @@ -5041,6 +5084,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") @@ -5060,6 +5104,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") @@ -5079,6 +5124,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") @@ -5098,6 +5144,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") @@ -5117,6 +5164,7 @@ describe("CheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/subscription/subscription_id/edit-trial-end") diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 86210aa9..4ec66743 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -19,7 +19,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -51,8 +51,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -63,8 +63,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -78,7 +78,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -99,8 +99,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -111,8 +111,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -126,7 +126,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -179,7 +179,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -201,7 +201,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -246,7 +246,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -256,7 +256,7 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -264,15 +264,15 @@ describe("CompaniesClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, ], params: { credit_type_ids: ["credit_type_ids"], ids: ["ids"], - limit: 1, + limit: 1000000, monetized_subscriptions: true, - offset: 1, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", @@ -288,6 +288,7 @@ describe("CompaniesClient", () => { without_subscription: true, }, }; + server.mockEndpoint().get("/companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listCompanies({ @@ -302,8 +303,8 @@ describe("CompaniesClient", () => { withoutPlan: true, withoutSubscription: true, withSubscription: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -315,7 +316,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -349,8 +350,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -361,8 +362,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -376,7 +377,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -397,8 +398,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -409,8 +410,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -424,7 +425,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -483,7 +484,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -505,7 +506,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -555,7 +556,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -565,7 +566,7 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -575,15 +576,15 @@ describe("CompaniesClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, ], params: { creditTypeIds: ["credit_type_ids"], ids: ["ids"], - limit: 1, + limit: 1000000, monetizedSubscriptions: true, - offset: 1, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -606,6 +607,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -618,6 +620,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -630,6 +633,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -642,6 +646,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -654,6 +659,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -674,7 +680,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -690,7 +696,7 @@ describe("CompaniesClient", () => { billing_credit_balances: { key: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -712,9 +718,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -722,7 +728,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, metadata: { key: "value" }, @@ -736,8 +742,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -748,8 +754,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -763,8 +769,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ @@ -786,8 +792,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -798,8 +804,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -813,7 +819,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -824,8 +830,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -876,7 +882,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -903,7 +909,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -915,7 +921,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [{ id: "id", name: "name" }], @@ -951,7 +957,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -961,20 +967,21 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/companies") @@ -998,7 +1005,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1016,7 +1023,7 @@ describe("CompaniesClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1038,9 +1045,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -1048,7 +1055,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metadata: { @@ -1064,8 +1071,8 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1076,8 +1083,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1091,8 +1098,8 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ @@ -1114,8 +1121,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1126,8 +1133,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1141,7 +1148,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1152,8 +1159,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1210,7 +1217,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1237,7 +1244,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1249,7 +1256,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -1290,7 +1297,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -1300,11 +1307,11 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -1312,7 +1319,7 @@ describe("CompaniesClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { key: "value", @@ -1325,6 +1332,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies") @@ -1348,6 +1356,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies") @@ -1371,6 +1380,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies") @@ -1394,6 +1404,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies") @@ -1417,6 +1428,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies") @@ -1448,7 +1460,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1464,7 +1476,7 @@ describe("CompaniesClient", () => { billing_credit_balances: { key: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1486,9 +1498,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -1496,7 +1508,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, metadata: { key: "value" }, @@ -1510,8 +1522,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1522,8 +1534,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1537,8 +1549,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ @@ -1560,8 +1572,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1572,8 +1584,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1587,7 +1599,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -1598,8 +1610,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1650,7 +1662,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1677,7 +1689,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1689,7 +1701,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [{ id: "id", name: "name" }], @@ -1725,7 +1737,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -1735,20 +1747,21 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .get("/companies/company_id") @@ -1767,7 +1780,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1785,7 +1798,7 @@ describe("CompaniesClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1807,9 +1820,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -1817,7 +1830,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metadata: { @@ -1833,8 +1846,8 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1845,8 +1858,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1860,8 +1873,8 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ @@ -1883,8 +1896,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1895,8 +1908,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1910,7 +1923,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1921,8 +1934,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1979,7 +1992,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2006,7 +2019,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2018,7 +2031,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -2059,7 +2072,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -2069,11 +2082,11 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -2081,7 +2094,7 @@ describe("CompaniesClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { key: "value", @@ -2094,6 +2107,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/companies/company_id") @@ -2112,6 +2126,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/companies/company_id") @@ -2130,6 +2145,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/companies/company_id") @@ -2148,6 +2164,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/companies/company_id") @@ -2166,6 +2183,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { cancel_subscription: true, prorate: true } }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2194,6 +2212,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2212,6 +2231,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2230,6 +2250,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2248,6 +2269,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2266,6 +2288,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/companies/company_id") @@ -2288,9 +2311,9 @@ describe("CompaniesClient", () => { params: { credit_type_ids: ["credit_type_ids"], ids: ["ids"], - limit: 1, + limit: 1000000, monetized_subscriptions: true, - offset: 1, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", @@ -2306,6 +2329,7 @@ describe("CompaniesClient", () => { without_subscription: true, }, }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.countCompanies({ @@ -2320,8 +2344,8 @@ describe("CompaniesClient", () => { withoutPlan: true, withoutSubscription: true, withSubscription: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -2330,9 +2354,9 @@ describe("CompaniesClient", () => { params: { creditTypeIds: ["credit_type_ids"], ids: ["ids"], - limit: 1, + limit: 1000000, monetizedSubscriptions: true, - offset: 1, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -2355,6 +2379,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2367,6 +2392,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2379,6 +2405,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2391,6 +2418,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2403,6 +2431,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2423,7 +2452,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -2439,7 +2468,7 @@ describe("CompaniesClient", () => { billing_credit_balances: { key: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -2461,9 +2490,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -2471,7 +2500,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, metadata: { key: "value" }, @@ -2485,8 +2514,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2497,8 +2526,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2512,8 +2541,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ @@ -2535,8 +2564,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2547,8 +2576,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2562,7 +2591,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -2573,8 +2602,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -2625,7 +2654,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2652,7 +2681,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -2664,7 +2693,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [{ id: "id", name: "name" }], @@ -2700,7 +2729,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -2710,20 +2739,21 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/companies/create") @@ -2747,7 +2777,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2765,7 +2795,7 @@ describe("CompaniesClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2787,9 +2817,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -2797,7 +2827,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metadata: { @@ -2813,8 +2843,8 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2825,8 +2855,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2840,8 +2870,8 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ @@ -2863,8 +2893,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2875,8 +2905,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2890,7 +2920,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2901,8 +2931,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2959,7 +2989,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2986,7 +3016,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2998,7 +3028,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -3039,7 +3069,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -3049,11 +3079,11 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -3061,7 +3091,7 @@ describe("CompaniesClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { key: "value", @@ -3074,6 +3104,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/create") @@ -3097,6 +3128,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/create") @@ -3120,6 +3152,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/create") @@ -3143,6 +3176,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/create") @@ -3166,6 +3200,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/create") @@ -3200,6 +3235,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/companies/delete") @@ -3235,6 +3271,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/delete") @@ -3258,6 +3295,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/delete") @@ -3281,6 +3319,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/delete") @@ -3304,6 +3343,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/delete") @@ -3327,6 +3367,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/companies/delete") @@ -3361,13 +3402,13 @@ describe("CompaniesClient", () => { image_url: "image_url", included_credit_grants: [ { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -3375,7 +3416,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -3390,8 +3431,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -3402,7 +3443,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -3420,14 +3461,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -3440,13 +3481,13 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -3454,7 +3495,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -3469,8 +3510,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -3481,7 +3522,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -3499,14 +3540,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -3521,7 +3562,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, { @@ -3533,13 +3574,13 @@ describe("CompaniesClient", () => { image_url: "image_url", included_credit_grants: [ { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -3547,7 +3588,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -3562,8 +3603,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -3574,7 +3615,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -3592,14 +3633,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -3612,13 +3653,13 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -3626,7 +3667,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -3641,8 +3682,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -3653,7 +3694,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -3671,14 +3712,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -3693,14 +3734,14 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, ], billing_credit_balances: { billing_credit_balances: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3709,14 +3750,14 @@ describe("CompaniesClient", () => { default_payment_method_id: "default_payment_method_id", discounts: [ { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -3725,14 +3766,14 @@ describe("CompaniesClient", () => { subscription_external_id: "subscription_external_id", }, { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -3745,9 +3786,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3761,7 +3802,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, @@ -3773,8 +3814,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3786,12 +3827,12 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -3800,23 +3841,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -3828,7 +3869,7 @@ describe("CompaniesClient", () => { }, { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -3837,23 +3878,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -3867,14 +3908,14 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3883,14 +3924,14 @@ describe("CompaniesClient", () => { default_payment_method_id: "default_payment_method_id", discounts: [ { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -3899,14 +3940,14 @@ describe("CompaniesClient", () => { subscription_external_id: "subscription_external_id", }, { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -3919,9 +3960,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3935,7 +3976,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, @@ -3947,8 +3988,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -3960,12 +4001,12 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -3974,23 +4015,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -4002,7 +4043,7 @@ describe("CompaniesClient", () => { }, { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -4011,23 +4052,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -4041,13 +4082,13 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4056,14 +4097,14 @@ describe("CompaniesClient", () => { default_payment_method_id: "default_payment_method_id", discounts: [ { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -4072,14 +4113,14 @@ describe("CompaniesClient", () => { subscription_external_id: "subscription_external_id", }, { - amount_off: 1, + amount_off: 1000000, coupon_id: "coupon_id", coupon_name: "coupon_name", currency: "currency", customer_facing_code: "customer_facing_code", discount_external_id: "discount_external_id", duration: "duration", - duration_in_months: 1, + duration_in_months: 1000000, ended_at: "2024-01-15T09:30:00Z", is_active: true, percent_off: 1.1, @@ -4092,9 +4133,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4108,7 +4149,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, @@ -4120,8 +4161,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4133,12 +4174,12 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -4147,23 +4188,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -4175,7 +4216,7 @@ describe("CompaniesClient", () => { }, { billing_scheme: "per_unit", - billing_threshold: 1, + billing_threshold: 1000000, created_at: "2024-01-15T09:30:00Z", currency: "currency", environment_id: "environment_id", @@ -4184,23 +4225,23 @@ describe("CompaniesClient", () => { interval: "interval", meter_id: "meter_id", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], provider_type: "schematic", @@ -4214,8 +4255,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, ], @@ -4227,8 +4268,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4242,7 +4283,7 @@ describe("CompaniesClient", () => { }, entitlements: [ { - allocation: 1, + allocation: 1000000, credit_id: "credit_id", credit_remaining: 1.1, credit_total: 1.1, @@ -4253,12 +4294,12 @@ describe("CompaniesClient", () => { metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", month_reset: "first_of_month", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, value_type: "boolean", }, { - allocation: 1, + allocation: 1000000, credit_id: "credit_id", credit_remaining: 1.1, credit_total: 1.1, @@ -4269,8 +4310,8 @@ describe("CompaniesClient", () => { metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", month_reset: "first_of_month", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, value_type: "boolean", }, ], @@ -4364,7 +4405,7 @@ describe("CompaniesClient", () => { month_reset: "month_reset", period: "period", valid_until: "2024-01-15T09:30:00Z", - value: 1, + value: 1000000, }, { account_id: "account_id", @@ -4377,7 +4418,7 @@ describe("CompaniesClient", () => { month_reset: "month_reset", period: "period", valid_until: "2024-01-15T09:30:00Z", - value: 1, + value: 1000000, }, ], name: "name", @@ -4389,8 +4430,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4409,8 +4450,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -4432,13 +4473,13 @@ describe("CompaniesClient", () => { image_url: "image_url", included_credit_grants: [ { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -4446,7 +4487,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -4461,8 +4502,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -4473,7 +4514,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -4491,14 +4532,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -4511,13 +4552,13 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, { - billing_credit_auto_topup_amount: 1, + billing_credit_auto_topup_amount: 1000000, billing_credit_auto_topup_amount_type: "billing_credit_auto_topup_amount_type", billing_credit_auto_topup_enabled: true, billing_credit_auto_topup_expiry_type: "duration", billing_credit_auto_topup_expiry_unit: "billing_periods", - billing_credit_auto_topup_expiry_unit_count: 1, - billing_credit_auto_topup_threshold_percent: 1, + billing_credit_auto_topup_expiry_unit_count: 1000000, + billing_credit_auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { account_id: "account_id", @@ -4525,7 +4566,7 @@ describe("CompaniesClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", environment_id: "environment_id", @@ -4540,8 +4581,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [], @@ -4552,7 +4593,7 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - price_per_unit: 1, + price_per_unit: 1000000, price_per_unit_decimal: "price_per_unit_decimal", product: { account_id: "account_id", @@ -4570,14 +4611,14 @@ describe("CompaniesClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_icon: "credit_icon", credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -4592,7 +4633,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [ @@ -4620,7 +4661,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4641,7 +4682,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4666,7 +4707,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4687,7 +4728,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4712,7 +4753,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4733,7 +4774,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4744,7 +4785,7 @@ describe("CompaniesClient", () => { flag_id: "flag_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -4768,7 +4809,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4789,7 +4830,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4814,7 +4855,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4835,7 +4876,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4860,7 +4901,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4881,7 +4922,7 @@ describe("CompaniesClient", () => { id: "id", metric_period: "all_time", metric_period_month_reset: "first_of_month", - metric_value: 1, + metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], trait_definition: { comparable_type: "bool", entity_type: "company", id: "id" }, @@ -4892,7 +4933,7 @@ describe("CompaniesClient", () => { flag_id: "flag_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -4902,20 +4943,21 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { traits: { key: "value" } }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { keys: { keys: "keys" } }, }; + server.mockEndpoint().get("/companies/lookup").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.lookupCompany({ @@ -4935,13 +4977,13 @@ describe("CompaniesClient", () => { imageUrl: "image_url", includedCreditGrants: [ { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -4949,7 +4991,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -4964,8 +5006,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -4976,7 +5018,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -4994,14 +5036,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -5019,13 +5061,13 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -5033,7 +5075,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -5048,8 +5090,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -5060,7 +5102,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -5078,14 +5120,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -5105,7 +5147,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, { @@ -5117,13 +5159,13 @@ describe("CompaniesClient", () => { imageUrl: "image_url", includedCreditGrants: [ { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -5131,7 +5173,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -5146,8 +5188,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -5158,7 +5200,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -5176,14 +5218,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -5201,13 +5243,13 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -5215,7 +5257,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -5230,8 +5272,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -5242,7 +5284,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -5260,14 +5302,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -5287,7 +5329,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, ], @@ -5296,7 +5338,7 @@ describe("CompaniesClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5305,14 +5347,14 @@ describe("CompaniesClient", () => { defaultPaymentMethodId: "default_payment_method_id", discounts: [ { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5321,14 +5363,14 @@ describe("CompaniesClient", () => { subscriptionExternalId: "subscription_external_id", }, { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5341,9 +5383,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5357,7 +5399,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -5373,8 +5415,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5386,12 +5428,12 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5400,23 +5442,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5428,7 +5470,7 @@ describe("CompaniesClient", () => { }, { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5437,23 +5479,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5467,14 +5509,14 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5483,14 +5525,14 @@ describe("CompaniesClient", () => { defaultPaymentMethodId: "default_payment_method_id", discounts: [ { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5499,14 +5541,14 @@ describe("CompaniesClient", () => { subscriptionExternalId: "subscription_external_id", }, { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5519,9 +5561,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5535,7 +5577,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -5551,8 +5593,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5564,12 +5606,12 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5578,23 +5620,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5606,7 +5648,7 @@ describe("CompaniesClient", () => { }, { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5615,23 +5657,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5645,13 +5687,13 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5660,14 +5702,14 @@ describe("CompaniesClient", () => { defaultPaymentMethodId: "default_payment_method_id", discounts: [ { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5676,14 +5718,14 @@ describe("CompaniesClient", () => { subscriptionExternalId: "subscription_external_id", }, { - amountOff: 1, + amountOff: 1000000, couponId: "coupon_id", couponName: "coupon_name", currency: "currency", customerFacingCode: "customer_facing_code", discountExternalId: "discount_external_id", duration: "duration", - durationInMonths: 1, + durationInMonths: 1000000, endedAt: new Date("2024-01-15T09:30:00.000Z"), isActive: true, percentOff: 1.1, @@ -5696,9 +5738,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5712,7 +5754,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -5728,8 +5770,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5741,12 +5783,12 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5755,23 +5797,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5783,7 +5825,7 @@ describe("CompaniesClient", () => { }, { billingScheme: "per_unit", - billingThreshold: 1, + billingThreshold: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", environmentId: "environment_id", @@ -5792,23 +5834,23 @@ describe("CompaniesClient", () => { interval: "interval", meterId: "meter_id", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], providerType: "schematic", @@ -5822,8 +5864,8 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, ], @@ -5835,8 +5877,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5850,7 +5892,7 @@ describe("CompaniesClient", () => { }, entitlements: [ { - allocation: 1, + allocation: 1000000, creditId: "credit_id", creditRemaining: 1.1, creditTotal: 1.1, @@ -5861,12 +5903,12 @@ describe("CompaniesClient", () => { metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), monthReset: "first_of_month", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, valueType: "boolean", }, { - allocation: 1, + allocation: 1000000, creditId: "credit_id", creditRemaining: 1.1, creditTotal: 1.1, @@ -5877,8 +5919,8 @@ describe("CompaniesClient", () => { metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), monthReset: "first_of_month", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, valueType: "boolean", }, ], @@ -5972,7 +6014,7 @@ describe("CompaniesClient", () => { monthReset: "month_reset", period: "period", validUntil: new Date("2024-01-15T09:30:00.000Z"), - value: 1, + value: 1000000, }, { accountId: "account_id", @@ -5985,7 +6027,7 @@ describe("CompaniesClient", () => { monthReset: "month_reset", period: "period", validUntil: new Date("2024-01-15T09:30:00.000Z"), - value: 1, + value: 1000000, }, ], name: "name", @@ -5997,8 +6039,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -6017,8 +6059,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -6040,13 +6082,13 @@ describe("CompaniesClient", () => { imageUrl: "image_url", includedCreditGrants: [ { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -6054,7 +6096,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -6069,8 +6111,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -6081,7 +6123,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -6099,14 +6141,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -6124,13 +6166,13 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, { - billingCreditAutoTopupAmount: 1, + billingCreditAutoTopupAmount: 1000000, billingCreditAutoTopupAmountType: "billing_credit_auto_topup_amount_type", billingCreditAutoTopupEnabled: true, billingCreditAutoTopupExpiryType: "duration", billingCreditAutoTopupExpiryUnit: "billing_periods", - billingCreditAutoTopupExpiryUnitCount: 1, - billingCreditAutoTopupThresholdPercent: 1, + billingCreditAutoTopupExpiryUnitCount: 1000000, + billingCreditAutoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { accountId: "account_id", @@ -6138,7 +6180,7 @@ describe("CompaniesClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", environmentId: "environment_id", @@ -6153,8 +6195,8 @@ describe("CompaniesClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [], @@ -6165,7 +6207,7 @@ describe("CompaniesClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - pricePerUnit: 1, + pricePerUnit: 1000000, pricePerUnitDecimal: "price_per_unit_decimal", product: { accountId: "account_id", @@ -6183,14 +6225,14 @@ describe("CompaniesClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditIcon: "credit_icon", creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -6210,7 +6252,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -6248,7 +6290,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6273,7 +6315,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6302,7 +6344,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6327,7 +6369,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6356,7 +6398,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6381,7 +6423,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6396,7 +6438,7 @@ describe("CompaniesClient", () => { flagId: "flag_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -6420,7 +6462,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6445,7 +6487,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6474,7 +6516,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6499,7 +6541,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6528,7 +6570,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6553,7 +6595,7 @@ describe("CompaniesClient", () => { id: "id", metricPeriod: "all_time", metricPeriodMonthReset: "first_of_month", - metricValue: 1, + metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], traitDefinition: { @@ -6568,7 +6610,7 @@ describe("CompaniesClient", () => { flagId: "flag_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -6578,11 +6620,11 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -6592,7 +6634,7 @@ describe("CompaniesClient", () => { }, }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { keys: { @@ -6607,6 +6649,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/lookup").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -6623,6 +6666,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/lookup").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -6639,6 +6683,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/lookup").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -6655,6 +6700,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/companies/lookup").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -6687,8 +6733,9 @@ describe("CompaniesClient", () => { user_id: "user_id", }, ], - params: { company_id: "company_id", limit: 1, offset: 1, user_id: "user_id" }, + params: { company_id: "company_id", limit: 1000000, offset: 1000000, user_id: "user_id" }, }; + server .mockEndpoint() .get("/company-memberships") @@ -6700,8 +6747,8 @@ describe("CompaniesClient", () => { const response = await client.companies.listCompanyMemberships({ companyId: "company_id", userId: "user_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -6722,8 +6769,8 @@ describe("CompaniesClient", () => { ], params: { companyId: "company_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, userId: "user_id", }, }); @@ -6734,6 +6781,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-memberships") @@ -6752,6 +6800,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-memberships") @@ -6770,6 +6819,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-memberships") @@ -6788,6 +6838,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-memberships") @@ -6806,6 +6857,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-memberships") @@ -6842,6 +6894,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/company-memberships") @@ -6883,6 +6936,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", user_id: "user_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-memberships") @@ -6905,6 +6959,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", user_id: "user_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-memberships") @@ -6927,6 +6982,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", user_id: "user_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-memberships") @@ -6949,6 +7005,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", user_id: "user_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-memberships") @@ -6971,6 +7028,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", user_id: "user_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-memberships") @@ -6993,6 +7051,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7017,6 +7076,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7035,6 +7095,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7053,6 +7114,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7071,6 +7133,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7089,6 +7152,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-memberships/company_membership_id") @@ -7127,9 +7191,9 @@ describe("CompaniesClient", () => { expired_at: "2024-01-15T09:30:00Z", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -7137,7 +7201,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, payment_method: { @@ -7160,8 +7224,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -7174,12 +7238,13 @@ describe("CompaniesClient", () => { ], status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, trial_end: "2024-01-15T09:30:00Z", }, ], - params: { company_id: "company_id", company_ids: ["company_ids"], limit: 1, offset: 1 }, + params: { company_id: "company_id", company_ids: ["company_ids"], limit: 1000000, offset: 1000000 }, }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7190,8 +7255,8 @@ describe("CompaniesClient", () => { const response = await client.companies.getActiveCompanySubscription({ companyId: "company_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -7214,9 +7279,9 @@ describe("CompaniesClient", () => { expiredAt: new Date("2024-01-15T09:30:00.000Z"), interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -7224,7 +7289,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, paymentMethod: { @@ -7247,8 +7312,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -7261,15 +7326,15 @@ describe("CompaniesClient", () => { ], status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, trialEnd: new Date("2024-01-15T09:30:00.000Z"), }, ], params: { companyId: "company_id", companyIds: ["company_ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -7279,6 +7344,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7297,6 +7363,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7315,6 +7382,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7333,6 +7401,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7351,6 +7420,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-subscriptions") @@ -7377,7 +7447,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -7393,7 +7463,7 @@ describe("CompaniesClient", () => { billing_credit_balances: { key: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -7415,9 +7485,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -7425,7 +7495,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, metadata: { key: "value" }, @@ -7439,8 +7509,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -7451,8 +7521,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -7466,8 +7536,8 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ @@ -7489,8 +7559,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -7501,8 +7571,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -7516,7 +7586,7 @@ describe("CompaniesClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -7527,8 +7597,8 @@ describe("CompaniesClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -7579,7 +7649,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -7606,7 +7676,7 @@ describe("CompaniesClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -7618,7 +7688,7 @@ describe("CompaniesClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [{ id: "id", name: "name" }], @@ -7654,7 +7724,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -7664,20 +7734,21 @@ describe("CompaniesClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/company-traits") @@ -7702,7 +7773,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -7720,7 +7791,7 @@ describe("CompaniesClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -7742,9 +7813,9 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -7752,7 +7823,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metadata: { @@ -7768,8 +7839,8 @@ describe("CompaniesClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -7780,8 +7851,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -7795,8 +7866,8 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ @@ -7818,8 +7889,8 @@ describe("CompaniesClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -7830,8 +7901,8 @@ describe("CompaniesClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -7845,7 +7916,7 @@ describe("CompaniesClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -7856,8 +7927,8 @@ describe("CompaniesClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -7914,7 +7985,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -7941,7 +8012,7 @@ describe("CompaniesClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -7953,7 +8024,7 @@ describe("CompaniesClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -7994,7 +8065,7 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -8004,11 +8075,11 @@ describe("CompaniesClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -8016,7 +8087,7 @@ describe("CompaniesClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { key: "value", @@ -8029,6 +8100,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-traits") @@ -8053,6 +8125,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-traits") @@ -8077,6 +8150,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-traits") @@ -8101,6 +8175,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-traits") @@ -8125,6 +8200,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-traits") @@ -8158,8 +8234,9 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { entity_type: "company", ids: ["ids"], limit: 1, offset: 1, q: "q" }, + params: { entity_type: "company", ids: ["ids"], limit: 1000000, offset: 1000000, q: "q" }, }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8171,8 +8248,8 @@ describe("CompaniesClient", () => { const response = await client.companies.listEntityKeyDefinitions({ entityType: "company", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -8187,8 +8264,8 @@ describe("CompaniesClient", () => { params: { entityType: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -8199,6 +8276,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8217,6 +8295,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8235,6 +8314,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8253,6 +8333,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8271,6 +8352,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions") @@ -8290,8 +8372,9 @@ describe("CompaniesClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { entity_type: "company", ids: ["ids"], limit: 1, offset: 1, q: "q" }, + params: { entity_type: "company", ids: ["ids"], limit: 1000000, offset: 1000000, q: "q" }, }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8303,8 +8386,8 @@ describe("CompaniesClient", () => { const response = await client.companies.countEntityKeyDefinitions({ entityType: "company", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -8313,8 +8396,8 @@ describe("CompaniesClient", () => { params: { entityType: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -8325,6 +8408,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8343,6 +8427,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8361,6 +8446,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8379,6 +8465,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8397,6 +8484,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-key-definitions/count") @@ -8429,13 +8517,14 @@ describe("CompaniesClient", () => { params: { entity_type: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", trait_type: "boolean", trait_types: ["boolean"], }, }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8448,8 +8537,8 @@ describe("CompaniesClient", () => { entityType: "company", q: "q", traitType: "boolean", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -8466,8 +8555,8 @@ describe("CompaniesClient", () => { params: { entityType: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", traitType: "boolean", traitTypes: ["boolean"], @@ -8480,6 +8569,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8498,6 +8588,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8516,6 +8607,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8534,6 +8626,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8552,6 +8645,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions") @@ -8581,6 +8675,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8616,6 +8711,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "company", hierarchy: ["hierarchy", "hierarchy"], trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8639,6 +8735,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "company", hierarchy: ["hierarchy", "hierarchy"], trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8662,6 +8759,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "company", hierarchy: ["hierarchy", "hierarchy"], trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8685,6 +8783,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "company", hierarchy: ["hierarchy", "hierarchy"], trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8708,6 +8807,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "company", hierarchy: ["hierarchy", "hierarchy"], trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/entity-trait-definitions") @@ -8742,6 +8842,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/entity-trait-definitions/entity_trait_definition_id") @@ -8772,6 +8873,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/entity_trait_definition_id") @@ -8790,6 +8892,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/entity_trait_definition_id") @@ -8808,6 +8911,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/entity_trait_definition_id") @@ -8826,6 +8930,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/entity_trait_definition_id") @@ -8855,6 +8960,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8888,6 +8994,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8909,6 +9016,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8930,6 +9038,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8951,6 +9060,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8972,6 +9082,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { trait_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/entity-trait-definitions/entity_trait_definition_id") @@ -8997,13 +9108,14 @@ describe("CompaniesClient", () => { params: { entity_type: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", trait_type: "boolean", trait_types: ["boolean"], }, }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9016,8 +9128,8 @@ describe("CompaniesClient", () => { entityType: "company", q: "q", traitType: "boolean", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -9026,8 +9138,8 @@ describe("CompaniesClient", () => { params: { entityType: "company", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", traitType: "boolean", traitTypes: ["boolean"], @@ -9040,6 +9152,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9058,6 +9171,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9076,6 +9190,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9094,6 +9209,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9112,6 +9228,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-definitions/count") @@ -9131,8 +9248,9 @@ describe("CompaniesClient", () => { const rawResponseBody = { data: [{ definition_id: "definition_id", value: "value" }], - params: { definition_id: "definition_id", limit: 1, offset: 1, q: "q" }, + params: { definition_id: "definition_id", limit: 1000000, offset: 1000000, q: "q" }, }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9144,8 +9262,8 @@ describe("CompaniesClient", () => { const response = await client.companies.getEntityTraitValues({ definitionId: "definition_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -9156,8 +9274,8 @@ describe("CompaniesClient", () => { ], params: { definitionId: "definition_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -9168,6 +9286,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9188,6 +9307,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9208,6 +9328,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9228,6 +9349,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9248,6 +9370,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/entity-trait-values") @@ -9295,7 +9418,7 @@ describe("CompaniesClient", () => { }, base_plan: { deleted: true, description: "description", icon: "icon", id: "id", name: "name" }, base_plan_action: "fallback", - base_plan_version: { id: "id", name: "name", version: 1 }, + base_plan_version: { id: "id", name: "name", version: 1000000 }, company: { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -9314,7 +9437,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", }, - previous_base_plan_version: { id: "id", name: "name", version: 1 }, + previous_base_plan_version: { id: "id", name: "name", version: 1000000 }, request_id: "request_id", subscription_change_action: "adjustment", traits_updated: [ @@ -9338,19 +9461,20 @@ describe("CompaniesClient", () => { base_plan_action: "base_plan_action", company_id: "company_id", company_ids: ["company_ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_ids: ["plan_ids"], }, }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listPlanChanges({ action: "action", basePlanAction: "base_plan_action", companyId: "company_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -9401,7 +9525,7 @@ describe("CompaniesClient", () => { basePlanVersion: { id: "id", name: "name", - version: 1, + version: 1000000, }, company: { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9424,7 +9548,7 @@ describe("CompaniesClient", () => { previousBasePlanVersion: { id: "id", name: "name", - version: 1, + version: 1000000, }, requestId: "request_id", subscriptionChangeAction: "adjustment", @@ -9449,8 +9573,8 @@ describe("CompaniesClient", () => { basePlanAction: "base_plan_action", companyId: "company_id", companyIds: ["company_ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planIds: ["plan_ids"], }, }); @@ -9461,6 +9585,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9473,6 +9598,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9485,6 +9611,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9497,6 +9624,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9509,6 +9637,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-changes").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9544,11 +9673,11 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", method: "method", - resource_id: 1, + resource_id: 1000000, resource_id_string: "resource_id_string", resource_name: "resource_name", resource_type: "resource_type", - resp_code: 1, + resp_code: 1000000, secondary_resource: "secondary_resource", started_at: "2024-01-15T09:30:00Z", url: "url", @@ -9556,7 +9685,7 @@ describe("CompaniesClient", () => { }, base_plan: { deleted: true, description: "description", icon: "icon", id: "id", name: "name" }, base_plan_action: "fallback", - base_plan_version: { id: "id", name: "name", version: 1 }, + base_plan_version: { id: "id", name: "name", version: 1000000 }, company: { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -9571,7 +9700,7 @@ describe("CompaniesClient", () => { environment_id: "environment_id", id: "id", previous_base_plan: { deleted: true, description: "description", icon: "icon", id: "id", name: "name" }, - previous_base_plan_version: { id: "id", name: "name", version: 1 }, + previous_base_plan_version: { id: "id", name: "name", version: 1000000 }, request_id: "request_id", subscription_change_action: "adjustment", traits_updated: [ @@ -9591,6 +9720,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/plan-changes/plan_change_id") @@ -9640,11 +9770,11 @@ describe("CompaniesClient", () => { environmentId: "environment_id", id: "id", method: "method", - resourceId: 1, + resourceId: 1000000, resourceIdString: "resource_id_string", resourceName: "resource_name", resourceType: "resource_type", - respCode: 1, + respCode: 1000000, secondaryResource: "secondary_resource", startedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", @@ -9661,7 +9791,7 @@ describe("CompaniesClient", () => { basePlanVersion: { id: "id", name: "name", - version: 1, + version: 1000000, }, company: { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9686,7 +9816,7 @@ describe("CompaniesClient", () => { previousBasePlanVersion: { id: "id", name: "name", - version: 1, + version: 1000000, }, requestId: "request_id", subscriptionChangeAction: "adjustment", @@ -9716,6 +9846,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-changes/plan_change_id") @@ -9734,6 +9865,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-changes/plan_change_id") @@ -9752,6 +9884,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-changes/plan_change_id") @@ -9770,6 +9903,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-changes/plan_change_id") @@ -9803,20 +9937,21 @@ describe("CompaniesClient", () => { ], params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", trait_id: "trait_id", trait_ids: ["trait_ids"], }, }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listPlanTraits({ planId: "plan_id", traitId: "trait_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -9834,8 +9969,8 @@ describe("CompaniesClient", () => { ], params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", traitId: "trait_id", traitIds: ["trait_ids"], @@ -9848,6 +9983,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9860,6 +9996,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9872,6 +10009,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9884,6 +10022,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9896,6 +10035,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -9921,6 +10061,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-traits") @@ -9958,6 +10099,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits") @@ -9981,6 +10123,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits") @@ -10004,6 +10147,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits") @@ -10027,6 +10171,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits") @@ -10050,6 +10195,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits") @@ -10086,6 +10232,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/plan-traits/plan_trait_id") @@ -10118,6 +10265,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-traits/plan_trait_id") @@ -10136,6 +10284,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-traits/plan_trait_id") @@ -10154,6 +10303,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-traits/plan_trait_id") @@ -10172,6 +10322,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-traits/plan_trait_id") @@ -10203,6 +10354,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10239,6 +10391,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10261,6 +10414,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10283,6 +10437,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10305,6 +10460,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10327,6 +10483,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-traits/plan_trait_id") @@ -10349,6 +10506,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10373,6 +10531,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10391,6 +10550,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10409,6 +10569,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10427,6 +10588,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10445,6 +10607,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-traits/plan_trait_id") @@ -10482,6 +10645,7 @@ describe("CompaniesClient", () => { ], params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10533,6 +10697,7 @@ describe("CompaniesClient", () => { ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10572,6 +10737,7 @@ describe("CompaniesClient", () => { ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10611,6 +10777,7 @@ describe("CompaniesClient", () => { ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10650,6 +10817,7 @@ describe("CompaniesClient", () => { ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10689,6 +10857,7 @@ describe("CompaniesClient", () => { ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-traits/bulk") @@ -10724,20 +10893,21 @@ describe("CompaniesClient", () => { data: { count: 1 }, params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", trait_id: "trait_id", trait_ids: ["trait_ids"], }, }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.countPlanTraits({ planId: "plan_id", traitId: "trait_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -10745,8 +10915,8 @@ describe("CompaniesClient", () => { }, params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", traitId: "trait_id", traitIds: ["trait_ids"], @@ -10759,6 +10929,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10771,6 +10942,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10783,6 +10955,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10795,6 +10968,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10807,6 +10981,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10862,6 +11037,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/user-traits") @@ -10932,6 +11108,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/user-traits") @@ -10956,6 +11133,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/user-traits") @@ -10980,6 +11158,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/user-traits") @@ -11004,6 +11183,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/user-traits") @@ -11028,6 +11208,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" }, trait: "trait" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/user-traits") @@ -11095,16 +11276,24 @@ describe("CompaniesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { company_id: "company_id", ids: ["ids"], limit: 1, offset: 1, plan_id: "plan_id", q: "q" }, + params: { + company_id: "company_id", + ids: ["ids"], + limit: 1000000, + offset: 1000000, + plan_id: "plan_id", + q: "q", + }, }; + server.mockEndpoint().get("/users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listUsers({ companyId: "company_id", planId: "plan_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -11155,8 +11344,8 @@ describe("CompaniesClient", () => { params: { companyId: "company_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", q: "q", }, @@ -11168,6 +11357,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11180,6 +11370,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11192,6 +11383,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11204,6 +11396,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11216,6 +11409,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11271,6 +11465,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/users") @@ -11340,6 +11535,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users") @@ -11363,6 +11559,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users") @@ -11386,6 +11583,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users") @@ -11409,6 +11607,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users") @@ -11432,6 +11631,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users") @@ -11498,6 +11698,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server.mockEndpoint().get("/users/user_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.getUser("user_id"); @@ -11556,6 +11757,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/user_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11568,6 +11770,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/user_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11580,6 +11783,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/user_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11592,6 +11796,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/user_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11604,6 +11809,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.deleteUser("user_id"); @@ -11622,6 +11828,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11634,6 +11841,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11646,6 +11854,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11658,6 +11867,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11670,6 +11880,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/users/user_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11683,16 +11894,24 @@ describe("CompaniesClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { company_id: "company_id", ids: ["ids"], limit: 1, offset: 1, plan_id: "plan_id", q: "q" }, + params: { + company_id: "company_id", + ids: ["ids"], + limit: 1000000, + offset: 1000000, + plan_id: "plan_id", + q: "q", + }, }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.countUsers({ companyId: "company_id", planId: "plan_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -11701,8 +11920,8 @@ describe("CompaniesClient", () => { params: { companyId: "company_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", q: "q", }, @@ -11714,6 +11933,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11726,6 +11946,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11738,6 +11959,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11750,6 +11972,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11762,6 +11985,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -11817,6 +12041,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/users/create") @@ -11886,6 +12111,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/create") @@ -11909,6 +12135,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/create") @@ -11932,6 +12159,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/create") @@ -11955,6 +12183,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/create") @@ -11978,6 +12207,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/create") @@ -12011,6 +12241,7 @@ describe("CompaniesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/users/delete") @@ -12045,6 +12276,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/delete") @@ -12068,6 +12300,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/delete") @@ -12091,6 +12324,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/delete") @@ -12114,6 +12348,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/delete") @@ -12137,6 +12372,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { keys: { keys: "keys" } }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/users/delete") @@ -12279,6 +12515,7 @@ describe("CompaniesClient", () => { }, params: { keys: { keys: "keys" } }, }; + server.mockEndpoint().get("/users/lookup").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.lookupUser({ @@ -12421,6 +12658,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/lookup").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -12437,6 +12675,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/lookup").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -12453,6 +12692,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/lookup").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -12469,6 +12709,7 @@ describe("CompaniesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/users/lookup").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 7342968a..6391ebf7 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -21,14 +21,15 @@ describe("ComponentsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { limit: 1, offset: 1, q: "q" }, + params: { limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/components").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.components.listComponents({ q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -45,8 +46,8 @@ describe("ComponentsClient", () => { }, ], params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -57,6 +58,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -69,6 +71,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -81,6 +84,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -93,6 +97,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -105,6 +110,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -128,6 +134,7 @@ describe("ComponentsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/components") @@ -164,6 +171,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "billing", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/components") @@ -186,6 +194,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "billing", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/components") @@ -208,6 +217,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "billing", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/components") @@ -230,6 +240,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "billing", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/components") @@ -252,6 +263,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entity_type: "billing", name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/components") @@ -285,6 +297,7 @@ describe("ComponentsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/components/component_id") @@ -317,6 +330,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/component_id") @@ -335,6 +349,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/component_id") @@ -353,6 +368,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/component_id") @@ -371,6 +387,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/component_id") @@ -400,6 +417,7 @@ describe("ComponentsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/components/component_id") @@ -433,6 +451,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/components/component_id") @@ -452,6 +471,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/components/component_id") @@ -471,6 +491,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/components/component_id") @@ -490,6 +511,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/components/component_id") @@ -509,6 +531,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/components/component_id") @@ -528,6 +551,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/components/component_id") @@ -552,6 +576,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/components/component_id") @@ -570,6 +595,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/components/component_id") @@ -588,6 +614,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/components/component_id") @@ -606,6 +633,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/components/component_id") @@ -624,6 +652,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/components/component_id") @@ -641,21 +670,22 @@ describe("ComponentsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { data: { count: 1 }, params: { limit: 1, offset: 1, q: "q" } }; + const rawResponseBody = { data: { count: 1 }, params: { limit: 1000000, offset: 1000000, q: "q" } }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.components.countComponents({ q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { count: 1, }, params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -666,6 +696,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -678,6 +709,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -690,6 +722,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -702,6 +735,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -714,6 +748,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/components/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -731,7 +766,7 @@ describe("ComponentsClient", () => { { charge_type: "free", company_can_trial: true, - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -807,7 +842,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -829,7 +864,7 @@ describe("ComponentsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -866,7 +901,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -875,7 +910,7 @@ describe("ComponentsClient", () => { { charge_type: "free", company_can_trial: true, - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -951,7 +986,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -973,7 +1008,7 @@ describe("ComponentsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1010,7 +1045,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -1034,7 +1069,7 @@ describe("ComponentsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1066,8 +1101,8 @@ describe("ComponentsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1078,8 +1113,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1093,7 +1128,7 @@ describe("ComponentsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -1114,8 +1149,8 @@ describe("ComponentsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1126,8 +1161,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1141,7 +1176,7 @@ describe("ComponentsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -1194,7 +1229,7 @@ describe("ComponentsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1216,7 +1251,7 @@ describe("ComponentsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1261,7 +1296,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -1271,7 +1306,7 @@ describe("ComponentsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -1279,7 +1314,7 @@ describe("ComponentsClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, component: { ast: { key: 1.1 }, @@ -1315,7 +1350,7 @@ describe("ComponentsClient", () => { credit_name: "credit_name", grant_reason: "billing_credit_auto_topup", id: "id", - quantity: 1, + quantity: 1000000, quantity_remaining: 1.1, quantity_used: 1.1, renewal_enabled: true, @@ -1334,7 +1369,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -1350,7 +1385,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1358,11 +1393,11 @@ describe("ComponentsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -1376,7 +1411,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -1435,7 +1470,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1457,7 +1492,7 @@ describe("ComponentsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1474,7 +1509,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1484,12 +1519,12 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -1502,7 +1537,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -1510,7 +1545,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1535,9 +1570,9 @@ describe("ComponentsClient", () => { }, invoices: [ { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -1545,7 +1580,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, ], @@ -1560,7 +1595,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -1576,7 +1611,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1584,11 +1619,11 @@ describe("ComponentsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -1602,7 +1637,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -1661,7 +1696,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1683,7 +1718,7 @@ describe("ComponentsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1700,7 +1735,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1710,12 +1745,12 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -1728,7 +1763,7 @@ describe("ComponentsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -1736,7 +1771,7 @@ describe("ComponentsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1749,11 +1784,11 @@ describe("ComponentsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, @@ -1786,9 +1821,9 @@ describe("ComponentsClient", () => { expired_at: "2024-01-15T09:30:00Z", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -1796,7 +1831,7 @@ describe("ComponentsClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, payment_method: { @@ -1819,8 +1854,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1833,14 +1868,14 @@ describe("ComponentsClient", () => { ], status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, trial_end: "2024-01-15T09:30:00Z", }, trial_payment_method_required: true, upcoming_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -1854,13 +1889,14 @@ describe("ComponentsClient", () => { provider_type: "schematic", status: "draft", subscription_external_id: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", url: "url", }, }, params: { company_id: "company_id", component_id: "component_id" }, }; + server .mockEndpoint() .get("/components/preview-data") @@ -1879,7 +1915,7 @@ describe("ComponentsClient", () => { { chargeType: "free", companyCanTrial: true, - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1965,7 +2001,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1992,7 +2028,7 @@ describe("ComponentsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2029,7 +2065,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -2038,7 +2074,7 @@ describe("ComponentsClient", () => { { chargeType: "free", companyCanTrial: true, - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2124,7 +2160,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2151,7 +2187,7 @@ describe("ComponentsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2188,7 +2224,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -2223,7 +2259,7 @@ describe("ComponentsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2257,8 +2293,8 @@ describe("ComponentsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2269,8 +2305,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2284,7 +2320,7 @@ describe("ComponentsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -2305,8 +2341,8 @@ describe("ComponentsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2317,8 +2353,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2332,7 +2368,7 @@ describe("ComponentsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2391,7 +2427,7 @@ describe("ComponentsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2413,7 +2449,7 @@ describe("ComponentsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2463,7 +2499,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -2473,7 +2509,7 @@ describe("ComponentsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -2483,7 +2519,7 @@ describe("ComponentsClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, component: { ast: { @@ -2521,7 +2557,7 @@ describe("ComponentsClient", () => { creditName: "credit_name", grantReason: "billing_credit_auto_topup", id: "id", - quantity: 1, + quantity: 1000000, quantityRemaining: 1.1, quantityUsed: 1.1, renewalEnabled: true, @@ -2540,7 +2576,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -2556,7 +2592,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2564,11 +2600,11 @@ describe("ComponentsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -2582,7 +2618,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -2651,7 +2687,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2678,7 +2714,7 @@ describe("ComponentsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2695,7 +2731,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2705,12 +2741,12 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2723,7 +2759,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2731,7 +2767,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2756,9 +2792,9 @@ describe("ComponentsClient", () => { }, invoices: [ { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -2766,7 +2802,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], @@ -2781,7 +2817,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -2797,7 +2833,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2805,11 +2841,11 @@ describe("ComponentsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -2823,7 +2859,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -2892,7 +2928,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2919,7 +2955,7 @@ describe("ComponentsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2936,7 +2972,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2946,12 +2982,12 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2964,7 +3000,7 @@ describe("ComponentsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2972,7 +3008,7 @@ describe("ComponentsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2985,11 +3021,11 @@ describe("ComponentsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -3022,9 +3058,9 @@ describe("ComponentsClient", () => { expiredAt: new Date("2024-01-15T09:30:00.000Z"), interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -3032,7 +3068,7 @@ describe("ComponentsClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, paymentMethod: { @@ -3055,8 +3091,8 @@ describe("ComponentsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3069,14 +3105,14 @@ describe("ComponentsClient", () => { ], status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, trialEnd: new Date("2024-01-15T09:30:00.000Z"), }, trialPaymentMethodRequired: true, upcomingInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3090,7 +3126,7 @@ describe("ComponentsClient", () => { providerType: "schematic", status: "draft", subscriptionExternalId: "subscription_external_id", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), url: "url", }, @@ -3107,6 +3143,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/preview-data") @@ -3125,6 +3162,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/preview-data") @@ -3143,6 +3181,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/preview-data") @@ -3161,6 +3200,7 @@ describe("ComponentsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/components/preview-data") diff --git a/tests/wire/componentspublic.test.ts b/tests/wire/componentspublic.test.ts index bdbafe96..70432915 100644 --- a/tests/wire/componentspublic.test.ts +++ b/tests/wire/componentspublic.test.ts @@ -14,7 +14,7 @@ describe("ComponentspublicClient", () => { active_add_ons: [ { charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -89,7 +89,7 @@ describe("ComponentspublicClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -111,7 +111,7 @@ describe("ComponentspublicClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -139,7 +139,7 @@ describe("ComponentspublicClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -147,7 +147,7 @@ describe("ComponentspublicClient", () => { active_plans: [ { charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -222,7 +222,7 @@ describe("ComponentspublicClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -244,7 +244,7 @@ describe("ComponentspublicClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -272,7 +272,7 @@ describe("ComponentspublicClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -296,6 +296,7 @@ describe("ComponentspublicClient", () => { }, params: { key: "value" }, }; + server.mockEndpoint().get("/public/plans").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.componentspublic.getPublicPlans(); @@ -304,7 +305,7 @@ describe("ComponentspublicClient", () => { activeAddOns: [ { chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -389,7 +390,7 @@ describe("ComponentspublicClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -416,7 +417,7 @@ describe("ComponentspublicClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -444,7 +445,7 @@ describe("ComponentspublicClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -452,7 +453,7 @@ describe("ComponentspublicClient", () => { activePlans: [ { chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -537,7 +538,7 @@ describe("ComponentspublicClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -564,7 +565,7 @@ describe("ComponentspublicClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -592,7 +593,7 @@ describe("ComponentspublicClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -631,6 +632,7 @@ describe("ComponentspublicClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/public/plans").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -643,6 +645,7 @@ describe("ComponentspublicClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/public/plans").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -655,6 +658,7 @@ describe("ComponentspublicClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/public/plans").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -667,6 +671,7 @@ describe("ComponentspublicClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/public/plans").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/credits.test.ts b/tests/wire/credits.test.ts index 86fb3083..e2b2e587 100644 --- a/tests/wire/credits.test.ts +++ b/tests/wire/credits.test.ts @@ -16,7 +16,7 @@ describe("CreditsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -28,7 +28,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -49,14 +49,15 @@ describe("CreditsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { ids: ["ids"], limit: 1, name: "name", offset: 1 }, + params: { ids: ["ids"], limit: 1000000, name: "name", offset: 1000000 }, }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.credits.listBillingCredits({ name: "name", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -65,7 +66,7 @@ describe("CreditsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -77,7 +78,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -100,9 +101,9 @@ describe("CreditsClient", () => { ], params: { ids: ["ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, }, }); }); @@ -112,6 +113,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -124,6 +126,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -136,6 +139,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -148,6 +152,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -160,6 +165,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/billing/credits").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -177,7 +183,7 @@ describe("CreditsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -189,7 +195,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -213,6 +219,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/credits") @@ -233,7 +240,7 @@ describe("CreditsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -245,7 +252,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -278,6 +285,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { currency: "currency", description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits") @@ -301,6 +309,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { currency: "currency", description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits") @@ -324,6 +333,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { currency: "currency", description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits") @@ -347,6 +357,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { currency: "currency", description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits") @@ -370,6 +381,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { currency: "currency", description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits") @@ -398,7 +410,7 @@ describe("CreditsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -410,7 +422,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -434,6 +446,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/billing/credits/credit_id") @@ -449,7 +462,7 @@ describe("CreditsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -461,7 +474,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -494,6 +507,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/credit_id") @@ -512,6 +526,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/credit_id") @@ -530,6 +545,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/credit_id") @@ -548,6 +564,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/credit_id") @@ -571,7 +588,7 @@ describe("CreditsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -583,7 +600,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -607,6 +624,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -626,7 +644,7 @@ describe("CreditsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -638,7 +656,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -671,6 +689,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -693,6 +712,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -715,6 +735,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -737,6 +758,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -759,6 +781,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/credit_id") @@ -781,6 +804,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -805,6 +829,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -823,6 +848,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -841,6 +867,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -859,6 +886,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -877,6 +905,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/credit_id") @@ -905,7 +934,7 @@ describe("CreditsClient", () => { credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, has_grants: true, id: "id", name: "name", @@ -915,11 +944,11 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singular_name: "singular_name", status: "active", unit_price: { @@ -927,7 +956,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -938,11 +967,12 @@ describe("CreditsClient", () => { bundle_type: "fixed", credit_id: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, status: "active", }, }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -955,8 +985,8 @@ describe("CreditsClient", () => { creditId: "credit_id", status: "active", bundleType: "fixed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -969,7 +999,7 @@ describe("CreditsClient", () => { creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, hasGrants: true, id: "id", name: "name", @@ -979,11 +1009,11 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singularName: "singular_name", status: "active", unitPrice: { @@ -991,7 +1021,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1002,8 +1032,8 @@ describe("CreditsClient", () => { bundleType: "fixed", creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, status: "active", }, }); @@ -1014,6 +1044,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -1032,6 +1063,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -1050,6 +1082,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -1068,6 +1101,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -1086,6 +1120,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles") @@ -1106,7 +1141,7 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { data: { @@ -1118,7 +1153,7 @@ describe("CreditsClient", () => { credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, has_grants: true, id: "id", name: "name", @@ -1128,12 +1163,12 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singular_name: "singular_name", status: "active", unit_price: { @@ -1141,7 +1176,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -1150,6 +1185,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1163,7 +1199,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); expect(response).toEqual({ data: { @@ -1175,7 +1211,7 @@ describe("CreditsClient", () => { creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, hasGrants: true, id: "id", name: "name", @@ -1185,12 +1221,12 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singularName: "singular_name", status: "active", unitPrice: { @@ -1198,7 +1234,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -1218,9 +1254,10 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1235,7 +1272,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -1247,9 +1284,10 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1264,7 +1302,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -1276,9 +1314,10 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1293,7 +1332,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -1305,9 +1344,10 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1322,7 +1362,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -1334,9 +1374,10 @@ describe("CreditsClient", () => { bundle_name: "bundle_name", credit_id: "credit_id", currency: "currency", - price_per_unit: 1, + price_per_unit: 1000000, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/bundles") @@ -1351,7 +1392,7 @@ describe("CreditsClient", () => { bundleName: "bundle_name", creditId: "credit_id", currency: "currency", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.InternalServerError); }); @@ -1370,7 +1411,7 @@ describe("CreditsClient", () => { credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, has_grants: true, id: "id", name: "name", @@ -1380,12 +1421,12 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singular_name: "singular_name", status: "active", unit_price: { @@ -1393,7 +1434,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -1402,6 +1443,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/billing/credits/bundles/bundle_id") @@ -1421,7 +1463,7 @@ describe("CreditsClient", () => { creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, hasGrants: true, id: "id", name: "name", @@ -1431,12 +1473,12 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singularName: "singular_name", status: "active", unitPrice: { @@ -1444,7 +1486,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -1462,6 +1504,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/bundle_id") @@ -1480,6 +1523,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/bundle_id") @@ -1498,6 +1542,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/bundle_id") @@ -1516,6 +1561,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/bundle_id") @@ -1532,7 +1578,7 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { data: { bundle_type: "fixed", @@ -1543,7 +1589,7 @@ describe("CreditsClient", () => { credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, has_grants: true, id: "id", name: "name", @@ -1553,12 +1599,12 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singular_name: "singular_name", status: "active", unit_price: { @@ -1566,7 +1612,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -1575,6 +1621,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1586,7 +1633,7 @@ describe("CreditsClient", () => { const response = await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); expect(response).toEqual({ data: { @@ -1598,7 +1645,7 @@ describe("CreditsClient", () => { creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, hasGrants: true, id: "id", name: "name", @@ -1608,12 +1655,12 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, singularName: "singular_name", status: "active", unitPrice: { @@ -1621,7 +1668,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -1637,8 +1684,9 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (2)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1651,7 +1699,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -1659,8 +1707,9 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (3)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1673,7 +1722,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -1681,8 +1730,9 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (4)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1695,7 +1745,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -1703,8 +1753,9 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (5)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1717,7 +1768,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -1725,8 +1776,9 @@ describe("CreditsClient", () => { test("updateCreditBundleDetails (6)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1 }; + const rawRequestBody = { bundle_name: "bundle_name", price_per_unit: 1000000 }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/bundles/bundle_id") @@ -1739,7 +1791,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.updateCreditBundleDetails("bundle_id", { bundleName: "bundle_name", - pricePerUnit: 1, + pricePerUnit: 1000000, }); }).rejects.toThrow(Schematic.InternalServerError); }); @@ -1749,6 +1801,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1773,6 +1826,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1791,6 +1845,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1809,6 +1864,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1827,6 +1883,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1845,6 +1902,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/bundles/bundle_id") @@ -1868,11 +1926,12 @@ describe("CreditsClient", () => { bundle_type: "fixed", credit_id: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, status: "active", }, }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1885,8 +1944,8 @@ describe("CreditsClient", () => { creditId: "credit_id", status: "active", bundleType: "fixed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -1896,8 +1955,8 @@ describe("CreditsClient", () => { bundleType: "fixed", creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, status: "active", }, }); @@ -1908,6 +1967,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1926,6 +1986,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1944,6 +2005,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1962,6 +2024,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1980,6 +2043,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/bundles/count") @@ -1997,7 +2061,11 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { data: { count: 1 }, params: { ids: ["ids"], limit: 1, name: "name", offset: 1 } }; + const rawResponseBody = { + data: { count: 1 }, + params: { ids: ["ids"], limit: 1000000, name: "name", offset: 1000000 }, + }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2008,8 +2076,8 @@ describe("CreditsClient", () => { const response = await client.credits.countBillingCredits({ name: "name", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -2017,9 +2085,9 @@ describe("CreditsClient", () => { }, params: { ids: ["ids"], - limit: 1, + limit: 1000000, name: "name", - offset: 1, + offset: 1000000, }, }); }); @@ -2029,6 +2097,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2047,6 +2116,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2065,6 +2135,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2083,6 +2154,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2101,6 +2173,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/count") @@ -2136,12 +2209,12 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantity_remaining: 1.1, quantity_used: 1.1, renewal_enabled: true, @@ -2164,6 +2237,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2192,12 +2266,12 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantityRemaining: 1.1, quantityUsed: 1.1, renewalEnabled: true, @@ -2229,6 +2303,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2248,6 +2323,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2267,6 +2343,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2286,6 +2363,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2305,6 +2383,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/grants/grant_id/zero-out") @@ -2325,7 +2404,7 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { @@ -2346,12 +2425,12 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantity_remaining: 1.1, quantity_used: 1.1, renewal_enabled: true, @@ -2374,6 +2453,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2386,7 +2466,7 @@ describe("CreditsClient", () => { const response = await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); expect(response).toEqual({ @@ -2407,12 +2487,12 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantityRemaining: 1.1, quantityUsed: 1.1, renewalEnabled: true, @@ -2445,10 +2525,11 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2462,7 +2543,7 @@ describe("CreditsClient", () => { return await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); }).rejects.toThrow(Schematic.BadRequestError); @@ -2474,10 +2555,11 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2491,7 +2573,7 @@ describe("CreditsClient", () => { return await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); }).rejects.toThrow(Schematic.UnauthorizedError); @@ -2503,10 +2585,11 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2520,7 +2603,7 @@ describe("CreditsClient", () => { return await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); }).rejects.toThrow(Schematic.ForbiddenError); @@ -2532,10 +2615,11 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2549,7 +2633,7 @@ describe("CreditsClient", () => { return await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); }).rejects.toThrow(Schematic.NotFoundError); @@ -2561,10 +2645,11 @@ describe("CreditsClient", () => { const rawRequestBody = { company_id: "company_id", credit_id: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/grants/company") @@ -2578,7 +2663,7 @@ describe("CreditsClient", () => { return await client.credits.grantBillingCreditsToCompany({ companyId: "company_id", creditId: "credit_id", - quantity: 1, + quantity: 1000000, reason: "billing_credit_auto_topup", }); }).rejects.toThrow(Schematic.InternalServerError); @@ -2590,8 +2675,9 @@ describe("CreditsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { company_id: "company_id", dir: "asc", limit: 1, offset: 1, order: "created_at" }, + params: { company_id: "company_id", dir: "asc", limit: 1000000, offset: 1000000, order: "created_at" }, }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2604,8 +2690,8 @@ describe("CreditsClient", () => { companyId: "company_id", order: "created_at", dir: "asc", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -2614,8 +2700,8 @@ describe("CreditsClient", () => { params: { companyId: "company_id", dir: "asc", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, order: "created_at", }, }); @@ -2626,6 +2712,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2644,6 +2731,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2662,6 +2750,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2680,6 +2769,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2698,6 +2788,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/count") @@ -2734,11 +2825,11 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantity_remaining: 1.1, quantity_used: 1.1, renewal_enabled: true, @@ -2760,8 +2851,9 @@ describe("CreditsClient", () => { zeroed_out_reason: "expired", }, ], - params: { company_id: "company_id", dir: "asc", limit: 1, offset: 1, order: "created_at" }, + params: { company_id: "company_id", dir: "asc", limit: 1000000, offset: 1000000, order: "created_at" }, }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2774,8 +2866,8 @@ describe("CreditsClient", () => { companyId: "company_id", order: "created_at", dir: "asc", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -2796,11 +2888,11 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantityRemaining: 1.1, quantityUsed: 1.1, renewalEnabled: true, @@ -2825,8 +2917,8 @@ describe("CreditsClient", () => { params: { companyId: "company_id", dir: "asc", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, order: "created_at", }, }); @@ -2837,6 +2929,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2855,6 +2948,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2873,6 +2967,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2891,6 +2986,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2909,6 +3005,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/company/list") @@ -2928,8 +3025,9 @@ describe("CreditsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { credit_id: "credit_id", ids: ["ids"], limit: 1, offset: 1 }, + params: { credit_id: "credit_id", ids: ["ids"], limit: 1000000, offset: 1000000 }, }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -2940,8 +3038,8 @@ describe("CreditsClient", () => { const response = await client.credits.countBillingCreditsGrants({ creditId: "credit_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -2950,8 +3048,8 @@ describe("CreditsClient", () => { params: { creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -2961,6 +3059,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -2979,6 +3078,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -2997,6 +3097,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -3015,6 +3116,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -3033,6 +3135,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/count") @@ -3069,11 +3172,11 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantity_remaining: 1.1, quantity_used: 1.1, renewal_enabled: true, @@ -3095,8 +3198,9 @@ describe("CreditsClient", () => { zeroed_out_reason: "expired", }, ], - params: { credit_id: "credit_id", ids: ["ids"], limit: 1, offset: 1 }, + params: { credit_id: "credit_id", ids: ["ids"], limit: 1000000, offset: 1000000 }, }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3107,8 +3211,8 @@ describe("CreditsClient", () => { const response = await client.credits.listGrantsForCredit({ creditId: "credit_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -3129,11 +3233,11 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, - quantity: 1, + quantity: 1000000, quantityRemaining: 1.1, quantityUsed: 1.1, renewalEnabled: true, @@ -3158,8 +3262,8 @@ describe("CreditsClient", () => { params: { creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }, }); }); @@ -3169,6 +3273,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3187,6 +3292,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3205,6 +3311,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3223,6 +3330,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3241,6 +3349,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/grants/list") @@ -3261,28 +3370,28 @@ describe("CreditsClient", () => { const rawResponseBody = { data: [ { - billing_credit_auto_topup_grant_count: 1, + billing_credit_auto_topup_grant_count: 1000000, billing_credit_id: "billing_credit_id", company: { id: "id", name: "name" }, company_id: "company_id", credit: { id: "id", name: "name" }, - expired_grant_count: 1, + expired_grant_count: 1000000, feature: { id: "id", name: "name" }, feature_id: "feature_id", first_transaction_at: "2024-01-15T09:30:00Z", - free_grant_count: 1, - grant_count: 1, + free_grant_count: 1000000, + grant_count: 1000000, last_transaction_at: "2024-01-15T09:30:00Z", - manually_zeroed_count: 1, + manually_zeroed_count: 1000000, net_change: 1.1, - plan_grant_count: 1, - purchased_grant_count: 1, + plan_grant_count: 1000000, + purchased_grant_count: 1000000, time_bucket: "2024-01-15T09:30:00Z", total_consumed: 1.1, total_granted: 1.1, - transaction_count: 1, - usage_count: 1, - zeroed_out_count: 1, + transaction_count: 1000000, + usage_count: 1000000, + zeroed_out_count: 1000000, }, ], params: { @@ -3290,12 +3399,13 @@ describe("CreditsClient", () => { company_id: "company_id", end_time: "end_time", feature_id: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, period: "daily", start_time: "start_time", }, }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3311,13 +3421,13 @@ describe("CreditsClient", () => { period: "daily", startTime: "start_time", endTime: "end_time", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { - billingCreditAutoTopupGrantCount: 1, + billingCreditAutoTopupGrantCount: 1000000, billingCreditId: "billing_credit_id", company: { id: "id", @@ -3328,26 +3438,26 @@ describe("CreditsClient", () => { id: "id", name: "name", }, - expiredGrantCount: 1, + expiredGrantCount: 1000000, feature: { id: "id", name: "name", }, featureId: "feature_id", firstTransactionAt: new Date("2024-01-15T09:30:00.000Z"), - freeGrantCount: 1, - grantCount: 1, + freeGrantCount: 1000000, + grantCount: 1000000, lastTransactionAt: new Date("2024-01-15T09:30:00.000Z"), - manuallyZeroedCount: 1, + manuallyZeroedCount: 1000000, netChange: 1.1, - planGrantCount: 1, - purchasedGrantCount: 1, + planGrantCount: 1000000, + purchasedGrantCount: 1000000, timeBucket: new Date("2024-01-15T09:30:00.000Z"), totalConsumed: 1.1, totalGranted: 1.1, - transactionCount: 1, - usageCount: 1, - zeroedOutCount: 1, + transactionCount: 1000000, + usageCount: 1000000, + zeroedOutCount: 1000000, }, ], params: { @@ -3355,8 +3465,8 @@ describe("CreditsClient", () => { companyId: "company_id", endTime: "end_time", featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, period: "daily", startTime: "start_time", }, @@ -3368,6 +3478,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3389,6 +3500,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3410,6 +3522,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3431,6 +3544,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3452,6 +3566,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger") @@ -3479,12 +3594,13 @@ describe("CreditsClient", () => { company_id: "company_id", end_time: "end_time", feature_id: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, period: "daily", start_time: "start_time", }, }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3500,8 +3616,8 @@ describe("CreditsClient", () => { period: "daily", startTime: "start_time", endTime: "end_time", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -3512,8 +3628,8 @@ describe("CreditsClient", () => { companyId: "company_id", endTime: "end_time", featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, period: "daily", startTime: "start_time", }, @@ -3525,6 +3641,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3546,6 +3663,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3567,6 +3685,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3588,6 +3707,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3609,6 +3729,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/ledger/count") @@ -3632,13 +3753,13 @@ describe("CreditsClient", () => { const rawResponseBody = { data: [ { - auto_topup_amount: 1, + auto_topup_amount: 1000000, auto_topup_amount_type: "auto_topup_amount_type", auto_topup_enabled: true, auto_topup_expiry_type: "duration", auto_topup_expiry_unit: "billing_periods", - auto_topup_expiry_unit_count: 1, - auto_topup_threshold_percent: 1, + auto_topup_expiry_unit_count: 1000000, + auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { burn_strategy: "expiration_priority", @@ -3651,12 +3772,12 @@ describe("CreditsClient", () => { name: "name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { id: "id", name: "name" }, plan_id: "plan_id", @@ -3671,13 +3792,14 @@ describe("CreditsClient", () => { params: { credit_id: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", }, }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3690,19 +3812,19 @@ describe("CreditsClient", () => { creditId: "credit_id", planId: "plan_id", planVersionId: "plan_version_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { - autoTopupAmount: 1, + autoTopupAmount: 1000000, autoTopupAmountType: "auto_topup_amount_type", autoTopupEnabled: true, autoTopupExpiryType: "duration", autoTopupExpiryUnit: "billing_periods", - autoTopupExpiryUnitCount: 1, - autoTopupThresholdPercent: 1, + autoTopupExpiryUnitCount: 1000000, + autoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { burnStrategy: "expiration_priority", @@ -3715,12 +3837,12 @@ describe("CreditsClient", () => { name: "name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { id: "id", @@ -3738,8 +3860,8 @@ describe("CreditsClient", () => { params: { creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -3752,6 +3874,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3770,6 +3893,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3788,6 +3912,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3806,6 +3931,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3824,6 +3950,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants") @@ -3841,7 +3968,7 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", @@ -3849,20 +3976,20 @@ describe("CreditsClient", () => { }; const rawResponseBody = { data: { - auto_topup_amount: 1, + auto_topup_amount: 1000000, auto_topup_amount_type: "auto_topup_amount_type", auto_topup_enabled: true, auto_topup_expiry_type: "duration", auto_topup_expiry_unit: "billing_periods", - auto_topup_expiry_unit_count: 1, - auto_topup_threshold_percent: 1, + auto_topup_expiry_unit_count: 1000000, + auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { burn_strategy: "expiration_priority", cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -3874,7 +4001,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -3894,12 +4021,12 @@ describe("CreditsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -3912,6 +4039,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -3922,7 +4050,7 @@ describe("CreditsClient", () => { .build(); const response = await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -3930,20 +4058,20 @@ describe("CreditsClient", () => { }); expect(response).toEqual({ data: { - autoTopupAmount: 1, + autoTopupAmount: 1000000, autoTopupAmountType: "auto_topup_amount_type", autoTopupEnabled: true, autoTopupExpiryType: "duration", autoTopupExpiryUnit: "billing_periods", - autoTopupExpiryUnitCount: 1, - autoTopupThresholdPercent: 1, + autoTopupExpiryUnitCount: 1000000, + autoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { burnStrategy: "expiration_priority", costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -3955,7 +4083,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -3975,12 +4103,12 @@ describe("CreditsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -4006,13 +4134,14 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", reset_start: "billing_period", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -4024,7 +4153,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -4037,13 +4166,14 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", reset_start: "billing_period", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -4055,7 +4185,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -4068,13 +4198,14 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", reset_start: "billing_period", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -4086,7 +4217,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -4099,13 +4230,14 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", reset_start: "billing_period", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -4117,7 +4249,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -4130,13 +4262,14 @@ describe("CreditsClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", plan_id: "plan_id", reset_cadence: "daily", reset_start: "billing_period", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/billing/credits/plan-grants") @@ -4148,7 +4281,7 @@ describe("CreditsClient", () => { await expect(async () => { return await client.credits.createBillingPlanCreditGrant({ - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", planId: "plan_id", resetCadence: "daily", @@ -4163,20 +4296,20 @@ describe("CreditsClient", () => { const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { data: { - auto_topup_amount: 1, + auto_topup_amount: 1000000, auto_topup_amount_type: "auto_topup_amount_type", auto_topup_enabled: true, auto_topup_expiry_type: "duration", auto_topup_expiry_unit: "billing_periods", - auto_topup_expiry_unit_count: 1, - auto_topup_threshold_percent: 1, + auto_topup_expiry_unit_count: 1000000, + auto_topup_threshold_percent: 1000000, created_at: "2024-01-15T09:30:00Z", credit: { burn_strategy: "expiration_priority", cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -4188,7 +4321,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -4208,12 +4341,12 @@ describe("CreditsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, id: "id", plan: { description: "description", id: "id", image_url: "image_url", name: "name" }, plan_id: "plan_id", @@ -4226,6 +4359,7 @@ describe("CreditsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4241,20 +4375,20 @@ describe("CreditsClient", () => { }); expect(response).toEqual({ data: { - autoTopupAmount: 1, + autoTopupAmount: 1000000, autoTopupAmountType: "auto_topup_amount_type", autoTopupEnabled: true, autoTopupExpiryType: "duration", autoTopupExpiryUnit: "billing_periods", - autoTopupExpiryUnitCount: 1, - autoTopupThresholdPercent: 1, + autoTopupExpiryUnitCount: 1000000, + autoTopupThresholdPercent: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), credit: { burnStrategy: "expiration_priority", costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -4266,7 +4400,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -4286,12 +4420,12 @@ describe("CreditsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, id: "id", plan: { description: "description", @@ -4318,6 +4452,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4340,6 +4475,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4362,6 +4498,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4384,6 +4521,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4406,6 +4544,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { reset_cadence: "daily", reset_start: "billing_period" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/billing/credits/plan-grants/plan_grant_id") @@ -4428,6 +4567,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { apply_to_existing: true } }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4454,6 +4594,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4472,6 +4613,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4490,6 +4632,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4508,6 +4651,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4526,6 +4670,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/billing/credits/plan-grants/plan_grant_id") @@ -4548,13 +4693,14 @@ describe("CreditsClient", () => { params: { credit_id: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", }, }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4567,8 +4713,8 @@ describe("CreditsClient", () => { creditId: "credit_id", planId: "plan_id", planVersionId: "plan_version_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -4577,8 +4723,8 @@ describe("CreditsClient", () => { params: { creditId: "credit_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -4591,6 +4737,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4609,6 +4756,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4627,6 +4775,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4645,6 +4794,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4663,6 +4813,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/billing/credits/plan-grants/count") @@ -4697,20 +4848,20 @@ describe("CreditsClient", () => { event_type: "grant", expiry_type: "duration", expiry_unit: "billing_periods", - expiry_unit_count: 1, + expiry_unit_count: 1000000, feature: { id: "id", name: "name" }, feature_id: "feature_id", from_grant_id: "from_grant_id", grant_expires_at: "2024-01-15T09:30:00Z", grant_id: "grant_id", - grant_quantity: 1, + grant_quantity: 1000000, grant_quantity_remaining: 1.1, grant_reason: "billing_credit_auto_topup", grant_valid_from: "2024-01-15T09:30:00Z", plan_id: "plan_id", quantity_consumed: 1.1, quantity_remaining_at_zero_out: 1.1, - source_id: 1, + source_id: 1000000, to_grant_id: "to_grant_id", usage_event_id: "usage_event_id", zeroed_out_reason: "expired", @@ -4722,11 +4873,12 @@ describe("CreditsClient", () => { end_time: "end_time", event_type: "grant", feature_id: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, start_time: "start_time", }, }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4742,8 +4894,8 @@ describe("CreditsClient", () => { eventType: "grant", featureId: "feature_id", startTime: "start_time", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -4768,7 +4920,7 @@ describe("CreditsClient", () => { eventType: "grant", expiryType: "duration", expiryUnit: "billing_periods", - expiryUnitCount: 1, + expiryUnitCount: 1000000, feature: { id: "id", name: "name", @@ -4777,14 +4929,14 @@ describe("CreditsClient", () => { fromGrantId: "from_grant_id", grantExpiresAt: new Date("2024-01-15T09:30:00.000Z"), grantId: "grant_id", - grantQuantity: 1, + grantQuantity: 1000000, grantQuantityRemaining: 1.1, grantReason: "billing_credit_auto_topup", grantValidFrom: new Date("2024-01-15T09:30:00.000Z"), planId: "plan_id", quantityConsumed: 1.1, quantityRemainingAtZeroOut: 1.1, - sourceId: 1, + sourceId: 1000000, toGrantId: "to_grant_id", usageEventId: "usage_event_id", zeroedOutReason: "expired", @@ -4796,8 +4948,8 @@ describe("CreditsClient", () => { endTime: "end_time", eventType: "grant", featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, startTime: "start_time", }, }); @@ -4808,6 +4960,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4828,6 +4981,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4848,6 +5002,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4868,6 +5023,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4888,6 +5044,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger") @@ -4915,11 +5072,12 @@ describe("CreditsClient", () => { end_time: "end_time", event_type: "grant", feature_id: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, start_time: "start_time", }, }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") @@ -4935,8 +5093,8 @@ describe("CreditsClient", () => { eventType: "grant", featureId: "feature_id", startTime: "start_time", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -4948,8 +5106,8 @@ describe("CreditsClient", () => { endTime: "end_time", eventType: "grant", featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, startTime: "start_time", }, }); @@ -4960,6 +5118,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") @@ -4980,6 +5139,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") @@ -5000,6 +5160,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") @@ -5020,6 +5181,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") @@ -5040,6 +5202,7 @@ describe("CreditsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/v2/billing/credits/ledger/count") diff --git a/tests/wire/dataexports.test.ts b/tests/wire/dataexports.test.ts index 95e4d40a..b6097298 100644 --- a/tests/wire/dataexports.test.ts +++ b/tests/wire/dataexports.test.ts @@ -23,6 +23,7 @@ describe("DataexportsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/data-exports") @@ -58,6 +59,7 @@ describe("DataexportsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/data-exports") @@ -79,6 +81,7 @@ describe("DataexportsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/data-exports") @@ -100,6 +103,7 @@ describe("DataexportsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/data-exports") @@ -121,6 +125,7 @@ describe("DataexportsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/data-exports") @@ -142,6 +147,7 @@ describe("DataexportsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/data-exports") diff --git a/tests/wire/entitlements.test.ts b/tests/wire/entitlements.test.ts index 35d2b7e4..1fd33f1a 100644 --- a/tests/wire/entitlements.test.ts +++ b/tests/wire/entitlements.test.ts @@ -20,7 +20,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -52,8 +52,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -64,8 +64,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -79,7 +79,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -120,7 +120,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -169,13 +169,13 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, ], updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -209,7 +209,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -229,12 +229,13 @@ describe("EntitlementsClient", () => { feature_id: "feature_id", feature_ids: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", without_expired: true, }, }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.listCompanyOverrides({ @@ -242,8 +243,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", withoutExpired: true, q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -256,7 +257,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -288,8 +289,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -300,8 +301,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -315,7 +316,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -362,7 +363,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -416,13 +417,13 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, ], updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -456,7 +457,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -476,8 +477,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", featureIds: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", withoutExpired: true, }, @@ -489,6 +490,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -501,6 +503,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -513,6 +516,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -525,6 +529,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -537,6 +542,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/company-overrides").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -558,7 +564,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -590,8 +596,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -602,8 +608,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -617,7 +623,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -638,8 +644,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -650,8 +656,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -665,7 +671,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -718,7 +724,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -740,7 +746,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -785,7 +791,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -795,7 +801,7 @@ describe("EntitlementsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -803,7 +809,7 @@ describe("EntitlementsClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -843,7 +849,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -858,6 +864,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/company-overrides") @@ -882,7 +889,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -916,8 +923,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -928,8 +935,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -943,7 +950,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -964,8 +971,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -976,8 +983,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -991,7 +998,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1050,7 +1057,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1072,7 +1079,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1122,7 +1129,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -1132,7 +1139,7 @@ describe("EntitlementsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -1142,7 +1149,7 @@ describe("EntitlementsClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -1182,7 +1189,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -1206,6 +1213,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", feature_id: "feature_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-overrides") @@ -1229,6 +1237,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", feature_id: "feature_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-overrides") @@ -1252,6 +1261,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", feature_id: "feature_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-overrides") @@ -1275,6 +1285,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", feature_id: "feature_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-overrides") @@ -1298,6 +1309,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { company_id: "company_id", feature_id: "feature_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/company-overrides") @@ -1330,7 +1342,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1362,8 +1374,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1374,8 +1386,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1389,7 +1401,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -1410,8 +1422,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -1422,8 +1434,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -1437,7 +1449,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -1490,7 +1502,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1512,7 +1524,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -1557,7 +1569,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -1567,7 +1579,7 @@ describe("EntitlementsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -1575,7 +1587,7 @@ describe("EntitlementsClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -1615,7 +1627,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -1630,6 +1642,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/company-overrides/company_override_id") @@ -1649,7 +1662,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1683,8 +1696,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1695,8 +1708,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1710,7 +1723,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -1731,8 +1744,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -1743,8 +1756,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -1758,7 +1771,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1817,7 +1830,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -1839,7 +1852,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -1889,7 +1902,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -1899,7 +1912,7 @@ describe("EntitlementsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -1909,7 +1922,7 @@ describe("EntitlementsClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -1949,7 +1962,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -1973,6 +1986,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/company_override_id") @@ -1991,6 +2005,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/company_override_id") @@ -2009,6 +2024,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/company_override_id") @@ -2027,6 +2043,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/company_override_id") @@ -2054,7 +2071,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -2086,8 +2103,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2098,8 +2115,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2113,7 +2130,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -2134,8 +2151,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -2146,8 +2163,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -2161,7 +2178,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -2214,7 +2231,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2236,7 +2253,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -2281,7 +2298,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -2291,7 +2308,7 @@ describe("EntitlementsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -2299,7 +2316,7 @@ describe("EntitlementsClient", () => { }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -2339,7 +2356,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -2354,6 +2371,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2376,7 +2394,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2410,8 +2428,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2422,8 +2440,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2437,7 +2455,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -2458,8 +2476,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -2470,8 +2488,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -2485,7 +2503,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2544,7 +2562,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -2566,7 +2584,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -2616,7 +2634,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -2626,7 +2644,7 @@ describe("EntitlementsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -2636,7 +2654,7 @@ describe("EntitlementsClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -2676,7 +2694,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -2700,6 +2718,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2721,6 +2740,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2742,6 +2762,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2763,6 +2784,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2784,6 +2806,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-overrides/company_override_id") @@ -2805,6 +2828,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2829,6 +2853,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2847,6 +2872,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2865,6 +2891,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2883,6 +2910,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2901,6 +2929,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/company-overrides/company_override_id") @@ -2926,12 +2955,13 @@ describe("EntitlementsClient", () => { feature_id: "feature_id", feature_ids: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", without_expired: true, }, }; + server .mockEndpoint() .get("/company-overrides/count") @@ -2945,8 +2975,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", withoutExpired: true, q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -2958,8 +2988,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", featureIds: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", withoutExpired: true, }, @@ -2971,6 +3001,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/count") @@ -2989,6 +3020,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/count") @@ -3007,6 +3039,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/count") @@ -3025,6 +3058,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/count") @@ -3043,6 +3077,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/company-overrides/count") @@ -3064,7 +3099,7 @@ describe("EntitlementsClient", () => { data: [ { access: true, - allocation: 1, + allocation: 1000000, allocation_type: "boolean", company: { add_ons: [ @@ -3074,7 +3109,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -3106,8 +3141,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -3118,8 +3153,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -3133,7 +3168,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -3174,7 +3209,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -3223,13 +3258,13 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, ], updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_override: { company_id: "company_id", @@ -3257,7 +3292,7 @@ describe("EntitlementsClient", () => { credit_remaining: 1.1, credit_type_icon: "credit_type_icon", credit_used: 1.1, - effective_limit: 1, + effective_limit: 1000000, effective_price: 1.1, entitlement_expiration_date: "2024-01-15T09:30:00Z", entitlement_id: "entitlement_id", @@ -3319,7 +3354,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -3345,8 +3380,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -3357,7 +3392,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - overuse: 1, + overuse: 1000000, percent_used: 1.1, period: "period", plan: { @@ -3380,8 +3415,8 @@ describe("EntitlementsClient", () => { value_type: "boolean", }, price_behavior: "credit_burndown", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, yearly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -3389,8 +3424,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -3403,21 +3438,22 @@ describe("EntitlementsClient", () => { }, }, ], - params: { feature_id: "feature_id", limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.listFeatureCompanies({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { access: true, - allocation: 1, + allocation: 1000000, allocationType: "boolean", company: { addOns: [ @@ -3427,7 +3463,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -3459,8 +3495,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -3471,8 +3507,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3486,7 +3522,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3533,7 +3569,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -3587,13 +3623,13 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, ], updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyOverride: { companyId: "company_id", @@ -3628,7 +3664,7 @@ describe("EntitlementsClient", () => { creditRemaining: 1.1, creditTypeIcon: "credit_type_icon", creditUsed: 1.1, - effectiveLimit: 1, + effectiveLimit: 1000000, effectivePrice: 1.1, entitlementExpirationDate: new Date("2024-01-15T09:30:00.000Z"), entitlementId: "entitlement_id", @@ -3700,7 +3736,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -3731,8 +3767,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3743,7 +3779,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - overuse: 1, + overuse: 1000000, percentUsed: 1.1, period: "period", plan: { @@ -3766,8 +3802,8 @@ describe("EntitlementsClient", () => { valueType: "boolean", }, priceBehavior: "credit_burndown", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, yearlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3775,8 +3811,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -3791,8 +3827,8 @@ describe("EntitlementsClient", () => { ], params: { featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -3803,6 +3839,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3817,6 +3854,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3831,6 +3869,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3845,6 +3884,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3859,6 +3899,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-companies").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3874,8 +3915,9 @@ describe("EntitlementsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { feature_id: "feature_id", limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", limit: 1000000, offset: 1000000, q: "q" }, }; + server .mockEndpoint() .get("/feature-companies/count") @@ -3887,8 +3929,8 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.countFeatureCompanies({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -3896,8 +3938,8 @@ describe("EntitlementsClient", () => { }, params: { featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -3908,6 +3950,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-companies/count") @@ -3928,6 +3971,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-companies/count") @@ -3948,6 +3992,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-companies/count") @@ -3968,6 +4013,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-companies/count") @@ -3988,6 +4034,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-companies/count") @@ -4011,7 +4058,7 @@ describe("EntitlementsClient", () => { data: [ { access: true, - allocation: 1, + allocation: 1000000, allocation_type: "boolean", company_override: { company_id: "company_id", @@ -4039,7 +4086,7 @@ describe("EntitlementsClient", () => { credit_remaining: 1.1, credit_type_icon: "credit_type_icon", credit_used: 1.1, - effective_limit: 1, + effective_limit: 1000000, effective_price: 1.1, entitlement_expiration_date: "2024-01-15T09:30:00Z", entitlement_id: "entitlement_id", @@ -4101,7 +4148,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -4127,8 +4174,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4139,7 +4186,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - overuse: 1, + overuse: 1000000, percent_used: 1.1, period: "period", plan: { @@ -4162,8 +4209,8 @@ describe("EntitlementsClient", () => { value_type: "boolean", }, price_behavior: "credit_burndown", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, yearly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -4171,8 +4218,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4190,12 +4237,13 @@ describe("EntitlementsClient", () => { company_keys: { key: "value" }, feature_ids: ["feature_ids"], include_usage_aggregation: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", without_negative_entitlements: true, }, }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.listFeatureUsage({ @@ -4203,14 +4251,14 @@ describe("EntitlementsClient", () => { includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { access: true, - allocation: 1, + allocation: 1000000, allocationType: "boolean", companyOverride: { companyId: "company_id", @@ -4245,7 +4293,7 @@ describe("EntitlementsClient", () => { creditRemaining: 1.1, creditTypeIcon: "credit_type_icon", creditUsed: 1.1, - effectiveLimit: 1, + effectiveLimit: 1000000, effectivePrice: 1.1, entitlementExpirationDate: new Date("2024-01-15T09:30:00.000Z"), entitlementId: "entitlement_id", @@ -4317,7 +4365,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -4348,8 +4396,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -4360,7 +4408,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - overuse: 1, + overuse: 1000000, percentUsed: 1.1, period: "period", plan: { @@ -4383,8 +4431,8 @@ describe("EntitlementsClient", () => { valueType: "boolean", }, priceBehavior: "credit_burndown", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, yearlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4392,8 +4440,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -4413,8 +4461,8 @@ describe("EntitlementsClient", () => { }, featureIds: ["feature_ids"], includeUsageAggregation: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", withoutNegativeEntitlements: true, }, @@ -4426,6 +4474,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4438,6 +4487,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4450,6 +4500,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4462,6 +4513,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4474,6 +4526,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-usage").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4493,7 +4546,7 @@ describe("EntitlementsClient", () => { { effective_at: "2024-01-15T09:30:00Z", is_soft_limit: true, limit_source: "company_override" }, ], period_type: "period_type", - usage_points: [{ timestamp: "2024-01-15T09:30:00Z", usage: 1 }], + usage_points: [{ timestamp: "2024-01-15T09:30:00Z", usage: 1000000 }], }, params: { company_id: "company_id", @@ -4503,6 +4556,7 @@ describe("EntitlementsClient", () => { start_time: "2024-01-15T09:30:00Z", }, }; + server .mockEndpoint() .get("/feature-usage-timeseries") @@ -4533,7 +4587,7 @@ describe("EntitlementsClient", () => { usagePoints: [ { timestamp: new Date("2024-01-15T09:30:00.000Z"), - usage: 1, + usage: 1000000, }, ], }, @@ -4552,6 +4606,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage-timeseries") @@ -4575,6 +4630,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage-timeseries") @@ -4598,6 +4654,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage-timeseries") @@ -4621,6 +4678,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage-timeseries") @@ -4650,12 +4708,13 @@ describe("EntitlementsClient", () => { company_keys: { key: "value" }, feature_ids: ["feature_ids"], include_usage_aggregation: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", without_negative_entitlements: true, }, }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4669,8 +4728,8 @@ describe("EntitlementsClient", () => { includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -4683,8 +4742,8 @@ describe("EntitlementsClient", () => { }, featureIds: ["feature_ids"], includeUsageAggregation: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", withoutNegativeEntitlements: true, }, @@ -4696,6 +4755,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4714,6 +4774,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4732,6 +4793,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4750,6 +4812,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4768,6 +4831,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-usage/count") @@ -4789,7 +4853,7 @@ describe("EntitlementsClient", () => { data: [ { access: true, - allocation: 1, + allocation: 1000000, allocation_type: "boolean", company: { add_ons: [ @@ -4799,7 +4863,7 @@ describe("EntitlementsClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -4831,8 +4895,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -4843,8 +4907,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -4858,7 +4922,7 @@ describe("EntitlementsClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -4899,7 +4963,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -4948,13 +5012,13 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, ], updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, entitlement_id: "entitlement_id", entitlement_type: "company_override", @@ -5014,7 +5078,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -5041,7 +5105,7 @@ describe("EntitlementsClient", () => { plan_type: "plan", updated_at: "2024-01-15T09:30:00Z", }, - usage: 1, + usage: 1000000, user: { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -5051,21 +5115,22 @@ describe("EntitlementsClient", () => { }, }, ], - params: { feature_id: "feature_id", limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.listFeatureUsers({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { access: true, - allocation: 1, + allocation: 1000000, allocationType: "boolean", company: { addOns: [ @@ -5075,7 +5140,7 @@ describe("EntitlementsClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -5107,8 +5172,8 @@ describe("EntitlementsClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -5119,8 +5184,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -5134,7 +5199,7 @@ describe("EntitlementsClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -5181,7 +5246,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -5235,13 +5300,13 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, ], updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, entitlementId: "entitlement_id", entitlementType: "company_override", @@ -5311,7 +5376,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -5343,7 +5408,7 @@ describe("EntitlementsClient", () => { planType: "plan", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - usage: 1, + usage: 1000000, user: { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -5355,8 +5420,8 @@ describe("EntitlementsClient", () => { ], params: { featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -5367,6 +5432,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5381,6 +5447,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5395,6 +5462,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5409,6 +5477,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5423,6 +5492,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/feature-users").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5438,8 +5508,9 @@ describe("EntitlementsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { feature_id: "feature_id", limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", limit: 1000000, offset: 1000000, q: "q" }, }; + server .mockEndpoint() .get("/feature-users/count") @@ -5451,8 +5522,8 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.countFeatureUsers({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -5460,8 +5531,8 @@ describe("EntitlementsClient", () => { }, params: { featureId: "feature_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -5472,6 +5543,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-users/count") @@ -5492,6 +5564,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-users/count") @@ -5512,6 +5585,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-users/count") @@ -5532,6 +5606,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-users/count") @@ -5552,6 +5627,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/feature-users/count") @@ -5574,7 +5650,7 @@ describe("EntitlementsClient", () => { const rawResponseBody = { data: [ { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -5596,8 +5672,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -5615,8 +5691,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", is_active: true, - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -5642,7 +5718,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -5669,7 +5745,7 @@ describe("EntitlementsClient", () => { name: "name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -5687,8 +5763,8 @@ describe("EntitlementsClient", () => { feature_id: "feature_id", feature_ids: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", @@ -5697,6 +5773,7 @@ describe("EntitlementsClient", () => { with_metered_products: true, }, }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.listPlanEntitlements({ @@ -5705,13 +5782,13 @@ describe("EntitlementsClient", () => { planVersionId: "plan_version_id", q: "q", withMeteredProducts: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -5733,8 +5810,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -5752,8 +5829,8 @@ describe("EntitlementsClient", () => { id: "id", interval: "day", isActive: true, - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -5779,7 +5856,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -5806,7 +5883,7 @@ describe("EntitlementsClient", () => { name: "name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -5824,8 +5901,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", featureIds: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -5841,6 +5918,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5853,6 +5931,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5865,6 +5944,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5877,6 +5957,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5889,6 +5970,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-entitlements").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -5902,7 +5984,7 @@ describe("EntitlementsClient", () => { const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { data: { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -5933,8 +6015,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -5957,8 +6039,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -5986,7 +6068,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -6008,7 +6090,7 @@ describe("EntitlementsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -6020,7 +6102,7 @@ describe("EntitlementsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -6040,7 +6122,7 @@ describe("EntitlementsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -6055,6 +6137,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6071,7 +6154,7 @@ describe("EntitlementsClient", () => { }); expect(response).toEqual({ data: { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -6102,8 +6185,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6126,8 +6209,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6155,7 +6238,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -6177,7 +6260,7 @@ describe("EntitlementsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -6189,7 +6272,7 @@ describe("EntitlementsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -6209,7 +6292,7 @@ describe("EntitlementsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -6233,6 +6316,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6256,6 +6340,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6279,6 +6364,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6302,6 +6388,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6325,6 +6412,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { feature_id: "feature_id", plan_id: "plan_id", value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements") @@ -6349,7 +6437,7 @@ describe("EntitlementsClient", () => { const rawResponseBody = { data: { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -6380,8 +6468,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -6404,8 +6492,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -6433,7 +6521,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -6455,7 +6543,7 @@ describe("EntitlementsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -6467,7 +6555,7 @@ describe("EntitlementsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -6487,7 +6575,7 @@ describe("EntitlementsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -6502,6 +6590,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/plan-entitlements/plan_entitlement_id") @@ -6513,7 +6602,7 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.getPlanEntitlement("plan_entitlement_id"); expect(response).toEqual({ data: { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -6544,8 +6633,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6568,8 +6657,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6597,7 +6686,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -6619,7 +6708,7 @@ describe("EntitlementsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -6631,7 +6720,7 @@ describe("EntitlementsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -6651,7 +6740,7 @@ describe("EntitlementsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -6675,6 +6764,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/plan_entitlement_id") @@ -6693,6 +6783,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/plan_entitlement_id") @@ -6711,6 +6802,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/plan_entitlement_id") @@ -6729,6 +6821,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/plan_entitlement_id") @@ -6748,7 +6841,7 @@ describe("EntitlementsClient", () => { const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { data: { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -6779,8 +6872,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -6803,8 +6896,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -6832,7 +6925,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -6854,7 +6947,7 @@ describe("EntitlementsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -6866,7 +6959,7 @@ describe("EntitlementsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -6886,7 +6979,7 @@ describe("EntitlementsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -6901,6 +6994,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -6915,7 +7009,7 @@ describe("EntitlementsClient", () => { }); expect(response).toEqual({ data: { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -6946,8 +7040,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6970,8 +7064,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -6999,7 +7093,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -7021,7 +7115,7 @@ describe("EntitlementsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -7033,7 +7127,7 @@ describe("EntitlementsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -7053,7 +7147,7 @@ describe("EntitlementsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -7077,6 +7171,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -7098,6 +7193,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -7119,6 +7215,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -7140,6 +7237,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -7161,6 +7259,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { value_type: "boolean" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-entitlements/plan_entitlement_id") @@ -7182,6 +7281,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7206,6 +7306,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7224,6 +7325,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7242,6 +7344,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7260,6 +7363,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7278,6 +7382,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plan-entitlements/plan_entitlement_id") @@ -7301,8 +7406,8 @@ describe("EntitlementsClient", () => { feature_id: "feature_id", feature_ids: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_id: "plan_id", plan_ids: ["plan_ids"], plan_version_id: "plan_version_id", @@ -7311,6 +7416,7 @@ describe("EntitlementsClient", () => { with_metered_products: true, }, }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7325,8 +7431,8 @@ describe("EntitlementsClient", () => { planVersionId: "plan_version_id", q: "q", withMeteredProducts: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -7336,8 +7442,8 @@ describe("EntitlementsClient", () => { featureId: "feature_id", featureIds: ["feature_ids"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planId: "plan_id", planIds: ["plan_ids"], planVersionId: "plan_version_id", @@ -7353,6 +7459,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7371,6 +7478,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7389,6 +7497,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7407,6 +7516,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7425,6 +7535,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-entitlements/count") @@ -7467,6 +7578,7 @@ describe("EntitlementsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7518,6 +7630,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { source_plan_id: "source_plan_id", target_plan_id: "target_plan_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7540,6 +7653,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { source_plan_id: "source_plan_id", target_plan_id: "target_plan_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7562,6 +7676,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { source_plan_id: "source_plan_id", target_plan_id: "target_plan_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7584,6 +7699,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { source_plan_id: "source_plan_id", target_plan_id: "target_plan_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7606,6 +7722,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { source_plan_id: "source_plan_id", target_plan_id: "target_plan_id" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-entitlements/duplicate") @@ -7632,7 +7749,7 @@ describe("EntitlementsClient", () => { features: [ { access: true, - allocation: 1, + allocation: 1000000, allocation_type: "boolean", company_override: { company: { @@ -7649,13 +7766,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -7666,13 +7783,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, { cancel_at_period_end: true, @@ -7682,13 +7799,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -7763,7 +7880,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, { account_id: "account_id", @@ -7775,7 +7892,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -7814,7 +7931,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -7825,7 +7942,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -7835,7 +7952,7 @@ describe("EntitlementsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -7843,7 +7960,7 @@ describe("EntitlementsClient", () => { }, traits: { traits: { key: "value" } }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -7891,7 +8008,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -7931,7 +8048,7 @@ describe("EntitlementsClient", () => { usage_today: 1.1, }, credit_used: 1.1, - effective_limit: 1, + effective_limit: 1000000, effective_price: 1.1, entitlement_expiration_date: "2024-01-15T09:30:00Z", entitlement_id: "entitlement_id", @@ -7942,12 +8059,12 @@ describe("EntitlementsClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -7979,7 +8096,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -7991,7 +8108,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8027,7 +8144,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8039,7 +8156,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8085,23 +8202,23 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], product_external_id: "product_external_id", @@ -8112,7 +8229,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - overuse: 1, + overuse: 1000000, percent_used: 1.1, period: "period", plan: { @@ -8126,7 +8243,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, plan_entitlement: { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -8157,8 +8274,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -8181,8 +8298,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -8211,7 +8328,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -8234,7 +8351,7 @@ describe("EntitlementsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -8246,7 +8363,7 @@ describe("EntitlementsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -8266,7 +8383,7 @@ describe("EntitlementsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -8280,8 +8397,8 @@ describe("EntitlementsClient", () => { value_type: "boolean", }, price_behavior: "credit_burndown", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, yearly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -8292,23 +8409,23 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], product_external_id: "product_external_id", @@ -8322,7 +8439,7 @@ describe("EntitlementsClient", () => { }, { access: true, - allocation: 1, + allocation: 1000000, allocation_type: "boolean", company_override: { company: { @@ -8339,13 +8456,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, billing_subscriptions: [ { @@ -8356,13 +8473,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, { cancel_at_period_end: true, @@ -8372,13 +8489,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [], provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -8453,7 +8570,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, { account_id: "account_id", @@ -8465,7 +8582,7 @@ describe("EntitlementsClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -8504,7 +8621,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -8515,7 +8632,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -8525,7 +8642,7 @@ describe("EntitlementsClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", to_plan_id: "to_plan_id", @@ -8533,7 +8650,7 @@ describe("EntitlementsClient", () => { }, traits: { traits: { key: "value" } }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, company_id: "company_id", consumption_rate: 1.1, @@ -8581,7 +8698,7 @@ describe("EntitlementsClient", () => { rule_id_usage_exceeded: "rule_id_usage_exceeded", updated_at: "2024-01-15T09:30:00Z", value_bool: true, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -8621,7 +8738,7 @@ describe("EntitlementsClient", () => { usage_today: 1.1, }, credit_used: 1.1, - effective_limit: 1, + effective_limit: 1000000, effective_price: 1.1, entitlement_expiration_date: "2024-01-15T09:30:00Z", entitlement_id: "entitlement_id", @@ -8632,12 +8749,12 @@ describe("EntitlementsClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -8669,7 +8786,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8681,7 +8798,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8717,7 +8834,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8729,7 +8846,7 @@ describe("EntitlementsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -8775,23 +8892,23 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], product_external_id: "product_external_id", @@ -8802,7 +8919,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - overuse: 1, + overuse: 1000000, percent_used: 1.1, period: "period", plan: { @@ -8816,7 +8933,7 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, plan_entitlement: { - billing_threshold: 1, + billing_threshold: 1000000, consumption_rate: 1.1, created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", @@ -8847,8 +8964,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -8871,8 +8988,8 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -8901,7 +9018,7 @@ describe("EntitlementsClient", () => { price_behavior: "credit_burndown", rule_id: "rule_id", rule_id_usage_exceeded: "rule_id_usage_exceeded", - soft_limit: 1, + soft_limit: 1000000, updated_at: "2024-01-15T09:30:00Z", usage_based_product: { account_id: "account_id", @@ -8924,7 +9041,7 @@ describe("EntitlementsClient", () => { cost_editable: true, created_at: "2024-01-15T09:30:00Z", default_expiry_unit: "billing_periods", - default_expiry_unit_count: 1, + default_expiry_unit_count: 1000000, default_rollover_policy: "expire", description: "description", icon: "icon", @@ -8936,7 +9053,7 @@ describe("EntitlementsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -8956,7 +9073,7 @@ describe("EntitlementsClient", () => { singular_name: "singular_name", updated_at: "2024-01-15T09:30:00Z", }, - value_numeric: 1, + value_numeric: 1000000, value_trait: { created_at: "2024-01-15T09:30:00Z", display_name: "display_name", @@ -8970,8 +9087,8 @@ describe("EntitlementsClient", () => { value_type: "boolean", }, price_behavior: "credit_burndown", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, yearly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -8982,23 +9099,23 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", price_tier: [ { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, { - flat_amount: 1, - per_unit_price: 1, + flat_amount: 1000000, + per_unit_price: 1000000, per_unit_price_decimal: "per_unit_price_decimal", - up_to: 1, + up_to: 1000000, }, ], product_external_id: "product_external_id", @@ -9014,6 +9131,7 @@ describe("EntitlementsClient", () => { }, params: { keys: { keys: "keys" } }, }; + server.mockEndpoint().get("/usage-by-company").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.entitlements.getFeatureUsageByCompany({ @@ -9026,7 +9144,7 @@ describe("EntitlementsClient", () => { features: [ { access: true, - allocation: 1, + allocation: 1000000, allocationType: "boolean", companyOverride: { company: { @@ -9053,13 +9171,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -9070,13 +9188,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, { cancelAtPeriodEnd: true, @@ -9086,13 +9204,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9175,7 +9293,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, { accountId: "account_id", @@ -9187,7 +9305,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -9236,7 +9354,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -9247,7 +9365,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -9257,7 +9375,7 @@ describe("EntitlementsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -9269,7 +9387,7 @@ describe("EntitlementsClient", () => { }, }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -9317,7 +9435,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -9359,7 +9477,7 @@ describe("EntitlementsClient", () => { usageToday: 1.1, }, creditUsed: 1.1, - effectiveLimit: 1, + effectiveLimit: 1000000, effectivePrice: 1.1, entitlementExpirationDate: new Date("2024-01-15T09:30:00.000Z"), entitlementId: "entitlement_id", @@ -9370,12 +9488,12 @@ describe("EntitlementsClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -9407,7 +9525,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -9419,7 +9537,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -9455,7 +9573,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -9467,7 +9585,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -9523,23 +9641,23 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], productExternalId: "product_external_id", @@ -9550,7 +9668,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - overuse: 1, + overuse: 1000000, percentUsed: 1.1, period: "period", plan: { @@ -9564,7 +9682,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, planEntitlement: { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -9595,8 +9713,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -9619,8 +9737,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -9649,7 +9767,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -9672,7 +9790,7 @@ describe("EntitlementsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -9684,7 +9802,7 @@ describe("EntitlementsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -9704,7 +9822,7 @@ describe("EntitlementsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -9718,8 +9836,8 @@ describe("EntitlementsClient", () => { valueType: "boolean", }, priceBehavior: "credit_burndown", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, yearlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9730,23 +9848,23 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], productExternalId: "product_external_id", @@ -9760,7 +9878,7 @@ describe("EntitlementsClient", () => { }, { access: true, - allocation: 1, + allocation: 1000000, allocationType: "boolean", companyOverride: { company: { @@ -9787,13 +9905,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, billingSubscriptions: [ { @@ -9804,13 +9922,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, { cancelAtPeriodEnd: true, @@ -9820,13 +9938,13 @@ describe("EntitlementsClient", () => { discounts: [], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [], providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9909,7 +10027,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, { accountId: "account_id", @@ -9921,7 +10039,7 @@ describe("EntitlementsClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -9970,7 +10088,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -9981,7 +10099,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -9991,7 +10109,7 @@ describe("EntitlementsClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", toPlanId: "to_plan_id", @@ -10003,7 +10121,7 @@ describe("EntitlementsClient", () => { }, }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, companyId: "company_id", consumptionRate: 1.1, @@ -10051,7 +10169,7 @@ describe("EntitlementsClient", () => { ruleIdUsageExceeded: "rule_id_usage_exceeded", updatedAt: new Date("2024-01-15T09:30:00.000Z"), valueBool: true, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -10093,7 +10211,7 @@ describe("EntitlementsClient", () => { usageToday: 1.1, }, creditUsed: 1.1, - effectiveLimit: 1, + effectiveLimit: 1000000, effectivePrice: 1.1, entitlementExpirationDate: new Date("2024-01-15T09:30:00.000Z"), entitlementId: "entitlement_id", @@ -10104,12 +10222,12 @@ describe("EntitlementsClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -10141,7 +10259,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -10153,7 +10271,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -10189,7 +10307,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -10201,7 +10319,7 @@ describe("EntitlementsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -10257,23 +10375,23 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], productExternalId: "product_external_id", @@ -10284,7 +10402,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - overuse: 1, + overuse: 1000000, percentUsed: 1.1, period: "period", plan: { @@ -10298,7 +10416,7 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, planEntitlement: { - billingThreshold: 1, + billingThreshold: 1000000, consumptionRate: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", @@ -10329,8 +10447,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -10353,8 +10471,8 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -10383,7 +10501,7 @@ describe("EntitlementsClient", () => { priceBehavior: "credit_burndown", ruleId: "rule_id", ruleIdUsageExceeded: "rule_id_usage_exceeded", - softLimit: 1, + softLimit: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageBasedProduct: { accountId: "account_id", @@ -10406,7 +10524,7 @@ describe("EntitlementsClient", () => { costEditable: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), defaultExpiryUnit: "billing_periods", - defaultExpiryUnitCount: 1, + defaultExpiryUnitCount: 1000000, defaultRolloverPolicy: "expire", description: "description", icon: "icon", @@ -10418,7 +10536,7 @@ describe("EntitlementsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -10438,7 +10556,7 @@ describe("EntitlementsClient", () => { singularName: "singular_name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - valueNumeric: 1, + valueNumeric: 1000000, valueTrait: { createdAt: new Date("2024-01-15T09:30:00.000Z"), displayName: "display_name", @@ -10452,8 +10570,8 @@ describe("EntitlementsClient", () => { valueType: "boolean", }, priceBehavior: "credit_burndown", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, yearlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -10464,23 +10582,23 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", priceTier: [ { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, { - flatAmount: 1, - perUnitPrice: 1, + flatAmount: 1000000, + perUnitPrice: 1000000, perUnitPriceDecimal: "per_unit_price_decimal", - upTo: 1, + upTo: 1000000, }, ], productExternalId: "product_external_id", @@ -10507,6 +10625,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/usage-by-company").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10523,6 +10642,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/usage-by-company").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10539,6 +10659,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/usage-by-company").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -10555,6 +10676,7 @@ describe("EntitlementsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/usage-by-company").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index 476a5a21..c1c9039d 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -15,6 +15,7 @@ describe("EventsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/event-batch") @@ -52,6 +53,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: [{ event_type: "flag_check" }, { event_type: "flag_check" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/event-batch") @@ -80,6 +82,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: [{ event_type: "flag_check" }, { event_type: "flag_check" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/event-batch") @@ -108,6 +111,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: [{ event_type: "flag_check" }, { event_type: "flag_check" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/event-batch") @@ -136,6 +140,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: [{ event_type: "flag_check" }, { event_type: "flag_check" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/event-batch") @@ -164,6 +169,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: [{ event_type: "flag_check" }, { event_type: "flag_check" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/event-batch") @@ -194,38 +200,39 @@ describe("EventsClient", () => { const rawResponseBody = { data: [ { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, ], - params: { event_subtypes: ["event_subtypes"], limit: 1, offset: 1, q: "q" }, + params: { event_subtypes: ["event_subtypes"], limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.getEventSummaries({ q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, ], params: { eventSubtypes: ["event_subtypes"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -236,6 +243,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -248,6 +256,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -260,6 +269,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -272,6 +282,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -284,6 +295,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/event-types").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -310,7 +322,7 @@ describe("EventsClient", () => { features: [{ id: "id", name: "name" }], id: "id", loaded_at: "2024-01-15T09:30:00Z", - quantity: 1, + quantity: 1000000, sent_at: "2024-01-15T09:30:00Z", status: "enriched", subtype: "subtype", @@ -324,11 +336,12 @@ describe("EventsClient", () => { event_subtype: "event_subtype", event_types: ["flag_check"], flag_id: "flag_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, user_id: "user_id", }, }; + server.mockEndpoint().get("/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.listEvents({ @@ -336,8 +349,8 @@ describe("EventsClient", () => { eventSubtype: "event_subtype", flagId: "flag_id", userId: "user_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -364,7 +377,7 @@ describe("EventsClient", () => { ], id: "id", loadedAt: new Date("2024-01-15T09:30:00.000Z"), - quantity: 1, + quantity: 1000000, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "enriched", subtype: "subtype", @@ -381,8 +394,8 @@ describe("EventsClient", () => { eventSubtype: "event_subtype", eventTypes: ["flag_check"], flagId: "flag_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, userId: "user_id", }, }); @@ -393,6 +406,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -405,6 +419,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -417,6 +432,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -429,6 +445,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -441,6 +458,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -462,6 +480,7 @@ describe("EventsClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/events") @@ -493,6 +512,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "flag_check" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/events") @@ -514,6 +534,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "flag_check" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/events") @@ -535,6 +556,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "flag_check" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/events") @@ -556,6 +578,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "flag_check" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/events") @@ -577,6 +600,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "flag_check" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/events") @@ -611,7 +635,7 @@ describe("EventsClient", () => { features: [{ id: "id", name: "name" }], id: "id", loaded_at: "2024-01-15T09:30:00Z", - quantity: 1, + quantity: 1000000, sent_at: "2024-01-15T09:30:00Z", status: "enriched", subtype: "subtype", @@ -621,6 +645,7 @@ describe("EventsClient", () => { }, params: { key: "value" }, }; + server.mockEndpoint().get("/events/event_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.getEvent("event_id"); @@ -650,7 +675,7 @@ describe("EventsClient", () => { ], id: "id", loadedAt: new Date("2024-01-15T09:30:00.000Z"), - quantity: 1, + quantity: 1000000, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "enriched", subtype: "subtype", @@ -674,6 +699,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events/event_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -686,6 +712,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events/event_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -698,6 +725,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events/event_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -710,6 +738,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/events/event_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -725,6 +754,7 @@ describe("EventsClient", () => { data: { connected: true, environment_id: "environment_id", last_event_at: "2024-01-15T09:30:00Z" }, params: { key: "value" }, }; + server .mockEndpoint() .get("/segment-integration") @@ -751,6 +781,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/segment-integration") @@ -769,6 +800,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/segment-integration") @@ -787,6 +819,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/segment-integration") @@ -805,6 +838,7 @@ describe("EventsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/segment-integration") diff --git a/tests/wire/features.test.ts b/tests/wire/features.test.ts index fc6b09c5..f17feb05 100644 --- a/tests/wire/features.test.ts +++ b/tests/wire/features.test.ts @@ -16,11 +16,11 @@ describe("FeaturesClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -75,7 +75,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -109,14 +109,15 @@ describe("FeaturesClient", () => { boolean_require_event: true, feature_type: ["boolean"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_version_id: "plan_version_id", q: "q", without_company_override_for: "without_company_override_for", without_plan_entitlement_for: "without_plan_entitlement_for", }, }; + server.mockEndpoint().get("/features").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.listFeatures({ @@ -125,8 +126,8 @@ describe("FeaturesClient", () => { planVersionId: "plan_version_id", withoutPlanEntitlementFor: "without_plan_entitlement_for", booleanRequireEvent: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -135,11 +136,11 @@ describe("FeaturesClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -204,7 +205,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -243,8 +244,8 @@ describe("FeaturesClient", () => { booleanRequireEvent: true, featureType: ["boolean"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -258,6 +259,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -270,6 +272,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -282,6 +285,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -294,6 +298,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -306,6 +311,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -323,12 +329,12 @@ describe("FeaturesClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -383,7 +389,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -414,6 +420,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/features") @@ -434,12 +441,12 @@ describe("FeaturesClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -504,7 +511,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -549,6 +556,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", feature_type: "boolean", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/features") @@ -572,6 +580,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", feature_type: "boolean", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/features") @@ -595,6 +604,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", feature_type: "boolean", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/features") @@ -618,6 +628,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", feature_type: "boolean", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/features") @@ -641,6 +652,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", feature_type: "boolean", name: "name" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/features") @@ -669,12 +681,12 @@ describe("FeaturesClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -729,7 +741,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -760,6 +772,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/features/feature_id") @@ -775,12 +788,12 @@ describe("FeaturesClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -845,7 +858,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -890,6 +903,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/features/feature_id") @@ -908,6 +922,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/features/feature_id") @@ -926,6 +941,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/features/feature_id") @@ -944,6 +960,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/features/feature_id") @@ -967,12 +984,12 @@ describe("FeaturesClient", () => { description: "description", event_subtype: "event_subtype", event_summary: { - company_count: 1, + company_count: 1000000, environment_id: "environment_id", - event_count: 1, + event_count: 1000000, event_subtype: "event_subtype", last_seen_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, feature_type: "boolean", flags: [ @@ -1027,7 +1044,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1058,6 +1075,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/features/feature_id") @@ -1074,12 +1092,12 @@ describe("FeaturesClient", () => { description: "description", eventSubtype: "event_subtype", eventSummary: { - companyCount: 1, + companyCount: 1000000, environmentId: "environment_id", - eventCount: 1, + eventCount: 1000000, eventSubtype: "event_subtype", lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, featureType: "boolean", flags: [ @@ -1144,7 +1162,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1189,6 +1207,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/features/feature_id") @@ -1208,6 +1227,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/features/feature_id") @@ -1227,6 +1247,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/features/feature_id") @@ -1246,6 +1267,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/features/feature_id") @@ -1265,6 +1287,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/features/feature_id") @@ -1284,6 +1307,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1308,6 +1332,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1326,6 +1351,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1344,6 +1370,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1362,6 +1389,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1380,6 +1408,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/features/feature_id") @@ -1403,14 +1432,15 @@ describe("FeaturesClient", () => { boolean_require_event: true, feature_type: ["boolean"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, plan_version_id: "plan_version_id", q: "q", without_company_override_for: "without_company_override_for", without_plan_entitlement_for: "without_plan_entitlement_for", }, }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.countFeatures({ @@ -1419,8 +1449,8 @@ describe("FeaturesClient", () => { planVersionId: "plan_version_id", withoutPlanEntitlementFor: "without_plan_entitlement_for", booleanRequireEvent: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -1430,8 +1460,8 @@ describe("FeaturesClient", () => { booleanRequireEvent: true, featureType: ["boolean"], ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -1445,6 +1475,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1457,6 +1488,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1469,6 +1501,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1481,6 +1514,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1493,6 +1527,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/features/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1569,7 +1604,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1578,15 +1613,16 @@ describe("FeaturesClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { feature_id: "feature_id", ids: ["ids"], limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", ids: ["ids"], limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/flags").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.listFlags({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -1663,7 +1699,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1675,8 +1711,8 @@ describe("FeaturesClient", () => { params: { featureId: "feature_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -1687,6 +1723,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1699,6 +1736,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1711,6 +1749,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1723,6 +1762,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1735,6 +1775,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1822,7 +1863,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1832,6 +1873,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/flags") @@ -1928,7 +1970,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1953,6 +1995,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags") @@ -1984,6 +2027,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags") @@ -2015,6 +2059,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags") @@ -2046,6 +2091,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags") @@ -2077,6 +2123,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags") @@ -2171,7 +2218,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -2181,6 +2228,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server.mockEndpoint().get("/flags/flag_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.getFlag("flag_id"); @@ -2264,7 +2312,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2283,6 +2331,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/flag_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2295,6 +2344,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/flag_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2307,6 +2357,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/flag_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2319,6 +2370,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/flag_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2406,7 +2458,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -2416,6 +2468,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2512,7 +2565,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2537,6 +2590,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2568,6 +2622,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2599,6 +2654,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2630,6 +2686,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2661,6 +2718,7 @@ describe("FeaturesClient", () => { name: "name", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id") @@ -2686,6 +2744,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.deleteFlag("flag_id"); @@ -2704,6 +2763,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2716,6 +2776,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2728,6 +2789,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2740,6 +2802,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2752,6 +2815,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/flags/flag_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2770,7 +2834,7 @@ describe("FeaturesClient", () => { ], conditions: [{ condition_type: "company", operator: "eq", resource_ids: ["resource_ids"] }], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -2832,7 +2896,7 @@ describe("FeaturesClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -2841,6 +2905,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -2872,7 +2937,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -2944,7 +3009,7 @@ describe("FeaturesClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2998,7 +3063,7 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3037,12 +3102,13 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -3099,7 +3165,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3146,7 +3212,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -3195,7 +3261,7 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3234,12 +3300,13 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -3296,7 +3363,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3343,7 +3410,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -3392,7 +3459,7 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3431,12 +3498,13 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -3493,7 +3561,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3540,7 +3608,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -3589,7 +3657,7 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3628,12 +3696,13 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -3690,7 +3759,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3737,7 +3806,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -3786,7 +3855,7 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3825,12 +3894,13 @@ describe("FeaturesClient", () => { { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/flags/flag_id/rules") @@ -3887,7 +3957,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, { @@ -3934,7 +4004,7 @@ describe("FeaturesClient", () => { }, ], name: "name", - priority: 1, + priority: 1000000, value: true, }, ], @@ -3950,7 +4020,7 @@ describe("FeaturesClient", () => { data: { company_id: "company_id", entitlement: { - allocation: 1, + allocation: 1000000, credit_id: "credit_id", credit_remaining: 1.1, credit_total: 1.1, @@ -3961,8 +4031,8 @@ describe("FeaturesClient", () => { metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", month_reset: "first_of_month", - soft_limit: 1, - usage: 1, + soft_limit: 1000000, + usage: 1000000, value_type: "boolean", }, error: "error", @@ -3976,6 +4046,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/flags/key/check") @@ -3990,7 +4061,7 @@ describe("FeaturesClient", () => { data: { companyId: "company_id", entitlement: { - allocation: 1, + allocation: 1000000, creditId: "credit_id", creditRemaining: 1.1, creditTotal: 1.1, @@ -4001,8 +4072,8 @@ describe("FeaturesClient", () => { metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), monthReset: "first_of_month", - softLimit: 1, - usage: 1, + softLimit: 1000000, + usage: 1000000, valueType: "boolean", }, error: "error", @@ -4025,6 +4096,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/key/check") @@ -4044,6 +4116,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/key/check") @@ -4063,6 +4136,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/key/check") @@ -4082,6 +4156,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/key/check") @@ -4101,6 +4176,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/key/check") @@ -4126,6 +4202,7 @@ describe("FeaturesClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/flags/check") @@ -4162,6 +4239,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check") @@ -4181,6 +4259,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check") @@ -4200,6 +4279,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check") @@ -4219,6 +4299,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check") @@ -4238,6 +4319,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check") @@ -4260,6 +4342,7 @@ describe("FeaturesClient", () => { data: { data: [{ flags: [{ flag: "flag", reason: "reason", value: true }] }] }, params: { key: "value" }, }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4297,6 +4380,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contexts: [{}, {}] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4318,6 +4402,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contexts: [{}, {}] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4339,6 +4424,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contexts: [{}, {}] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4360,6 +4446,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contexts: [{}, {}] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4381,6 +4468,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contexts: [{}, {}] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/flags/check-bulk") @@ -4403,15 +4491,16 @@ describe("FeaturesClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { feature_id: "feature_id", ids: ["ids"], limit: 1, offset: 1, q: "q" }, + params: { feature_id: "feature_id", ids: ["ids"], limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.features.countFlags({ featureId: "feature_id", q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -4420,8 +4509,8 @@ describe("FeaturesClient", () => { params: { featureId: "feature_id", ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -4432,6 +4521,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4444,6 +4534,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4456,6 +4547,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4468,6 +4560,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -4480,6 +4573,7 @@ describe("FeaturesClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/flags/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/planbundle.test.ts b/tests/wire/planbundle.test.ts index 8ceb43d3..a7597c70 100644 --- a/tests/wire/planbundle.test.ts +++ b/tests/wire/planbundle.test.ts @@ -21,14 +21,14 @@ describe("PlanbundleClient", () => { monthly_price_id: "monthly_price_id", one_time_price_id: "one_time_price_id", plan_id: "plan_id", - trial_days: 1, + trial_days: 1000000, yearly_price_id: "yearly_price_id", }, credit_grants: [ { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -74,6 +74,7 @@ describe("PlanbundleClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-bundles") @@ -102,14 +103,14 @@ describe("PlanbundleClient", () => { monthlyPriceId: "monthly_price_id", oneTimePriceId: "one_time_price_id", planId: "plan_id", - trialDays: 1, + trialDays: 1000000, yearlyPriceId: "yearly_price_id", }, creditGrants: [ { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -164,6 +165,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-bundles") @@ -192,6 +194,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-bundles") @@ -220,6 +223,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-bundles") @@ -248,6 +252,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-bundles") @@ -276,6 +281,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-bundles") @@ -315,14 +321,14 @@ describe("PlanbundleClient", () => { monthly_price_id: "monthly_price_id", one_time_price_id: "one_time_price_id", plan_id: "plan_id", - trial_days: 1, + trial_days: 1000000, yearly_price_id: "yearly_price_id", }, credit_grants: [ { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -368,6 +374,7 @@ describe("PlanbundleClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") @@ -396,14 +403,14 @@ describe("PlanbundleClient", () => { monthlyPriceId: "monthly_price_id", oneTimePriceId: "one_time_price_id", planId: "plan_id", - trialDays: 1, + trialDays: 1000000, yearlyPriceId: "yearly_price_id", }, creditGrants: [ { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -458,6 +465,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") @@ -486,6 +494,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") @@ -514,6 +523,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") @@ -542,6 +552,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") @@ -570,6 +581,7 @@ describe("PlanbundleClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { entitlements: [{ action: "create" }, { action: "create" }] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-bundles/plan_bundle_id") diff --git a/tests/wire/plangroups.test.ts b/tests/wire/plangroups.test.ts index 80b7ba33..6ab1d499 100644 --- a/tests/wire/plangroups.test.ts +++ b/tests/wire/plangroups.test.ts @@ -14,7 +14,7 @@ describe("PlangroupsClient", () => { add_ons: [ { charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -88,7 +88,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -124,7 +124,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -151,7 +151,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -167,7 +167,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -175,11 +175,11 @@ describe("PlangroupsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -199,7 +199,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, entitlements: [ { @@ -270,7 +270,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -292,7 +292,7 @@ describe("PlangroupsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -310,7 +310,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -320,12 +320,12 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -338,7 +338,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -346,7 +346,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -362,7 +362,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -378,7 +378,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -386,11 +386,11 @@ describe("PlangroupsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -410,7 +410,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, entitlements: [ { @@ -481,7 +481,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -503,7 +503,7 @@ describe("PlangroupsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -521,7 +521,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -531,12 +531,12 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -549,7 +549,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -557,7 +557,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -575,7 +575,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -591,7 +591,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -599,11 +599,11 @@ describe("PlangroupsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -623,7 +623,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, entitlements: [ { @@ -694,7 +694,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -716,7 +716,7 @@ describe("PlangroupsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -734,7 +734,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -744,12 +744,12 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -762,7 +762,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -770,7 +770,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -786,8 +786,8 @@ describe("PlangroupsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -807,7 +807,7 @@ describe("PlangroupsClient", () => { plans: [ { charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -881,7 +881,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -917,7 +917,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], }, @@ -935,7 +935,7 @@ describe("PlangroupsClient", () => { show_zero_price_as_free: true, sync_customer_billing_details: true, tax_collection_enabled: true, - trial_days: 1, + trial_days: 1000000, trial_expiry_plan: { active_version: { created_at: "2024-01-15T09:30:00Z", @@ -947,7 +947,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -963,7 +963,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -971,11 +971,11 @@ describe("PlangroupsClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", @@ -995,7 +995,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, entitlements: [ { @@ -1066,7 +1066,7 @@ describe("PlangroupsClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1088,7 +1088,7 @@ describe("PlangroupsClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1106,7 +1106,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1116,12 +1116,12 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -1134,7 +1134,7 @@ describe("PlangroupsClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -1142,7 +1142,7 @@ describe("PlangroupsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1158,8 +1158,8 @@ describe("PlangroupsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_decimal: "price_decimal", price_external_id: "price_external_id", price_id: "price_id", @@ -1177,6 +1177,7 @@ describe("PlangroupsClient", () => { }, params: { include_company_counts: true }, }; + server.mockEndpoint().get("/plan-groups").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plangroups.getPlanGroup({ @@ -1187,7 +1188,7 @@ describe("PlangroupsClient", () => { addOns: [ { chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1271,7 +1272,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1312,7 +1313,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -1347,7 +1348,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1363,7 +1364,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1371,11 +1372,11 @@ describe("PlangroupsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1395,7 +1396,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, entitlements: [ { @@ -1476,7 +1477,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1503,7 +1504,7 @@ describe("PlangroupsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1521,7 +1522,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1531,12 +1532,12 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -1549,7 +1550,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -1557,7 +1558,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1573,7 +1574,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1589,7 +1590,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1597,11 +1598,11 @@ describe("PlangroupsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1621,7 +1622,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, entitlements: [ { @@ -1702,7 +1703,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1729,7 +1730,7 @@ describe("PlangroupsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1747,7 +1748,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1757,12 +1758,12 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -1775,7 +1776,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -1783,7 +1784,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1801,7 +1802,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1817,7 +1818,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1825,11 +1826,11 @@ describe("PlangroupsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1849,7 +1850,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, entitlements: [ { @@ -1930,7 +1931,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1957,7 +1958,7 @@ describe("PlangroupsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1975,7 +1976,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1985,12 +1986,12 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2003,7 +2004,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2011,7 +2012,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2027,8 +2028,8 @@ describe("PlangroupsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -2060,7 +2061,7 @@ describe("PlangroupsClient", () => { plans: [ { chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2144,7 +2145,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2185,7 +2186,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], }, @@ -2203,7 +2204,7 @@ describe("PlangroupsClient", () => { showZeroPriceAsFree: true, syncCustomerBillingDetails: true, taxCollectionEnabled: true, - trialDays: 1, + trialDays: 1000000, trialExpiryPlan: { activeVersion: { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2215,7 +2216,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -2231,7 +2232,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2239,11 +2240,11 @@ describe("PlangroupsClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2263,7 +2264,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, entitlements: [ { @@ -2344,7 +2345,7 @@ describe("PlangroupsClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2371,7 +2372,7 @@ describe("PlangroupsClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2389,7 +2390,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2399,12 +2400,12 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2417,7 +2418,7 @@ describe("PlangroupsClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2425,7 +2426,7 @@ describe("PlangroupsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2441,8 +2442,8 @@ describe("PlangroupsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceDecimal: "price_decimal", priceExternalId: "price_external_id", priceId: "price_id", @@ -2469,6 +2470,7 @@ describe("PlangroupsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-groups").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2481,6 +2483,7 @@ describe("PlangroupsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-groups").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2493,6 +2496,7 @@ describe("PlangroupsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-groups").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2505,6 +2509,7 @@ describe("PlangroupsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plan-groups").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2569,13 +2574,14 @@ describe("PlangroupsClient", () => { show_zero_price_as_free: true, sync_customer_billing_details: true, tax_collection_enabled: true, - trial_days: 1, + trial_days: 1000000, trial_expiry_plan_id: "trial_expiry_plan_id", trial_expiry_plan_price_id: "trial_expiry_plan_price_id", trial_payment_method_required: true, }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plan-groups") @@ -2666,7 +2672,7 @@ describe("PlangroupsClient", () => { showZeroPriceAsFree: true, syncCustomerBillingDetails: true, taxCollectionEnabled: true, - trialDays: 1, + trialDays: 1000000, trialExpiryPlanId: "trial_expiry_plan_id", trialExpiryPlanPriceId: "trial_expiry_plan_price_id", trialPaymentMethodRequired: true, @@ -2701,6 +2707,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-groups") @@ -2779,6 +2786,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-groups") @@ -2857,6 +2865,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-groups") @@ -2935,6 +2944,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-groups") @@ -3013,6 +3023,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plan-groups") @@ -3124,13 +3135,14 @@ describe("PlangroupsClient", () => { show_zero_price_as_free: true, sync_customer_billing_details: true, tax_collection_enabled: true, - trial_days: 1, + trial_days: 1000000, trial_expiry_plan_id: "trial_expiry_plan_id", trial_expiry_plan_price_id: "trial_expiry_plan_price_id", trial_payment_method_required: true, }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") @@ -3221,7 +3233,7 @@ describe("PlangroupsClient", () => { showZeroPriceAsFree: true, syncCustomerBillingDetails: true, taxCollectionEnabled: true, - trialDays: 1, + trialDays: 1000000, trialExpiryPlanId: "trial_expiry_plan_id", trialExpiryPlanPriceId: "trial_expiry_plan_price_id", trialPaymentMethodRequired: true, @@ -3256,6 +3268,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") @@ -3334,6 +3347,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") @@ -3412,6 +3426,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") @@ -3490,6 +3505,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") @@ -3568,6 +3584,7 @@ describe("PlangroupsClient", () => { sync_customer_billing_details: true, }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plan-groups/plan_group_id") diff --git a/tests/wire/planmigrations.test.ts b/tests/wire/planmigrations.test.ts index b322a955..bbc400ca 100644 --- a/tests/wire/planmigrations.test.ts +++ b/tests/wire/planmigrations.test.ts @@ -25,8 +25,9 @@ describe("PlanmigrationsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, ], - params: { limit: 1, migration_id: "migration_id", offset: 1, q: "q", status: "completed" }, + params: { limit: 1000000, migration_id: "migration_id", offset: 1000000, q: "q", status: "completed" }, }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -39,8 +40,8 @@ describe("PlanmigrationsClient", () => { migrationId: "migration_id", q: "q", status: "completed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -59,9 +60,9 @@ describe("PlanmigrationsClient", () => { }, ], params: { - limit: 1, + limit: 1000000, migrationId: "migration_id", - offset: 1, + offset: 1000000, q: "q", status: "completed", }, @@ -73,6 +74,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -91,6 +93,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -109,6 +112,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -127,6 +131,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -145,6 +150,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations") @@ -164,8 +170,9 @@ describe("PlanmigrationsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { limit: 1, migration_id: "migration_id", offset: 1, q: "q", status: "completed" }, + params: { limit: 1000000, migration_id: "migration_id", offset: 1000000, q: "q", status: "completed" }, }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -178,17 +185,17 @@ describe("PlanmigrationsClient", () => { migrationId: "migration_id", q: "q", status: "completed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { count: 1, }, params: { - limit: 1, + limit: 1000000, migrationId: "migration_id", - offset: 1, + offset: 1000000, q: "q", status: "completed", }, @@ -200,6 +207,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -218,6 +226,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -236,6 +245,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -254,6 +264,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -272,6 +283,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-company-migrations/count") @@ -293,24 +305,25 @@ describe("PlanmigrationsClient", () => { data: [ { completed_at: "2024-01-15T09:30:00Z", - completed_companies: 1, + completed_companies: 1000000, created_at: "2024-01-15T09:30:00Z", error: "error", - failed_companies: 1, + failed_companies: 1000000, id: "id", plan_id: "plan_id", plan_version_id_from: "plan_version_id_from", plan_version_id_to: "plan_version_id_to", - skipped_companies: 1, + skipped_companies: 1000000, started_at: "2024-01-15T09:30:00Z", status: "completed", strategy: "immediate", - total_companies: 1, + total_companies: 1000000, updated_at: "2024-01-15T09:30:00Z", }, ], - params: { limit: 1, offset: 1, plan_version_id: "plan_version_id", status: "completed" }, + params: { limit: 1000000, offset: 1000000, plan_version_id: "plan_version_id", status: "completed" }, }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -322,32 +335,32 @@ describe("PlanmigrationsClient", () => { const response = await client.planmigrations.listMigrations({ planVersionId: "plan_version_id", status: "completed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ { completedAt: new Date("2024-01-15T09:30:00.000Z"), - completedCompanies: 1, + completedCompanies: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), error: "error", - failedCompanies: 1, + failedCompanies: 1000000, id: "id", planId: "plan_id", planVersionIdFrom: "plan_version_id_from", planVersionIdTo: "plan_version_id_to", - skippedCompanies: 1, + skippedCompanies: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "completed", strategy: "immediate", - totalCompanies: 1, + totalCompanies: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planVersionId: "plan_version_id", status: "completed", }, @@ -359,6 +372,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -377,6 +391,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -395,6 +410,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -413,6 +429,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -431,6 +448,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations") @@ -451,23 +469,24 @@ describe("PlanmigrationsClient", () => { const rawResponseBody = { data: { completed_at: "2024-01-15T09:30:00Z", - completed_companies: 1, + completed_companies: 1000000, created_at: "2024-01-15T09:30:00Z", error: "error", - failed_companies: 1, + failed_companies: 1000000, id: "id", plan_id: "plan_id", plan_version_id_from: "plan_version_id_from", plan_version_id_to: "plan_version_id_to", - skipped_companies: 1, + skipped_companies: 1000000, started_at: "2024-01-15T09:30:00Z", status: "completed", strategy: "immediate", - total_companies: 1, + total_companies: 1000000, updated_at: "2024-01-15T09:30:00Z", }, params: { key: "value" }, }; + server .mockEndpoint() .get("/plan-version-migrations/plan_version_migration_id") @@ -480,19 +499,19 @@ describe("PlanmigrationsClient", () => { expect(response).toEqual({ data: { completedAt: new Date("2024-01-15T09:30:00.000Z"), - completedCompanies: 1, + completedCompanies: 1000000, createdAt: new Date("2024-01-15T09:30:00.000Z"), error: "error", - failedCompanies: 1, + failedCompanies: 1000000, id: "id", planId: "plan_id", planVersionIdFrom: "plan_version_id_from", planVersionIdTo: "plan_version_id_to", - skippedCompanies: 1, + skippedCompanies: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "completed", strategy: "immediate", - totalCompanies: 1, + totalCompanies: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, params: { @@ -506,6 +525,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/plan_version_migration_id") @@ -524,6 +544,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/plan_version_migration_id") @@ -542,6 +563,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/plan_version_migration_id") @@ -560,6 +582,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/plan_version_migration_id") @@ -579,8 +602,9 @@ describe("PlanmigrationsClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { limit: 1, offset: 1, plan_version_id: "plan_version_id", status: "completed" }, + params: { limit: 1000000, offset: 1000000, plan_version_id: "plan_version_id", status: "completed" }, }; + server .mockEndpoint() .get("/plan-version-migrations/count") @@ -592,16 +616,16 @@ describe("PlanmigrationsClient", () => { const response = await client.planmigrations.countMigrations({ planVersionId: "plan_version_id", status: "completed", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { count: 1, }, params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, planVersionId: "plan_version_id", status: "completed", }, @@ -613,6 +637,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/count") @@ -631,6 +656,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/count") @@ -649,6 +675,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/count") @@ -667,6 +694,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/count") @@ -685,6 +713,7 @@ describe("PlanmigrationsClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/plan-version-migrations/count") diff --git a/tests/wire/plans.test.ts b/tests/wire/plans.test.ts index fec1767d..6fdeccbd 100644 --- a/tests/wire/plans.test.ts +++ b/tests/wire/plans.test.ts @@ -18,7 +18,7 @@ describe("PlansClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -34,7 +34,7 @@ describe("PlansClient", () => { billing_credit_balances: { key: 1.1 }, billing_subscription: { application_id: "application_id", - cancel_at: 1, + cancel_at: 1000000, cancel_at_period_end: true, company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -56,9 +56,9 @@ describe("PlansClient", () => { id: "id", interval: "interval", latest_invoice: { - amount_due: 1, - amount_paid: 1, - amount_remaining: 1, + amount_due: 1000000, + amount_paid: 1000000, + amount_remaining: 1000000, collection_method: "collection_method", created_at: "2024-01-15T09:30:00Z", currency: "currency", @@ -66,7 +66,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", provider_type: "schematic", - subtotal: 1, + subtotal: 1000000, updated_at: "2024-01-15T09:30:00Z", }, metadata: { key: "value" }, @@ -80,8 +80,8 @@ describe("PlansClient", () => { provider_type: "schematic", updated_at: "2024-01-15T09:30:00Z", }, - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -92,8 +92,8 @@ describe("PlansClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -107,8 +107,8 @@ describe("PlansClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, - trial_end: 1, + total_price: 1000000, + trial_end: 1000000, trial_end_setting: "cancel", }, billing_subscriptions: [ @@ -130,8 +130,8 @@ describe("PlansClient", () => { ], id: "id", interval: "interval", - period_end: 1, - period_start: 1, + period_end: 1000000, + period_start: 1000000, products: [ { billing_scheme: "per_unit", @@ -142,8 +142,8 @@ describe("PlansClient", () => { id: "id", interval: "interval", name: "name", - package_size: 1, - price: 1, + package_size: 1000000, + price: 1000000, price_external_id: "price_external_id", price_id: "price_id", price_tier: [{}], @@ -157,7 +157,7 @@ describe("PlansClient", () => { provider_type: "schematic", status: "status", subscription_external_id: "subscription_external_id", - total_price: 1, + total_price: 1000000, }, ], created_at: "2024-01-15T09:30:00Z", @@ -168,8 +168,8 @@ describe("PlansClient", () => { billing_email: "billing_email", billing_name: "billing_name", card_brand: "card_brand", - card_exp_month: 1, - card_exp_year: 1, + card_exp_month: 1000000, + card_exp_year: 1000000, card_last4: "card_last4", company_id: "company_id", created_at: "2024-01-15T09:30:00Z", @@ -220,7 +220,7 @@ describe("PlansClient", () => { event_subtype: "event_subtype", month_reset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -247,7 +247,7 @@ describe("PlansClient", () => { { billing_credit_auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_description: "credit_description", credit_id: "credit_id", credit_name: "credit_name", @@ -259,7 +259,7 @@ describe("PlansClient", () => { ], name: "name", plan_period: "plan_period", - plan_price: 1, + plan_price: 1000000, plan_version_id: "plan_version_id", }, plans: [{ id: "id", name: "name" }], @@ -295,7 +295,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "default", value: true, }, @@ -305,20 +305,21 @@ describe("PlansClient", () => { effective_after: "2024-01-15T09:30:00Z", from_plan_id: "from_plan_id", from_plan_name: "from_plan_name", - from_subscription_price: 1, + from_subscription_price: 1000000, id: "id", interval: "interval", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, to_plan_id: "to_plan_id", to_plan_name: "to_plan_name", }, traits: { key: "value" }, updated_at: "2024-01-15T09:30:00Z", - user_count: 1, + user_count: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -340,7 +341,7 @@ describe("PlansClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -358,7 +359,7 @@ describe("PlansClient", () => { }, billingSubscription: { applicationId: "application_id", - cancelAt: 1, + cancelAt: 1000000, cancelAtPeriodEnd: true, companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -380,9 +381,9 @@ describe("PlansClient", () => { id: "id", interval: "interval", latestInvoice: { - amountDue: 1, - amountPaid: 1, - amountRemaining: 1, + amountDue: 1000000, + amountPaid: 1000000, + amountRemaining: 1000000, collectionMethod: "collection_method", createdAt: new Date("2024-01-15T09:30:00.000Z"), currency: "currency", @@ -390,7 +391,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", providerType: "schematic", - subtotal: 1, + subtotal: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metadata: { @@ -406,8 +407,8 @@ describe("PlansClient", () => { providerType: "schematic", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -418,8 +419,8 @@ describe("PlansClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -433,8 +434,8 @@ describe("PlansClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, - trialEnd: 1, + totalPrice: 1000000, + trialEnd: 1000000, trialEndSetting: "cancel", }, billingSubscriptions: [ @@ -456,8 +457,8 @@ describe("PlansClient", () => { ], id: "id", interval: "interval", - periodEnd: 1, - periodStart: 1, + periodEnd: 1000000, + periodStart: 1000000, products: [ { billingScheme: "per_unit", @@ -468,8 +469,8 @@ describe("PlansClient", () => { id: "id", interval: "interval", name: "name", - packageSize: 1, - price: 1, + packageSize: 1000000, + price: 1000000, priceExternalId: "price_external_id", priceId: "price_id", priceTier: [{}], @@ -483,7 +484,7 @@ describe("PlansClient", () => { providerType: "schematic", status: "status", subscriptionExternalId: "subscription_external_id", - totalPrice: 1, + totalPrice: 1000000, }, ], createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -494,8 +495,8 @@ describe("PlansClient", () => { billingEmail: "billing_email", billingName: "billing_name", cardBrand: "card_brand", - cardExpMonth: 1, - cardExpYear: 1, + cardExpMonth: 1000000, + cardExpYear: 1000000, cardLast4: "card_last4", companyId: "company_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -552,7 +553,7 @@ describe("PlansClient", () => { eventSubtype: "event_subtype", monthReset: "month_reset", period: "period", - value: 1, + value: 1000000, }, ], name: "name", @@ -579,7 +580,7 @@ describe("PlansClient", () => { { billingCreditAutoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditDescription: "credit_description", creditId: "credit_id", creditName: "credit_name", @@ -591,7 +592,7 @@ describe("PlansClient", () => { ], name: "name", planPeriod: "plan_period", - planPrice: 1, + planPrice: 1000000, planVersionId: "plan_version_id", }, plans: [ @@ -632,7 +633,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "default", value: true, }, @@ -642,11 +643,11 @@ describe("PlansClient", () => { effectiveAfter: new Date("2024-01-15T09:30:00.000Z"), fromPlanId: "from_plan_id", fromPlanName: "from_plan_name", - fromSubscriptionPrice: 1, + fromSubscriptionPrice: 1000000, id: "id", interval: "interval", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, toPlanId: "to_plan_id", toPlanName: "to_plan_name", }, @@ -654,7 +655,7 @@ describe("PlansClient", () => { key: "value", }, updatedAt: new Date("2024-01-15T09:30:00.000Z"), - userCount: 1, + userCount: 1000000, }, params: { key: "value", @@ -667,6 +668,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { add_on_ids: ["add_on_ids", "add_on_ids"] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -688,6 +690,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { add_on_ids: ["add_on_ids", "add_on_ids"] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -709,6 +712,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { add_on_ids: ["add_on_ids", "add_on_ids"] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -730,6 +734,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { add_on_ids: ["add_on_ids", "add_on_ids"] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -751,6 +756,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { add_on_ids: ["add_on_ids", "add_on_ids"] }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/company-plans/company_plan_id") @@ -784,7 +790,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -800,7 +806,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -808,11 +814,11 @@ describe("PlansClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -826,7 +832,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -885,7 +891,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -907,7 +913,7 @@ describe("PlansClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -924,7 +930,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -934,12 +940,12 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -952,7 +958,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -960,7 +966,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -973,14 +979,16 @@ describe("PlansClient", () => { for_trial_expiry_plan: true, has_product_id: true, ids: ["ids"], - limit: 1, - offset: 1, + include_draft_versions: true, + limit: 1000000, + offset: 1000000, plan_type: "plan", q: "q", without_entitlement_for: "without_entitlement_for", without_paid_product_id: true, }, }; + server.mockEndpoint().get("/plans").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plans.listPlans({ @@ -989,12 +997,13 @@ describe("PlansClient", () => { forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + includeDraftVersions: true, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", withoutPaidProductId: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -1009,7 +1018,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1025,7 +1034,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1033,11 +1042,11 @@ describe("PlansClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -1051,7 +1060,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -1120,7 +1129,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1147,7 +1156,7 @@ describe("PlansClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1164,7 +1173,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1174,12 +1183,12 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -1192,7 +1201,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -1200,7 +1209,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1213,8 +1222,9 @@ describe("PlansClient", () => { forTrialExpiryPlan: true, hasProductId: true, ids: ["ids"], - limit: 1, - offset: 1, + includeDraftVersions: true, + limit: 1000000, + offset: 1000000, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", @@ -1228,6 +1238,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1240,6 +1251,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1252,6 +1264,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1264,6 +1277,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1276,6 +1290,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1300,7 +1315,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -1317,7 +1332,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1325,11 +1340,11 @@ describe("PlansClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -1344,7 +1359,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -1403,7 +1418,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1425,7 +1440,7 @@ describe("PlansClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1442,7 +1457,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -1453,13 +1468,13 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -1472,7 +1487,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -1480,7 +1495,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -1488,6 +1503,7 @@ describe("PlansClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/plans") @@ -1515,7 +1531,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -1532,7 +1548,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -1540,11 +1556,11 @@ describe("PlansClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -1559,7 +1575,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -1628,7 +1644,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -1655,7 +1671,7 @@ describe("PlansClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -1672,7 +1688,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -1683,13 +1699,13 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -1702,7 +1718,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -1710,7 +1726,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -1727,6 +1743,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "x", plan_type: "plan" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plans") @@ -1750,6 +1767,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "x", plan_type: "plan" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plans") @@ -1773,6 +1791,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "x", plan_type: "plan" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plans") @@ -1796,6 +1815,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "x", plan_type: "plan" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plans") @@ -1819,6 +1839,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { description: "description", name: "x", plan_type: "plan" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/plans") @@ -1854,7 +1875,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -1871,7 +1892,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -1879,11 +1900,11 @@ describe("PlansClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -1898,7 +1919,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -1957,7 +1978,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -1979,7 +2000,7 @@ describe("PlansClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -1996,7 +2017,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -2007,13 +2028,13 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -2026,7 +2047,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -2034,7 +2055,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -2042,6 +2063,7 @@ describe("PlansClient", () => { }, params: { plan_version_id: "plan_version_id" }, }; + server.mockEndpoint().get("/plans/plan_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plans.getPlan("plan_id", { @@ -2060,7 +2082,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -2077,7 +2099,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2085,11 +2107,11 @@ describe("PlansClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -2104,7 +2126,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -2173,7 +2195,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2200,7 +2222,7 @@ describe("PlansClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2217,7 +2239,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -2228,13 +2250,13 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2247,7 +2269,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2255,7 +2277,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -2272,6 +2294,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/plan_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2284,6 +2307,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/plan_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2296,6 +2320,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/plan_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2308,6 +2333,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/plan_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2332,7 +2358,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, billing_product: { account_id: "account_id", @@ -2349,7 +2375,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, provider_type: "schematic", scheme: "per_unit", }, @@ -2357,11 +2383,11 @@ describe("PlansClient", () => { product_id: "product_id", provider_type: "schematic", quantity: 1.1, - subscription_count: 1, + subscription_count: 1000000, updated_at: "2024-01-15T09:30:00Z", }, charge_type: "free", - company_count: 1, + company_count: 1000000, controlled_by: "schematic", created_at: "2024-01-15T09:30:00Z", description: "description", @@ -2376,7 +2402,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, features: [ { @@ -2435,7 +2461,7 @@ describe("PlansClient", () => { environment_id: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, rule_type: "rule_type", updated_at: "2024-01-15T09:30:00Z", value: true, @@ -2457,7 +2483,7 @@ describe("PlansClient", () => { { auto_topup_enabled: true, created_at: "2024-01-15T09:30:00Z", - credit_amount: 1, + credit_amount: 1000000, credit_id: "credit_id", credit_name: "credit_name", id: "id", @@ -2474,7 +2500,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -2485,13 +2511,13 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", }, plan_type: "plan", - trial_days: 1, + trial_days: 1000000, updated_at: "2024-01-15T09:30:00Z", versions: [ { @@ -2504,7 +2530,7 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, ], yearly_price: { @@ -2512,7 +2538,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, price_decimal: "price_decimal", provider_type: "schematic", scheme: "per_unit", @@ -2520,6 +2546,7 @@ describe("PlansClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2545,7 +2572,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, billingProduct: { accountId: "account_id", @@ -2562,7 +2589,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, providerType: "schematic", scheme: "per_unit", }, @@ -2570,11 +2597,11 @@ describe("PlansClient", () => { productId: "product_id", providerType: "schematic", quantity: 1.1, - subscriptionCount: 1, + subscriptionCount: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, chargeType: "free", - companyCount: 1, + companyCount: 1000000, controlledBy: "schematic", createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -2589,7 +2616,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, features: [ { @@ -2658,7 +2685,7 @@ describe("PlansClient", () => { environmentId: "environment_id", id: "id", name: "name", - priority: 1, + priority: 1000000, ruleType: "rule_type", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, @@ -2685,7 +2712,7 @@ describe("PlansClient", () => { { autoTopupEnabled: true, createdAt: new Date("2024-01-15T09:30:00.000Z"), - creditAmount: 1, + creditAmount: 1000000, creditId: "credit_id", creditName: "credit_name", id: "id", @@ -2702,7 +2729,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -2713,13 +2740,13 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", }, planType: "plan", - trialDays: 1, + trialDays: 1000000, updatedAt: new Date("2024-01-15T09:30:00.000Z"), versions: [ { @@ -2732,7 +2759,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, ], yearlyPrice: { @@ -2740,7 +2767,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", - price: 1, + price: 1000000, priceDecimal: "price_decimal", providerType: "schematic", scheme: "per_unit", @@ -2757,6 +2784,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2778,6 +2806,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2799,6 +2828,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2820,6 +2850,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2841,6 +2872,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "x" }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id") @@ -2862,6 +2894,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plans.deletePlan("plan_id"); @@ -2880,6 +2913,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2892,6 +2926,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2904,6 +2939,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2916,6 +2952,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2928,6 +2965,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().delete("/plans/plan_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2950,11 +2988,12 @@ describe("PlansClient", () => { monthly_price_id: "monthly_price_id", one_time_price_id: "one_time_price_id", plan_id: "plan_id", - trial_days: 1, + trial_days: 1000000, yearly_price_id: "yearly_price_id", }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -2979,7 +3018,7 @@ describe("PlansClient", () => { monthlyPriceId: "monthly_price_id", oneTimePriceId: "one_time_price_id", planId: "plan_id", - trialDays: 1, + trialDays: 1000000, yearlyPriceId: "yearly_price_id", }, params: { @@ -2993,6 +3032,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { charge_type: "free", is_trialable: true }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -3015,6 +3055,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { charge_type: "free", is_trialable: true }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -3037,6 +3078,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { charge_type: "free", is_trialable: true }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -3059,6 +3101,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { charge_type: "free", is_trialable: true }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -3081,6 +3124,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { charge_type: "free", is_trialable: true }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/plan_id/billing_products") @@ -3111,14 +3155,16 @@ describe("PlansClient", () => { for_trial_expiry_plan: true, has_product_id: true, ids: ["ids"], - limit: 1, - offset: 1, + include_draft_versions: true, + limit: 1000000, + offset: 1000000, plan_type: "plan", q: "q", without_entitlement_for: "without_entitlement_for", without_paid_product_id: true, }, }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plans.countPlans({ @@ -3127,12 +3173,13 @@ describe("PlansClient", () => { forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + includeDraftVersions: true, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", withoutPaidProductId: true, - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -3145,8 +3192,9 @@ describe("PlansClient", () => { forTrialExpiryPlan: true, hasProductId: true, ids: ["ids"], - limit: 1, - offset: 1, + includeDraftVersions: true, + limit: 1000000, + offset: 1000000, planType: "plan", q: "q", withoutEntitlementFor: "without_entitlement_for", @@ -3160,6 +3208,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3172,6 +3221,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3184,6 +3234,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3196,6 +3247,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3208,6 +3260,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3223,6 +3276,7 @@ describe("PlansClient", () => { data: [{ code: "code", description: "description", detail: "detail", id: "id" }], params: { plan_id: "plan_id", plan_version_id: "plan_version_id" }, }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.plans.listPlanIssues({ @@ -3250,6 +3304,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3264,6 +3319,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3278,6 +3334,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3292,6 +3349,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3306,6 +3364,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/plans/issues").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -3320,6 +3379,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3344,6 +3404,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3362,6 +3423,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3380,6 +3442,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3398,6 +3461,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3416,6 +3480,7 @@ describe("PlansClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/plans/version/plan_id") @@ -3445,10 +3510,11 @@ describe("PlansClient", () => { plan_type: "plan", status: "published", updated_at: "2024-01-15T09:30:00Z", - version: 1, + version: 1000000, }, params: { key: "value" }, }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") @@ -3474,7 +3540,7 @@ describe("PlansClient", () => { planType: "plan", status: "published", updatedAt: new Date("2024-01-15T09:30:00.000Z"), - version: 1, + version: 1000000, }, params: { key: "value", @@ -3490,6 +3556,7 @@ describe("PlansClient", () => { migration_strategy: "immediate", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") @@ -3515,6 +3582,7 @@ describe("PlansClient", () => { migration_strategy: "immediate", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") @@ -3540,6 +3608,7 @@ describe("PlansClient", () => { migration_strategy: "immediate", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") @@ -3565,6 +3634,7 @@ describe("PlansClient", () => { migration_strategy: "immediate", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") @@ -3590,6 +3660,7 @@ describe("PlansClient", () => { migration_strategy: "immediate", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/plans/version/plan_id/publish") diff --git a/tests/wire/scheduledcheckout.test.ts b/tests/wire/scheduledcheckout.test.ts index cade7a11..6dfdc1b2 100644 --- a/tests/wire/scheduledcheckout.test.ts +++ b/tests/wire/scheduledcheckout.test.ts @@ -21,15 +21,16 @@ describe("ScheduledcheckoutClient", () => { from_plan_id: "from_plan_id", id: "id", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, started_at: "2024-01-15T09:30:00Z", status: "cancelled", to_plan_id: "to_plan_id", updated_at: "2024-01-15T09:30:00Z", }, ], - params: { company_id: "company_id", limit: 1, offset: 1, status: "cancelled" }, + params: { company_id: "company_id", limit: 1000000, offset: 1000000, status: "cancelled" }, }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -41,8 +42,8 @@ describe("ScheduledcheckoutClient", () => { const response = await client.scheduledcheckout.listScheduledCheckouts({ companyId: "company_id", status: "cancelled", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -56,7 +57,7 @@ describe("ScheduledcheckoutClient", () => { fromPlanId: "from_plan_id", id: "id", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "cancelled", toPlanId: "to_plan_id", @@ -65,8 +66,8 @@ describe("ScheduledcheckoutClient", () => { ], params: { companyId: "company_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, status: "cancelled", }, }); @@ -77,6 +78,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -95,6 +97,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -113,6 +116,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -131,6 +135,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -149,6 +154,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout") @@ -182,7 +188,7 @@ describe("ScheduledcheckoutClient", () => { from_plan_id: "from_plan_id", id: "id", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, started_at: "2024-01-15T09:30:00Z", status: "cancelled", to_plan_id: "to_plan_id", @@ -190,6 +196,7 @@ describe("ScheduledcheckoutClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -216,7 +223,7 @@ describe("ScheduledcheckoutClient", () => { fromPlanId: "from_plan_id", id: "id", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "cancelled", toPlanId: "to_plan_id", @@ -238,6 +245,7 @@ describe("ScheduledcheckoutClient", () => { to_plan_id: "to_plan_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -267,6 +275,7 @@ describe("ScheduledcheckoutClient", () => { to_plan_id: "to_plan_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -296,6 +305,7 @@ describe("ScheduledcheckoutClient", () => { to_plan_id: "to_plan_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -325,6 +335,7 @@ describe("ScheduledcheckoutClient", () => { to_plan_id: "to_plan_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -354,6 +365,7 @@ describe("ScheduledcheckoutClient", () => { to_plan_id: "to_plan_id", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/scheduled-checkout") @@ -388,7 +400,7 @@ describe("ScheduledcheckoutClient", () => { from_plan_id: "from_plan_id", id: "id", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, started_at: "2024-01-15T09:30:00Z", status: "cancelled", to_plan_id: "to_plan_id", @@ -396,6 +408,7 @@ describe("ScheduledcheckoutClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/scheduled-checkout/scheduled_checkout_id") @@ -416,7 +429,7 @@ describe("ScheduledcheckoutClient", () => { fromPlanId: "from_plan_id", id: "id", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "cancelled", toPlanId: "to_plan_id", @@ -433,6 +446,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout/scheduled_checkout_id") @@ -451,6 +465,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout/scheduled_checkout_id") @@ -469,6 +484,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout/scheduled_checkout_id") @@ -487,6 +503,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/scheduled-checkout/scheduled_checkout_id") @@ -515,7 +532,7 @@ describe("ScheduledcheckoutClient", () => { from_plan_id: "from_plan_id", id: "id", scheduled_interval: "scheduled_interval", - scheduled_price: 1, + scheduled_price: 1000000, started_at: "2024-01-15T09:30:00Z", status: "cancelled", to_plan_id: "to_plan_id", @@ -523,6 +540,7 @@ describe("ScheduledcheckoutClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") @@ -544,7 +562,7 @@ describe("ScheduledcheckoutClient", () => { fromPlanId: "from_plan_id", id: "id", scheduledInterval: "scheduled_interval", - scheduledPrice: 1, + scheduledPrice: 1000000, startedAt: new Date("2024-01-15T09:30:00.000Z"), status: "cancelled", toPlanId: "to_plan_id", @@ -561,6 +579,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") @@ -580,6 +599,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") @@ -599,6 +619,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") @@ -618,6 +639,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") @@ -637,6 +659,7 @@ describe("ScheduledcheckoutClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/scheduled-checkout/scheduled_checkout_id") diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index 4cd2e664..5069c0e9 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -16,7 +16,7 @@ describe("WebhooksClient", () => { id: "id", payload: "payload", request_type: "subscription.trial.ended", - response_code: 1, + response_code: 1000000, sent_at: "2024-01-15T09:30:00Z", status: "failure", updated_at: "2024-01-15T09:30:00Z", @@ -33,15 +33,16 @@ describe("WebhooksClient", () => { webhook_id: "webhook_id", }, ], - params: { ids: ["ids"], limit: 1, offset: 1, q: "q", webhook_id: "webhook_id" }, + params: { ids: ["ids"], limit: 1000000, offset: 1000000, q: "q", webhook_id: "webhook_id" }, }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.listWebhookEvents({ q: "q", webhookId: "webhook_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -50,7 +51,7 @@ describe("WebhooksClient", () => { id: "id", payload: "payload", requestType: "subscription.trial.ended", - responseCode: 1, + responseCode: 1000000, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "failure", updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -69,8 +70,8 @@ describe("WebhooksClient", () => { ], params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", webhookId: "webhook_id", }, @@ -82,6 +83,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -94,6 +96,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -106,6 +109,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -118,6 +122,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -130,6 +135,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhook-events").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -147,7 +153,7 @@ describe("WebhooksClient", () => { id: "id", payload: "payload", request_type: "subscription.trial.ended", - response_code: 1, + response_code: 1000000, sent_at: "2024-01-15T09:30:00Z", status: "failure", updated_at: "2024-01-15T09:30:00Z", @@ -167,6 +173,7 @@ describe("WebhooksClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/webhook-events/webhook_event_id") @@ -182,7 +189,7 @@ describe("WebhooksClient", () => { id: "id", payload: "payload", requestType: "subscription.trial.ended", - responseCode: 1, + responseCode: 1000000, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "failure", updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -219,6 +226,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/webhook_event_id") @@ -237,6 +245,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/webhook_event_id") @@ -255,6 +264,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/webhook_event_id") @@ -273,6 +283,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/webhook_event_id") @@ -292,8 +303,9 @@ describe("WebhooksClient", () => { const rawResponseBody = { data: { count: 1 }, - params: { ids: ["ids"], limit: 1, offset: 1, q: "q", webhook_id: "webhook_id" }, + params: { ids: ["ids"], limit: 1000000, offset: 1000000, q: "q", webhook_id: "webhook_id" }, }; + server .mockEndpoint() .get("/webhook-events/count") @@ -305,8 +317,8 @@ describe("WebhooksClient", () => { const response = await client.webhooks.countWebhookEvents({ q: "q", webhookId: "webhook_id", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { @@ -314,8 +326,8 @@ describe("WebhooksClient", () => { }, params: { ids: ["ids"], - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", webhookId: "webhook_id", }, @@ -327,6 +339,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/count") @@ -345,6 +358,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/count") @@ -363,6 +377,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/count") @@ -381,6 +396,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/count") @@ -399,6 +415,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhook-events/count") @@ -431,14 +448,15 @@ describe("WebhooksClient", () => { url: "url", }, ], - params: { limit: 1, offset: 1, q: "q" }, + params: { limit: 1000000, offset: 1000000, q: "q" }, }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.listWebhooks({ q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: [ @@ -464,8 +482,8 @@ describe("WebhooksClient", () => { }, ], params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -476,6 +494,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -488,6 +507,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -500,6 +520,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -512,6 +533,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -524,6 +546,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -550,6 +573,7 @@ describe("WebhooksClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .post("/webhooks") @@ -600,6 +624,7 @@ describe("WebhooksClient", () => { url: "x", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/webhooks") @@ -627,6 +652,7 @@ describe("WebhooksClient", () => { url: "x", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/webhooks") @@ -654,6 +680,7 @@ describe("WebhooksClient", () => { url: "x", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/webhooks") @@ -681,6 +708,7 @@ describe("WebhooksClient", () => { url: "x", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/webhooks") @@ -708,6 +736,7 @@ describe("WebhooksClient", () => { url: "x", }; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .post("/webhooks") @@ -745,6 +774,7 @@ describe("WebhooksClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .get("/webhooks/webhook_id") @@ -786,6 +816,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhooks/webhook_id") @@ -804,6 +835,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhooks/webhook_id") @@ -822,6 +854,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhooks/webhook_id") @@ -840,6 +873,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .get("/webhooks/webhook_id") @@ -872,6 +906,7 @@ describe("WebhooksClient", () => { }, params: { key: "value" }, }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -914,6 +949,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -933,6 +969,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -952,6 +989,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -971,6 +1009,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -990,6 +1029,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { error: "error" }; + server .mockEndpoint() .put("/webhooks/webhook_id") @@ -1009,6 +1049,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1033,6 +1074,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1051,6 +1093,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1069,6 +1112,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1087,6 +1131,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1105,6 +1150,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server .mockEndpoint() .delete("/webhooks/webhook_id") @@ -1122,21 +1168,22 @@ describe("WebhooksClient", () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { data: { count: 1 }, params: { limit: 1, offset: 1, q: "q" } }; + const rawResponseBody = { data: { count: 1 }, params: { limit: 1000000, offset: 1000000, q: "q" } }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.countWebhooks({ q: "q", - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, }); expect(response).toEqual({ data: { count: 1, }, params: { - limit: 1, - offset: 1, + limit: 1000000, + offset: 1000000, q: "q", }, }); @@ -1147,6 +1194,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1159,6 +1207,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1171,6 +1220,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1183,6 +1233,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1195,6 +1246,7 @@ describe("WebhooksClient", () => { const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { error: "error" }; + server.mockEndpoint().get("/webhooks/count").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tsconfig.json b/tsconfig.json index 0140f411..2e282c33 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ "declaration": true, "outDir": "dist", "rootDir": "src", - "baseUrl": "src", "isolatedModules": true, "isolatedDeclarations": true, "module": "CommonJS" diff --git a/yarn.lock b/yarn.lock index edfcc197..ada8eaed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,34 +2,34 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" - integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6", "@babel/code-frame@^7.29.0": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.29.0.tgz#7cd7a59f15b3cc0dcd803038f7792712a7d0b15c" + integrity sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw== dependencies: - "@babel/helper-validator-identifier" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" js-tokens "^4.0.0" picocolors "^1.1.1" -"@babel/compat-data@^7.27.2": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.5.tgz#a8a4962e1567121ac0b3b487f52107443b455c7f" - integrity sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA== +"@babel/compat-data@^7.28.6": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d" + integrity sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.5.tgz#4c81b35e51e1b734f510c99b07dfbc7bbbb48f7e" - integrity sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw== - dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.5" - "@babel/helper-compilation-targets" "^7.27.2" - "@babel/helper-module-transforms" "^7.28.3" - "@babel/helpers" "^7.28.4" - "@babel/parser" "^7.28.5" - "@babel/template" "^7.27.2" - "@babel/traverse" "^7.28.5" - "@babel/types" "^7.28.5" + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.0.tgz#5286ad785df7f79d656e88ce86e650d16ca5f322" + integrity sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA== + dependencies: + "@babel/code-frame" "^7.29.0" + "@babel/generator" "^7.29.0" + "@babel/helper-compilation-targets" "^7.28.6" + "@babel/helper-module-transforms" "^7.28.6" + "@babel/helpers" "^7.28.6" + "@babel/parser" "^7.29.0" + "@babel/template" "^7.28.6" + "@babel/traverse" "^7.29.0" + "@babel/types" "^7.29.0" "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" @@ -37,23 +37,23 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.28.5", "@babel/generator@^7.7.2": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.5.tgz#712722d5e50f44d07bc7ac9fe84438742dd61298" - integrity sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ== +"@babel/generator@^7.29.0", "@babel/generator@^7.7.2": + version "7.29.1" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.1.tgz#d09876290111abbb00ef962a7b83a5307fba0d50" + integrity sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw== dependencies: - "@babel/parser" "^7.28.5" - "@babel/types" "^7.28.5" + "@babel/parser" "^7.29.0" + "@babel/types" "^7.29.0" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" -"@babel/helper-compilation-targets@^7.27.2": - version "7.27.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d" - integrity sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ== +"@babel/helper-compilation-targets@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" + integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== dependencies: - "@babel/compat-data" "^7.27.2" + "@babel/compat-data" "^7.28.6" "@babel/helper-validator-option" "^7.27.1" browserslist "^4.24.0" lru-cache "^5.1.1" @@ -64,34 +64,34 @@ resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== -"@babel/helper-module-imports@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz#7ef769a323e2655e126673bb6d2d6913bbead204" - integrity sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w== +"@babel/helper-module-imports@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== dependencies: - "@babel/traverse" "^7.27.1" - "@babel/types" "^7.27.1" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/helper-module-transforms@^7.28.3": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz#a2b37d3da3b2344fe085dab234426f2b9a2fa5f6" - integrity sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw== +"@babel/helper-module-transforms@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" + integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== dependencies: - "@babel/helper-module-imports" "^7.27.1" - "@babel/helper-validator-identifier" "^7.27.1" - "@babel/traverse" "^7.28.3" + "@babel/helper-module-imports" "^7.28.6" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/traverse" "^7.28.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c" - integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" + integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== "@babel/helper-string-parser@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== -"@babel/helper-validator-identifier@^7.27.1", "@babel/helper-validator-identifier@^7.28.5": +"@babel/helper-validator-identifier@^7.28.5": version "7.28.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== @@ -101,20 +101,20 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== -"@babel/helpers@^7.28.4": - version "7.28.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.4.tgz#fe07274742e95bdf7cf1443593eeb8926ab63827" - integrity sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w== +"@babel/helpers@^7.28.6": + version "7.29.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.29.2.tgz#9cfbccb02b8e229892c0b07038052cc1a8709c49" + integrity sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw== dependencies: - "@babel/template" "^7.27.2" - "@babel/types" "^7.28.4" + "@babel/template" "^7.28.6" + "@babel/types" "^7.29.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.5.tgz#0b0225ee90362f030efd644e8034c99468893b08" - integrity sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0": + version "7.29.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.2.tgz#58bd50b9a7951d134988a1ae177a35ef9a703ba1" + integrity sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA== dependencies: - "@babel/types" "^7.28.5" + "@babel/types" "^7.29.0" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -145,11 +145,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz#34c017d54496f9b11b61474e7ea3dfd5563ffe07" - integrity sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" + integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -166,11 +166,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz#2f9beb5eff30fa507c5532d107daac7b888fa34c" - integrity sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" + integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -229,38 +229,38 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz#5147d29066a793450f220c63fa3a9431b7e6dd18" - integrity sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" + integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" -"@babel/template@^7.27.2", "@babel/template@^7.3.3": - version "7.27.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d" - integrity sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw== +"@babel/template@^7.28.6", "@babel/template@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/parser" "^7.27.2" - "@babel/types" "^7.27.1" + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/traverse@^7.27.1", "@babel/traverse@^7.28.3", "@babel/traverse@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.5.tgz#450cab9135d21a7a2ca9d2d35aa05c20e68c360b" - integrity sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ== +"@babel/traverse@^7.28.6", "@babel/traverse@^7.29.0": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.0.tgz#f323d05001440253eead3c9c858adbe00b90310a" + integrity sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA== dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.5" + "@babel/code-frame" "^7.29.0" + "@babel/generator" "^7.29.0" "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.5" - "@babel/template" "^7.27.2" - "@babel/types" "^7.28.5" + "@babel/parser" "^7.29.0" + "@babel/template" "^7.28.6" + "@babel/types" "^7.29.0" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4", "@babel/types@^7.28.5", "@babel/types@^7.3.3": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b" - integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.28.6", "@babel/types@^7.29.0", "@babel/types@^7.3.3": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.0.tgz#9f5b1e838c446e72cf3cd4b918152b8c605e37c7" + integrity sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A== dependencies: "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.28.5" @@ -270,59 +270,59 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@biomejs/biome@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.3.1.tgz#d1a9284f52986324f288cdaf450331a0f3fb1da7" - integrity sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w== +"@biomejs/biome@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.4.3.tgz#eb7a48f1763fe333949665b3ff7814267eda000f" + integrity sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ== optionalDependencies: - "@biomejs/cli-darwin-arm64" "2.3.1" - "@biomejs/cli-darwin-x64" "2.3.1" - "@biomejs/cli-linux-arm64" "2.3.1" - "@biomejs/cli-linux-arm64-musl" "2.3.1" - "@biomejs/cli-linux-x64" "2.3.1" - "@biomejs/cli-linux-x64-musl" "2.3.1" - "@biomejs/cli-win32-arm64" "2.3.1" - "@biomejs/cli-win32-x64" "2.3.1" - -"@biomejs/cli-darwin-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz#607835f8ef043e1a80f9ad2a232c9e860941ab60" - integrity sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA== - -"@biomejs/cli-darwin-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz#654fe4aaa8ea5d5bde5457db4961ad5d214713ac" - integrity sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ== - -"@biomejs/cli-linux-arm64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz#5fe502082a575c31ef808cf080cbcd4485964167" - integrity sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg== - -"@biomejs/cli-linux-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz#81c02547905d379dbb312e6ff24b04908c2e320f" - integrity sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ== - -"@biomejs/cli-linux-x64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz#c7c00beb5eda1ad25185544897e66eeec6be3b0b" - integrity sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ== - -"@biomejs/cli-linux-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz#7481d2e7be98d4de574df233766a5bdda037c897" - integrity sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q== - -"@biomejs/cli-win32-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz#dac8c7c7223e97f86cd0eed7aa95584984761481" - integrity sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A== - -"@biomejs/cli-win32-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz#f8818ab2c1e3a6e2ed8a656935173e5ce4c720be" - integrity sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA== + "@biomejs/cli-darwin-arm64" "2.4.3" + "@biomejs/cli-darwin-x64" "2.4.3" + "@biomejs/cli-linux-arm64" "2.4.3" + "@biomejs/cli-linux-arm64-musl" "2.4.3" + "@biomejs/cli-linux-x64" "2.4.3" + "@biomejs/cli-linux-x64-musl" "2.4.3" + "@biomejs/cli-win32-arm64" "2.4.3" + "@biomejs/cli-win32-x64" "2.4.3" + +"@biomejs/cli-darwin-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.3.tgz#ca188065f29940de1bb0029df2fd639719c92750" + integrity sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w== + +"@biomejs/cli-darwin-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.3.tgz#418c55c0bfd1f5d4d22c48cddf8bbd78b02e7fd7" + integrity sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA== + +"@biomejs/cli-linux-arm64-musl@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.3.tgz#58da6a862764cc6c02c27a2d737a4f187a446bcd" + integrity sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw== + +"@biomejs/cli-linux-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.3.tgz#7642518e76df8fc2dcd0675042e85e58c03f6a74" + integrity sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA== + +"@biomejs/cli-linux-x64-musl@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.3.tgz#2a2fe720f636fc3894debf23925e9fe1c06da079" + integrity sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw== + +"@biomejs/cli-linux-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.3.tgz#dad0a81804ed2043e9ea3e4b29b3bb352c4eb26a" + integrity sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w== + +"@biomejs/cli-win32-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.3.tgz#1da3559be0924e891f9b986c8c0db7d503a34a11" + integrity sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ== + +"@biomejs/cli-win32-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.3.tgz#58ddb4e205b274d693940f3d334debd6f4c94ff4" + integrity sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw== "@bundled-es-modules/cookie@^2.0.1": version "2.0.1" @@ -338,30 +338,30 @@ dependencies: statuses "^2.0.1" -"@cloudflare/workerd-darwin-64@1.20260310.1": - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260310.1.tgz#7bed9d84d85355b8685ed336b86e812eac615af6" - integrity sha512-hF2VpoWaMb1fiGCQJqCY6M8I+2QQqjkyY4LiDYdTL5D/w6C1l5v1zhc0/jrjdD1DXfpJtpcSMSmEPjHse4p9Ig== +"@cloudflare/workerd-darwin-64@1.20260317.1": + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260317.1.tgz#254e6483e866c413fd156628c6477d6f48ac7a8e" + integrity sha512-8hjh3sPMwY8M/zedq3/sXoA2Q4BedlGufn3KOOleIG+5a4ReQKLlUah140D7J6zlKmYZAFMJ4tWC7hCuI/s79g== -"@cloudflare/workerd-darwin-arm64@1.20260310.1": - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260310.1.tgz#f4d22ca0405eac8a83947ec2c31d53d6d61e907d" - integrity sha512-h/Vl3XrYYPI6yFDE27XO1QPq/1G1lKIM8tzZGIWYpntK3IN5XtH3Ee/sLaegpJ49aIJoqhF2mVAZ6Yw+Vk2gJw== +"@cloudflare/workerd-darwin-arm64@1.20260317.1": + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260317.1.tgz#147de93c0a7feaca7a37ed86159aea47d152c88b" + integrity sha512-M/MnNyvO5HMgoIdr3QHjdCj2T1ki9gt0vIUnxYxBu9ISXS/jgtMl6chUVPJ7zHYBn9MyYr8ByeN6frjYxj0MGg== -"@cloudflare/workerd-linux-64@1.20260310.1": - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260310.1.tgz#65c03d88737ba2371d9b2a98fc3d121eb59ea0f4" - integrity sha512-XzQ0GZ8G5P4d74bQYOIP2Su4CLdNPpYidrInaSOuSxMw+HamsHaFrjVsrV2mPy/yk2hi6SY2yMbgKFK9YjA7vw== +"@cloudflare/workerd-linux-64@1.20260317.1": + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260317.1.tgz#0d24362e2c618086d98fdb305ede90e547752816" + integrity sha512-1ltuEjkRcS3fsVF7CxsKlWiRmzq2ZqMfqDN0qUOgbUwkpXsLVJsXmoblaLf5OP00ELlcgF0QsN0p2xPEua4Uug== -"@cloudflare/workerd-linux-arm64@1.20260310.1": - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260310.1.tgz#557379ae3e4b332b9e27a4ac30a10e07538ad805" - integrity sha512-sxv4CxnN4ZR0uQGTFVGa0V4KTqwdej/czpIc5tYS86G8FQQoGIBiAIs2VvU7b8EROPcandxYHDBPTb+D9HIMPw== +"@cloudflare/workerd-linux-arm64@1.20260317.1": + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260317.1.tgz#7f957cb0260010a896b72c5bab01ae9c85c7fcbe" + integrity sha512-3QrNnPF1xlaNwkHpasvRvAMidOvQs2NhXQmALJrEfpIJ/IDL2la8g499yXp3eqhG3hVMCB07XVY149GTs42Xtw== -"@cloudflare/workerd-windows-64@1.20260310.1": - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260310.1.tgz#8b542803c52804aef657a68c07641e0564e459d0" - integrity sha512-+1ZTViWKJypLfgH/luAHCqkent0DEBjAjvO40iAhOMHRLYP/SPphLvr4Jpi6lb+sIocS8Q1QZL4uM5Etg1Wskg== +"@cloudflare/workerd-windows-64@1.20260317.1": + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260317.1.tgz#bbfa136d697114bd11f0c34d21537f89640126c8" + integrity sha512-MfZTz+7LfuIpMGTa3RLXHX8Z/pnycZLItn94WRdHr8LPVet+C5/1Nzei399w/jr3+kzT4pDKk26JF/tlI5elpQ== "@cspotcode/source-map-support@0.8.1": version "0.8.1" @@ -371,9 +371,9 @@ "@jridgewell/trace-mapping" "0.3.9" "@emnapi/runtime@^1.7.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.9.0.tgz#91c54a6e77c36154c125e873409472e2b70efd5b" - integrity sha512-QN75eB0IH2ywSpRpNddCRfQIhmJYBCJ1x5Lb3IscKAL8bMnVAKnRg8dCoXbHzVLLH7P38N2Z3mtulB7W0J0FKw== + version "1.9.1" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.9.1.tgz#115ff2a0d589865be6bd8e9d701e499c473f2a8d" + integrity sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA== dependencies: tslib "^2.4.0" @@ -1001,9 +1001,9 @@ integrity sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw== "@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + version "0.27.10" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.10.tgz#beefe675f1853f73676aecc915b2bd2ac98c4fc6" + integrity sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA== "@sindresorhus/is@^7.0.2": version "7.2.0" @@ -1025,9 +1025,9 @@ "@sinonjs/commons" "^3.0.0" "@speed-highlight/core@^1.2.7": - version "1.2.14" - resolved "https://registry.yarnpkg.com/@speed-highlight/core/-/core-1.2.14.tgz#5d7fe87410d2d779bd0b7680f7a706466f363314" - integrity sha512-G4ewlBNhUtlLvrJTb88d2mdy2KRijzs4UhnlrOSRT4bmjh/IqNElZa3zkrZ+TC47TwtlDWzVLFADljF1Ijp5hA== + version "1.2.15" + resolved "https://registry.yarnpkg.com/@speed-highlight/core/-/core-1.2.15.tgz#88c45609a2b5c2293a2e1935417c507f98f39d0b" + integrity sha512-BMq1K3DsElxDWawkX6eLg9+CKJrTVGCBAWVuHXVUV2u0s2711qiChLSId6ikYPfxhdYocLNt3wWwSvDiTvFabw== "@tootallnate/once@2": version "2.0.0" @@ -1150,11 +1150,11 @@ form-data "^4.0.4" "@types/node@*": - version "25.0.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.3.tgz#79b9ac8318f373fbfaaf6e2784893efa9701f269" - integrity sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA== + version "25.5.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-25.5.0.tgz#5c99f37c443d9ccc4985866913f1ed364217da31" + integrity sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw== dependencies: - undici-types "~7.16.0" + undici-types "~7.18.0" "@types/node@^18.19.70": version "18.19.130" @@ -1361,16 +1361,16 @@ acorn-import-phases@^1.0.3: integrity sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ== acorn-walk@^8.0.2: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + version "8.3.5" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.5.tgz#8a6b8ca8fc5b34685af15dabb44118663c296496" + integrity sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw== dependencies: acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.11.0, acorn@^8.15.0, acorn@^8.8.1: - version "8.15.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" - integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.15.0, acorn@^8.16.0, acorn@^8.8.1: + version "8.16.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" + integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== agent-base@6: version "6.0.2" @@ -1394,9 +1394,9 @@ ajv-keywords@^5.1.0: fast-deep-equal "^3.1.3" ajv@^8.0.0, ajv@^8.9.0: - version "8.17.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" - integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.18.0.tgz#8864186b6738d003eb3a933172bb3833e10cefbc" + integrity sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A== dependencies: fast-deep-equal "^3.1.3" fast-uri "^3.0.1" @@ -1521,9 +1521,9 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== baseline-browser-mapping@^2.9.0: - version "2.9.10" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.10.tgz#099221e89b30ec784675af076fbd4a93e58b53c3" - integrity sha512-2VIKvDx8Z1a9rTB2eCkdPE5nSe28XnA+qivGnWHoB40hMMt/h1hSz0960Zqsn6ZyxWXUie0EBdElKv8may20AA== + version "2.10.10" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz#e74bd066724c1d8d7d8ea75fc3be25389a7a5c56" + integrity sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ== brace-expansion@^1.1.7: version "1.1.12" @@ -1602,9 +1602,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001759: - version "1.0.30001760" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001760.tgz#bdd1960fafedf8d5f04ff16e81460506ff9b798f" - integrity sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw== + version "1.0.30001781" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz#344b47c03eb8168b79c3c158b872bcfbdd02a400" + integrity sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1763,9 +1763,9 @@ decimal.js@^10.4.2: integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== dedent@^1.0.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" - integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== + version "1.7.2" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.2.tgz#34e2264ab538301e27cf7b07bf2369c19baa8dd9" + integrity sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA== deepmerge@^4.2.2: version "4.3.1" @@ -1809,9 +1809,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.263: - version "1.5.267" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" - integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== + version "1.5.325" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.325.tgz#c2b3d510435a2b65dd65e891dde7eac0362edfb7" + integrity sha512-PwfIw7WQSt3xX7yOf5OE/unLzsK9CaN2f/FvV3WjPR1Knoc1T9vePRVV4W1EM301JzzysK51K7FNKcusCr0zYA== emittery@^0.13.1: version "0.13.1" @@ -1823,13 +1823,13 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.4: - version "5.18.4" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" - integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.20.0: + version "5.20.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz#eeeb3966bea62c348c40a0cc9e7912e2557d0be0" + integrity sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA== dependencies: graceful-fs "^4.2.4" - tapable "^2.2.0" + tapable "^2.3.0" entities@^6.0.0: version "6.0.1" @@ -2149,9 +2149,9 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphql@^16.8.1: - version "16.12.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.12.0.tgz#28cc2462435b1ac3fdc6976d030cef83a0c13ac7" - integrity sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ== + version "16.13.2" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.13.2.tgz#4d2b73df5796b201f1bc2765f5d7067f689cb55f" + integrity sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig== handlebars@^4.7.8: version "4.7.8" @@ -2911,21 +2911,21 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== miniflare@^4.20260305.0: - version "4.20260310.0" - resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260310.0.tgz#ca786687fd81746bb066c5d9a1e185a539216b8f" - integrity sha512-uC5vNPenFpDSj5aUU3wGSABG6UUqMr+Xs1m4AkCrTHo37F4Z6xcQw5BXqViTfPDVT/zcYH1UgTVoXhr1l6ZMXw== + version "4.20260317.2" + resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260317.2.tgz#b513afa637b302dec07f89a04f8332df66c7270d" + integrity sha512-qNL+yWAFMX6fr0pWU6Lx1vNpPobpnDSF1V8eunIckWvoIQl8y1oBjL2RJFEGY3un+l3f9gwW9dirDPP26usYJQ== dependencies: "@cspotcode/source-map-support" "0.8.1" sharp "^0.34.5" - undici "7.18.2" - workerd "1.20260310.1" + undici "7.24.4" + workerd "1.20260317.1" ws "8.18.0" youch "4.1.0-beta.10" minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + version "3.1.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== dependencies: brace-expansion "^1.1.7" @@ -2992,9 +2992,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.27: - version "2.0.27" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" - integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== + version "2.0.36" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.36.tgz#99fd6552aaeda9e17c4713b57a63964a2e325e9d" + integrity sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA== normalize-path@^3.0.0: version "3.0.0" @@ -3106,9 +3106,9 @@ picocolors@^1.1.1: integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601" + integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA== pirates@^4.0.4: version "4.0.7" @@ -3166,13 +3166,6 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - react-is@^18.0.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" @@ -3235,7 +3228,7 @@ rettime@^0.7.0: resolved "https://registry.yarnpkg.com/rettime/-/rettime-0.7.0.tgz#c040f1a65e396eaa4b8346dd96ed937edc79d96f" integrity sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw== -safe-buffer@^5.1.0, safe-buffer@~5.2.0: +safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3268,16 +3261,9 @@ semver@^6.3.0, semver@^6.3.1: integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.7.3: - version "7.7.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" - integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== - -serialize-javascript@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" - integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== - dependencies: - randombytes "^2.1.0" + version "7.7.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" + integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== sharp@^0.34.5: version "0.34.5" @@ -3468,26 +3454,25 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tapable@^2.2.0, tapable@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.0.tgz#7e3ea6d5ca31ba8e078b560f0d83ce9a14aa8be6" - integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== +tapable@^2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.2.tgz#86755feabad08d82a26b891db044808c6ad00f15" + integrity sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA== -terser-webpack-plugin@^5.3.16: - version "5.3.16" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz#741e448cc3f93d8026ebe4f7ef9e4afacfd56330" - integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== +terser-webpack-plugin@^5.3.17: + version "5.4.0" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.4.0.tgz#95fc4cf4437e587be11ecf37d08636089174d76b" + integrity sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" schema-utils "^4.3.0" - serialize-javascript "^6.0.2" terser "^5.31.1" terser@^5.31.1: - version "5.44.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" - integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== + version "5.46.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.46.1.tgz#40e4b1e35d5f13130f82793a8b3eeb7ec3a92eee" + integrity sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3503,17 +3488,17 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -tldts-core@^7.0.19: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.19.tgz#9dd8a457a09b4e65c8266c029f1847fa78dead20" - integrity sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A== +tldts-core@^7.0.27: + version "7.0.27" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.27.tgz#4be95bd03b318f2232ea4c1554c4ae9980c77f69" + integrity sha512-YQ7uPjgWUibIK6DW5lrKujGwUKhLevU4hcGbP5O6TcIUb+oTjJYJVWPS4nZsIHrEEEG6myk/oqAJUEQmpZrHsg== tldts@^7.0.5: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.19.tgz#84cd7a7f04e68ec93b93b106fac038c527b99368" - integrity sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA== + version "7.0.27" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.27.tgz#43c3fc6123eb07a3e12ae1868a9f2d1a5889028c" + integrity sha512-I4FZcVFcqCRuT0ph6dCDpPuO4Xgzvh+spkcTr1gK7peIvxWauoloVO0vuy1FQnijT63ss6AsHB6+OIM4aXHbPg== dependencies: - tldts-core "^7.0.19" + tldts-core "^7.0.27" tmpl@1.0.5: version "1.0.5" @@ -3538,9 +3523,9 @@ tough-cookie@^4.1.2: url-parse "^1.5.3" tough-cookie@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-6.0.0.tgz#11e418b7864a2c0d874702bc8ce0f011261940e5" - integrity sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w== + version "6.0.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-6.0.1.tgz#a495f833836609ed983c19bc65639cfbceb54c76" + integrity sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw== dependencies: tldts "^7.0.5" @@ -3617,15 +3602,15 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~7.16.0: - version "7.16.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" - integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== - -undici@7.18.2: +undici-types@~7.18.0: version "7.18.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-7.18.2.tgz#6cf724ef799a67d94fd55adf66b1e184176efcdf" - integrity sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw== + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.18.2.tgz#29357a89e7b7ca4aef3bf0fd3fd0cd73884229e9" + integrity sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w== + +undici@7.24.4: + version "7.24.4" + resolved "https://registry.yarnpkg.com/undici/-/undici-7.24.4.tgz#873bce680d7c6354c941399fd4e8ea4563de4ea7" + integrity sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w== universalify@^0.2.0: version "0.2.0" @@ -3671,10 +3656,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.4.4: - version "2.4.4" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.4.tgz#473bda72f0850453da6425081ea46fc0d7602947" - integrity sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA== +watchpack@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.1.tgz#dd38b601f669e0cbf567cb802e75cead82cde102" + integrity sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -3689,15 +3674,15 @@ webidl-conversions@^7.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -webpack-sources@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.3.tgz#d4bf7f9909675d7a070ff14d0ef2a4f3c982c723" - integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== +webpack-sources@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.4.tgz#a338b95eb484ecc75fbb196cbe8a2890618b4891" + integrity sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q== webpack@^5.97.1: - version "5.104.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.1.tgz#94bd41eb5dbf06e93be165ba8be41b8260d4fb1a" - integrity sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA== + version "5.105.4" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.4.tgz#1b77fcd55a985ac7ca9de80a746caffa38220169" + integrity sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3705,11 +3690,11 @@ webpack@^5.97.1: "@webassemblyjs/ast" "^1.14.1" "@webassemblyjs/wasm-edit" "^1.14.1" "@webassemblyjs/wasm-parser" "^1.14.1" - acorn "^8.15.0" + acorn "^8.16.0" acorn-import-phases "^1.0.3" browserslist "^4.28.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.4" + enhanced-resolve "^5.20.0" es-module-lexer "^2.0.0" eslint-scope "5.1.1" events "^3.2.0" @@ -3721,9 +3706,9 @@ webpack@^5.97.1: neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" - terser-webpack-plugin "^5.3.16" - watchpack "^2.4.4" - webpack-sources "^3.3.3" + terser-webpack-plugin "^5.3.17" + watchpack "^2.5.1" + webpack-sources "^3.3.4" whatwg-encoding@^2.0.0: version "2.0.0" @@ -3765,16 +3750,16 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -workerd@1.20260310.1: - version "1.20260310.1" - resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260310.1.tgz#42305f0eeba473494b88fecb9546d559bf2b03ef" - integrity sha512-yawXhypXXHtArikJj15HOMknNGikpBbSg2ZDe6lddUbqZnJXuCVSkgc/0ArUeVMG1jbbGvpst+REFtKwILvRTQ== +workerd@1.20260317.1: + version "1.20260317.1" + resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260317.1.tgz#f963e1afd0b996ae2e86e4fac284ecb2fb1743a2" + integrity sha512-ZuEq1OdrJBS+NV+L5HMYPCzVn49a2O60slQiiLpG44jqtlOo+S167fWC76kEXteXLLLydeuRrluRel7WdOUa4g== optionalDependencies: - "@cloudflare/workerd-darwin-64" "1.20260310.1" - "@cloudflare/workerd-darwin-arm64" "1.20260310.1" - "@cloudflare/workerd-linux-64" "1.20260310.1" - "@cloudflare/workerd-linux-arm64" "1.20260310.1" - "@cloudflare/workerd-windows-64" "1.20260310.1" + "@cloudflare/workerd-darwin-64" "1.20260317.1" + "@cloudflare/workerd-darwin-arm64" "1.20260317.1" + "@cloudflare/workerd-linux-64" "1.20260317.1" + "@cloudflare/workerd-linux-arm64" "1.20260317.1" + "@cloudflare/workerd-windows-64" "1.20260317.1" wrap-ansi@^6.2.0: version "6.2.0" @@ -3813,9 +3798,9 @@ ws@8.18.0: integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== ws@^8.11.0, ws@^8.18.1: - version "8.18.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" - integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== + version "8.20.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.20.0.tgz#4cd9532358eba60bc863aad1623dfb045a4d4af8" + integrity sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA== xml-name-validator@^4.0.0: version "4.0.0"