From 5185860aaf283d5a55ba044209b9ff171d47d5af Mon Sep 17 00:00:00 2001 From: Benjamin Papillon Date: Tue, 8 Oct 2024 13:49:22 -0400 Subject: [PATCH] Update subscription API types (#94) --- components/package.json | 2 +- .../models/BillingSubscriptionResponseData.ts | 30 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/components/package.json b/components/package.json index 05b251fc..a97860e2 100644 --- a/components/package.json +++ b/components/package.json @@ -1,6 +1,6 @@ { "name": "@schematichq/schematic-components", - "version": "0.3.1", + "version": "0.3.2", "main": "dist/schematic-components.cjs.js", "module": "dist/schematic-components.esm.js", "types": "dist/schematic-components.d.ts", diff --git a/components/src/api/models/BillingSubscriptionResponseData.ts b/components/src/api/models/BillingSubscriptionResponseData.ts index 1358db89..4a27c52f 100644 --- a/components/src/api/models/BillingSubscriptionResponseData.ts +++ b/components/src/api/models/BillingSubscriptionResponseData.ts @@ -19,6 +19,12 @@ import { mapValues } from "../runtime"; * @interface BillingSubscriptionResponseData */ export interface BillingSubscriptionResponseData { + /** + * + * @type {string} + * @memberof BillingSubscriptionResponseData + */ + currency: string; /** * * @type {Date} @@ -31,12 +37,24 @@ export interface BillingSubscriptionResponseData { * @memberof BillingSubscriptionResponseData */ externalId: string; + /** + * + * @type {string} + * @memberof BillingSubscriptionResponseData + */ + id: string; + /** + * + * @type {string} + * @memberof BillingSubscriptionResponseData + */ + interval: string; /** * * @type {number} * @memberof BillingSubscriptionResponseData */ - id: number; + totalPrice: number; /** * * @type {Date} @@ -51,9 +69,13 @@ export interface BillingSubscriptionResponseData { export function instanceOfBillingSubscriptionResponseData( value: object, ): value is BillingSubscriptionResponseData { + if (!("currency" in value) || value["currency"] === undefined) return false; if (!("externalId" in value) || value["externalId"] === undefined) return false; if (!("id" in value) || value["id"] === undefined) return false; + if (!("interval" in value) || value["interval"] === undefined) return false; + if (!("totalPrice" in value) || value["totalPrice"] === undefined) + return false; if (!("updatedAt" in value) || value["updatedAt"] === undefined) return false; return true; } @@ -72,10 +94,13 @@ export function BillingSubscriptionResponseDataFromJSONTyped( return json; } return { + currency: json["currency"], expiredAt: json["expired_at"] == null ? undefined : new Date(json["expired_at"]), externalId: json["external_id"], id: json["id"], + interval: json["interval"], + totalPrice: json["total_price"], updatedAt: new Date(json["updated_at"]), }; } @@ -87,12 +112,15 @@ export function BillingSubscriptionResponseDataToJSON( return value; } return { + currency: value["currency"], expired_at: value["expiredAt"] == null ? undefined : (value["expiredAt"] as any).toISOString(), external_id: value["externalId"], id: value["id"], + interval: value["interval"], + total_price: value["totalPrice"], updated_at: value["updatedAt"].toISOString(), }; }