From 269a12e28c82490b75348df4af27b8683626b1f2 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:31:26 +0000 Subject: [PATCH] SDK regeneration Unable to analyze changes with AI, incrementing PATCH version. --- .fern/metadata.json | 2 +- .fernignore | 1 + changelog.md | 4 ++ package.json | 2 +- reference.md | 3 - src/BaseClient.ts | 4 +- src/api/resources/billing/client/Client.ts | 15 +---- .../requests/CountBillingProductsRequest.ts | 2 +- .../client/requests/CountCustomersRequest.ts | 2 - .../CreateBillingCustomerRequestBody.ts | 2 - .../requests/ListBillingProductsRequest.ts | 2 +- .../ListCustomersWithSubscriptionsRequest.ts | 2 - .../types/CountBillingProductsParams.ts | 2 +- .../billing/types/CountCustomersParams.ts | 1 - .../types/ListBillingProductsParams.ts | 2 +- .../ListCustomersWithSubscriptionsParams.ts | 1 - .../types/BillingCreditGrantResponseData.ts | 2 + src/api/types/BillingCustomerResponseData.ts | 1 - ...ngCustomerWithSubscriptionsResponseData.ts | 1 - src/api/types/CreditCompanyGrantView.ts | 2 + src/api/types/EventDetailResponseData.ts | 2 +- src/api/types/EventResponseData.ts | 2 +- src/api/types/RawEventResponseData.ts | 2 +- src/api/types/WebhookRequestType.ts | 2 + .../CreateBillingCustomerRequestBody.ts | 2 - .../billing/types/CountCustomersParams.ts | 2 - .../ListCustomersWithSubscriptionsParams.ts | 2 - .../types/BillingCreditGrantResponseData.ts | 5 ++ .../types/BillingCustomerResponseData.ts | 2 - ...ngCustomerWithSubscriptionsResponseData.ts | 2 - .../types/CreditCompanyGrantView.ts | 5 ++ .../types/EventDetailResponseData.ts | 4 +- src/serialization/types/EventResponseData.ts | 4 +- .../types/RawEventResponseData.ts | 4 +- src/serialization/types/WebhookRequestType.ts | 6 +- tests/wire/billing.test.ts | 64 ++----------------- tests/wire/components.test.ts | 2 + tests/wire/credits.test.ts | 16 +++++ tests/wire/events.test.ts | 22 +------ 39 files changed, 70 insertions(+), 133 deletions(-) create mode 100644 changelog.md diff --git a/.fern/metadata.json b/.fern/metadata.json index 067eb1d8..48a6294c 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -41,5 +41,5 @@ "files": ["dist/**/*.js", "dist/**/*.d.ts", "!dist/**/*.js.map", "!dist/**/*.test.*", "README.md"] } }, - "sdkVersion": "1.3.0" + "sdkVersion": "1.3.1" } diff --git a/.fernignore b/.fernignore index e9e36859..8fe32017 100644 --- a/.fernignore +++ b/.fernignore @@ -17,3 +17,4 @@ src/version.ts src/webhooks.ts src/wrapper.ts tests/unit/webhooks.test.ts +changelog.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 00000000..4e306db5 --- /dev/null +++ b/changelog.md @@ -0,0 +1,4 @@ +## 1.3.1 - 2026-01-06 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + diff --git a/package.json b/package.json index 1a7081e0..afea1608 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@schematichq/schematic-typescript-node", - "version": "1.3.0", + "version": "1.3.1", "private": false, "repository": { "type": "git", diff --git a/reference.md b/reference.md index 4c0efe4a..1d3768c7 100644 --- a/reference.md +++ b/reference.md @@ -1000,7 +1000,6 @@ await client.billing.upsertBillingCoupon({ await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { "key": "value" }, @@ -1055,7 +1054,6 @@ await client.billing.upsertBillingCustomer({ ```typescript await client.billing.listCustomersWithSubscriptions({ - failedToImport: true, name: "name", providerType: "schematic", q: "q", @@ -1111,7 +1109,6 @@ await client.billing.listCustomersWithSubscriptions({ ```typescript await client.billing.countCustomers({ - failedToImport: true, name: "name", providerType: "schematic", q: "q", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 0a3311c2..676a711a 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -52,8 +52,8 @@ export function normalizeClientOptions> { - const { companyIds, failedToImport, name, providerType, q, limit, offset } = request; + const { companyIds, name, providerType, q, limit, offset } = request; const _queryParams: Record = {}; if (companyIds != null) { if (Array.isArray(companyIds)) { @@ -496,10 +494,6 @@ export class BillingClient { } } - if (failedToImport != null) { - _queryParams.failed_to_import = failedToImport.toString(); - } - if (name != null) { _queryParams.name = name; } @@ -638,7 +632,6 @@ export class BillingClient { * * @example * await client.billing.countCustomers({ - * failedToImport: true, * name: "name", * providerType: "schematic", * q: "q", @@ -657,7 +650,7 @@ export class BillingClient { request: Schematic.CountCustomersRequest = {}, requestOptions?: BillingClient.RequestOptions, ): Promise> { - const { companyIds, failedToImport, name, providerType, q, limit, offset } = request; + const { companyIds, name, providerType, q, limit, offset } = request; const _queryParams: Record = {}; if (companyIds != null) { if (Array.isArray(companyIds)) { @@ -667,10 +660,6 @@ export class BillingClient { } } - if (failedToImport != null) { - _queryParams.failed_to_import = failedToImport.toString(); - } - if (name != null) { _queryParams.name = name; } diff --git a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts index b124a506..f17d758f 100644 --- a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts @@ -20,7 +20,7 @@ import type * as Schematic from "../../../../index"; */ export interface CountBillingProductsRequest { ids?: string | string[]; - /** Filter products that are active */ + /** Filter products that are active. Defaults to true if not specified */ isActive?: boolean; name?: string; priceUsageType?: Schematic.BillingPriceUsageType; diff --git a/src/api/resources/billing/client/requests/CountCustomersRequest.ts b/src/api/resources/billing/client/requests/CountCustomersRequest.ts index 7cc93483..e6be6d43 100644 --- a/src/api/resources/billing/client/requests/CountCustomersRequest.ts +++ b/src/api/resources/billing/client/requests/CountCustomersRequest.ts @@ -5,7 +5,6 @@ import type * as Schematic from "../../../../index"; /** * @example * { - * failedToImport: true, * name: "name", * providerType: "schematic", * q: "q", @@ -15,7 +14,6 @@ import type * as Schematic from "../../../../index"; */ export interface CountCustomersRequest { companyIds?: string | string[]; - failedToImport?: boolean; name?: string; providerType?: Schematic.BillingProviderType; q?: string; diff --git a/src/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts b/src/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts index 03ca9a72..773deb88 100644 --- a/src/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts @@ -7,7 +7,6 @@ import type * as Schematic from "../../../../index"; * { * email: "email", * externalId: "external_id", - * failedToImport: true, * meta: { * "key": "value" * }, @@ -19,7 +18,6 @@ export interface CreateBillingCustomerRequestBody { defaultPaymentMethodId?: string; email: string; externalId: string; - failedToImport: boolean; meta: Record; name: string; providerType?: Schematic.BillingProviderType; diff --git a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts index 3a3b858b..9e8d9b74 100644 --- a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts @@ -20,7 +20,7 @@ import type * as Schematic from "../../../../index"; */ export interface ListBillingProductsRequest { ids?: string | string[]; - /** Filter products that are active */ + /** Filter products that are active. Defaults to true if not specified */ isActive?: boolean; name?: string; priceUsageType?: Schematic.BillingPriceUsageType; diff --git a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts index 1475eb04..79a9b8a2 100644 --- a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts +++ b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts @@ -5,7 +5,6 @@ import type * as Schematic from "../../../../index"; /** * @example * { - * failedToImport: true, * name: "name", * providerType: "schematic", * q: "q", @@ -15,7 +14,6 @@ import type * as Schematic from "../../../../index"; */ export interface ListCustomersWithSubscriptionsRequest { companyIds?: string | string[]; - failedToImport?: boolean; name?: string; providerType?: Schematic.BillingProviderType; q?: string; diff --git a/src/api/resources/billing/types/CountBillingProductsParams.ts b/src/api/resources/billing/types/CountBillingProductsParams.ts index f64f226b..df12cd04 100644 --- a/src/api/resources/billing/types/CountBillingProductsParams.ts +++ b/src/api/resources/billing/types/CountBillingProductsParams.ts @@ -7,7 +7,7 @@ import type * as Schematic from "../../../index"; */ export interface CountBillingProductsParams { ids?: string[]; - /** Filter products that are active */ + /** Filter products that are active. Defaults to true if not specified */ isActive?: boolean; /** Page limit (default 100) */ limit?: number; diff --git a/src/api/resources/billing/types/CountCustomersParams.ts b/src/api/resources/billing/types/CountCustomersParams.ts index fa5d87d8..cf5bcac5 100644 --- a/src/api/resources/billing/types/CountCustomersParams.ts +++ b/src/api/resources/billing/types/CountCustomersParams.ts @@ -7,7 +7,6 @@ import type * as Schematic from "../../../index"; */ export interface CountCustomersParams { companyIds?: string[]; - failedToImport?: boolean; /** Page limit (default 100) */ limit?: number; name?: string; diff --git a/src/api/resources/billing/types/ListBillingProductsParams.ts b/src/api/resources/billing/types/ListBillingProductsParams.ts index 817d2b70..6329d215 100644 --- a/src/api/resources/billing/types/ListBillingProductsParams.ts +++ b/src/api/resources/billing/types/ListBillingProductsParams.ts @@ -7,7 +7,7 @@ import type * as Schematic from "../../../index"; */ export interface ListBillingProductsParams { ids?: string[]; - /** Filter products that are active */ + /** Filter products that are active. Defaults to true if not specified */ isActive?: boolean; /** Page limit (default 100) */ limit?: number; diff --git a/src/api/resources/billing/types/ListCustomersWithSubscriptionsParams.ts b/src/api/resources/billing/types/ListCustomersWithSubscriptionsParams.ts index f8ca529c..666da40c 100644 --- a/src/api/resources/billing/types/ListCustomersWithSubscriptionsParams.ts +++ b/src/api/resources/billing/types/ListCustomersWithSubscriptionsParams.ts @@ -7,7 +7,6 @@ import type * as Schematic from "../../../index"; */ export interface ListCustomersWithSubscriptionsParams { companyIds?: string[]; - failedToImport?: boolean; /** Page limit (default 100) */ limit?: number; name?: string; diff --git a/src/api/types/BillingCreditGrantResponseData.ts b/src/api/types/BillingCreditGrantResponseData.ts index 7a6df259..5f1581e7 100644 --- a/src/api/types/BillingCreditGrantResponseData.ts +++ b/src/api/types/BillingCreditGrantResponseData.ts @@ -18,6 +18,8 @@ export interface BillingCreditGrantResponseData { quantity: number; quantityRemaining: number; quantityUsed: number; + renewalEnabled: boolean; + renewalPeriod?: Schematic.BillingPlanCreditGrantResetCadence; sourceLabel: string; transfers?: Schematic.CreditTransferResponseData[]; updatedAt: Date; diff --git a/src/api/types/BillingCustomerResponseData.ts b/src/api/types/BillingCustomerResponseData.ts index c747a3db..9ebc807e 100644 --- a/src/api/types/BillingCustomerResponseData.ts +++ b/src/api/types/BillingCustomerResponseData.ts @@ -7,7 +7,6 @@ export interface BillingCustomerResponseData { deletedAt?: Date; email: string; externalId: string; - failedToImport: boolean; id: string; name: string; providerType: Schematic.BillingProviderType; diff --git a/src/api/types/BillingCustomerWithSubscriptionsResponseData.ts b/src/api/types/BillingCustomerWithSubscriptionsResponseData.ts index 94277958..ccefa635 100644 --- a/src/api/types/BillingCustomerWithSubscriptionsResponseData.ts +++ b/src/api/types/BillingCustomerWithSubscriptionsResponseData.ts @@ -7,7 +7,6 @@ export interface BillingCustomerWithSubscriptionsResponseData { deletedAt?: Date; email: string; externalId: string; - failedToImport: boolean; id: string; name: string; providerType: Schematic.BillingProviderType; diff --git a/src/api/types/CreditCompanyGrantView.ts b/src/api/types/CreditCompanyGrantView.ts index 34bf9ddb..b00c31be 100644 --- a/src/api/types/CreditCompanyGrantView.ts +++ b/src/api/types/CreditCompanyGrantView.ts @@ -25,6 +25,8 @@ export interface CreditCompanyGrantView { quantity: number; quantityRemaining: number; quantityUsed: number; + renewalEnabled: boolean; + renewalPeriod?: Schematic.BillingPlanCreditGrantResetCadence; singularName?: string; sourceLabel: string; transfers?: Schematic.CreditTransferView[]; diff --git a/src/api/types/EventDetailResponseData.ts b/src/api/types/EventDetailResponseData.ts index cdf843ef..77c751a1 100644 --- a/src/api/types/EventDetailResponseData.ts +++ b/src/api/types/EventDetailResponseData.ts @@ -22,7 +22,7 @@ export interface EventDetailResponseData { status: Schematic.EventStatus; subtype?: string; type: Schematic.EventType; - updatedAt: Date; + updatedAt?: Date; user?: Schematic.PreviewObject; userId?: string; } diff --git a/src/api/types/EventResponseData.ts b/src/api/types/EventResponseData.ts index 63664ddd..b2eab487 100644 --- a/src/api/types/EventResponseData.ts +++ b/src/api/types/EventResponseData.ts @@ -20,6 +20,6 @@ export interface EventResponseData { status: Schematic.EventStatus; subtype?: string; type: Schematic.EventType; - updatedAt: Date; + updatedAt?: Date; userId?: string; } diff --git a/src/api/types/RawEventResponseData.ts b/src/api/types/RawEventResponseData.ts index 75a9d2c8..46777aa3 100644 --- a/src/api/types/RawEventResponseData.ts +++ b/src/api/types/RawEventResponseData.ts @@ -3,7 +3,7 @@ export interface RawEventResponseData { capturedAt: Date; eventId?: string; - remoteAddr: string; + remoteAddr?: string; remoteIp: string; userAgent: string; } diff --git a/src/api/types/WebhookRequestType.ts b/src/api/types/WebhookRequestType.ts index 3088924e..7d04a109 100644 --- a/src/api/types/WebhookRequestType.ts +++ b/src/api/types/WebhookRequestType.ts @@ -36,5 +36,7 @@ export const WebhookRequestType = { UserCreated: "user.created", UserDeleted: "user.deleted", UserUpdated: "user.updated", + AutoTopupHardFailure: "auto.topup.hard.failure", + AutoTopupRetryExceeded: "auto.topup.retry.exceeded", } as const; export type WebhookRequestType = (typeof WebhookRequestType)[keyof typeof WebhookRequestType]; diff --git a/src/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts b/src/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts index 223f39ae..d4aa9b24 100644 --- a/src/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts +++ b/src/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.ts @@ -16,7 +16,6 @@ export const CreateBillingCustomerRequestBody: core.serialization.Schema< ), email: core.serialization.string(), externalId: core.serialization.property("external_id", core.serialization.string()), - failedToImport: core.serialization.property("failed_to_import", core.serialization.boolean()), meta: core.serialization.record(core.serialization.string(), core.serialization.string()), name: core.serialization.string(), providerType: core.serialization.property("provider_type", BillingProviderType.optional()), @@ -28,7 +27,6 @@ export declare namespace CreateBillingCustomerRequestBody { default_payment_method_id?: string | null; email: string; external_id: string; - failed_to_import: boolean; meta: Record; name: string; provider_type?: BillingProviderType.Raw | null; diff --git a/src/serialization/resources/billing/types/CountCustomersParams.ts b/src/serialization/resources/billing/types/CountCustomersParams.ts index 441c2dfb..38ea18c7 100644 --- a/src/serialization/resources/billing/types/CountCustomersParams.ts +++ b/src/serialization/resources/billing/types/CountCustomersParams.ts @@ -13,7 +13,6 @@ export const CountCustomersParams: core.serialization.ObjectSchema< "company_ids", core.serialization.list(core.serialization.string()).optional(), ), - failedToImport: core.serialization.property("failed_to_import", core.serialization.boolean().optional()), limit: core.serialization.number().optional(), name: core.serialization.string().optional(), offset: core.serialization.number().optional(), @@ -24,7 +23,6 @@ export const CountCustomersParams: core.serialization.ObjectSchema< export declare namespace CountCustomersParams { export interface Raw { company_ids?: string[] | null; - failed_to_import?: boolean | null; limit?: number | null; name?: string | null; offset?: number | null; diff --git a/src/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.ts b/src/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.ts index 3d73be7c..6e28f92e 100644 --- a/src/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.ts +++ b/src/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.ts @@ -13,7 +13,6 @@ export const ListCustomersWithSubscriptionsParams: core.serialization.ObjectSche "company_ids", core.serialization.list(core.serialization.string()).optional(), ), - failedToImport: core.serialization.property("failed_to_import", core.serialization.boolean().optional()), limit: core.serialization.number().optional(), name: core.serialization.string().optional(), offset: core.serialization.number().optional(), @@ -24,7 +23,6 @@ export const ListCustomersWithSubscriptionsParams: core.serialization.ObjectSche export declare namespace ListCustomersWithSubscriptionsParams { export interface Raw { company_ids?: string[] | null; - failed_to_import?: boolean | null; limit?: number | null; name?: string | null; offset?: number | null; diff --git a/src/serialization/types/BillingCreditGrantResponseData.ts b/src/serialization/types/BillingCreditGrantResponseData.ts index 5ec3de4a..116b6b5d 100644 --- a/src/serialization/types/BillingCreditGrantResponseData.ts +++ b/src/serialization/types/BillingCreditGrantResponseData.ts @@ -5,6 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { BillingCreditGrantReason } from "./BillingCreditGrantReason"; import { BillingCreditGrantZeroedOutReason } from "./BillingCreditGrantZeroedOutReason"; +import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence"; import { BillingPriceResponseData } from "./BillingPriceResponseData"; import { CreditTransferResponseData } from "./CreditTransferResponseData"; @@ -27,6 +28,8 @@ export const BillingCreditGrantResponseData: core.serialization.ObjectSchema< quantity: core.serialization.number(), quantityRemaining: core.serialization.property("quantity_remaining", core.serialization.number()), quantityUsed: core.serialization.property("quantity_used", core.serialization.number()), + renewalEnabled: core.serialization.property("renewal_enabled", core.serialization.boolean()), + renewalPeriod: core.serialization.property("renewal_period", BillingPlanCreditGrantResetCadence.optional()), sourceLabel: core.serialization.property("source_label", core.serialization.string()), transfers: core.serialization.list(CreditTransferResponseData).optional(), updatedAt: core.serialization.property("updated_at", core.serialization.date()), @@ -52,6 +55,8 @@ export declare namespace BillingCreditGrantResponseData { quantity: number; quantity_remaining: number; quantity_used: number; + renewal_enabled: boolean; + renewal_period?: BillingPlanCreditGrantResetCadence.Raw | null; source_label: string; transfers?: CreditTransferResponseData.Raw[] | null; updated_at: string; diff --git a/src/serialization/types/BillingCustomerResponseData.ts b/src/serialization/types/BillingCustomerResponseData.ts index 3d4a7ef3..21f031a1 100644 --- a/src/serialization/types/BillingCustomerResponseData.ts +++ b/src/serialization/types/BillingCustomerResponseData.ts @@ -13,7 +13,6 @@ export const BillingCustomerResponseData: core.serialization.ObjectSchema< deletedAt: core.serialization.property("deleted_at", core.serialization.date().optional()), email: core.serialization.string(), externalId: core.serialization.property("external_id", core.serialization.string()), - failedToImport: core.serialization.property("failed_to_import", core.serialization.boolean()), id: core.serialization.string(), name: core.serialization.string(), providerType: core.serialization.property("provider_type", BillingProviderType), @@ -26,7 +25,6 @@ export declare namespace BillingCustomerResponseData { deleted_at?: string | null; email: string; external_id: string; - failed_to_import: boolean; id: string; name: string; provider_type: BillingProviderType.Raw; diff --git a/src/serialization/types/BillingCustomerWithSubscriptionsResponseData.ts b/src/serialization/types/BillingCustomerWithSubscriptionsResponseData.ts index 1489540b..c68b2c98 100644 --- a/src/serialization/types/BillingCustomerWithSubscriptionsResponseData.ts +++ b/src/serialization/types/BillingCustomerWithSubscriptionsResponseData.ts @@ -14,7 +14,6 @@ export const BillingCustomerWithSubscriptionsResponseData: core.serialization.Ob deletedAt: core.serialization.property("deleted_at", core.serialization.date().optional()), email: core.serialization.string(), externalId: core.serialization.property("external_id", core.serialization.string()), - failedToImport: core.serialization.property("failed_to_import", core.serialization.boolean()), id: core.serialization.string(), name: core.serialization.string(), providerType: core.serialization.property("provider_type", BillingProviderType), @@ -28,7 +27,6 @@ export declare namespace BillingCustomerWithSubscriptionsResponseData { deleted_at?: string | null; email: string; external_id: string; - failed_to_import: boolean; id: string; name: string; provider_type: BillingProviderType.Raw; diff --git a/src/serialization/types/CreditCompanyGrantView.ts b/src/serialization/types/CreditCompanyGrantView.ts index 8e0eaaa1..0daf22e2 100644 --- a/src/serialization/types/CreditCompanyGrantView.ts +++ b/src/serialization/types/CreditCompanyGrantView.ts @@ -7,6 +7,7 @@ import { BillingCreditExpiryType } from "./BillingCreditExpiryType"; import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit"; import { BillingCreditGrantReason } from "./BillingCreditGrantReason"; import { BillingCreditGrantZeroedOutReason } from "./BillingCreditGrantZeroedOutReason"; +import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence"; import { BillingProductPriceResponseData } from "./BillingProductPriceResponseData"; import { CreditTransferView } from "./CreditTransferView"; @@ -39,6 +40,8 @@ export const CreditCompanyGrantView: core.serialization.ObjectSchema< quantity: core.serialization.number(), quantityRemaining: core.serialization.property("quantity_remaining", core.serialization.number()), quantityUsed: core.serialization.property("quantity_used", core.serialization.number()), + renewalEnabled: core.serialization.property("renewal_enabled", core.serialization.boolean()), + renewalPeriod: core.serialization.property("renewal_period", BillingPlanCreditGrantResetCadence.optional()), singularName: core.serialization.property("singular_name", core.serialization.string().optional()), sourceLabel: core.serialization.property("source_label", core.serialization.string()), transfers: core.serialization.list(CreditTransferView).optional(), @@ -72,6 +75,8 @@ export declare namespace CreditCompanyGrantView { quantity: number; quantity_remaining: number; quantity_used: number; + renewal_enabled: boolean; + renewal_period?: BillingPlanCreditGrantResetCadence.Raw | null; singular_name?: string | null; source_label: string; transfers?: CreditTransferView.Raw[] | null; diff --git a/src/serialization/types/EventDetailResponseData.ts b/src/serialization/types/EventDetailResponseData.ts index 6f994425..af8ae92a 100644 --- a/src/serialization/types/EventDetailResponseData.ts +++ b/src/serialization/types/EventDetailResponseData.ts @@ -30,7 +30,7 @@ export const EventDetailResponseData: core.serialization.ObjectSchema< status: EventStatus, subtype: core.serialization.string().optional(), type: EventType, - updatedAt: core.serialization.property("updated_at", core.serialization.date()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optional()), user: PreviewObject.optional(), userId: core.serialization.property("user_id", core.serialization.string().optional()), }); @@ -56,7 +56,7 @@ export declare namespace EventDetailResponseData { status: EventStatus.Raw; subtype?: string | null; type: EventType.Raw; - updated_at: string; + updated_at?: string | null; user?: PreviewObject.Raw | null; user_id?: string | null; } diff --git a/src/serialization/types/EventResponseData.ts b/src/serialization/types/EventResponseData.ts index bd96587b..b6caa6a6 100644 --- a/src/serialization/types/EventResponseData.ts +++ b/src/serialization/types/EventResponseData.ts @@ -27,7 +27,7 @@ export const EventResponseData: core.serialization.ObjectSchema< status: EventStatus, subtype: core.serialization.string().optional(), type: EventType, - updatedAt: core.serialization.property("updated_at", core.serialization.date()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optional()), userId: core.serialization.property("user_id", core.serialization.string().optional()), }); @@ -50,7 +50,7 @@ export declare namespace EventResponseData { status: EventStatus.Raw; subtype?: string | null; type: EventType.Raw; - updated_at: string; + updated_at?: string | null; user_id?: string | null; } } diff --git a/src/serialization/types/RawEventResponseData.ts b/src/serialization/types/RawEventResponseData.ts index 8a1d328c..ae1eaeba 100644 --- a/src/serialization/types/RawEventResponseData.ts +++ b/src/serialization/types/RawEventResponseData.ts @@ -10,7 +10,7 @@ export const RawEventResponseData: core.serialization.ObjectSchema< > = core.serialization.object({ capturedAt: core.serialization.property("captured_at", core.serialization.date()), eventId: core.serialization.property("event_id", core.serialization.string().optional()), - remoteAddr: core.serialization.property("remote_addr", core.serialization.string()), + remoteAddr: core.serialization.property("remote_addr", core.serialization.string().optional()), remoteIp: core.serialization.property("remote_ip", core.serialization.string()), userAgent: core.serialization.property("user_agent", core.serialization.string()), }); @@ -19,7 +19,7 @@ export declare namespace RawEventResponseData { export interface Raw { captured_at: string; event_id?: string | null; - remote_addr: string; + remote_addr?: string | null; remote_ip: string; user_agent: string; } diff --git a/src/serialization/types/WebhookRequestType.ts b/src/serialization/types/WebhookRequestType.ts index 484474aa..e38cce50 100644 --- a/src/serialization/types/WebhookRequestType.ts +++ b/src/serialization/types/WebhookRequestType.ts @@ -43,6 +43,8 @@ export const WebhookRequestType: core.serialization.Schema< "user.created", "user.deleted", "user.updated", + "auto.topup.hard.failure", + "auto.topup.retry.exceeded", ]); export declare namespace WebhookRequestType { @@ -81,5 +83,7 @@ export declare namespace WebhookRequestType { | "test.send" | "user.created" | "user.deleted" - | "user.updated"; + | "user.updated" + | "auto.topup.hard.failure" + | "auto.topup.retry.exceeded"; } diff --git a/tests/wire/billing.test.ts b/tests/wire/billing.test.ts index c75ab8f8..063457c1 100644 --- a/tests/wire/billing.test.ts +++ b/tests/wire/billing.test.ts @@ -404,20 +404,13 @@ describe("BillingClient", () => { test("upsertBillingCustomer (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { key: "value" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { key: "value" }, name: "name" }; const rawResponseBody = { data: { company_id: "company_id", deleted_at: "2024-01-15T09:30:00Z", email: "email", external_id: "external_id", - failed_to_import: true, id: "id", name: "name", provider_type: "schematic", @@ -437,7 +430,6 @@ describe("BillingClient", () => { const response = await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { key: "value", }, @@ -449,7 +441,6 @@ describe("BillingClient", () => { deletedAt: new Date("2024-01-15T09:30:00.000Z"), email: "email", externalId: "external_id", - failedToImport: true, id: "id", name: "name", providerType: "schematic", @@ -464,13 +455,7 @@ describe("BillingClient", () => { test("upsertBillingCustomer (2)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { meta: "meta" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; server .mockEndpoint() @@ -485,7 +470,6 @@ describe("BillingClient", () => { return await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { meta: "meta", }, @@ -497,13 +481,7 @@ describe("BillingClient", () => { test("upsertBillingCustomer (3)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { meta: "meta" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; server .mockEndpoint() @@ -518,7 +496,6 @@ describe("BillingClient", () => { return await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { meta: "meta", }, @@ -530,13 +507,7 @@ describe("BillingClient", () => { test("upsertBillingCustomer (4)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { meta: "meta" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; server .mockEndpoint() @@ -551,7 +522,6 @@ describe("BillingClient", () => { return await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { meta: "meta", }, @@ -563,13 +533,7 @@ describe("BillingClient", () => { test("upsertBillingCustomer (5)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { meta: "meta" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; server .mockEndpoint() @@ -584,7 +548,6 @@ describe("BillingClient", () => { return await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { meta: "meta", }, @@ -596,13 +559,7 @@ describe("BillingClient", () => { test("upsertBillingCustomer (6)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { - email: "email", - external_id: "external_id", - failed_to_import: true, - meta: { meta: "meta" }, - name: "name", - }; + const rawRequestBody = { email: "email", external_id: "external_id", meta: { meta: "meta" }, name: "name" }; const rawResponseBody = { error: "error" }; server .mockEndpoint() @@ -617,7 +574,6 @@ describe("BillingClient", () => { return await client.billing.upsertBillingCustomer({ email: "email", externalId: "external_id", - failedToImport: true, meta: { meta: "meta", }, @@ -637,7 +593,6 @@ describe("BillingClient", () => { deleted_at: "2024-01-15T09:30:00Z", email: "email", external_id: "external_id", - failed_to_import: true, id: "id", name: "name", provider_type: "schematic", @@ -655,7 +610,6 @@ describe("BillingClient", () => { ], params: { company_ids: ["company_ids"], - failed_to_import: true, limit: 1, name: "name", offset: 1, @@ -666,7 +620,6 @@ describe("BillingClient", () => { server.mockEndpoint().get("/billing/customers").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listCustomersWithSubscriptions({ - failedToImport: true, name: "name", providerType: "schematic", q: "q", @@ -680,7 +633,6 @@ describe("BillingClient", () => { deletedAt: new Date("2024-01-15T09:30:00.000Z"), email: "email", externalId: "external_id", - failedToImport: true, id: "id", name: "name", providerType: "schematic", @@ -698,7 +650,6 @@ describe("BillingClient", () => { ], params: { companyIds: ["company_ids"], - failedToImport: true, limit: 1, name: "name", offset: 1, @@ -776,7 +727,6 @@ describe("BillingClient", () => { data: { count: 1 }, params: { company_ids: ["company_ids"], - failed_to_import: true, limit: 1, name: "name", offset: 1, @@ -793,7 +743,6 @@ describe("BillingClient", () => { .build(); const response = await client.billing.countCustomers({ - failedToImport: true, name: "name", providerType: "schematic", q: "q", @@ -806,7 +755,6 @@ describe("BillingClient", () => { }, params: { companyIds: ["company_ids"], - failedToImport: true, limit: 1, name: "name", offset: 1, diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index aa380627..d70242bc 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -1290,6 +1290,7 @@ describe("ComponentsClient", () => { quantity: 1, quantity_remaining: 1.1, quantity_used: 1.1, + renewal_enabled: true, source_label: "source_label", updated_at: "2024-01-15T09:30:00Z", }, @@ -2373,6 +2374,7 @@ describe("ComponentsClient", () => { quantity: 1, quantityRemaining: 1.1, quantityUsed: 1.1, + renewalEnabled: true, sourceLabel: "source_label", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, diff --git a/tests/wire/credits.test.ts b/tests/wire/credits.test.ts index 96b47cb7..4fea9d04 100644 --- a/tests/wire/credits.test.ts +++ b/tests/wire/credits.test.ts @@ -2144,6 +2144,8 @@ describe("CreditsClient", () => { quantity: 1, quantity_remaining: 1.1, quantity_used: 1.1, + renewal_enabled: true, + renewal_period: "daily", source_label: "source_label", transfers: [ { @@ -2198,6 +2200,8 @@ describe("CreditsClient", () => { quantity: 1, quantityRemaining: 1.1, quantityUsed: 1.1, + renewalEnabled: true, + renewalPeriod: "daily", sourceLabel: "source_label", transfers: [ { @@ -2350,6 +2354,8 @@ describe("CreditsClient", () => { quantity: 1, quantity_remaining: 1.1, quantity_used: 1.1, + renewal_enabled: true, + renewal_period: "daily", source_label: "source_label", transfers: [ { @@ -2409,6 +2415,8 @@ describe("CreditsClient", () => { quantity: 1, quantityRemaining: 1.1, quantityUsed: 1.1, + renewalEnabled: true, + renewalPeriod: "daily", sourceLabel: "source_label", transfers: [ { @@ -2606,6 +2614,8 @@ describe("CreditsClient", () => { quantity: 1, quantity_remaining: 1.1, quantity_used: 1.1, + renewal_enabled: true, + renewal_period: "daily", source_label: "source_label", transfers: [ { @@ -2666,6 +2676,8 @@ describe("CreditsClient", () => { quantity: 1, quantityRemaining: 1.1, quantityUsed: 1.1, + renewalEnabled: true, + renewalPeriod: "daily", sourceLabel: "source_label", transfers: [ { @@ -2937,6 +2949,8 @@ describe("CreditsClient", () => { quantity: 1, quantity_remaining: 1.1, quantity_used: 1.1, + renewal_enabled: true, + renewal_period: "daily", source_label: "source_label", transfers: [ { @@ -2995,6 +3009,8 @@ describe("CreditsClient", () => { quantity: 1, quantityRemaining: 1.1, quantityUsed: 1.1, + renewalEnabled: true, + renewalPeriod: "daily", sourceLabel: "source_label", transfers: [ { diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index 38d7d15b..476a5a21 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -11,14 +11,7 @@ describe("EventsClient", () => { const rawRequestBody = { events: [{ event_type: "flag_check" }] }; const rawResponseBody = { data: { - events: [ - { - captured_at: "2024-01-15T09:30:00Z", - remote_addr: "remote_addr", - remote_ip: "remote_ip", - user_agent: "user_agent", - }, - ], + events: [{ captured_at: "2024-01-15T09:30:00Z", remote_ip: "remote_ip", user_agent: "user_agent" }], }, params: { key: "value" }, }; @@ -43,7 +36,6 @@ describe("EventsClient", () => { events: [ { capturedAt: new Date("2024-01-15T09:30:00.000Z"), - remoteAddr: "remote_addr", remoteIp: "remote_ip", userAgent: "user_agent", }, @@ -312,20 +304,17 @@ describe("EventsClient", () => { captured_at: "2024-01-15T09:30:00Z", company: { id: "id", name: "name" }, company_id: "company_id", - enriched_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", error_message: "error_message", feature_ids: ["feature_ids"], features: [{ id: "id", name: "name" }], id: "id", loaded_at: "2024-01-15T09:30:00Z", - processed_at: "2024-01-15T09:30:00Z", quantity: 1, sent_at: "2024-01-15T09:30:00Z", status: "enriched", subtype: "subtype", type: "flag_check", - updated_at: "2024-01-15T09:30:00Z", user: { id: "id", name: "name" }, user_id: "user_id", }, @@ -364,7 +353,6 @@ describe("EventsClient", () => { name: "name", }, companyId: "company_id", - enrichedAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", errorMessage: "error_message", featureIds: ["feature_ids"], @@ -376,13 +364,11 @@ describe("EventsClient", () => { ], id: "id", loadedAt: new Date("2024-01-15T09:30:00.000Z"), - processedAt: new Date("2024-01-15T09:30:00.000Z"), quantity: 1, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "enriched", subtype: "subtype", type: "flag_check", - updatedAt: new Date("2024-01-15T09:30:00.000Z"), user: { id: "id", name: "name", @@ -619,20 +605,17 @@ describe("EventsClient", () => { captured_at: "2024-01-15T09:30:00Z", company: { description: "description", id: "id", image_url: "image_url", name: "name" }, company_id: "company_id", - enriched_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", error_message: "error_message", feature_ids: ["feature_ids"], features: [{ id: "id", name: "name" }], id: "id", loaded_at: "2024-01-15T09:30:00Z", - processed_at: "2024-01-15T09:30:00Z", quantity: 1, sent_at: "2024-01-15T09:30:00Z", status: "enriched", subtype: "subtype", type: "flag_check", - updated_at: "2024-01-15T09:30:00Z", user: { description: "description", id: "id", image_url: "image_url", name: "name" }, user_id: "user_id", }, @@ -656,7 +639,6 @@ describe("EventsClient", () => { name: "name", }, companyId: "company_id", - enrichedAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", errorMessage: "error_message", featureIds: ["feature_ids"], @@ -668,13 +650,11 @@ describe("EventsClient", () => { ], id: "id", loadedAt: new Date("2024-01-15T09:30:00.000Z"), - processedAt: new Date("2024-01-15T09:30:00.000Z"), quantity: 1, sentAt: new Date("2024-01-15T09:30:00.000Z"), status: "enriched", subtype: "subtype", type: "flag_check", - updatedAt: new Date("2024-01-15T09:30:00.000Z"), user: { description: "description", id: "id",