From 8f1f76577174938852c3900aa7d6276f451a0e45 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 19 Nov 2024 15:10:32 +0000 Subject: [PATCH] SDK updates --- src/generated/.openapi-generator/FILES | 3 + src/generated/.openapi-generator/VERSION | 2 +- src/generated/apis/AppsApi.ts | 9 +- src/generated/apis/AuthenticateApi.ts | 18 +- src/generated/apis/TransactionsApi.ts | 36 ++- src/generated/apis/UserDevicesApi.ts | 39 ++- src/generated/apis/UsersApi.ts | 69 ++--- src/generated/models/AppInfo.ts | 235 ++++++++++-------- src/generated/models/AppResponse.ts | 29 +-- .../models/AppleUserSocialConnection.ts | 40 +-- src/generated/models/AuthMethods.ts | 51 ++-- .../models/AuthenticateVerifyNonceResponse.ts | 28 +-- .../CreateTransactionAuthenticateRequest.ts | 28 +-- .../CreateTransactionRegisterRequest.ts | 32 +-- .../models/CreateTransactionResponse.ts | 28 +-- src/generated/models/ElementCustomization.ts | 111 +++++---- src/generated/models/FontFamily.ts | 15 ++ .../models/GithubUserSocialConnection.ts | 40 +-- .../models/GoogleUserSocialConnection.ts | 40 +-- src/generated/models/LayoutConfig.ts | 44 ++-- src/generated/models/Layouts.ts | 33 +-- src/generated/models/Link.ts | 28 +-- src/generated/models/ListDevicesResponse.ts | 29 +-- .../models/ListPaginatedUsersItem.ts | 75 +++--- .../models/ListPaginatedUsersResponse.ts | 62 ++--- src/generated/models/MagicLinkAuthMethod.ts | 39 +-- src/generated/models/Model400Error.ts | 32 +-- src/generated/models/Model401Error.ts | 32 +-- src/generated/models/Model403Error.ts | 32 +-- src/generated/models/Model404Error.ts | 35 +-- src/generated/models/Model409Error.ts | 40 +-- src/generated/models/Model500Error.ts | 32 +-- src/generated/models/Nonce.ts | 28 +-- src/generated/models/OtpAuthMethod.ts | 39 +-- src/generated/models/PaginatedLinks.ts | 45 ++-- src/generated/models/PasskeysAuthMethod.ts | 28 +-- src/generated/models/SocialConnectionType.ts | 54 ++++ src/generated/models/Technologies.ts | 15 ++ src/generated/models/ThemeType.ts | 54 ++++ src/generated/models/TtlDisplayUnit.ts | 16 ++ src/generated/models/UserEventAction.ts | 54 ++++ src/generated/models/UserEventStatus.ts | 15 ++ src/generated/models/UserInfo.ts | 111 +++++---- src/generated/models/UserMetadataField.ts | 51 ++-- src/generated/models/UserMetadataFieldType.ts | 15 ++ src/generated/models/UserRecentEvent.ts | 100 +++++--- src/generated/models/UserResponse.ts | 29 +-- src/generated/models/UserSocialConnections.ts | 51 ++-- src/generated/models/UserStatus.ts | 15 ++ src/generated/models/WebAuthnDevices.ts | 64 ++--- src/generated/models/WebAuthnIcons.ts | 32 +-- src/generated/models/WebAuthnType.ts | 15 ++ src/generated/models/index.ts | 3 + src/generated/runtime.ts | 16 +- 54 files changed, 1328 insertions(+), 888 deletions(-) create mode 100644 src/generated/models/SocialConnectionType.ts create mode 100644 src/generated/models/ThemeType.ts create mode 100644 src/generated/models/UserEventAction.ts diff --git a/src/generated/.openapi-generator/FILES b/src/generated/.openapi-generator/FILES index 607cd4b..14d2130 100644 --- a/src/generated/.openapi-generator/FILES +++ b/src/generated/.openapi-generator/FILES @@ -35,8 +35,11 @@ models/Nonce.ts models/OtpAuthMethod.ts models/PaginatedLinks.ts models/PasskeysAuthMethod.ts +models/SocialConnectionType.ts models/Technologies.ts +models/ThemeType.ts models/TtlDisplayUnit.ts +models/UserEventAction.ts models/UserEventStatus.ts models/UserInfo.ts models/UserMetadataField.ts diff --git a/src/generated/.openapi-generator/VERSION b/src/generated/.openapi-generator/VERSION index 4122521..8841191 100644 --- a/src/generated/.openapi-generator/VERSION +++ b/src/generated/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.0 \ No newline at end of file +7.11.0-SNAPSHOT diff --git a/src/generated/apis/AppsApi.ts b/src/generated/apis/AppsApi.ts index fd45210..a72bf47 100644 --- a/src/generated/apis/AppsApi.ts +++ b/src/generated/apis/AppsApi.ts @@ -45,8 +45,11 @@ export class AppsApi extends runtime.BaseAPI { * Get App */ async getAppRaw(requestParameters: GetAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling getApp.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling getApp().' + ); } const queryParameters: any = {}; @@ -62,7 +65,7 @@ export class AppsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))), + path: `/apps/{app_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/src/generated/apis/AuthenticateApi.ts b/src/generated/apis/AuthenticateApi.ts index b3633c2..cf2b2dd 100644 --- a/src/generated/apis/AuthenticateApi.ts +++ b/src/generated/apis/AuthenticateApi.ts @@ -55,12 +55,18 @@ export class AuthenticateApi extends runtime.BaseAPI { * Verify the nonce received from a WebAuthn ceremony */ async authenticateVerifyNonceRaw(requestParameters: AuthenticateVerifyNonceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling authenticateVerifyNonce.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling authenticateVerifyNonce().' + ); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling authenticateVerifyNonce.'); + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling authenticateVerifyNonce().' + ); } const queryParameters: any = {}; @@ -78,11 +84,11 @@ export class AuthenticateApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/authenticate/verify`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))), + path: `/apps/{app_id}/authenticate/verify`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body as any, + body: requestParameters['body'] as any, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AuthenticateVerifyNonceResponseFromJSON(jsonValue)); diff --git a/src/generated/apis/TransactionsApi.ts b/src/generated/apis/TransactionsApi.ts index 0ece2ae..4414e20 100644 --- a/src/generated/apis/TransactionsApi.ts +++ b/src/generated/apis/TransactionsApi.ts @@ -65,12 +65,18 @@ export class TransactionsApi extends runtime.BaseAPI { * Create a transaction to start a user\'s authentication process */ async createAuthenticateTransactionRaw(requestParameters: CreateAuthenticateTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling createAuthenticateTransaction.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling createAuthenticateTransaction().' + ); } - if (requestParameters.createTransactionAuthenticateRequest === null || requestParameters.createTransactionAuthenticateRequest === undefined) { - throw new runtime.RequiredError('createTransactionAuthenticateRequest','Required parameter requestParameters.createTransactionAuthenticateRequest was null or undefined when calling createAuthenticateTransaction.'); + if (requestParameters['createTransactionAuthenticateRequest'] == null) { + throw new runtime.RequiredError( + 'createTransactionAuthenticateRequest', + 'Required parameter "createTransactionAuthenticateRequest" was null or undefined when calling createAuthenticateTransaction().' + ); } const queryParameters: any = {}; @@ -88,11 +94,11 @@ export class TransactionsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/transactions/authenticate`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))), + path: `/apps/{app_id}/transactions/authenticate`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateTransactionAuthenticateRequestToJSON(requestParameters.createTransactionAuthenticateRequest), + body: CreateTransactionAuthenticateRequestToJSON(requestParameters['createTransactionAuthenticateRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateTransactionResponseFromJSON(jsonValue)); @@ -110,12 +116,18 @@ export class TransactionsApi extends runtime.BaseAPI { * Create a transaction to start a user\'s registration process */ async createRegisterTransactionRaw(requestParameters: CreateRegisterTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling createRegisterTransaction.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling createRegisterTransaction().' + ); } - if (requestParameters.createTransactionRegisterRequest === null || requestParameters.createTransactionRegisterRequest === undefined) { - throw new runtime.RequiredError('createTransactionRegisterRequest','Required parameter requestParameters.createTransactionRegisterRequest was null or undefined when calling createRegisterTransaction.'); + if (requestParameters['createTransactionRegisterRequest'] == null) { + throw new runtime.RequiredError( + 'createTransactionRegisterRequest', + 'Required parameter "createTransactionRegisterRequest" was null or undefined when calling createRegisterTransaction().' + ); } const queryParameters: any = {}; @@ -133,11 +145,11 @@ export class TransactionsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/transactions/register`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))), + path: `/apps/{app_id}/transactions/register`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateTransactionRegisterRequestToJSON(requestParameters.createTransactionRegisterRequest), + body: CreateTransactionRegisterRequestToJSON(requestParameters['createTransactionRegisterRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateTransactionResponseFromJSON(jsonValue)); diff --git a/src/generated/apis/UserDevicesApi.ts b/src/generated/apis/UserDevicesApi.ts index 4a33cbe..0b89e38 100644 --- a/src/generated/apis/UserDevicesApi.ts +++ b/src/generated/apis/UserDevicesApi.ts @@ -52,16 +52,25 @@ export class UserDevicesApi extends runtime.BaseAPI { * Delete a device for a user */ async deleteUserDevicesRaw(requestParameters: DeleteUserDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling deleteUserDevices.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling deleteUserDevices().' + ); } - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteUserDevices.'); + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteUserDevices().' + ); } - if (requestParameters.deviceId === null || requestParameters.deviceId === undefined) { - throw new runtime.RequiredError('deviceId','Required parameter requestParameters.deviceId was null or undefined when calling deleteUserDevices.'); + if (requestParameters['deviceId'] == null) { + throw new runtime.RequiredError( + 'deviceId', + 'Required parameter "deviceId" was null or undefined when calling deleteUserDevices().' + ); } const queryParameters: any = {}; @@ -77,7 +86,7 @@ export class UserDevicesApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/users/{user_id}/devices/{device_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"device_id"}}`, encodeURIComponent(String(requestParameters.deviceId))), + path: `/apps/{app_id}/users/{user_id}/devices/{device_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters['userId']))).replace(`{${"device_id"}}`, encodeURIComponent(String(requestParameters['deviceId']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -99,12 +108,18 @@ export class UserDevicesApi extends runtime.BaseAPI { * List User Devices */ async listUserDevicesRaw(requestParameters: ListUserDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling listUserDevices.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling listUserDevices().' + ); } - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling listUserDevices.'); + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling listUserDevices().' + ); } const queryParameters: any = {}; @@ -120,7 +135,7 @@ export class UserDevicesApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/users/{user_id}/devices`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + path: `/apps/{app_id}/users/{user_id}/devices`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters['userId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/src/generated/apis/UsersApi.ts b/src/generated/apis/UsersApi.ts index 048e92a..2a63ee5 100644 --- a/src/generated/apis/UsersApi.ts +++ b/src/generated/apis/UsersApi.ts @@ -67,12 +67,18 @@ export class UsersApi extends runtime.BaseAPI { * Get User */ async getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling getUser.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling getUser().' + ); } - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling getUser.'); + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling getUser().' + ); } const queryParameters: any = {}; @@ -88,7 +94,7 @@ export class UsersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/users/{user_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + path: `/apps/{app_id}/users/{user_id}`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))).replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters['userId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -111,54 +117,57 @@ export class UsersApi extends runtime.BaseAPI { * List Users */ async listPaginatedUsersRaw(requestParameters: ListPaginatedUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.appId === null || requestParameters.appId === undefined) { - throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling listPaginatedUsers.'); + if (requestParameters['appId'] == null) { + throw new runtime.RequiredError( + 'appId', + 'Required parameter "appId" was null or undefined when calling listPaginatedUsers().' + ); } const queryParameters: any = {}; - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.createdBefore !== undefined) { - queryParameters['created_before'] = requestParameters.createdBefore; + if (requestParameters['createdBefore'] != null) { + queryParameters['created_before'] = requestParameters['createdBefore']; } - if (requestParameters.orderBy !== undefined) { - queryParameters['order_by'] = requestParameters.orderBy; + if (requestParameters['orderBy'] != null) { + queryParameters['order_by'] = requestParameters['orderBy']; } - if (requestParameters.identifier !== undefined) { - queryParameters['identifier'] = requestParameters.identifier; + if (requestParameters['identifier'] != null) { + queryParameters['identifier'] = requestParameters['identifier']; } - if (requestParameters.id !== undefined) { - queryParameters['id'] = requestParameters.id; + if (requestParameters['id'] != null) { + queryParameters['id'] = requestParameters['id']; } - if (requestParameters.loginCount !== undefined) { - queryParameters['login_count'] = requestParameters.loginCount; + if (requestParameters['loginCount'] != null) { + queryParameters['login_count'] = requestParameters['loginCount']; } - if (requestParameters.status !== undefined) { - queryParameters['status'] = requestParameters.status; + if (requestParameters['status'] != null) { + queryParameters['status'] = requestParameters['status']; } - if (requestParameters.createdAt !== undefined) { - queryParameters['created_at'] = requestParameters.createdAt; + if (requestParameters['createdAt'] != null) { + queryParameters['created_at'] = requestParameters['createdAt']; } - if (requestParameters.updatedAt !== undefined) { - queryParameters['updated_at'] = requestParameters.updatedAt; + if (requestParameters['updatedAt'] != null) { + queryParameters['updated_at'] = requestParameters['updatedAt']; } - if (requestParameters.lastLoginAt !== undefined) { - queryParameters['last_login_at'] = requestParameters.lastLoginAt; + if (requestParameters['lastLoginAt'] != null) { + queryParameters['last_login_at'] = requestParameters['lastLoginAt']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -172,7 +181,7 @@ export class UsersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/apps/{app_id}/users`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))), + path: `/apps/{app_id}/users`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters['appId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/src/generated/models/AppInfo.ts b/src/generated/models/AppInfo.ts index 3bb4de5..0d9beba 100644 --- a/src/generated/models/AppInfo.ts +++ b/src/generated/models/AppInfo.ts @@ -12,37 +12,49 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AuthMethods } from './AuthMethods'; import { AuthMethodsFromJSON, AuthMethodsFromJSONTyped, AuthMethodsToJSON, + AuthMethodsToJSONTyped, } from './AuthMethods'; -import type { ElementCustomization } from './ElementCustomization'; -import { - ElementCustomizationFromJSON, - ElementCustomizationFromJSONTyped, - ElementCustomizationToJSON, -} from './ElementCustomization'; import type { Layouts } from './Layouts'; import { LayoutsFromJSON, LayoutsFromJSONTyped, LayoutsToJSON, + LayoutsToJSONTyped, } from './Layouts'; -import type { Technologies } from './Technologies'; +import type { ThemeType } from './ThemeType'; import { - TechnologiesFromJSON, - TechnologiesFromJSONTyped, - TechnologiesToJSON, -} from './Technologies'; + ThemeTypeFromJSON, + ThemeTypeFromJSONTyped, + ThemeTypeToJSON, + ThemeTypeToJSONTyped, +} from './ThemeType'; import type { UserMetadataField } from './UserMetadataField'; import { UserMetadataFieldFromJSON, UserMetadataFieldFromJSONTyped, UserMetadataFieldToJSON, + UserMetadataFieldToJSONTyped, } from './UserMetadataField'; +import type { ElementCustomization } from './ElementCustomization'; +import { + ElementCustomizationFromJSON, + ElementCustomizationFromJSONTyped, + ElementCustomizationToJSON, + ElementCustomizationToJSONTyped, +} from './ElementCustomization'; +import type { Technologies } from './Technologies'; +import { + TechnologiesFromJSON, + TechnologiesFromJSONTyped, + TechnologiesToJSON, + TechnologiesToJSONTyped, +} from './Technologies'; /** * @@ -106,6 +118,13 @@ export interface AppInfo { * @memberof AppInfo */ authOrigin: string; + /** + * Deprecated Property. Please use `hosted_theme` to set hosted page theming instead. + * @type {boolean} + * @memberof AppInfo + * @deprecated + */ + autoThemeEnabled: boolean; /** * * @type {Date} @@ -155,7 +174,7 @@ export interface AppInfo { */ name: string; /** - * whether or not the app's login page hosted by passage + * whether or not the app's login page is hosted by Passage * @type {boolean} * @memberof AppInfo */ @@ -166,6 +185,12 @@ export interface AppInfo { * @memberof AppInfo */ hostedSubdomain: string; + /** + * + * @type {ThemeType} + * @memberof AppInfo + */ + hostedTheme: ThemeType; /** * * @type {number} @@ -302,45 +327,45 @@ export type AppInfoTypeEnum = typeof AppInfoTypeEnum[keyof typeof AppInfoTypeEnu /** * Check if a given object implements the AppInfo interface. */ -export function instanceOfAppInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "additionalAuthOrigins" in value; - isInstance = isInstance && "allowedCallbackUrls" in value; - isInstance = isInstance && "allowedIdentifier" in value; - isInstance = isInstance && "allowedLogoutUrls" in value; - isInstance = isInstance && "applicationLoginUri" in value; - isInstance = isInstance && "authFallbackMethod" in value; - isInstance = isInstance && "authFallbackMethodTtl" in value; - isInstance = isInstance && "authMethods" in value; - isInstance = isInstance && "authOrigin" in value; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "defaultLanguage" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layouts" in value; - isInstance = isInstance && "loginUrl" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "hosted" in value; - isInstance = isInstance && "hostedSubdomain" in value; - isInstance = isInstance && "passageBranding" in value; - isInstance = isInstance && "profileManagement" in value; - isInstance = isInstance && "publicSignup" in value; - isInstance = isInstance && "redirectUrl" in value; - isInstance = isInstance && "refreshAbsoluteLifetime" in value; - isInstance = isInstance && "refreshEnabled" in value; - isInstance = isInstance && "refreshInactivityLifetime" in value; - isInstance = isInstance && "requireEmailVerification" in value; - isInstance = isInstance && "requireIdentifierVerification" in value; - isInstance = isInstance && "requiredIdentifier" in value; - isInstance = isInstance && "role" in value; - isInstance = isInstance && "rsaPublicKey" in value; - isInstance = isInstance && "sessionTimeoutLength" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "userMetadataSchema" in value; - isInstance = isInstance && "technologies" in value; - isInstance = isInstance && "elementCustomization" in value; - isInstance = isInstance && "elementCustomizationDark" in value; - - return isInstance; +export function instanceOfAppInfo(value: object): value is AppInfo { + if (!('additionalAuthOrigins' in value) || value['additionalAuthOrigins'] === undefined) return false; + if (!('allowedCallbackUrls' in value) || value['allowedCallbackUrls'] === undefined) return false; + if (!('allowedIdentifier' in value) || value['allowedIdentifier'] === undefined) return false; + if (!('allowedLogoutUrls' in value) || value['allowedLogoutUrls'] === undefined) return false; + if (!('applicationLoginUri' in value) || value['applicationLoginUri'] === undefined) return false; + if (!('authFallbackMethod' in value) || value['authFallbackMethod'] === undefined) return false; + if (!('authFallbackMethodTtl' in value) || value['authFallbackMethodTtl'] === undefined) return false; + if (!('authMethods' in value) || value['authMethods'] === undefined) return false; + if (!('authOrigin' in value) || value['authOrigin'] === undefined) return false; + if (!('autoThemeEnabled' in value) || value['autoThemeEnabled'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('defaultLanguage' in value) || value['defaultLanguage'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('layouts' in value) || value['layouts'] === undefined) return false; + if (!('loginUrl' in value) || value['loginUrl'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('hosted' in value) || value['hosted'] === undefined) return false; + if (!('hostedSubdomain' in value) || value['hostedSubdomain'] === undefined) return false; + if (!('hostedTheme' in value) || value['hostedTheme'] === undefined) return false; + if (!('passageBranding' in value) || value['passageBranding'] === undefined) return false; + if (!('profileManagement' in value) || value['profileManagement'] === undefined) return false; + if (!('publicSignup' in value) || value['publicSignup'] === undefined) return false; + if (!('redirectUrl' in value) || value['redirectUrl'] === undefined) return false; + if (!('refreshAbsoluteLifetime' in value) || value['refreshAbsoluteLifetime'] === undefined) return false; + if (!('refreshEnabled' in value) || value['refreshEnabled'] === undefined) return false; + if (!('refreshInactivityLifetime' in value) || value['refreshInactivityLifetime'] === undefined) return false; + if (!('requireEmailVerification' in value) || value['requireEmailVerification'] === undefined) return false; + if (!('requireIdentifierVerification' in value) || value['requireIdentifierVerification'] === undefined) return false; + if (!('requiredIdentifier' in value) || value['requiredIdentifier'] === undefined) return false; + if (!('role' in value) || value['role'] === undefined) return false; + if (!('rsaPublicKey' in value) || value['rsaPublicKey'] === undefined) return false; + if (!('sessionTimeoutLength' in value) || value['sessionTimeoutLength'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('userMetadataSchema' in value) || value['userMetadataSchema'] === undefined) return false; + if (!('technologies' in value) || value['technologies'] === undefined) return false; + if (!('elementCustomization' in value) || value['elementCustomization'] === undefined) return false; + if (!('elementCustomizationDark' in value) || value['elementCustomizationDark'] === undefined) return false; + return true; } export function AppInfoFromJSON(json: any): AppInfo { @@ -348,7 +373,7 @@ export function AppInfoFromJSON(json: any): AppInfo { } export function AppInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AppInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -362,17 +387,19 @@ export function AppInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): A 'authFallbackMethodTtl': json['auth_fallback_method_ttl'], 'authMethods': AuthMethodsFromJSON(json['auth_methods']), 'authOrigin': json['auth_origin'], + 'autoThemeEnabled': json['auto_theme_enabled'], 'createdAt': (new Date(json['created_at'])), 'defaultLanguage': json['default_language'], 'id': json['id'], 'layouts': LayoutsFromJSON(json['layouts']), 'loginUrl': json['login_url'], - 'lightLogoUrl': !exists(json, 'light_logo_url') ? undefined : json['light_logo_url'], - 'darkLogoUrl': !exists(json, 'dark_logo_url') ? undefined : json['dark_logo_url'], + 'lightLogoUrl': json['light_logo_url'] == null ? undefined : json['light_logo_url'], + 'darkLogoUrl': json['dark_logo_url'] == null ? undefined : json['dark_logo_url'], 'name': json['name'], 'hosted': json['hosted'], 'hostedSubdomain': json['hosted_subdomain'], - 'idTokenLifetime': !exists(json, 'id_token_lifetime') ? undefined : json['id_token_lifetime'], + 'hostedTheme': ThemeTypeFromJSON(json['hosted_theme']), + 'idTokenLifetime': json['id_token_lifetime'] == null ? undefined : json['id_token_lifetime'], 'passageBranding': json['passage_branding'], 'profileManagement': json['profile_management'], 'publicSignup': json['public_signup'], @@ -385,7 +412,7 @@ export function AppInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): A 'requiredIdentifier': json['required_identifier'], 'role': json['role'], 'rsaPublicKey': json['rsa_public_key'], - 'secret': !exists(json, 'secret') ? undefined : json['secret'], + 'secret': json['secret'] == null ? undefined : json['secret'], 'sessionTimeoutLength': json['session_timeout_length'], 'type': json['type'], 'userMetadataSchema': ((json['user_metadata_schema'] as Array).map(UserMetadataFieldFromJSON)), @@ -395,54 +422,58 @@ export function AppInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): A }; } -export function AppInfoToJSON(value?: AppInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AppInfoToJSON(json: any): AppInfo { + return AppInfoToJSONTyped(json, false); +} + +export function AppInfoToJSONTyped(value?: AppInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'additional_auth_origins': value.additionalAuthOrigins, - 'allowed_callback_urls': value.allowedCallbackUrls, - 'allowed_identifier': value.allowedIdentifier, - 'allowed_logout_urls': value.allowedLogoutUrls, - 'application_login_uri': value.applicationLoginUri, - 'auth_fallback_method': value.authFallbackMethod, - 'auth_fallback_method_ttl': value.authFallbackMethodTtl, - 'auth_methods': AuthMethodsToJSON(value.authMethods), - 'auth_origin': value.authOrigin, - 'created_at': (value.createdAt.toISOString()), - 'default_language': value.defaultLanguage, - 'id': value.id, - 'layouts': LayoutsToJSON(value.layouts), - 'login_url': value.loginUrl, - 'light_logo_url': value.lightLogoUrl, - 'dark_logo_url': value.darkLogoUrl, - 'name': value.name, - 'hosted': value.hosted, - 'hosted_subdomain': value.hostedSubdomain, - 'id_token_lifetime': value.idTokenLifetime, - 'passage_branding': value.passageBranding, - 'profile_management': value.profileManagement, - 'public_signup': value.publicSignup, - 'redirect_url': value.redirectUrl, - 'refresh_absolute_lifetime': value.refreshAbsoluteLifetime, - 'refresh_enabled': value.refreshEnabled, - 'refresh_inactivity_lifetime': value.refreshInactivityLifetime, - 'require_email_verification': value.requireEmailVerification, - 'require_identifier_verification': value.requireIdentifierVerification, - 'required_identifier': value.requiredIdentifier, - 'role': value.role, - 'rsa_public_key': value.rsaPublicKey, - 'secret': value.secret, - 'session_timeout_length': value.sessionTimeoutLength, - 'type': value.type, - 'user_metadata_schema': ((value.userMetadataSchema as Array).map(UserMetadataFieldToJSON)), - 'technologies': ((value.technologies as Array).map(TechnologiesToJSON)), - 'element_customization': ElementCustomizationToJSON(value.elementCustomization), - 'element_customization_dark': ElementCustomizationToJSON(value.elementCustomizationDark), + 'additional_auth_origins': value['additionalAuthOrigins'], + 'allowed_callback_urls': value['allowedCallbackUrls'], + 'allowed_identifier': value['allowedIdentifier'], + 'allowed_logout_urls': value['allowedLogoutUrls'], + 'application_login_uri': value['applicationLoginUri'], + 'auth_fallback_method': value['authFallbackMethod'], + 'auth_fallback_method_ttl': value['authFallbackMethodTtl'], + 'auth_methods': AuthMethodsToJSON(value['authMethods']), + 'auth_origin': value['authOrigin'], + 'auto_theme_enabled': value['autoThemeEnabled'], + 'created_at': ((value['createdAt']).toISOString()), + 'default_language': value['defaultLanguage'], + 'id': value['id'], + 'layouts': LayoutsToJSON(value['layouts']), + 'login_url': value['loginUrl'], + 'light_logo_url': value['lightLogoUrl'], + 'dark_logo_url': value['darkLogoUrl'], + 'name': value['name'], + 'hosted': value['hosted'], + 'hosted_subdomain': value['hostedSubdomain'], + 'hosted_theme': ThemeTypeToJSON(value['hostedTheme']), + 'id_token_lifetime': value['idTokenLifetime'], + 'passage_branding': value['passageBranding'], + 'profile_management': value['profileManagement'], + 'public_signup': value['publicSignup'], + 'redirect_url': value['redirectUrl'], + 'refresh_absolute_lifetime': value['refreshAbsoluteLifetime'], + 'refresh_enabled': value['refreshEnabled'], + 'refresh_inactivity_lifetime': value['refreshInactivityLifetime'], + 'require_email_verification': value['requireEmailVerification'], + 'require_identifier_verification': value['requireIdentifierVerification'], + 'required_identifier': value['requiredIdentifier'], + 'role': value['role'], + 'rsa_public_key': value['rsaPublicKey'], + 'secret': value['secret'], + 'session_timeout_length': value['sessionTimeoutLength'], + 'type': value['type'], + 'user_metadata_schema': ((value['userMetadataSchema'] as Array).map(UserMetadataFieldToJSON)), + 'technologies': ((value['technologies'] as Array).map(TechnologiesToJSON)), + 'element_customization': ElementCustomizationToJSON(value['elementCustomization']), + 'element_customization_dark': ElementCustomizationToJSON(value['elementCustomizationDark']), }; } diff --git a/src/generated/models/AppResponse.ts b/src/generated/models/AppResponse.ts index c0a09fd..fc2c2cc 100644 --- a/src/generated/models/AppResponse.ts +++ b/src/generated/models/AppResponse.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AppInfo } from './AppInfo'; import { AppInfoFromJSON, AppInfoFromJSONTyped, AppInfoToJSON, + AppInfoToJSONTyped, } from './AppInfo'; /** @@ -37,11 +38,9 @@ export interface AppResponse { /** * Check if a given object implements the AppResponse interface. */ -export function instanceOfAppResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "app" in value; - - return isInstance; +export function instanceOfAppResponse(value: object): value is AppResponse { + if (!('app' in value) || value['app'] === undefined) return false; + return true; } export function AppResponseFromJSON(json: any): AppResponse { @@ -49,7 +48,7 @@ export function AppResponseFromJSON(json: any): AppResponse { } export function AppResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AppResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function AppResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function AppResponseToJSON(value?: AppResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AppResponseToJSON(json: any): AppResponse { + return AppResponseToJSONTyped(json, false); +} + +export function AppResponseToJSONTyped(value?: AppResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'app': AppInfoToJSON(value.app), + 'app': AppInfoToJSON(value['app']), }; } diff --git a/src/generated/models/AppleUserSocialConnection.ts b/src/generated/models/AppleUserSocialConnection.ts index 8516317..f832807 100644 --- a/src/generated/models/AppleUserSocialConnection.ts +++ b/src/generated/models/AppleUserSocialConnection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface AppleUserSocialConnection { /** * Check if a given object implements the AppleUserSocialConnection interface. */ -export function instanceOfAppleUserSocialConnection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "providerIdentifier" in value; - - return isInstance; +export function instanceOfAppleUserSocialConnection(value: object): value is AppleUserSocialConnection { + if (!('providerId' in value) || value['providerId'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('providerIdentifier' in value) || value['providerIdentifier'] === undefined) return false; + return true; } export function AppleUserSocialConnectionFromJSON(json: any): AppleUserSocialConnection { @@ -63,7 +61,7 @@ export function AppleUserSocialConnectionFromJSON(json: any): AppleUserSocialCon } export function AppleUserSocialConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AppleUserSocialConnection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function AppleUserSocialConnectionFromJSONTyped(json: any, ignoreDiscrimi }; } -export function AppleUserSocialConnectionToJSON(value?: AppleUserSocialConnection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AppleUserSocialConnectionToJSON(json: any): AppleUserSocialConnection { + return AppleUserSocialConnectionToJSONTyped(json, false); +} + +export function AppleUserSocialConnectionToJSONTyped(value?: AppleUserSocialConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'provider_id': value.providerId, - 'created_at': (value.createdAt.toISOString()), - 'last_login_at': (value.lastLoginAt.toISOString()), - 'provider_identifier': value.providerIdentifier, + 'provider_id': value['providerId'], + 'created_at': ((value['createdAt']).toISOString()), + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'provider_identifier': value['providerIdentifier'], }; } diff --git a/src/generated/models/AuthMethods.ts b/src/generated/models/AuthMethods.ts index 8cc00cb..c5cc8d6 100644 --- a/src/generated/models/AuthMethods.ts +++ b/src/generated/models/AuthMethods.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MagicLinkAuthMethod } from './MagicLinkAuthMethod'; import { MagicLinkAuthMethodFromJSON, MagicLinkAuthMethodFromJSONTyped, MagicLinkAuthMethodToJSON, + MagicLinkAuthMethodToJSONTyped, } from './MagicLinkAuthMethod'; -import type { OtpAuthMethod } from './OtpAuthMethod'; -import { - OtpAuthMethodFromJSON, - OtpAuthMethodFromJSONTyped, - OtpAuthMethodToJSON, -} from './OtpAuthMethod'; import type { PasskeysAuthMethod } from './PasskeysAuthMethod'; import { PasskeysAuthMethodFromJSON, PasskeysAuthMethodFromJSONTyped, PasskeysAuthMethodToJSON, + PasskeysAuthMethodToJSONTyped, } from './PasskeysAuthMethod'; +import type { OtpAuthMethod } from './OtpAuthMethod'; +import { + OtpAuthMethodFromJSON, + OtpAuthMethodFromJSONTyped, + OtpAuthMethodToJSON, + OtpAuthMethodToJSONTyped, +} from './OtpAuthMethod'; /** * Denotes what methods this app is allowed to use for authentication with configurations @@ -61,13 +64,11 @@ export interface AuthMethods { /** * Check if a given object implements the AuthMethods interface. */ -export function instanceOfAuthMethods(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "passkeys" in value; - isInstance = isInstance && "otp" in value; - isInstance = isInstance && "magicLink" in value; - - return isInstance; +export function instanceOfAuthMethods(value: object): value is AuthMethods { + if (!('passkeys' in value) || value['passkeys'] === undefined) return false; + if (!('otp' in value) || value['otp'] === undefined) return false; + if (!('magicLink' in value) || value['magicLink'] === undefined) return false; + return true; } export function AuthMethodsFromJSON(json: any): AuthMethods { @@ -75,7 +76,7 @@ export function AuthMethodsFromJSON(json: any): AuthMethods { } export function AuthMethodsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthMethods { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,18 +87,20 @@ export function AuthMethodsFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function AuthMethodsToJSON(value?: AuthMethods | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthMethodsToJSON(json: any): AuthMethods { + return AuthMethodsToJSONTyped(json, false); +} + +export function AuthMethodsToJSONTyped(value?: AuthMethods | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'passkeys': PasskeysAuthMethodToJSON(value.passkeys), - 'otp': OtpAuthMethodToJSON(value.otp), - 'magic_link': MagicLinkAuthMethodToJSON(value.magicLink), + 'passkeys': PasskeysAuthMethodToJSON(value['passkeys']), + 'otp': OtpAuthMethodToJSON(value['otp']), + 'magic_link': MagicLinkAuthMethodToJSON(value['magicLink']), }; } diff --git a/src/generated/models/AuthenticateVerifyNonceResponse.ts b/src/generated/models/AuthenticateVerifyNonceResponse.ts index 6ae7875..733d3a5 100644 --- a/src/generated/models/AuthenticateVerifyNonceResponse.ts +++ b/src/generated/models/AuthenticateVerifyNonceResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface AuthenticateVerifyNonceResponse { /** * Check if a given object implements the AuthenticateVerifyNonceResponse interface. */ -export function instanceOfAuthenticateVerifyNonceResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "externalId" in value; - - return isInstance; +export function instanceOfAuthenticateVerifyNonceResponse(value: object): value is AuthenticateVerifyNonceResponse { + if (!('externalId' in value) || value['externalId'] === undefined) return false; + return true; } export function AuthenticateVerifyNonceResponseFromJSON(json: any): AuthenticateVerifyNonceResponse { @@ -42,7 +40,7 @@ export function AuthenticateVerifyNonceResponseFromJSON(json: any): Authenticate } export function AuthenticateVerifyNonceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticateVerifyNonceResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function AuthenticateVerifyNonceResponseFromJSONTyped(json: any, ignoreDi }; } -export function AuthenticateVerifyNonceResponseToJSON(value?: AuthenticateVerifyNonceResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthenticateVerifyNonceResponseToJSON(json: any): AuthenticateVerifyNonceResponse { + return AuthenticateVerifyNonceResponseToJSONTyped(json, false); +} + +export function AuthenticateVerifyNonceResponseToJSONTyped(value?: AuthenticateVerifyNonceResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'external_id': value.externalId, + 'external_id': value['externalId'], }; } diff --git a/src/generated/models/CreateTransactionAuthenticateRequest.ts b/src/generated/models/CreateTransactionAuthenticateRequest.ts index 038a34f..8629afe 100644 --- a/src/generated/models/CreateTransactionAuthenticateRequest.ts +++ b/src/generated/models/CreateTransactionAuthenticateRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface CreateTransactionAuthenticateRequest { /** * Check if a given object implements the CreateTransactionAuthenticateRequest interface. */ -export function instanceOfCreateTransactionAuthenticateRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "externalId" in value; - - return isInstance; +export function instanceOfCreateTransactionAuthenticateRequest(value: object): value is CreateTransactionAuthenticateRequest { + if (!('externalId' in value) || value['externalId'] === undefined) return false; + return true; } export function CreateTransactionAuthenticateRequestFromJSON(json: any): CreateTransactionAuthenticateRequest { @@ -42,7 +40,7 @@ export function CreateTransactionAuthenticateRequestFromJSON(json: any): CreateT } export function CreateTransactionAuthenticateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionAuthenticateRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function CreateTransactionAuthenticateRequestFromJSONTyped(json: any, ign }; } -export function CreateTransactionAuthenticateRequestToJSON(value?: CreateTransactionAuthenticateRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateTransactionAuthenticateRequestToJSON(json: any): CreateTransactionAuthenticateRequest { + return CreateTransactionAuthenticateRequestToJSONTyped(json, false); +} + +export function CreateTransactionAuthenticateRequestToJSONTyped(value?: CreateTransactionAuthenticateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'external_id': value.externalId, + 'external_id': value['externalId'], }; } diff --git a/src/generated/models/CreateTransactionRegisterRequest.ts b/src/generated/models/CreateTransactionRegisterRequest.ts index b12da91..405b28b 100644 --- a/src/generated/models/CreateTransactionRegisterRequest.ts +++ b/src/generated/models/CreateTransactionRegisterRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface CreateTransactionRegisterRequest { /** * Check if a given object implements the CreateTransactionRegisterRequest interface. */ -export function instanceOfCreateTransactionRegisterRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "externalId" in value; - isInstance = isInstance && "passkeyDisplayName" in value; - - return isInstance; +export function instanceOfCreateTransactionRegisterRequest(value: object): value is CreateTransactionRegisterRequest { + if (!('externalId' in value) || value['externalId'] === undefined) return false; + if (!('passkeyDisplayName' in value) || value['passkeyDisplayName'] === undefined) return false; + return true; } export function CreateTransactionRegisterRequestFromJSON(json: any): CreateTransactionRegisterRequest { @@ -49,7 +47,7 @@ export function CreateTransactionRegisterRequestFromJSON(json: any): CreateTrans } export function CreateTransactionRegisterRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionRegisterRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function CreateTransactionRegisterRequestFromJSONTyped(json: any, ignoreD }; } -export function CreateTransactionRegisterRequestToJSON(value?: CreateTransactionRegisterRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateTransactionRegisterRequestToJSON(json: any): CreateTransactionRegisterRequest { + return CreateTransactionRegisterRequestToJSONTyped(json, false); +} + +export function CreateTransactionRegisterRequestToJSONTyped(value?: CreateTransactionRegisterRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'external_id': value.externalId, - 'passkey_display_name': value.passkeyDisplayName, + 'external_id': value['externalId'], + 'passkey_display_name': value['passkeyDisplayName'], }; } diff --git a/src/generated/models/CreateTransactionResponse.ts b/src/generated/models/CreateTransactionResponse.ts index 14601f6..af4cb43 100644 --- a/src/generated/models/CreateTransactionResponse.ts +++ b/src/generated/models/CreateTransactionResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface CreateTransactionResponse { /** * Check if a given object implements the CreateTransactionResponse interface. */ -export function instanceOfCreateTransactionResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "transactionId" in value; - - return isInstance; +export function instanceOfCreateTransactionResponse(value: object): value is CreateTransactionResponse { + if (!('transactionId' in value) || value['transactionId'] === undefined) return false; + return true; } export function CreateTransactionResponseFromJSON(json: any): CreateTransactionResponse { @@ -42,7 +40,7 @@ export function CreateTransactionResponseFromJSON(json: any): CreateTransactionR } export function CreateTransactionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function CreateTransactionResponseFromJSONTyped(json: any, ignoreDiscrimi }; } -export function CreateTransactionResponseToJSON(value?: CreateTransactionResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateTransactionResponseToJSON(json: any): CreateTransactionResponse { + return CreateTransactionResponseToJSONTyped(json, false); +} + +export function CreateTransactionResponseToJSONTyped(value?: CreateTransactionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'transaction_id': value.transactionId, + 'transaction_id': value['transactionId'], }; } diff --git a/src/generated/models/ElementCustomization.ts b/src/generated/models/ElementCustomization.ts index 1302a86..86cc831 100644 --- a/src/generated/models/ElementCustomization.ts +++ b/src/generated/models/ElementCustomization.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { FontFamily } from './FontFamily'; import { FontFamilyFromJSON, FontFamilyFromJSONTyped, FontFamilyToJSON, + FontFamilyToJSONTyped, } from './FontFamily'; /** @@ -29,6 +30,7 @@ export interface ElementCustomization { /** * Container background color in hex. * Default is `#ffffff` in light mode & `#383838` in dark mode. + * * @type {string} * @memberof ElementCustomization */ @@ -42,6 +44,7 @@ export interface ElementCustomization { /** * Input box background color in hex. * Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. + * * @type {string} * @memberof ElementCustomization */ @@ -67,6 +70,7 @@ export interface ElementCustomization { /** * Header text color in hex. * Default is `#222222` in light mode & `#f3f3f3` in dark mode. + * * @type {string} * @memberof ElementCustomization */ @@ -74,6 +78,7 @@ export interface ElementCustomization { /** * Body text color in hex. * Default is `#222222` in light mode & `#f3f3f3` in dark mode. + * * @type {string} * @memberof ElementCustomization */ @@ -152,13 +157,13 @@ export interface ElementCustomization { passageSecondaryButtonBorderWidth?: number; } + + /** * Check if a given object implements the ElementCustomization interface. */ -export function instanceOfElementCustomization(value: object): boolean { - let isInstance = true; - - return isInstance; +export function instanceOfElementCustomization(value: object): value is ElementCustomization { + return true; } export function ElementCustomizationFromJSON(json: any): ElementCustomization { @@ -166,63 +171,65 @@ export function ElementCustomizationFromJSON(json: any): ElementCustomization { } export function ElementCustomizationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ElementCustomization { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'passageContainerBackgroundColor': !exists(json, 'passage_container_background_color') ? undefined : json['passage_container_background_color'], - 'passageContainerMaxWidth': !exists(json, 'passage_container_max_width') ? undefined : json['passage_container_max_width'], - 'passageInputBoxBackgroundColor': !exists(json, 'passage_input_box_background_color') ? undefined : json['passage_input_box_background_color'], - 'passageInputBoxBorderRadius': !exists(json, 'passage_input_box_border_radius') ? undefined : json['passage_input_box_border_radius'], - 'passageHeaderFontFamily': !exists(json, 'passage_header_font_family') ? undefined : FontFamilyFromJSON(json['passage_header_font_family']), - 'passageBodyFontFamily': !exists(json, 'passage_body_font_family') ? undefined : FontFamilyFromJSON(json['passage_body_font_family']), - 'passageHeaderTextColor': !exists(json, 'passage_header_text_color') ? undefined : json['passage_header_text_color'], - 'passageBodyTextColor': !exists(json, 'passage_body_text_color') ? undefined : json['passage_body_text_color'], - 'passagePrimaryButtonBackgroundColor': !exists(json, 'passage_primary_button_background_color') ? undefined : json['passage_primary_button_background_color'], - 'passagePrimaryButtonTextColor': !exists(json, 'passage_primary_button_text_color') ? undefined : json['passage_primary_button_text_color'], - 'passagePrimaryButtonHoverColor': !exists(json, 'passage_primary_button_hover_color') ? undefined : json['passage_primary_button_hover_color'], - 'passagePrimaryButtonBorderRadius': !exists(json, 'passage_primary_button_border_radius') ? undefined : json['passage_primary_button_border_radius'], - 'passagePrimaryButtonBorderColor': !exists(json, 'passage_primary_button_border_color') ? undefined : json['passage_primary_button_border_color'], - 'passagePrimaryButtonBorderWidth': !exists(json, 'passage_primary_button_border_width') ? undefined : json['passage_primary_button_border_width'], - 'passageSecondaryButtonBackgroundColor': !exists(json, 'passage_secondary_button_background_color') ? undefined : json['passage_secondary_button_background_color'], - 'passageSecondaryButtonTextColor': !exists(json, 'passage_secondary_button_text_color') ? undefined : json['passage_secondary_button_text_color'], - 'passageSecondaryButtonHoverColor': !exists(json, 'passage_secondary_button_hover_color') ? undefined : json['passage_secondary_button_hover_color'], - 'passageSecondaryButtonBorderRadius': !exists(json, 'passage_secondary_button_border_radius') ? undefined : json['passage_secondary_button_border_radius'], - 'passageSecondaryButtonBorderColor': !exists(json, 'passage_secondary_button_border_color') ? undefined : json['passage_secondary_button_border_color'], - 'passageSecondaryButtonBorderWidth': !exists(json, 'passage_secondary_button_border_width') ? undefined : json['passage_secondary_button_border_width'], + 'passageContainerBackgroundColor': json['passage_container_background_color'] == null ? undefined : json['passage_container_background_color'], + 'passageContainerMaxWidth': json['passage_container_max_width'] == null ? undefined : json['passage_container_max_width'], + 'passageInputBoxBackgroundColor': json['passage_input_box_background_color'] == null ? undefined : json['passage_input_box_background_color'], + 'passageInputBoxBorderRadius': json['passage_input_box_border_radius'] == null ? undefined : json['passage_input_box_border_radius'], + 'passageHeaderFontFamily': json['passage_header_font_family'] == null ? undefined : FontFamilyFromJSON(json['passage_header_font_family']), + 'passageBodyFontFamily': json['passage_body_font_family'] == null ? undefined : FontFamilyFromJSON(json['passage_body_font_family']), + 'passageHeaderTextColor': json['passage_header_text_color'] == null ? undefined : json['passage_header_text_color'], + 'passageBodyTextColor': json['passage_body_text_color'] == null ? undefined : json['passage_body_text_color'], + 'passagePrimaryButtonBackgroundColor': json['passage_primary_button_background_color'] == null ? undefined : json['passage_primary_button_background_color'], + 'passagePrimaryButtonTextColor': json['passage_primary_button_text_color'] == null ? undefined : json['passage_primary_button_text_color'], + 'passagePrimaryButtonHoverColor': json['passage_primary_button_hover_color'] == null ? undefined : json['passage_primary_button_hover_color'], + 'passagePrimaryButtonBorderRadius': json['passage_primary_button_border_radius'] == null ? undefined : json['passage_primary_button_border_radius'], + 'passagePrimaryButtonBorderColor': json['passage_primary_button_border_color'] == null ? undefined : json['passage_primary_button_border_color'], + 'passagePrimaryButtonBorderWidth': json['passage_primary_button_border_width'] == null ? undefined : json['passage_primary_button_border_width'], + 'passageSecondaryButtonBackgroundColor': json['passage_secondary_button_background_color'] == null ? undefined : json['passage_secondary_button_background_color'], + 'passageSecondaryButtonTextColor': json['passage_secondary_button_text_color'] == null ? undefined : json['passage_secondary_button_text_color'], + 'passageSecondaryButtonHoverColor': json['passage_secondary_button_hover_color'] == null ? undefined : json['passage_secondary_button_hover_color'], + 'passageSecondaryButtonBorderRadius': json['passage_secondary_button_border_radius'] == null ? undefined : json['passage_secondary_button_border_radius'], + 'passageSecondaryButtonBorderColor': json['passage_secondary_button_border_color'] == null ? undefined : json['passage_secondary_button_border_color'], + 'passageSecondaryButtonBorderWidth': json['passage_secondary_button_border_width'] == null ? undefined : json['passage_secondary_button_border_width'], }; } -export function ElementCustomizationToJSON(value?: ElementCustomization | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ElementCustomizationToJSON(json: any): ElementCustomization { + return ElementCustomizationToJSONTyped(json, false); +} + +export function ElementCustomizationToJSONTyped(value?: ElementCustomization | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'passage_container_background_color': value.passageContainerBackgroundColor, - 'passage_container_max_width': value.passageContainerMaxWidth, - 'passage_input_box_background_color': value.passageInputBoxBackgroundColor, - 'passage_input_box_border_radius': value.passageInputBoxBorderRadius, - 'passage_header_font_family': FontFamilyToJSON(value.passageHeaderFontFamily), - 'passage_body_font_family': FontFamilyToJSON(value.passageBodyFontFamily), - 'passage_header_text_color': value.passageHeaderTextColor, - 'passage_body_text_color': value.passageBodyTextColor, - 'passage_primary_button_background_color': value.passagePrimaryButtonBackgroundColor, - 'passage_primary_button_text_color': value.passagePrimaryButtonTextColor, - 'passage_primary_button_hover_color': value.passagePrimaryButtonHoverColor, - 'passage_primary_button_border_radius': value.passagePrimaryButtonBorderRadius, - 'passage_primary_button_border_color': value.passagePrimaryButtonBorderColor, - 'passage_primary_button_border_width': value.passagePrimaryButtonBorderWidth, - 'passage_secondary_button_background_color': value.passageSecondaryButtonBackgroundColor, - 'passage_secondary_button_text_color': value.passageSecondaryButtonTextColor, - 'passage_secondary_button_hover_color': value.passageSecondaryButtonHoverColor, - 'passage_secondary_button_border_radius': value.passageSecondaryButtonBorderRadius, - 'passage_secondary_button_border_color': value.passageSecondaryButtonBorderColor, - 'passage_secondary_button_border_width': value.passageSecondaryButtonBorderWidth, + 'passage_container_background_color': value['passageContainerBackgroundColor'], + 'passage_container_max_width': value['passageContainerMaxWidth'], + 'passage_input_box_background_color': value['passageInputBoxBackgroundColor'], + 'passage_input_box_border_radius': value['passageInputBoxBorderRadius'], + 'passage_header_font_family': FontFamilyToJSON(value['passageHeaderFontFamily']), + 'passage_body_font_family': FontFamilyToJSON(value['passageBodyFontFamily']), + 'passage_header_text_color': value['passageHeaderTextColor'], + 'passage_body_text_color': value['passageBodyTextColor'], + 'passage_primary_button_background_color': value['passagePrimaryButtonBackgroundColor'], + 'passage_primary_button_text_color': value['passagePrimaryButtonTextColor'], + 'passage_primary_button_hover_color': value['passagePrimaryButtonHoverColor'], + 'passage_primary_button_border_radius': value['passagePrimaryButtonBorderRadius'], + 'passage_primary_button_border_color': value['passagePrimaryButtonBorderColor'], + 'passage_primary_button_border_width': value['passagePrimaryButtonBorderWidth'], + 'passage_secondary_button_background_color': value['passageSecondaryButtonBackgroundColor'], + 'passage_secondary_button_text_color': value['passageSecondaryButtonTextColor'], + 'passage_secondary_button_hover_color': value['passageSecondaryButtonHoverColor'], + 'passage_secondary_button_border_radius': value['passageSecondaryButtonBorderRadius'], + 'passage_secondary_button_border_color': value['passageSecondaryButtonBorderColor'], + 'passage_secondary_button_border_width': value['passageSecondaryButtonBorderWidth'], }; } diff --git a/src/generated/models/FontFamily.ts b/src/generated/models/FontFamily.ts index 53506b5..eb3e3ca 100644 --- a/src/generated/models/FontFamily.ts +++ b/src/generated/models/FontFamily.ts @@ -42,6 +42,17 @@ export const FontFamily = { export type FontFamily = typeof FontFamily[keyof typeof FontFamily]; +export function instanceOfFontFamily(value: any): boolean { + for (const key in FontFamily) { + if (Object.prototype.hasOwnProperty.call(FontFamily, key)) { + if (FontFamily[key as keyof typeof FontFamily] === value) { + return true; + } + } + } + return false; +} + export function FontFamilyFromJSON(json: any): FontFamily { return FontFamilyFromJSONTyped(json, false); } @@ -54,3 +65,7 @@ export function FontFamilyToJSON(value?: FontFamily | null): any { return value as any; } +export function FontFamilyToJSONTyped(value: any, ignoreDiscriminator: boolean): FontFamily { + return value as FontFamily; +} + diff --git a/src/generated/models/GithubUserSocialConnection.ts b/src/generated/models/GithubUserSocialConnection.ts index 4ca2ec9..0be7efd 100644 --- a/src/generated/models/GithubUserSocialConnection.ts +++ b/src/generated/models/GithubUserSocialConnection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface GithubUserSocialConnection { /** * Check if a given object implements the GithubUserSocialConnection interface. */ -export function instanceOfGithubUserSocialConnection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "providerIdentifier" in value; - - return isInstance; +export function instanceOfGithubUserSocialConnection(value: object): value is GithubUserSocialConnection { + if (!('providerId' in value) || value['providerId'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('providerIdentifier' in value) || value['providerIdentifier'] === undefined) return false; + return true; } export function GithubUserSocialConnectionFromJSON(json: any): GithubUserSocialConnection { @@ -63,7 +61,7 @@ export function GithubUserSocialConnectionFromJSON(json: any): GithubUserSocialC } export function GithubUserSocialConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GithubUserSocialConnection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function GithubUserSocialConnectionFromJSONTyped(json: any, ignoreDiscrim }; } -export function GithubUserSocialConnectionToJSON(value?: GithubUserSocialConnection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GithubUserSocialConnectionToJSON(json: any): GithubUserSocialConnection { + return GithubUserSocialConnectionToJSONTyped(json, false); +} + +export function GithubUserSocialConnectionToJSONTyped(value?: GithubUserSocialConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'provider_id': value.providerId, - 'created_at': (value.createdAt.toISOString()), - 'last_login_at': (value.lastLoginAt.toISOString()), - 'provider_identifier': value.providerIdentifier, + 'provider_id': value['providerId'], + 'created_at': ((value['createdAt']).toISOString()), + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'provider_identifier': value['providerIdentifier'], }; } diff --git a/src/generated/models/GoogleUserSocialConnection.ts b/src/generated/models/GoogleUserSocialConnection.ts index 8e4199d..8f725d1 100644 --- a/src/generated/models/GoogleUserSocialConnection.ts +++ b/src/generated/models/GoogleUserSocialConnection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface GoogleUserSocialConnection { /** * Check if a given object implements the GoogleUserSocialConnection interface. */ -export function instanceOfGoogleUserSocialConnection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "providerIdentifier" in value; - - return isInstance; +export function instanceOfGoogleUserSocialConnection(value: object): value is GoogleUserSocialConnection { + if (!('providerId' in value) || value['providerId'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('providerIdentifier' in value) || value['providerIdentifier'] === undefined) return false; + return true; } export function GoogleUserSocialConnectionFromJSON(json: any): GoogleUserSocialConnection { @@ -63,7 +61,7 @@ export function GoogleUserSocialConnectionFromJSON(json: any): GoogleUserSocialC } export function GoogleUserSocialConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GoogleUserSocialConnection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function GoogleUserSocialConnectionFromJSONTyped(json: any, ignoreDiscrim }; } -export function GoogleUserSocialConnectionToJSON(value?: GoogleUserSocialConnection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GoogleUserSocialConnectionToJSON(json: any): GoogleUserSocialConnection { + return GoogleUserSocialConnectionToJSONTyped(json, false); +} + +export function GoogleUserSocialConnectionToJSONTyped(value?: GoogleUserSocialConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'provider_id': value.providerId, - 'created_at': (value.createdAt.toISOString()), - 'last_login_at': (value.lastLoginAt.toISOString()), - 'provider_identifier': value.providerIdentifier, + 'provider_id': value['providerId'], + 'created_at': ((value['createdAt']).toISOString()), + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'provider_identifier': value['providerIdentifier'], }; } diff --git a/src/generated/models/LayoutConfig.ts b/src/generated/models/LayoutConfig.ts index 35d09a3..1651896 100644 --- a/src/generated/models/LayoutConfig.ts +++ b/src/generated/models/LayoutConfig.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -54,15 +54,13 @@ export interface LayoutConfig { /** * Check if a given object implements the LayoutConfig interface. */ -export function instanceOfLayoutConfig(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "h" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "w" in value; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - - return isInstance; +export function instanceOfLayoutConfig(value: object): value is LayoutConfig { + if (!('h' in value) || value['h'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('w' in value) || value['w'] === undefined) return false; + if (!('x' in value) || value['x'] === undefined) return false; + if (!('y' in value) || value['y'] === undefined) return false; + return true; } export function LayoutConfigFromJSON(json: any): LayoutConfig { @@ -70,7 +68,7 @@ export function LayoutConfigFromJSON(json: any): LayoutConfig { } export function LayoutConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayoutConfig { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,20 +81,22 @@ export function LayoutConfigFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function LayoutConfigToJSON(value?: LayoutConfig | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayoutConfigToJSON(json: any): LayoutConfig { + return LayoutConfigToJSONTyped(json, false); +} + +export function LayoutConfigToJSONTyped(value?: LayoutConfig | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'h': value.h, - 'id': value.id, - 'w': value.w, - 'x': value.x, - 'y': value.y, + 'h': value['h'], + 'id': value['id'], + 'w': value['w'], + 'x': value['x'], + 'y': value['y'], }; } diff --git a/src/generated/models/Layouts.ts b/src/generated/models/Layouts.ts index 3553554..5d9f8a6 100644 --- a/src/generated/models/Layouts.ts +++ b/src/generated/models/Layouts.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { LayoutConfig } from './LayoutConfig'; import { LayoutConfigFromJSON, LayoutConfigFromJSONTyped, LayoutConfigToJSON, + LayoutConfigToJSONTyped, } from './LayoutConfig'; /** @@ -43,12 +44,10 @@ export interface Layouts { /** * Check if a given object implements the Layouts interface. */ -export function instanceOfLayouts(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "profile" in value; - isInstance = isInstance && "registration" in value; - - return isInstance; +export function instanceOfLayouts(value: object): value is Layouts { + if (!('profile' in value) || value['profile'] === undefined) return false; + if (!('registration' in value) || value['registration'] === undefined) return false; + return true; } export function LayoutsFromJSON(json: any): Layouts { @@ -56,7 +55,7 @@ export function LayoutsFromJSON(json: any): Layouts { } export function LayoutsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Layouts { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +65,19 @@ export function LayoutsFromJSONTyped(json: any, ignoreDiscriminator: boolean): L }; } -export function LayoutsToJSON(value?: Layouts | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayoutsToJSON(json: any): Layouts { + return LayoutsToJSONTyped(json, false); +} + +export function LayoutsToJSONTyped(value?: Layouts | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'profile': ((value.profile as Array).map(LayoutConfigToJSON)), - 'registration': ((value.registration as Array).map(LayoutConfigToJSON)), + 'profile': ((value['profile'] as Array).map(LayoutConfigToJSON)), + 'registration': ((value['registration'] as Array).map(LayoutConfigToJSON)), }; } diff --git a/src/generated/models/Link.ts b/src/generated/models/Link.ts index 604b7ba..feb208a 100644 --- a/src/generated/models/Link.ts +++ b/src/generated/models/Link.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface Link { /** * Check if a given object implements the Link interface. */ -export function instanceOfLink(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "href" in value; - - return isInstance; +export function instanceOfLink(value: object): value is Link { + if (!('href' in value) || value['href'] === undefined) return false; + return true; } export function LinkFromJSON(json: any): Link { @@ -42,7 +40,7 @@ export function LinkFromJSON(json: any): Link { } export function LinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): Link { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function LinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): Link }; } -export function LinkToJSON(value?: Link | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LinkToJSON(json: any): Link { + return LinkToJSONTyped(json, false); +} + +export function LinkToJSONTyped(value?: Link | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'href': value.href, + 'href': value['href'], }; } diff --git a/src/generated/models/ListDevicesResponse.ts b/src/generated/models/ListDevicesResponse.ts index c269655..03936b2 100644 --- a/src/generated/models/ListDevicesResponse.ts +++ b/src/generated/models/ListDevicesResponse.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { WebAuthnDevices } from './WebAuthnDevices'; import { WebAuthnDevicesFromJSON, WebAuthnDevicesFromJSONTyped, WebAuthnDevicesToJSON, + WebAuthnDevicesToJSONTyped, } from './WebAuthnDevices'; /** @@ -37,11 +38,9 @@ export interface ListDevicesResponse { /** * Check if a given object implements the ListDevicesResponse interface. */ -export function instanceOfListDevicesResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "devices" in value; - - return isInstance; +export function instanceOfListDevicesResponse(value: object): value is ListDevicesResponse { + if (!('devices' in value) || value['devices'] === undefined) return false; + return true; } export function ListDevicesResponseFromJSON(json: any): ListDevicesResponse { @@ -49,7 +48,7 @@ export function ListDevicesResponseFromJSON(json: any): ListDevicesResponse { } export function ListDevicesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListDevicesResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function ListDevicesResponseFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function ListDevicesResponseToJSON(value?: ListDevicesResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ListDevicesResponseToJSON(json: any): ListDevicesResponse { + return ListDevicesResponseToJSONTyped(json, false); +} + +export function ListDevicesResponseToJSONTyped(value?: ListDevicesResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'devices': ((value.devices as Array).map(WebAuthnDevicesToJSON)), + 'devices': ((value['devices'] as Array).map(WebAuthnDevicesToJSON)), }; } diff --git a/src/generated/models/ListPaginatedUsersItem.ts b/src/generated/models/ListPaginatedUsersItem.ts index 892b54c..8a53a59 100644 --- a/src/generated/models/ListPaginatedUsersItem.ts +++ b/src/generated/models/ListPaginatedUsersItem.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { UserStatus } from './UserStatus'; import { UserStatusFromJSON, UserStatusFromJSONTyped, UserStatusToJSON, + UserStatusToJSONTyped, } from './UserStatus'; /** @@ -100,25 +101,25 @@ export interface ListPaginatedUsersItem { userMetadata: object | null; } + + /** * Check if a given object implements the ListPaginatedUsersItem interface. */ -export function instanceOfListPaginatedUsersItem(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "emailVerified" in value; - isInstance = isInstance && "externalId" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "loginCount" in value; - isInstance = isInstance && "phone" in value; - isInstance = isInstance && "phoneVerified" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "updatedAt" in value; - isInstance = isInstance && "userMetadata" in value; - - return isInstance; +export function instanceOfListPaginatedUsersItem(value: object): value is ListPaginatedUsersItem { + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('email' in value) || value['email'] === undefined) return false; + if (!('emailVerified' in value) || value['emailVerified'] === undefined) return false; + if (!('externalId' in value) || value['externalId'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('loginCount' in value) || value['loginCount'] === undefined) return false; + if (!('phone' in value) || value['phone'] === undefined) return false; + if (!('phoneVerified' in value) || value['phoneVerified'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + if (!('userMetadata' in value) || value['userMetadata'] === undefined) return false; + return true; } export function ListPaginatedUsersItemFromJSON(json: any): ListPaginatedUsersItem { @@ -126,7 +127,7 @@ export function ListPaginatedUsersItemFromJSON(json: any): ListPaginatedUsersIte } export function ListPaginatedUsersItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListPaginatedUsersItem { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -146,27 +147,29 @@ export function ListPaginatedUsersItemFromJSONTyped(json: any, ignoreDiscriminat }; } -export function ListPaginatedUsersItemToJSON(value?: ListPaginatedUsersItem | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ListPaginatedUsersItemToJSON(json: any): ListPaginatedUsersItem { + return ListPaginatedUsersItemToJSONTyped(json, false); +} + +export function ListPaginatedUsersItemToJSONTyped(value?: ListPaginatedUsersItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'created_at': (value.createdAt.toISOString()), - 'email': value.email, - 'email_verified': value.emailVerified, - 'external_id': value.externalId, - 'id': value.id, - 'last_login_at': (value.lastLoginAt.toISOString()), - 'login_count': value.loginCount, - 'phone': value.phone, - 'phone_verified': value.phoneVerified, - 'status': UserStatusToJSON(value.status), - 'updated_at': (value.updatedAt.toISOString()), - 'user_metadata': value.userMetadata, + 'created_at': ((value['createdAt']).toISOString()), + 'email': value['email'], + 'email_verified': value['emailVerified'], + 'external_id': value['externalId'], + 'id': value['id'], + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'login_count': value['loginCount'], + 'phone': value['phone'], + 'phone_verified': value['phoneVerified'], + 'status': UserStatusToJSON(value['status']), + 'updated_at': ((value['updatedAt']).toISOString()), + 'user_metadata': value['userMetadata'], }; } diff --git a/src/generated/models/ListPaginatedUsersResponse.ts b/src/generated/models/ListPaginatedUsersResponse.ts index a88727b..fc5803b 100644 --- a/src/generated/models/ListPaginatedUsersResponse.ts +++ b/src/generated/models/ListPaginatedUsersResponse.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ListPaginatedUsersItem } from './ListPaginatedUsersItem'; -import { - ListPaginatedUsersItemFromJSON, - ListPaginatedUsersItemFromJSONTyped, - ListPaginatedUsersItemToJSON, -} from './ListPaginatedUsersItem'; +import { mapValues } from '../runtime'; import type { PaginatedLinks } from './PaginatedLinks'; import { PaginatedLinksFromJSON, PaginatedLinksFromJSONTyped, PaginatedLinksToJSON, + PaginatedLinksToJSONTyped, } from './PaginatedLinks'; +import type { ListPaginatedUsersItem } from './ListPaginatedUsersItem'; +import { + ListPaginatedUsersItemFromJSON, + ListPaginatedUsersItemFromJSONTyped, + ListPaginatedUsersItemToJSON, + ListPaginatedUsersItemToJSONTyped, +} from './ListPaginatedUsersItem'; /** * @@ -73,16 +75,14 @@ export interface ListPaginatedUsersResponse { /** * Check if a given object implements the ListPaginatedUsersResponse interface. */ -export function instanceOfListPaginatedUsersResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "links" in value; - isInstance = isInstance && "createdBefore" in value; - isInstance = isInstance && "limit" in value; - isInstance = isInstance && "page" in value; - isInstance = isInstance && "totalUsers" in value; - isInstance = isInstance && "users" in value; - - return isInstance; +export function instanceOfListPaginatedUsersResponse(value: object): value is ListPaginatedUsersResponse { + if (!('links' in value) || value['links'] === undefined) return false; + if (!('createdBefore' in value) || value['createdBefore'] === undefined) return false; + if (!('limit' in value) || value['limit'] === undefined) return false; + if (!('page' in value) || value['page'] === undefined) return false; + if (!('totalUsers' in value) || value['totalUsers'] === undefined) return false; + if (!('users' in value) || value['users'] === undefined) return false; + return true; } export function ListPaginatedUsersResponseFromJSON(json: any): ListPaginatedUsersResponse { @@ -90,7 +90,7 @@ export function ListPaginatedUsersResponseFromJSON(json: any): ListPaginatedUser } export function ListPaginatedUsersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListPaginatedUsersResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -104,21 +104,23 @@ export function ListPaginatedUsersResponseFromJSONTyped(json: any, ignoreDiscrim }; } -export function ListPaginatedUsersResponseToJSON(value?: ListPaginatedUsersResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ListPaginatedUsersResponseToJSON(json: any): ListPaginatedUsersResponse { + return ListPaginatedUsersResponseToJSONTyped(json, false); +} + +export function ListPaginatedUsersResponseToJSONTyped(value?: ListPaginatedUsersResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - '_links': PaginatedLinksToJSON(value.links), - 'created_before': value.createdBefore, - 'limit': value.limit, - 'page': value.page, - 'total_users': value.totalUsers, - 'users': ((value.users as Array).map(ListPaginatedUsersItemToJSON)), + '_links': PaginatedLinksToJSON(value['links']), + 'created_before': value['createdBefore'], + 'limit': value['limit'], + 'page': value['page'], + 'total_users': value['totalUsers'], + 'users': ((value['users'] as Array).map(ListPaginatedUsersItemToJSON)), }; } diff --git a/src/generated/models/MagicLinkAuthMethod.ts b/src/generated/models/MagicLinkAuthMethod.ts index a632a21..49d082d 100644 --- a/src/generated/models/MagicLinkAuthMethod.ts +++ b/src/generated/models/MagicLinkAuthMethod.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TtlDisplayUnit } from './TtlDisplayUnit'; import { TtlDisplayUnitFromJSON, TtlDisplayUnitFromJSONTyped, TtlDisplayUnitToJSON, + TtlDisplayUnitToJSONTyped, } from './TtlDisplayUnit'; /** @@ -47,16 +48,16 @@ export interface MagicLinkAuthMethod { ttlDisplayUnit: TtlDisplayUnit; } + + /** * Check if a given object implements the MagicLinkAuthMethod interface. */ -export function instanceOfMagicLinkAuthMethod(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "enabled" in value; - isInstance = isInstance && "ttl" in value; - isInstance = isInstance && "ttlDisplayUnit" in value; - - return isInstance; +export function instanceOfMagicLinkAuthMethod(value: object): value is MagicLinkAuthMethod { + if (!('enabled' in value) || value['enabled'] === undefined) return false; + if (!('ttl' in value) || value['ttl'] === undefined) return false; + if (!('ttlDisplayUnit' in value) || value['ttlDisplayUnit'] === undefined) return false; + return true; } export function MagicLinkAuthMethodFromJSON(json: any): MagicLinkAuthMethod { @@ -64,7 +65,7 @@ export function MagicLinkAuthMethodFromJSON(json: any): MagicLinkAuthMethod { } export function MagicLinkAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): MagicLinkAuthMethod { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,18 +76,20 @@ export function MagicLinkAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function MagicLinkAuthMethodToJSON(value?: MagicLinkAuthMethod | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MagicLinkAuthMethodToJSON(json: any): MagicLinkAuthMethod { + return MagicLinkAuthMethodToJSONTyped(json, false); +} + +export function MagicLinkAuthMethodToJSONTyped(value?: MagicLinkAuthMethod | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'enabled': value.enabled, - 'ttl': value.ttl, - 'ttl_display_unit': TtlDisplayUnitToJSON(value.ttlDisplayUnit), + 'enabled': value['enabled'], + 'ttl': value['ttl'], + 'ttl_display_unit': TtlDisplayUnitToJSON(value['ttlDisplayUnit']), }; } diff --git a/src/generated/models/Model400Error.ts b/src/generated/models/Model400Error.ts index bfe4ed6..663dc29 100644 --- a/src/generated/models/Model400Error.ts +++ b/src/generated/models/Model400Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -47,12 +47,10 @@ export type Model400ErrorCodeEnum = typeof Model400ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model400Error interface. */ -export function instanceOfModel400Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel400Error(value: object): value is Model400Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model400ErrorFromJSON(json: any): Model400Error { @@ -60,7 +58,7 @@ export function Model400ErrorFromJSON(json: any): Model400Error { } export function Model400ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model400Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -70,17 +68,19 @@ export function Model400ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model400ErrorToJSON(value?: Model400Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model400ErrorToJSON(json: any): Model400Error { + return Model400ErrorToJSONTyped(json, false); +} + +export function Model400ErrorToJSONTyped(value?: Model400Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Model401Error.ts b/src/generated/models/Model401Error.ts index 641399d..108e442 100644 --- a/src/generated/models/Model401Error.ts +++ b/src/generated/models/Model401Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -47,12 +47,10 @@ export type Model401ErrorCodeEnum = typeof Model401ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model401Error interface. */ -export function instanceOfModel401Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel401Error(value: object): value is Model401Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model401ErrorFromJSON(json: any): Model401Error { @@ -60,7 +58,7 @@ export function Model401ErrorFromJSON(json: any): Model401Error { } export function Model401ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model401Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -70,17 +68,19 @@ export function Model401ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model401ErrorToJSON(value?: Model401Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model401ErrorToJSON(json: any): Model401Error { + return Model401ErrorToJSONTyped(json, false); +} + +export function Model401ErrorToJSONTyped(value?: Model401Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Model403Error.ts b/src/generated/models/Model403Error.ts index 96ad794..28d8ed0 100644 --- a/src/generated/models/Model403Error.ts +++ b/src/generated/models/Model403Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -51,12 +51,10 @@ export type Model403ErrorCodeEnum = typeof Model403ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model403Error interface. */ -export function instanceOfModel403Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel403Error(value: object): value is Model403Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model403ErrorFromJSON(json: any): Model403Error { @@ -64,7 +62,7 @@ export function Model403ErrorFromJSON(json: any): Model403Error { } export function Model403ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model403Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -74,17 +72,19 @@ export function Model403ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model403ErrorToJSON(value?: Model403Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model403ErrorToJSON(json: any): Model403Error { + return Model403ErrorToJSONTyped(json, false); +} + +export function Model403ErrorToJSONTyped(value?: Model403Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Model404Error.ts b/src/generated/models/Model404Error.ts index 4a8ed8d..f596304 100644 --- a/src/generated/models/Model404Error.ts +++ b/src/generated/models/Model404Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,7 +55,8 @@ export const Model404ErrorCodeEnum = { SmsProviderNotFound: 'sms_provider_not_found', SmsTemplateNotFound: 'sms_template_not_found', SocialConnectionNotFound: 'social_connection_not_found', - UserNotFound: 'user_not_found' + UserNotFound: 'user_not_found', + NativeClientNotFound: 'native_client_not_found' } as const; export type Model404ErrorCodeEnum = typeof Model404ErrorCodeEnum[keyof typeof Model404ErrorCodeEnum]; @@ -63,12 +64,10 @@ export type Model404ErrorCodeEnum = typeof Model404ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model404Error interface. */ -export function instanceOfModel404Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel404Error(value: object): value is Model404Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model404ErrorFromJSON(json: any): Model404Error { @@ -76,7 +75,7 @@ export function Model404ErrorFromJSON(json: any): Model404Error { } export function Model404ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model404Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,17 +85,19 @@ export function Model404ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model404ErrorToJSON(value?: Model404Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model404ErrorToJSON(json: any): Model404Error { + return Model404ErrorToJSONTyped(json, false); +} + +export function Model404ErrorToJSONTyped(value?: Model404Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Model409Error.ts b/src/generated/models/Model409Error.ts index 8253633..be1294e 100644 --- a/src/generated/models/Model409Error.ts +++ b/src/generated/models/Model409Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -38,9 +38,11 @@ export interface Model409Error { * @export */ export const Model409ErrorCodeEnum = { - AlreadyAdmin: 'user_already_admin', - AlreadyOrganizationMember: 'user_already_organization_member', - HasNoPasskeys: 'user_has_no_passkeys' + UserAlreadyAdmin: 'user_already_admin', + UserAlreadyOrganizationMember: 'user_already_organization_member', + UserHasNoPasskeys: 'user_has_no_passkeys', + NativeClientAlreadyExists: 'native_client_already_exists', + FailedToSyncEmailPreferences: 'failed_to_sync_email_preferences' } as const; export type Model409ErrorCodeEnum = typeof Model409ErrorCodeEnum[keyof typeof Model409ErrorCodeEnum]; @@ -48,12 +50,10 @@ export type Model409ErrorCodeEnum = typeof Model409ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model409Error interface. */ -export function instanceOfModel409Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel409Error(value: object): value is Model409Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model409ErrorFromJSON(json: any): Model409Error { @@ -61,7 +61,7 @@ export function Model409ErrorFromJSON(json: any): Model409Error { } export function Model409ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model409Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -71,17 +71,19 @@ export function Model409ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model409ErrorToJSON(value?: Model409Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model409ErrorToJSON(json: any): Model409Error { + return Model409ErrorToJSONTyped(json, false); +} + +export function Model409ErrorToJSONTyped(value?: Model409Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Model500Error.ts b/src/generated/models/Model500Error.ts index 3303fad..12d2a99 100644 --- a/src/generated/models/Model500Error.ts +++ b/src/generated/models/Model500Error.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type Model500ErrorCodeEnum = typeof Model500ErrorCodeEnum[keyof typeof Mo /** * Check if a given object implements the Model500Error interface. */ -export function instanceOfModel500Error(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "error" in value; - - return isInstance; +export function instanceOfModel500Error(value: object): value is Model500Error { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + return true; } export function Model500ErrorFromJSON(json: any): Model500Error { @@ -59,7 +57,7 @@ export function Model500ErrorFromJSON(json: any): Model500Error { } export function Model500ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model500Error { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function Model500ErrorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function Model500ErrorToJSON(value?: Model500Error | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Model500ErrorToJSON(json: any): Model500Error { + return Model500ErrorToJSONTyped(json, false); +} + +export function Model500ErrorToJSONTyped(value?: Model500Error | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'error': value.error, + 'code': value['code'], + 'error': value['error'], }; } diff --git a/src/generated/models/Nonce.ts b/src/generated/models/Nonce.ts index 2a38f90..d9a96c2 100644 --- a/src/generated/models/Nonce.ts +++ b/src/generated/models/Nonce.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * the nonce to exchange for an authentication token * @export @@ -30,11 +30,9 @@ export interface Nonce { /** * Check if a given object implements the Nonce interface. */ -export function instanceOfNonce(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "nonce" in value; - - return isInstance; +export function instanceOfNonce(value: object): value is Nonce { + if (!('nonce' in value) || value['nonce'] === undefined) return false; + return true; } export function NonceFromJSON(json: any): Nonce { @@ -42,7 +40,7 @@ export function NonceFromJSON(json: any): Nonce { } export function NonceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Nonce { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function NonceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Non }; } -export function NonceToJSON(value?: Nonce | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function NonceToJSON(json: any): Nonce { + return NonceToJSONTyped(json, false); +} + +export function NonceToJSONTyped(value?: Nonce | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'nonce': value.nonce, + 'nonce': value['nonce'], }; } diff --git a/src/generated/models/OtpAuthMethod.ts b/src/generated/models/OtpAuthMethod.ts index 35fdaca..81ebc50 100644 --- a/src/generated/models/OtpAuthMethod.ts +++ b/src/generated/models/OtpAuthMethod.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TtlDisplayUnit } from './TtlDisplayUnit'; import { TtlDisplayUnitFromJSON, TtlDisplayUnitFromJSONTyped, TtlDisplayUnitToJSON, + TtlDisplayUnitToJSONTyped, } from './TtlDisplayUnit'; /** @@ -47,16 +48,16 @@ export interface OtpAuthMethod { ttlDisplayUnit: TtlDisplayUnit; } + + /** * Check if a given object implements the OtpAuthMethod interface. */ -export function instanceOfOtpAuthMethod(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "enabled" in value; - isInstance = isInstance && "ttl" in value; - isInstance = isInstance && "ttlDisplayUnit" in value; - - return isInstance; +export function instanceOfOtpAuthMethod(value: object): value is OtpAuthMethod { + if (!('enabled' in value) || value['enabled'] === undefined) return false; + if (!('ttl' in value) || value['ttl'] === undefined) return false; + if (!('ttlDisplayUnit' in value) || value['ttlDisplayUnit'] === undefined) return false; + return true; } export function OtpAuthMethodFromJSON(json: any): OtpAuthMethod { @@ -64,7 +65,7 @@ export function OtpAuthMethodFromJSON(json: any): OtpAuthMethod { } export function OtpAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): OtpAuthMethod { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,18 +76,20 @@ export function OtpAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function OtpAuthMethodToJSON(value?: OtpAuthMethod | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OtpAuthMethodToJSON(json: any): OtpAuthMethod { + return OtpAuthMethodToJSONTyped(json, false); +} + +export function OtpAuthMethodToJSONTyped(value?: OtpAuthMethod | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'enabled': value.enabled, - 'ttl': value.ttl, - 'ttl_display_unit': TtlDisplayUnitToJSON(value.ttlDisplayUnit), + 'enabled': value['enabled'], + 'ttl': value['ttl'], + 'ttl_display_unit': TtlDisplayUnitToJSON(value['ttlDisplayUnit']), }; } diff --git a/src/generated/models/PaginatedLinks.ts b/src/generated/models/PaginatedLinks.ts index 0b66128..4d2d25d 100644 --- a/src/generated/models/PaginatedLinks.ts +++ b/src/generated/models/PaginatedLinks.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Link } from './Link'; import { LinkFromJSON, LinkFromJSONTyped, LinkToJSON, + LinkToJSONTyped, } from './Link'; /** @@ -61,15 +62,13 @@ export interface PaginatedLinks { /** * Check if a given object implements the PaginatedLinks interface. */ -export function instanceOfPaginatedLinks(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "first" in value; - isInstance = isInstance && "last" in value; - isInstance = isInstance && "next" in value; - isInstance = isInstance && "previous" in value; - isInstance = isInstance && "self" in value; - - return isInstance; +export function instanceOfPaginatedLinks(value: object): value is PaginatedLinks { + if (!('first' in value) || value['first'] === undefined) return false; + if (!('last' in value) || value['last'] === undefined) return false; + if (!('next' in value) || value['next'] === undefined) return false; + if (!('previous' in value) || value['previous'] === undefined) return false; + if (!('self' in value) || value['self'] === undefined) return false; + return true; } export function PaginatedLinksFromJSON(json: any): PaginatedLinks { @@ -77,7 +76,7 @@ export function PaginatedLinksFromJSON(json: any): PaginatedLinks { } export function PaginatedLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedLinks { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -90,20 +89,22 @@ export function PaginatedLinksFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function PaginatedLinksToJSON(value?: PaginatedLinks | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PaginatedLinksToJSON(json: any): PaginatedLinks { + return PaginatedLinksToJSONTyped(json, false); +} + +export function PaginatedLinksToJSONTyped(value?: PaginatedLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'first': LinkToJSON(value.first), - 'last': LinkToJSON(value.last), - 'next': LinkToJSON(value.next), - 'previous': LinkToJSON(value.previous), - 'self': LinkToJSON(value.self), + 'first': LinkToJSON(value['first']), + 'last': LinkToJSON(value['last']), + 'next': LinkToJSON(value['next']), + 'previous': LinkToJSON(value['previous']), + 'self': LinkToJSON(value['self']), }; } diff --git a/src/generated/models/PasskeysAuthMethod.ts b/src/generated/models/PasskeysAuthMethod.ts index 51fd66c..40dfb6a 100644 --- a/src/generated/models/PasskeysAuthMethod.ts +++ b/src/generated/models/PasskeysAuthMethod.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface PasskeysAuthMethod { /** * Check if a given object implements the PasskeysAuthMethod interface. */ -export function instanceOfPasskeysAuthMethod(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "enabled" in value; - - return isInstance; +export function instanceOfPasskeysAuthMethod(value: object): value is PasskeysAuthMethod { + if (!('enabled' in value) || value['enabled'] === undefined) return false; + return true; } export function PasskeysAuthMethodFromJSON(json: any): PasskeysAuthMethod { @@ -42,7 +40,7 @@ export function PasskeysAuthMethodFromJSON(json: any): PasskeysAuthMethod { } export function PasskeysAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasskeysAuthMethod { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function PasskeysAuthMethodFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function PasskeysAuthMethodToJSON(value?: PasskeysAuthMethod | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PasskeysAuthMethodToJSON(json: any): PasskeysAuthMethod { + return PasskeysAuthMethodToJSONTyped(json, false); +} + +export function PasskeysAuthMethodToJSONTyped(value?: PasskeysAuthMethod | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'enabled': value.enabled, + 'enabled': value['enabled'], }; } diff --git a/src/generated/models/SocialConnectionType.ts b/src/generated/models/SocialConnectionType.ts new file mode 100644 index 0000000..eb54c9e --- /dev/null +++ b/src/generated/models/SocialConnectionType.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Passage Management API + * Passage\'s management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const SocialConnectionType = { + Apple: 'apple', + Github: 'github', + Google: 'google' +} as const; +export type SocialConnectionType = typeof SocialConnectionType[keyof typeof SocialConnectionType]; + + +export function instanceOfSocialConnectionType(value: any): boolean { + for (const key in SocialConnectionType) { + if (Object.prototype.hasOwnProperty.call(SocialConnectionType, key)) { + if (SocialConnectionType[key as keyof typeof SocialConnectionType] === value) { + return true; + } + } + } + return false; +} + +export function SocialConnectionTypeFromJSON(json: any): SocialConnectionType { + return SocialConnectionTypeFromJSONTyped(json, false); +} + +export function SocialConnectionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SocialConnectionType { + return json as SocialConnectionType; +} + +export function SocialConnectionTypeToJSON(value?: SocialConnectionType | null): any { + return value as any; +} + +export function SocialConnectionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SocialConnectionType { + return value as SocialConnectionType; +} + diff --git a/src/generated/models/Technologies.ts b/src/generated/models/Technologies.ts index 061dbe9..c405a22 100644 --- a/src/generated/models/Technologies.ts +++ b/src/generated/models/Technologies.ts @@ -30,6 +30,17 @@ export const Technologies = { export type Technologies = typeof Technologies[keyof typeof Technologies]; +export function instanceOfTechnologies(value: any): boolean { + for (const key in Technologies) { + if (Object.prototype.hasOwnProperty.call(Technologies, key)) { + if (Technologies[key as keyof typeof Technologies] === value) { + return true; + } + } + } + return false; +} + export function TechnologiesFromJSON(json: any): Technologies { return TechnologiesFromJSONTyped(json, false); } @@ -42,3 +53,7 @@ export function TechnologiesToJSON(value?: Technologies | null): any { return value as any; } +export function TechnologiesToJSONTyped(value: any, ignoreDiscriminator: boolean): Technologies { + return value as Technologies; +} + diff --git a/src/generated/models/ThemeType.ts b/src/generated/models/ThemeType.ts new file mode 100644 index 0000000..9e337b9 --- /dev/null +++ b/src/generated/models/ThemeType.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Passage Management API + * Passage\'s management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const ThemeType = { + Auto: 'auto', + Light: 'light', + Dark: 'dark' +} as const; +export type ThemeType = typeof ThemeType[keyof typeof ThemeType]; + + +export function instanceOfThemeType(value: any): boolean { + for (const key in ThemeType) { + if (Object.prototype.hasOwnProperty.call(ThemeType, key)) { + if (ThemeType[key as keyof typeof ThemeType] === value) { + return true; + } + } + } + return false; +} + +export function ThemeTypeFromJSON(json: any): ThemeType { + return ThemeTypeFromJSONTyped(json, false); +} + +export function ThemeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ThemeType { + return json as ThemeType; +} + +export function ThemeTypeToJSON(value?: ThemeType | null): any { + return value as any; +} + +export function ThemeTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): ThemeType { + return value as ThemeType; +} + diff --git a/src/generated/models/TtlDisplayUnit.ts b/src/generated/models/TtlDisplayUnit.ts index 4075d7b..bf54fed 100644 --- a/src/generated/models/TtlDisplayUnit.ts +++ b/src/generated/models/TtlDisplayUnit.ts @@ -19,6 +19,7 @@ * * `m` - minutes * * `h` - hours * * `d` - days + * * @export */ export const TtlDisplayUnit = { @@ -30,6 +31,17 @@ export const TtlDisplayUnit = { export type TtlDisplayUnit = typeof TtlDisplayUnit[keyof typeof TtlDisplayUnit]; +export function instanceOfTtlDisplayUnit(value: any): boolean { + for (const key in TtlDisplayUnit) { + if (Object.prototype.hasOwnProperty.call(TtlDisplayUnit, key)) { + if (TtlDisplayUnit[key as keyof typeof TtlDisplayUnit] === value) { + return true; + } + } + } + return false; +} + export function TtlDisplayUnitFromJSON(json: any): TtlDisplayUnit { return TtlDisplayUnitFromJSONTyped(json, false); } @@ -42,3 +54,7 @@ export function TtlDisplayUnitToJSON(value?: TtlDisplayUnit | null): any { return value as any; } +export function TtlDisplayUnitToJSONTyped(value: any, ignoreDiscriminator: boolean): TtlDisplayUnit { + return value as TtlDisplayUnit; +} + diff --git a/src/generated/models/UserEventAction.ts b/src/generated/models/UserEventAction.ts new file mode 100644 index 0000000..7db25b3 --- /dev/null +++ b/src/generated/models/UserEventAction.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Passage Management API + * Passage\'s management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const UserEventAction = { + Register: 'register', + Login: 'login', + Other: 'other' +} as const; +export type UserEventAction = typeof UserEventAction[keyof typeof UserEventAction]; + + +export function instanceOfUserEventAction(value: any): boolean { + for (const key in UserEventAction) { + if (Object.prototype.hasOwnProperty.call(UserEventAction, key)) { + if (UserEventAction[key as keyof typeof UserEventAction] === value) { + return true; + } + } + } + return false; +} + +export function UserEventActionFromJSON(json: any): UserEventAction { + return UserEventActionFromJSONTyped(json, false); +} + +export function UserEventActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserEventAction { + return json as UserEventAction; +} + +export function UserEventActionToJSON(value?: UserEventAction | null): any { + return value as any; +} + +export function UserEventActionToJSONTyped(value: any, ignoreDiscriminator: boolean): UserEventAction { + return value as UserEventAction; +} + diff --git a/src/generated/models/UserEventStatus.ts b/src/generated/models/UserEventStatus.ts index 1c4e79a..e82cc73 100644 --- a/src/generated/models/UserEventStatus.ts +++ b/src/generated/models/UserEventStatus.ts @@ -24,6 +24,17 @@ export const UserEventStatus = { export type UserEventStatus = typeof UserEventStatus[keyof typeof UserEventStatus]; +export function instanceOfUserEventStatus(value: any): boolean { + for (const key in UserEventStatus) { + if (Object.prototype.hasOwnProperty.call(UserEventStatus, key)) { + if (UserEventStatus[key as keyof typeof UserEventStatus] === value) { + return true; + } + } + } + return false; +} + export function UserEventStatusFromJSON(json: any): UserEventStatus { return UserEventStatusFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function UserEventStatusToJSON(value?: UserEventStatus | null): any { return value as any; } +export function UserEventStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): UserEventStatus { + return value as UserEventStatus; +} + diff --git a/src/generated/models/UserInfo.ts b/src/generated/models/UserInfo.ts index f9637d3..33ec248 100644 --- a/src/generated/models/UserInfo.ts +++ b/src/generated/models/UserInfo.ts @@ -12,36 +12,41 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { UserRecentEvent } from './UserRecentEvent'; import { UserRecentEventFromJSON, UserRecentEventFromJSONTyped, UserRecentEventToJSON, + UserRecentEventToJSONTyped, } from './UserRecentEvent'; import type { UserSocialConnections } from './UserSocialConnections'; import { UserSocialConnectionsFromJSON, UserSocialConnectionsFromJSONTyped, UserSocialConnectionsToJSON, + UserSocialConnectionsToJSONTyped, } from './UserSocialConnections'; -import type { UserStatus } from './UserStatus'; -import { - UserStatusFromJSON, - UserStatusFromJSONTyped, - UserStatusToJSON, -} from './UserStatus'; import type { WebAuthnDevices } from './WebAuthnDevices'; import { WebAuthnDevicesFromJSON, WebAuthnDevicesFromJSONTyped, WebAuthnDevicesToJSON, + WebAuthnDevicesToJSONTyped, } from './WebAuthnDevices'; +import type { UserStatus } from './UserStatus'; +import { + UserStatusFromJSON, + UserStatusFromJSONTyped, + UserStatusToJSON, + UserStatusToJSONTyped, +} from './UserStatus'; import type { WebAuthnType } from './WebAuthnType'; import { WebAuthnTypeFromJSON, WebAuthnTypeFromJSONTyped, WebAuthnTypeToJSON, + WebAuthnTypeToJSONTyped, } from './WebAuthnType'; /** @@ -154,30 +159,30 @@ export interface UserInfo { webauthnTypes: Array; } + + /** * Check if a given object implements the UserInfo interface. */ -export function instanceOfUserInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "emailVerified" in value; - isInstance = isInstance && "externalId" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "loginCount" in value; - isInstance = isInstance && "phone" in value; - isInstance = isInstance && "phoneVerified" in value; - isInstance = isInstance && "recentEvents" in value; - isInstance = isInstance && "socialConnections" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "updatedAt" in value; - isInstance = isInstance && "userMetadata" in value; - isInstance = isInstance && "webauthn" in value; - isInstance = isInstance && "webauthnDevices" in value; - isInstance = isInstance && "webauthnTypes" in value; - - return isInstance; +export function instanceOfUserInfo(value: object): value is UserInfo { + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('email' in value) || value['email'] === undefined) return false; + if (!('emailVerified' in value) || value['emailVerified'] === undefined) return false; + if (!('externalId' in value) || value['externalId'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('loginCount' in value) || value['loginCount'] === undefined) return false; + if (!('phone' in value) || value['phone'] === undefined) return false; + if (!('phoneVerified' in value) || value['phoneVerified'] === undefined) return false; + if (!('recentEvents' in value) || value['recentEvents'] === undefined) return false; + if (!('socialConnections' in value) || value['socialConnections'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + if (!('userMetadata' in value) || value['userMetadata'] === undefined) return false; + if (!('webauthn' in value) || value['webauthn'] === undefined) return false; + if (!('webauthnDevices' in value) || value['webauthnDevices'] === undefined) return false; + if (!('webauthnTypes' in value) || value['webauthnTypes'] === undefined) return false; + return true; } export function UserInfoFromJSON(json: any): UserInfo { @@ -185,7 +190,7 @@ export function UserInfoFromJSON(json: any): UserInfo { } export function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -210,32 +215,34 @@ export function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function UserInfoToJSON(value?: UserInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserInfoToJSON(json: any): UserInfo { + return UserInfoToJSONTyped(json, false); +} + +export function UserInfoToJSONTyped(value?: UserInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'created_at': (value.createdAt.toISOString()), - 'email': value.email, - 'email_verified': value.emailVerified, - 'external_id': value.externalId, - 'id': value.id, - 'last_login_at': (value.lastLoginAt.toISOString()), - 'login_count': value.loginCount, - 'phone': value.phone, - 'phone_verified': value.phoneVerified, - 'recent_events': ((value.recentEvents as Array).map(UserRecentEventToJSON)), - 'social_connections': UserSocialConnectionsToJSON(value.socialConnections), - 'status': UserStatusToJSON(value.status), - 'updated_at': (value.updatedAt.toISOString()), - 'user_metadata': value.userMetadata, - 'webauthn': value.webauthn, - 'webauthn_devices': ((value.webauthnDevices as Array).map(WebAuthnDevicesToJSON)), - 'webauthn_types': ((value.webauthnTypes as Array).map(WebAuthnTypeToJSON)), + 'created_at': ((value['createdAt']).toISOString()), + 'email': value['email'], + 'email_verified': value['emailVerified'], + 'external_id': value['externalId'], + 'id': value['id'], + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'login_count': value['loginCount'], + 'phone': value['phone'], + 'phone_verified': value['phoneVerified'], + 'recent_events': ((value['recentEvents'] as Array).map(UserRecentEventToJSON)), + 'social_connections': UserSocialConnectionsToJSON(value['socialConnections']), + 'status': UserStatusToJSON(value['status']), + 'updated_at': ((value['updatedAt']).toISOString()), + 'user_metadata': value['userMetadata'], + 'webauthn': value['webauthn'], + 'webauthn_devices': ((value['webauthnDevices'] as Array).map(WebAuthnDevicesToJSON)), + 'webauthn_types': ((value['webauthnTypes'] as Array).map(WebAuthnTypeToJSON)), }; } diff --git a/src/generated/models/UserMetadataField.ts b/src/generated/models/UserMetadataField.ts index 6cc5d91..78a91ca 100644 --- a/src/generated/models/UserMetadataField.ts +++ b/src/generated/models/UserMetadataField.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { UserMetadataFieldType } from './UserMetadataFieldType'; import { UserMetadataFieldTypeFromJSON, UserMetadataFieldTypeFromJSONTyped, UserMetadataFieldTypeToJSON, + UserMetadataFieldTypeToJSONTyped, } from './UserMetadataFieldType'; /** @@ -64,19 +65,19 @@ export interface UserMetadataField { type: UserMetadataFieldType; } + + /** * Check if a given object implements the UserMetadataField interface. */ -export function instanceOfUserMetadataField(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fieldName" in value; - isInstance = isInstance && "friendlyName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "profile" in value; - isInstance = isInstance && "registration" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfUserMetadataField(value: object): value is UserMetadataField { + if (!('fieldName' in value) || value['fieldName'] === undefined) return false; + if (!('friendlyName' in value) || value['friendlyName'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('profile' in value) || value['profile'] === undefined) return false; + if (!('registration' in value) || value['registration'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function UserMetadataFieldFromJSON(json: any): UserMetadataField { @@ -84,7 +85,7 @@ export function UserMetadataFieldFromJSON(json: any): UserMetadataField { } export function UserMetadataFieldFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserMetadataField { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -98,21 +99,23 @@ export function UserMetadataFieldFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function UserMetadataFieldToJSON(value?: UserMetadataField | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserMetadataFieldToJSON(json: any): UserMetadataField { + return UserMetadataFieldToJSONTyped(json, false); +} + +export function UserMetadataFieldToJSONTyped(value?: UserMetadataField | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'field_name': value.fieldName, - 'friendly_name': value.friendlyName, - 'id': value.id, - 'profile': value.profile, - 'registration': value.registration, - 'type': UserMetadataFieldTypeToJSON(value.type), + 'field_name': value['fieldName'], + 'friendly_name': value['friendlyName'], + 'id': value['id'], + 'profile': value['profile'], + 'registration': value['registration'], + 'type': UserMetadataFieldTypeToJSON(value['type']), }; } diff --git a/src/generated/models/UserMetadataFieldType.ts b/src/generated/models/UserMetadataFieldType.ts index e92e0f0..96e1ae5 100644 --- a/src/generated/models/UserMetadataFieldType.ts +++ b/src/generated/models/UserMetadataFieldType.ts @@ -28,6 +28,17 @@ export const UserMetadataFieldType = { export type UserMetadataFieldType = typeof UserMetadataFieldType[keyof typeof UserMetadataFieldType]; +export function instanceOfUserMetadataFieldType(value: any): boolean { + for (const key in UserMetadataFieldType) { + if (Object.prototype.hasOwnProperty.call(UserMetadataFieldType, key)) { + if (UserMetadataFieldType[key as keyof typeof UserMetadataFieldType] === value) { + return true; + } + } + } + return false; +} + export function UserMetadataFieldTypeFromJSON(json: any): UserMetadataFieldType { return UserMetadataFieldTypeFromJSONTyped(json, false); } @@ -40,3 +51,7 @@ export function UserMetadataFieldTypeToJSON(value?: UserMetadataFieldType | null return value as any; } +export function UserMetadataFieldTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): UserMetadataFieldType { + return value as UserMetadataFieldType; +} + diff --git a/src/generated/models/UserRecentEvent.ts b/src/generated/models/UserRecentEvent.ts index 55114fa..6a90d55 100644 --- a/src/generated/models/UserRecentEvent.ts +++ b/src/generated/models/UserRecentEvent.ts @@ -12,12 +12,27 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { SocialConnectionType } from './SocialConnectionType'; +import { + SocialConnectionTypeFromJSON, + SocialConnectionTypeFromJSONTyped, + SocialConnectionTypeToJSON, + SocialConnectionTypeToJSONTyped, +} from './SocialConnectionType'; +import type { UserEventAction } from './UserEventAction'; +import { + UserEventActionFromJSON, + UserEventActionFromJSONTyped, + UserEventActionToJSON, + UserEventActionToJSONTyped, +} from './UserEventAction'; import type { UserEventStatus } from './UserEventStatus'; import { UserEventStatusFromJSON, UserEventStatusFromJSONTyped, UserEventStatusToJSON, + UserEventStatusToJSONTyped, } from './UserEventStatus'; /** @@ -63,27 +78,48 @@ export interface UserRecentEvent { */ type: string; /** - * + * The raw user agent value from the originating device * @type {string} * @memberof UserRecentEvent */ userAgent: string; + /** + * A display-friendly version of the user agent + * @type {string} + * @memberof UserRecentEvent + */ + userAgentDisplay: string; + /** + * + * @type {UserEventAction} + * @memberof UserRecentEvent + */ + action: UserEventAction; + /** + * + * @type {SocialConnectionType} + * @memberof UserRecentEvent + */ + socialLoginType: SocialConnectionType | null; } + + /** * Check if a given object implements the UserRecentEvent interface. */ -export function instanceOfUserRecentEvent(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "completedAt" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "ipAddr" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "userAgent" in value; - - return isInstance; +export function instanceOfUserRecentEvent(value: object): value is UserRecentEvent { + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('completedAt' in value) || value['completedAt'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('ipAddr' in value) || value['ipAddr'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('userAgent' in value) || value['userAgent'] === undefined) return false; + if (!('userAgentDisplay' in value) || value['userAgentDisplay'] === undefined) return false; + if (!('action' in value) || value['action'] === undefined) return false; + if (!('socialLoginType' in value) || value['socialLoginType'] === undefined) return false; + return true; } export function UserRecentEventFromJSON(json: any): UserRecentEvent { @@ -91,37 +127,45 @@ export function UserRecentEventFromJSON(json: any): UserRecentEvent { } export function UserRecentEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRecentEvent { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'createdAt': (new Date(json['created_at'])), - 'completedAt': (json['completed_at'] === null ? null : new Date(json['completed_at'])), + 'completedAt': (json['completed_at'] == null ? null : new Date(json['completed_at'])), 'id': json['id'], 'ipAddr': json['ip_addr'], 'status': UserEventStatusFromJSON(json['status']), 'type': json['type'], 'userAgent': json['user_agent'], + 'userAgentDisplay': json['user_agent_display'], + 'action': UserEventActionFromJSON(json['action']), + 'socialLoginType': SocialConnectionTypeFromJSON(json['social_login_type']), }; } -export function UserRecentEventToJSON(value?: UserRecentEvent | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserRecentEventToJSON(json: any): UserRecentEvent { + return UserRecentEventToJSONTyped(json, false); +} + +export function UserRecentEventToJSONTyped(value?: UserRecentEvent | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'created_at': (value.createdAt.toISOString()), - 'completed_at': (value.completedAt === null ? null : value.completedAt.toISOString()), - 'id': value.id, - 'ip_addr': value.ipAddr, - 'status': UserEventStatusToJSON(value.status), - 'type': value.type, - 'user_agent': value.userAgent, + 'created_at': ((value['createdAt']).toISOString()), + 'completed_at': (value['completedAt'] == null ? null : (value['completedAt'] as any).toISOString()), + 'id': value['id'], + 'ip_addr': value['ipAddr'], + 'status': UserEventStatusToJSON(value['status']), + 'type': value['type'], + 'user_agent': value['userAgent'], + 'user_agent_display': value['userAgentDisplay'], + 'action': UserEventActionToJSON(value['action']), + 'social_login_type': SocialConnectionTypeToJSON(value['socialLoginType']), }; } diff --git a/src/generated/models/UserResponse.ts b/src/generated/models/UserResponse.ts index c7946c5..b0b719a 100644 --- a/src/generated/models/UserResponse.ts +++ b/src/generated/models/UserResponse.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { UserInfo } from './UserInfo'; import { UserInfoFromJSON, UserInfoFromJSONTyped, UserInfoToJSON, + UserInfoToJSONTyped, } from './UserInfo'; /** @@ -37,11 +38,9 @@ export interface UserResponse { /** * Check if a given object implements the UserResponse interface. */ -export function instanceOfUserResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "user" in value; - - return isInstance; +export function instanceOfUserResponse(value: object): value is UserResponse { + if (!('user' in value) || value['user'] === undefined) return false; + return true; } export function UserResponseFromJSON(json: any): UserResponse { @@ -49,7 +48,7 @@ export function UserResponseFromJSON(json: any): UserResponse { } export function UserResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function UserResponseFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function UserResponseToJSON(value?: UserResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserResponseToJSON(json: any): UserResponse { + return UserResponseToJSONTyped(json, false); +} + +export function UserResponseToJSONTyped(value?: UserResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'user': UserInfoToJSON(value.user), + 'user': UserInfoToJSON(value['user']), }; } diff --git a/src/generated/models/UserSocialConnections.ts b/src/generated/models/UserSocialConnections.ts index bf06df1..b3357a6 100644 --- a/src/generated/models/UserSocialConnections.ts +++ b/src/generated/models/UserSocialConnections.ts @@ -12,24 +12,27 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { AppleUserSocialConnection } from './AppleUserSocialConnection'; -import { - AppleUserSocialConnectionFromJSON, - AppleUserSocialConnectionFromJSONTyped, - AppleUserSocialConnectionToJSON, -} from './AppleUserSocialConnection'; +import { mapValues } from '../runtime'; import type { GithubUserSocialConnection } from './GithubUserSocialConnection'; import { GithubUserSocialConnectionFromJSON, GithubUserSocialConnectionFromJSONTyped, GithubUserSocialConnectionToJSON, + GithubUserSocialConnectionToJSONTyped, } from './GithubUserSocialConnection'; +import type { AppleUserSocialConnection } from './AppleUserSocialConnection'; +import { + AppleUserSocialConnectionFromJSON, + AppleUserSocialConnectionFromJSONTyped, + AppleUserSocialConnectionToJSON, + AppleUserSocialConnectionToJSONTyped, +} from './AppleUserSocialConnection'; import type { GoogleUserSocialConnection } from './GoogleUserSocialConnection'; import { GoogleUserSocialConnectionFromJSON, GoogleUserSocialConnectionFromJSONTyped, GoogleUserSocialConnectionToJSON, + GoogleUserSocialConnectionToJSONTyped, } from './GoogleUserSocialConnection'; /** @@ -61,10 +64,8 @@ export interface UserSocialConnections { /** * Check if a given object implements the UserSocialConnections interface. */ -export function instanceOfUserSocialConnections(value: object): boolean { - let isInstance = true; - - return isInstance; +export function instanceOfUserSocialConnections(value: object): value is UserSocialConnections { + return true; } export function UserSocialConnectionsFromJSON(json: any): UserSocialConnections { @@ -72,29 +73,31 @@ export function UserSocialConnectionsFromJSON(json: any): UserSocialConnections } export function UserSocialConnectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSocialConnections { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'apple': !exists(json, 'apple') ? undefined : AppleUserSocialConnectionFromJSON(json['apple']), - 'github': !exists(json, 'github') ? undefined : GithubUserSocialConnectionFromJSON(json['github']), - 'google': !exists(json, 'google') ? undefined : GoogleUserSocialConnectionFromJSON(json['google']), + 'apple': json['apple'] == null ? undefined : AppleUserSocialConnectionFromJSON(json['apple']), + 'github': json['github'] == null ? undefined : GithubUserSocialConnectionFromJSON(json['github']), + 'google': json['google'] == null ? undefined : GoogleUserSocialConnectionFromJSON(json['google']), }; } -export function UserSocialConnectionsToJSON(value?: UserSocialConnections | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserSocialConnectionsToJSON(json: any): UserSocialConnections { + return UserSocialConnectionsToJSONTyped(json, false); +} + +export function UserSocialConnectionsToJSONTyped(value?: UserSocialConnections | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'apple': AppleUserSocialConnectionToJSON(value.apple), - 'github': GithubUserSocialConnectionToJSON(value.github), - 'google': GoogleUserSocialConnectionToJSON(value.google), + 'apple': AppleUserSocialConnectionToJSON(value['apple']), + 'github': GithubUserSocialConnectionToJSON(value['github']), + 'google': GoogleUserSocialConnectionToJSON(value['google']), }; } diff --git a/src/generated/models/UserStatus.ts b/src/generated/models/UserStatus.ts index ca7e628..7e452e0 100644 --- a/src/generated/models/UserStatus.ts +++ b/src/generated/models/UserStatus.ts @@ -25,6 +25,17 @@ export const UserStatus = { export type UserStatus = typeof UserStatus[keyof typeof UserStatus]; +export function instanceOfUserStatus(value: any): boolean { + for (const key in UserStatus) { + if (Object.prototype.hasOwnProperty.call(UserStatus, key)) { + if (UserStatus[key as keyof typeof UserStatus] === value) { + return true; + } + } + } + return false; +} + export function UserStatusFromJSON(json: any): UserStatus { return UserStatusFromJSONTyped(json, false); } @@ -37,3 +48,7 @@ export function UserStatusToJSON(value?: UserStatus | null): any { return value as any; } +export function UserStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): UserStatus { + return value as UserStatus; +} + diff --git a/src/generated/models/WebAuthnDevices.ts b/src/generated/models/WebAuthnDevices.ts index 4df3681..6cd6b87 100644 --- a/src/generated/models/WebAuthnDevices.ts +++ b/src/generated/models/WebAuthnDevices.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { WebAuthnIcons } from './WebAuthnIcons'; import { WebAuthnIconsFromJSON, WebAuthnIconsFromJSONTyped, WebAuthnIconsToJSON, + WebAuthnIconsToJSONTyped, } from './WebAuthnIcons'; import type { WebAuthnType } from './WebAuthnType'; import { WebAuthnTypeFromJSON, WebAuthnTypeFromJSONTyped, WebAuthnTypeToJSON, + WebAuthnTypeToJSONTyped, } from './WebAuthnType'; /** @@ -88,22 +90,22 @@ export interface WebAuthnDevices { icons: WebAuthnIcons; } + + /** * Check if a given object implements the WebAuthnDevices interface. */ -export function instanceOfWebAuthnDevices(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "createdAt" in value; - isInstance = isInstance && "credId" in value; - isInstance = isInstance && "friendlyName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "lastLoginAt" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "updatedAt" in value; - isInstance = isInstance && "usageCount" in value; - isInstance = isInstance && "icons" in value; - - return isInstance; +export function instanceOfWebAuthnDevices(value: object): value is WebAuthnDevices { + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('credId' in value) || value['credId'] === undefined) return false; + if (!('friendlyName' in value) || value['friendlyName'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('lastLoginAt' in value) || value['lastLoginAt'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + if (!('usageCount' in value) || value['usageCount'] === undefined) return false; + if (!('icons' in value) || value['icons'] === undefined) return false; + return true; } export function WebAuthnDevicesFromJSON(json: any): WebAuthnDevices { @@ -111,7 +113,7 @@ export function WebAuthnDevicesFromJSON(json: any): WebAuthnDevices { } export function WebAuthnDevicesFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebAuthnDevices { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -128,24 +130,26 @@ export function WebAuthnDevicesFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function WebAuthnDevicesToJSON(value?: WebAuthnDevices | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WebAuthnDevicesToJSON(json: any): WebAuthnDevices { + return WebAuthnDevicesToJSONTyped(json, false); +} + +export function WebAuthnDevicesToJSONTyped(value?: WebAuthnDevices | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'created_at': (value.createdAt.toISOString()), - 'cred_id': value.credId, - 'friendly_name': value.friendlyName, - 'id': value.id, - 'last_login_at': (value.lastLoginAt.toISOString()), - 'type': WebAuthnTypeToJSON(value.type), - 'updated_at': (value.updatedAt.toISOString()), - 'usage_count': value.usageCount, - 'icons': WebAuthnIconsToJSON(value.icons), + 'created_at': ((value['createdAt']).toISOString()), + 'cred_id': value['credId'], + 'friendly_name': value['friendlyName'], + 'id': value['id'], + 'last_login_at': ((value['lastLoginAt']).toISOString()), + 'type': WebAuthnTypeToJSON(value['type']), + 'updated_at': ((value['updatedAt']).toISOString()), + 'usage_count': value['usageCount'], + 'icons': WebAuthnIconsToJSON(value['icons']), }; } diff --git a/src/generated/models/WebAuthnIcons.ts b/src/generated/models/WebAuthnIcons.ts index 88fc6ff..f23c95e 100644 --- a/src/generated/models/WebAuthnIcons.ts +++ b/src/generated/models/WebAuthnIcons.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * Contains the light and dark SVG icons that represent the brand of those devices * Values can be null or base64 encoded SVG. Example of SVG output: @@ -38,12 +38,10 @@ export interface WebAuthnIcons { /** * Check if a given object implements the WebAuthnIcons interface. */ -export function instanceOfWebAuthnIcons(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "light" in value; - isInstance = isInstance && "dark" in value; - - return isInstance; +export function instanceOfWebAuthnIcons(value: object): value is WebAuthnIcons { + if (!('light' in value) || value['light'] === undefined) return false; + if (!('dark' in value) || value['dark'] === undefined) return false; + return true; } export function WebAuthnIconsFromJSON(json: any): WebAuthnIcons { @@ -51,7 +49,7 @@ export function WebAuthnIconsFromJSON(json: any): WebAuthnIcons { } export function WebAuthnIconsFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebAuthnIcons { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -61,17 +59,19 @@ export function WebAuthnIconsFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function WebAuthnIconsToJSON(value?: WebAuthnIcons | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WebAuthnIconsToJSON(json: any): WebAuthnIcons { + return WebAuthnIconsToJSONTyped(json, false); +} + +export function WebAuthnIconsToJSONTyped(value?: WebAuthnIcons | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'light': value.light, - 'dark': value.dark, + 'light': value['light'], + 'dark': value['dark'], }; } diff --git a/src/generated/models/WebAuthnType.ts b/src/generated/models/WebAuthnType.ts index 67305a2..7fd3956 100644 --- a/src/generated/models/WebAuthnType.ts +++ b/src/generated/models/WebAuthnType.ts @@ -25,6 +25,17 @@ export const WebAuthnType = { export type WebAuthnType = typeof WebAuthnType[keyof typeof WebAuthnType]; +export function instanceOfWebAuthnType(value: any): boolean { + for (const key in WebAuthnType) { + if (Object.prototype.hasOwnProperty.call(WebAuthnType, key)) { + if (WebAuthnType[key as keyof typeof WebAuthnType] === value) { + return true; + } + } + } + return false; +} + export function WebAuthnTypeFromJSON(json: any): WebAuthnType { return WebAuthnTypeFromJSONTyped(json, false); } @@ -37,3 +48,7 @@ export function WebAuthnTypeToJSON(value?: WebAuthnType | null): any { return value as any; } +export function WebAuthnTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): WebAuthnType { + return value as WebAuthnType; +} + diff --git a/src/generated/models/index.ts b/src/generated/models/index.ts index 0d40f9f..cd2d814 100644 --- a/src/generated/models/index.ts +++ b/src/generated/models/index.ts @@ -29,8 +29,11 @@ export * from './Nonce'; export * from './OtpAuthMethod'; export * from './PaginatedLinks'; export * from './PasskeysAuthMethod'; +export * from './SocialConnectionType'; export * from './Technologies'; +export * from './ThemeType'; export * from './TtlDisplayUnit'; +export * from './UserEventAction'; export * from './UserEventStatus'; export * from './UserInfo'; export * from './UserMetadataField'; diff --git a/src/generated/runtime.ts b/src/generated/runtime.ts index d881200..7fbf5ec 100644 --- a/src/generated/runtime.ts +++ b/src/generated/runtime.ts @@ -22,7 +22,7 @@ export interface ConfigurationParameters { queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings username?: string; // parameter for basic security password?: string; // parameter for basic security - apiKey?: string | ((name: string) => string); // parameter for apiKey security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security headers?: HTTPHeaders; //header params we want to use on every request credentials?: RequestCredentials; //value for the credentials param we want to use on each request @@ -59,7 +59,7 @@ export class Configuration { return this.configuration.password; } - get apiKey(): ((name: string) => string) | undefined { + get apiKey(): ((name: string) => string | Promise) | undefined { const apiKey = this.configuration.apiKey; if (apiKey) { return typeof apiKey === 'function' ? apiKey : () => apiKey; @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -310,11 +310,6 @@ export interface RequestOpts { body?: HTTPBody; } -export function exists(json: any, key: string) { - const value = json[key]; - return value !== null && value !== undefined; -} - export function querystring(params: HTTPQuery, prefix: string = ''): string { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) @@ -342,6 +337,11 @@ function querystringSingleKey(key: string, value: string | number | null | undef return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; } +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + export function mapValues(data: any, fn: (item: any) => any) { return Object.keys(data).reduce( (acc, key) => ({ ...acc, [key]: fn(data[key]) }),