From b379c7119e4991b7bc6248c502ebdc0ae544237e Mon Sep 17 00:00:00 2001 From: Ricky Padilla Date: Wed, 31 Jul 2024 15:26:37 -0700 Subject: [PATCH] feat(PSG-4346): add generated code, fix script, and CONTRIBUTING.md --- CONTRIBUTING.md | 11 + Sources/Passage/fix_generated_code.py | 75 ++ Sources/Passage/generated/.gitignore | 100 +++ .../generated/.openapi-generator-ignore | 23 + .../generated/.openapi-generator/FILES | 243 +++++++ .../generated/.openapi-generator/VERSION | 1 + Sources/Passage/generated/.swiftformat | 45 ++ Sources/Passage/generated/Cartfile | 1 + .../Passage/generated/OpenAPIClient.podspec | 15 + .../Classes/OpenAPIs/APIHelper.swift | 119 ++++ .../OpenAPIClient/Classes/OpenAPIs/APIs.swift | 93 +++ .../Classes/OpenAPIs/APIs/AppsAPI.swift | 53 ++ .../OpenAPIs/APIs/AuthenticateAPI.swift | 96 +++ .../OpenAPIs/APIs/CurrentuserAPI.swift | 554 +++++++++++++++ .../Classes/OpenAPIs/APIs/JWKSAPI.swift | 53 ++ .../Classes/OpenAPIs/APIs/LoginAPI.swift | 178 +++++ .../Classes/OpenAPIs/APIs/MagicLinkAPI.swift | 96 +++ .../Classes/OpenAPIs/APIs/OAuth2API.swift | 470 +++++++++++++ .../Classes/OpenAPIs/APIs/OTPAPI.swift | 55 ++ .../Classes/OpenAPIs/APIs/OpenIDAPI.swift | 53 ++ .../OpenAPIs/APIs/PasskeyReadinessAPI.swift | 68 ++ .../Classes/OpenAPIs/APIs/RegisterAPI.swift | 260 +++++++ .../Classes/OpenAPIs/APIs/TokensAPI.swift | 99 +++ .../Classes/OpenAPIs/APIs/UsersAPI.swift | 99 +++ .../Classes/OpenAPIs/CodableHelper.swift | 49 ++ .../Classes/OpenAPIs/Configuration.swift | 18 + .../Classes/OpenAPIs/Extensions.swift | 233 +++++++ .../Classes/OpenAPIs/JSONDataEncoding.swift | 56 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 45 ++ .../Classes/OpenAPIs/Models.swift | 129 ++++ .../Models/ActivateMagicLinkRequest.swift | 32 + .../ActivateOneTimePasscodeRequest.swift | 37 + .../Models/AddDeviceFinishRequest.swift | 40 ++ .../Models/AddDeviceStartResponse.swift | 36 + .../Classes/OpenAPIs/Models/App.swift | 133 ++++ .../Models/AppleSocialConnection.swift | 46 ++ .../Classes/OpenAPIs/Models/AuthMethods.swift | 41 ++ .../OpenAPIs/Models/AuthResponse.swift | 32 + .../Classes/OpenAPIs/Models/AuthResult.swift | 44 ++ ...WebAuthnFinishWithTransactionRequest.swift | 41 ++ ...eWebAuthnStartWithTransactionRequest.swift | 33 + ...WebAuthnStartWithTransactionResponse.swift | 37 + .../Models/AuthenticatorAttachment.swift | 18 + .../CreatePasskeyReadinessRequest.swift | 52 ++ .../OpenAPIs/Models/CreateUserParams.swift | 36 + .../Classes/OpenAPIs/Models/Credential.swift | 76 +++ .../Models/CredentialAssertionChallenge.swift | 36 + .../Models/CredentialAssertionResponse.swift | 54 ++ .../CredentialAssertionResponseResponse.swift | 45 ++ .../OpenAPIs/Models/CredentialCreation.swift | 32 + .../Models/CredentialCreationChallenge.swift | 36 + .../Models/CredentialCreationPublicKey.swift | 64 ++ ...ationPublicKeyAuthenticatorSelection.swift | 48 ++ ...tionPublicKeyExcludeCredentialsInner.swift | 43 ++ ...eationPublicKeyPubKeyCredParamsInner.swift | 36 + .../CredentialCreationPublicKeyRp.swift | 43 ++ .../CredentialCreationPublicKeyUser.swift | 48 ++ .../Models/CredentialCreationResponse.swift | 58 ++ .../CredentialCreationResponseResponse.swift | 42 ++ .../Classes/OpenAPIs/Models/CurrentUser.swift | 100 +++ .../OpenAPIs/Models/CurrentUserDevice.swift | 32 + .../OpenAPIs/Models/CurrentUserDevices.swift | 32 + .../CurrentUserDevicesStartRequest.swift | 32 + .../OpenAPIs/Models/CurrentUserResponse.swift | 32 + .../Models/ElementCustomization.swift | 126 ++++ .../Classes/OpenAPIs/Models/FontFamily.swift | 35 + .../OpenAPIs/Models/GetAppResponse.swift | 32 + .../Models/GetMagicLinkStatusRequest.swift | 32 + .../Models/GithubSocialConnection.swift | 46 ++ .../Models/GoogleSocialConnection.swift | 46 ++ .../OpenAPIs/Models/IdTokenRequest.swift | 47 ++ .../Classes/OpenAPIs/Models/JWKResponse.swift | 32 + .../Models/JWKResponseKeysInner.swift | 58 ++ .../OpenAPIs/Models/LayoutConfig.swift | 48 ++ .../Classes/OpenAPIs/Models/Layouts.swift | 36 + .../Models/LoginMagicLinkRequest.swift | 43 ++ .../Models/LoginMagicLinkResponse.swift | 32 + .../Models/LoginOneTimePasscodeRequest.swift | 38 ++ .../Models/LoginWebAuthnFinishRequest.swift | 40 ++ .../Models/LoginWebAuthnStartRequest.swift | 33 + .../Models/LoginWebAuthnStartResponse.swift | 36 + .../Classes/OpenAPIs/Models/MagicLink.swift | 33 + .../OpenAPIs/Models/MagicLinkAuthMethod.swift | 39 ++ .../OpenAPIs/Models/MagicLinkResponse.swift | 32 + .../OpenAPIs/Models/Model400Code.swift | 16 + .../OpenAPIs/Models/Model400Error.swift | 36 + .../OpenAPIs/Models/Model401Code.swift | 20 + .../OpenAPIs/Models/Model401Error.swift | 36 + .../OpenAPIs/Models/Model403Code.swift | 17 + .../OpenAPIs/Models/Model403Error.swift | 36 + .../OpenAPIs/Models/Model404Code.swift | 19 + .../OpenAPIs/Models/Model404Error.swift | 36 + .../OpenAPIs/Models/Model409Code.swift | 15 + .../OpenAPIs/Models/Model409Error.swift | 36 + .../OpenAPIs/Models/Model500Code.swift | 15 + .../OpenAPIs/Models/Model500Error.swift | 36 + .../Classes/OpenAPIs/Models/Nonce.swift | 33 + .../Models/OneTimePasscodeResponse.swift | 33 + .../OpenAPIs/Models/OpenIdConfiguration.swift | 40 ++ .../OpenAPIs/Models/OtpAuthMethod.swift | 39 ++ .../Models/ProtocolCredentialAssertion.swift | 32 + ...ProtocolCredentialAssertionPublicKey.swift | 53 ++ ...ertionPublicKeyAllowCredentialsInner.swift | 43 ++ .../Models/RefreshAuthTokenRequest.swift | 32 + .../Models/RegisterMagicLinkRequest.swift | 43 ++ .../Models/RegisterMagicLinkResponse.swift | 32 + .../RegisterOneTimePasscodeRequest.swift | 38 ++ .../RegisterWebAuthnFinishRequest.swift | 40 ++ ...WebAuthnFinishWithTransactionRequest.swift | 41 ++ .../Models/RegisterWebAuthnStartRequest.swift | 37 + .../RegisterWebAuthnStartResponse.swift | 36 + ...rWebAuthnStartWithTransactionRequest.swift | 37 + ...WebAuthnStartWithTransactionResponse.swift | 37 + .../OpenAPIs/Models/SocialConnections.swift | 40 ++ .../Models/SocialConnectionsResponse.swift | 32 + .../OpenAPIs/Models/TtlDisplayUnit.swift | 20 + .../OpenAPIs/Models/UpdateDeviceRequest.swift | 32 + .../Models/UpdateMetadataRequest.swift | 32 + .../Models/UpdateUserEmailRequest.swift | 45 ++ .../Models/UpdateUserPhoneRequest.swift | 45 ++ .../Classes/OpenAPIs/Models/User.swift | 66 ++ .../OpenAPIs/Models/UserMetadataField.swift | 52 ++ .../Models/UserMetadataResponse.swift | 32 + .../OpenAPIs/Models/UserResponse.swift | 32 + .../Models/UserSocialConnections.swift | 40 ++ .../Classes/OpenAPIs/Models/UserStatus.swift | 19 + .../OpenAPIs/Models/WebAuthnIcons.swift | 37 + .../OpenAPIs/Models/WebAuthnType.swift | 18 + .../OpenAPIs/OpenISO8601DateFormatter.swift | 56 ++ .../OpenAPIs/SynchronizedDictionary.swift | 36 + .../OpenAPIs/URLSessionImplementations.swift | 634 +++++++++++++++++ .../Classes/OpenAPIs/Validation.swift | 126 ++++ Sources/Passage/generated/README.md | 197 ++++++ .../docs/ActivateMagicLinkRequest.md | 10 + .../docs/ActivateOneTimePasscodeRequest.md | 11 + .../generated/docs/AddDeviceFinishRequest.md | 12 + .../generated/docs/AddDeviceStartResponse.md | 11 + Sources/Passage/generated/docs/App.md | 33 + .../generated/docs/AppleSocialConnection.md | 13 + Sources/Passage/generated/docs/AppsAPI.md | 59 ++ Sources/Passage/generated/docs/AuthMethods.md | 12 + .../Passage/generated/docs/AuthResponse.md | 10 + Sources/Passage/generated/docs/AuthResult.md | 13 + .../Passage/generated/docs/AuthenticateAPI.md | 114 ++++ ...ateWebAuthnFinishWithTransactionRequest.md | 12 + ...cateWebAuthnStartWithTransactionRequest.md | 10 + ...ateWebAuthnStartWithTransactionResponse.md | 11 + .../generated/docs/AuthenticatorAttachment.md | 9 + .../docs/CreatePasskeyReadinessRequest.md | 15 + .../generated/docs/CreateUserParams.md | 11 + Sources/Passage/generated/docs/Credential.md | 19 + .../docs/CredentialAssertionChallenge.md | 11 + .../docs/CredentialAssertionResponse.md | 15 + .../CredentialAssertionResponseResponse.md | 13 + .../generated/docs/CredentialCreation.md | 10 + .../docs/CredentialCreationChallenge.md | 11 + .../docs/CredentialCreationPublicKey.md | 18 + ...CreationPublicKeyAuthenticatorSelection.md | 13 + ...reationPublicKeyExcludeCredentialsInner.md | 12 + ...lCreationPublicKeyPubKeyCredParamsInner.md | 11 + .../docs/CredentialCreationPublicKeyRp.md | 12 + .../docs/CredentialCreationPublicKeyUser.md | 13 + .../docs/CredentialCreationResponse.md | 16 + .../CredentialCreationResponseResponse.md | 12 + Sources/Passage/generated/docs/CurrentUser.md | 24 + .../generated/docs/CurrentUserDevice.md | 10 + .../generated/docs/CurrentUserDevices.md | 10 + .../docs/CurrentUserDevicesStartRequest.md | 10 + .../generated/docs/CurrentUserResponse.md | 10 + .../Passage/generated/docs/CurrentuserAPI.md | 638 ++++++++++++++++++ .../generated/docs/ElementCustomization.md | 29 + Sources/Passage/generated/docs/FontFamily.md | 9 + .../Passage/generated/docs/GetAppResponse.md | 10 + .../docs/GetMagicLinkStatusRequest.md | 10 + .../generated/docs/GithubSocialConnection.md | 13 + .../generated/docs/GoogleSocialConnection.md | 13 + .../Passage/generated/docs/IdTokenRequest.md | 12 + Sources/Passage/generated/docs/JWKResponse.md | 10 + .../generated/docs/JWKResponseKeysInner.md | 15 + Sources/Passage/generated/docs/JWKSAPI.md | 59 ++ .../Passage/generated/docs/LayoutConfig.md | 14 + Sources/Passage/generated/docs/Layouts.md | 11 + Sources/Passage/generated/docs/LoginAPI.md | 220 ++++++ .../generated/docs/LoginMagicLinkRequest.md | 12 + .../generated/docs/LoginMagicLinkResponse.md | 10 + .../docs/LoginOneTimePasscodeRequest.md | 11 + .../docs/LoginWebAuthnFinishRequest.md | 12 + .../docs/LoginWebAuthnStartRequest.md | 10 + .../docs/LoginWebAuthnStartResponse.md | 11 + Sources/Passage/generated/docs/MagicLink.md | 10 + .../Passage/generated/docs/MagicLinkAPI.md | 114 ++++ .../generated/docs/MagicLinkAuthMethod.md | 11 + .../generated/docs/MagicLinkResponse.md | 10 + .../Passage/generated/docs/Model400Code.md | 9 + .../Passage/generated/docs/Model400Error.md | 11 + .../Passage/generated/docs/Model401Code.md | 9 + .../Passage/generated/docs/Model401Error.md | 11 + .../Passage/generated/docs/Model403Code.md | 9 + .../Passage/generated/docs/Model403Error.md | 11 + .../Passage/generated/docs/Model404Code.md | 9 + .../Passage/generated/docs/Model404Error.md | 11 + .../Passage/generated/docs/Model409Code.md | 9 + .../Passage/generated/docs/Model409Error.md | 11 + .../Passage/generated/docs/Model500Code.md | 9 + .../Passage/generated/docs/Model500Error.md | 11 + Sources/Passage/generated/docs/Nonce.md | 10 + Sources/Passage/generated/docs/OAuth2API.md | 456 +++++++++++++ Sources/Passage/generated/docs/OTPAPI.md | 61 ++ .../generated/docs/OneTimePasscodeResponse.md | 10 + Sources/Passage/generated/docs/OpenIDAPI.md | 59 ++ .../generated/docs/OpenIdConfiguration.md | 12 + .../Passage/generated/docs/OtpAuthMethod.md | 11 + .../generated/docs/PasskeyReadinessAPI.md | 69 ++ .../docs/ProtocolCredentialAssertion.md | 10 + .../ProtocolCredentialAssertionPublicKey.md | 15 + ...AssertionPublicKeyAllowCredentialsInner.md | 12 + .../generated/docs/RefreshAuthTokenRequest.md | 10 + Sources/Passage/generated/docs/RegisterAPI.md | 326 +++++++++ .../docs/RegisterMagicLinkRequest.md | 12 + .../docs/RegisterMagicLinkResponse.md | 10 + .../docs/RegisterOneTimePasscodeRequest.md | 11 + .../docs/RegisterWebAuthnFinishRequest.md | 12 + ...terWebAuthnFinishWithTransactionRequest.md | 12 + .../docs/RegisterWebAuthnStartRequest.md | 11 + .../docs/RegisterWebAuthnStartResponse.md | 11 + ...sterWebAuthnStartWithTransactionRequest.md | 11 + ...terWebAuthnStartWithTransactionResponse.md | 11 + .../generated/docs/SocialConnections.md | 12 + .../docs/SocialConnectionsResponse.md | 10 + Sources/Passage/generated/docs/TokensAPI.md | 114 ++++ .../Passage/generated/docs/TtlDisplayUnit.md | 9 + .../generated/docs/UpdateDeviceRequest.md | 10 + .../generated/docs/UpdateMetadataRequest.md | 10 + .../generated/docs/UpdateUserEmailRequest.md | 13 + .../generated/docs/UpdateUserPhoneRequest.md | 13 + Sources/Passage/generated/docs/User.md | 18 + .../generated/docs/UserMetadataField.md | 15 + .../generated/docs/UserMetadataResponse.md | 10 + .../Passage/generated/docs/UserResponse.md | 10 + .../generated/docs/UserSocialConnections.md | 12 + Sources/Passage/generated/docs/UserStatus.md | 9 + Sources/Passage/generated/docs/UsersAPI.md | 114 ++++ .../Passage/generated/docs/WebAuthnIcons.md | 11 + .../Passage/generated/docs/WebAuthnType.md | 9 + Sources/Passage/generated/git_push.sh | 57 ++ Sources/Passage/generated/project.yml | 15 + 246 files changed, 11999 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 Sources/Passage/fix_generated_code.py create mode 100644 Sources/Passage/generated/.gitignore create mode 100644 Sources/Passage/generated/.openapi-generator-ignore create mode 100644 Sources/Passage/generated/.openapi-generator/FILES create mode 100644 Sources/Passage/generated/.openapi-generator/VERSION create mode 100644 Sources/Passage/generated/.swiftformat create mode 100644 Sources/Passage/generated/Cartfile create mode 100644 Sources/Passage/generated/OpenAPIClient.podspec create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AppsAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AuthenticateAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/CurrentuserAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/JWKSAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/LoginAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/MagicLinkAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OAuth2API.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OTPAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OpenIDAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/PasskeyReadinessAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/RegisterAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/TokensAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/UsersAPI.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Configuration.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Extensions.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateMagicLinkRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateOneTimePasscodeRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceFinishRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceStartResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/App.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AppleSocialConnection.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthMethods.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResult.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnFinishWithTransactionRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticatorAttachment.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreatePasskeyReadinessRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreateUserParams.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Credential.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionChallenge.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponseResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreation.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationChallenge.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKey.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyAuthenticatorSelection.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyExcludeCredentialsInner.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyPubKeyCredParamsInner.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyRp.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyUser.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponseResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUser.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevice.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevices.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevicesStartRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ElementCustomization.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/FontFamily.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetAppResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetMagicLinkStatusRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GithubSocialConnection.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GoogleSocialConnection.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/IdTokenRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponseKeysInner.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LayoutConfig.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Layouts.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginOneTimePasscodeRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnFinishRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLink.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkAuthMethod.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Code.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Error.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Nonce.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OneTimePasscodeResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OpenIdConfiguration.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OtpAuthMethod.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertion.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKey.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RefreshAuthTokenRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterOneTimePasscodeRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishWithTransactionRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnections.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnectionsResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/TtlDisplayUnit.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateDeviceRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateMetadataRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserEmailRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserPhoneRequest.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/User.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataField.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserResponse.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserSocialConnections.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserStatus.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnIcons.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnType.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift create mode 100644 Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Validation.swift create mode 100644 Sources/Passage/generated/README.md create mode 100644 Sources/Passage/generated/docs/ActivateMagicLinkRequest.md create mode 100644 Sources/Passage/generated/docs/ActivateOneTimePasscodeRequest.md create mode 100644 Sources/Passage/generated/docs/AddDeviceFinishRequest.md create mode 100644 Sources/Passage/generated/docs/AddDeviceStartResponse.md create mode 100644 Sources/Passage/generated/docs/App.md create mode 100644 Sources/Passage/generated/docs/AppleSocialConnection.md create mode 100644 Sources/Passage/generated/docs/AppsAPI.md create mode 100644 Sources/Passage/generated/docs/AuthMethods.md create mode 100644 Sources/Passage/generated/docs/AuthResponse.md create mode 100644 Sources/Passage/generated/docs/AuthResult.md create mode 100644 Sources/Passage/generated/docs/AuthenticateAPI.md create mode 100644 Sources/Passage/generated/docs/AuthenticateWebAuthnFinishWithTransactionRequest.md create mode 100644 Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionRequest.md create mode 100644 Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionResponse.md create mode 100644 Sources/Passage/generated/docs/AuthenticatorAttachment.md create mode 100644 Sources/Passage/generated/docs/CreatePasskeyReadinessRequest.md create mode 100644 Sources/Passage/generated/docs/CreateUserParams.md create mode 100644 Sources/Passage/generated/docs/Credential.md create mode 100644 Sources/Passage/generated/docs/CredentialAssertionChallenge.md create mode 100644 Sources/Passage/generated/docs/CredentialAssertionResponse.md create mode 100644 Sources/Passage/generated/docs/CredentialAssertionResponseResponse.md create mode 100644 Sources/Passage/generated/docs/CredentialCreation.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationChallenge.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKey.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKeyAuthenticatorSelection.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKeyExcludeCredentialsInner.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKeyRp.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationPublicKeyUser.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationResponse.md create mode 100644 Sources/Passage/generated/docs/CredentialCreationResponseResponse.md create mode 100644 Sources/Passage/generated/docs/CurrentUser.md create mode 100644 Sources/Passage/generated/docs/CurrentUserDevice.md create mode 100644 Sources/Passage/generated/docs/CurrentUserDevices.md create mode 100644 Sources/Passage/generated/docs/CurrentUserDevicesStartRequest.md create mode 100644 Sources/Passage/generated/docs/CurrentUserResponse.md create mode 100644 Sources/Passage/generated/docs/CurrentuserAPI.md create mode 100644 Sources/Passage/generated/docs/ElementCustomization.md create mode 100644 Sources/Passage/generated/docs/FontFamily.md create mode 100644 Sources/Passage/generated/docs/GetAppResponse.md create mode 100644 Sources/Passage/generated/docs/GetMagicLinkStatusRequest.md create mode 100644 Sources/Passage/generated/docs/GithubSocialConnection.md create mode 100644 Sources/Passage/generated/docs/GoogleSocialConnection.md create mode 100644 Sources/Passage/generated/docs/IdTokenRequest.md create mode 100644 Sources/Passage/generated/docs/JWKResponse.md create mode 100644 Sources/Passage/generated/docs/JWKResponseKeysInner.md create mode 100644 Sources/Passage/generated/docs/JWKSAPI.md create mode 100644 Sources/Passage/generated/docs/LayoutConfig.md create mode 100644 Sources/Passage/generated/docs/Layouts.md create mode 100644 Sources/Passage/generated/docs/LoginAPI.md create mode 100644 Sources/Passage/generated/docs/LoginMagicLinkRequest.md create mode 100644 Sources/Passage/generated/docs/LoginMagicLinkResponse.md create mode 100644 Sources/Passage/generated/docs/LoginOneTimePasscodeRequest.md create mode 100644 Sources/Passage/generated/docs/LoginWebAuthnFinishRequest.md create mode 100644 Sources/Passage/generated/docs/LoginWebAuthnStartRequest.md create mode 100644 Sources/Passage/generated/docs/LoginWebAuthnStartResponse.md create mode 100644 Sources/Passage/generated/docs/MagicLink.md create mode 100644 Sources/Passage/generated/docs/MagicLinkAPI.md create mode 100644 Sources/Passage/generated/docs/MagicLinkAuthMethod.md create mode 100644 Sources/Passage/generated/docs/MagicLinkResponse.md create mode 100644 Sources/Passage/generated/docs/Model400Code.md create mode 100644 Sources/Passage/generated/docs/Model400Error.md create mode 100644 Sources/Passage/generated/docs/Model401Code.md create mode 100644 Sources/Passage/generated/docs/Model401Error.md create mode 100644 Sources/Passage/generated/docs/Model403Code.md create mode 100644 Sources/Passage/generated/docs/Model403Error.md create mode 100644 Sources/Passage/generated/docs/Model404Code.md create mode 100644 Sources/Passage/generated/docs/Model404Error.md create mode 100644 Sources/Passage/generated/docs/Model409Code.md create mode 100644 Sources/Passage/generated/docs/Model409Error.md create mode 100644 Sources/Passage/generated/docs/Model500Code.md create mode 100644 Sources/Passage/generated/docs/Model500Error.md create mode 100644 Sources/Passage/generated/docs/Nonce.md create mode 100644 Sources/Passage/generated/docs/OAuth2API.md create mode 100644 Sources/Passage/generated/docs/OTPAPI.md create mode 100644 Sources/Passage/generated/docs/OneTimePasscodeResponse.md create mode 100644 Sources/Passage/generated/docs/OpenIDAPI.md create mode 100644 Sources/Passage/generated/docs/OpenIdConfiguration.md create mode 100644 Sources/Passage/generated/docs/OtpAuthMethod.md create mode 100644 Sources/Passage/generated/docs/PasskeyReadinessAPI.md create mode 100644 Sources/Passage/generated/docs/ProtocolCredentialAssertion.md create mode 100644 Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKey.md create mode 100644 Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md create mode 100644 Sources/Passage/generated/docs/RefreshAuthTokenRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterAPI.md create mode 100644 Sources/Passage/generated/docs/RegisterMagicLinkRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterMagicLinkResponse.md create mode 100644 Sources/Passage/generated/docs/RegisterOneTimePasscodeRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnFinishRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnFinishWithTransactionRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnStartRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnStartResponse.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionRequest.md create mode 100644 Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionResponse.md create mode 100644 Sources/Passage/generated/docs/SocialConnections.md create mode 100644 Sources/Passage/generated/docs/SocialConnectionsResponse.md create mode 100644 Sources/Passage/generated/docs/TokensAPI.md create mode 100644 Sources/Passage/generated/docs/TtlDisplayUnit.md create mode 100644 Sources/Passage/generated/docs/UpdateDeviceRequest.md create mode 100644 Sources/Passage/generated/docs/UpdateMetadataRequest.md create mode 100644 Sources/Passage/generated/docs/UpdateUserEmailRequest.md create mode 100644 Sources/Passage/generated/docs/UpdateUserPhoneRequest.md create mode 100644 Sources/Passage/generated/docs/User.md create mode 100644 Sources/Passage/generated/docs/UserMetadataField.md create mode 100644 Sources/Passage/generated/docs/UserMetadataResponse.md create mode 100644 Sources/Passage/generated/docs/UserResponse.md create mode 100644 Sources/Passage/generated/docs/UserSocialConnections.md create mode 100644 Sources/Passage/generated/docs/UserStatus.md create mode 100644 Sources/Passage/generated/docs/UsersAPI.md create mode 100644 Sources/Passage/generated/docs/WebAuthnIcons.md create mode 100644 Sources/Passage/generated/docs/WebAuthnType.md create mode 100644 Sources/Passage/generated/git_push.sh create mode 100644 Sources/Passage/generated/project.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e74ab23 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +## Code generation + +1. Run below command to update the OpenAPI generated code: +``` +openapi-generator generate -i https://api.swaggerhub.com/apis/passage/passage-auth-api/1 -g swift5 --additional-properties=responseAs=AsyncAwait -o Sources/Passage/generated +``` + +2. Run script to fix known generated code issues: +``` +python3 Sources/Passage/fix_generated_code.py +``` diff --git a/Sources/Passage/fix_generated_code.py b/Sources/Passage/fix_generated_code.py new file mode 100644 index 0000000..7dd04cc --- /dev/null +++ b/Sources/Passage/fix_generated_code.py @@ -0,0 +1,75 @@ +import os + +openApiDirectory = './Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs' + +# Define a list of tuples for replacements where each tuple is ('file_path', 'old_text', 'new_text') +replacements = [ + + # User model requires `webauthn_types` property, but webauthn start returns user WITHOUT it, so we must make it optional. + ( + f'{openApiDirectory}/Models/User.swift', + '''public var webauthnTypes: [WebAuthnType] + + ''', + '''public var webauthnTypes: [WebAuthnType]? + + ''' + ), + + ( + f'{openApiDirectory}/Models/CurrentUser.swift', + '''public var webauthnTypes: [WebAuthnType] + + ''', + '''public var webauthnTypes: [WebAuthnType]? + + ''' + ), + + # Some endpoints return a user with a status set to "". This is incompatible with the spec, so we have to add the statusUnavailable option. + ( + f'{openApiDirectory}/Models/UserStatus.swift', + '''case pending = "pending" +} +''', + '''case pending = "pending" + case statusUnavailable = "" +} +''' + ), + + # Fix identifier encoding issue in UsersAPI: + ( + f'{openApiDirectory}/APIs/UsersAPI.swift', + 'return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false)', + 'return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string?.removingPercentEncoding ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false)' + ), + + # Add more replacements here as needed + # ('file', 'oldText', 'newText'), +] + +def replace_in_file(replacement): + file_path, old_text, new_text = replacement + with open(file_path, 'r', encoding='utf-8') as file: + content = file.read() + + updated_content = content + # for old_text, new_text in replacements: + updated_content = updated_content.replace(old_text, new_text) + + if content != updated_content: + with open(file_path, 'w', encoding='utf-8') as file: + file.write(updated_content) + print(f"Updated {file_path}") + +def remove_file(file_path): + if os.path.exists(file_path): + os.remove(file_path) + print(f"File '{file_path}' deleted successfully.") + else: print(f"File '{file_path}' not found.") + +for replacement in replacements: + replace_in_file(replacement) + +remove_file('Sources/Passage/generated/Package.swift') diff --git a/Sources/Passage/generated/.gitignore b/Sources/Passage/generated/.gitignore new file mode 100644 index 0000000..316a845 --- /dev/null +++ b/Sources/Passage/generated/.gitignore @@ -0,0 +1,100 @@ +# Created by https://www.toptal.com/developers/gitignore/api/xcode,swift +# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swift + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### + +## Xcode 8 and earlier + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/xcode,swift diff --git a/Sources/Passage/generated/.openapi-generator-ignore b/Sources/Passage/generated/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/Sources/Passage/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/Sources/Passage/generated/.openapi-generator/FILES b/Sources/Passage/generated/.openapi-generator/FILES new file mode 100644 index 0000000..c16bbf5 --- /dev/null +++ b/Sources/Passage/generated/.openapi-generator/FILES @@ -0,0 +1,243 @@ +.gitignore +.openapi-generator-ignore +.swiftformat +Cartfile +OpenAPIClient.podspec +OpenAPIClient/Classes/OpenAPIs/APIHelper.swift +OpenAPIClient/Classes/OpenAPIs/APIs.swift +OpenAPIClient/Classes/OpenAPIs/APIs/AppsAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/AuthenticateAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/CurrentuserAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/JWKSAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/LoginAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/MagicLinkAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/OAuth2API.swift +OpenAPIClient/Classes/OpenAPIs/APIs/OTPAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/OpenIDAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/PasskeyReadinessAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/RegisterAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/TokensAPI.swift +OpenAPIClient/Classes/OpenAPIs/APIs/UsersAPI.swift +OpenAPIClient/Classes/OpenAPIs/CodableHelper.swift +OpenAPIClient/Classes/OpenAPIs/Configuration.swift +OpenAPIClient/Classes/OpenAPIs/Extensions.swift +OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift +OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift +OpenAPIClient/Classes/OpenAPIs/Models.swift +OpenAPIClient/Classes/OpenAPIs/Models/ActivateMagicLinkRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/ActivateOneTimePasscodeRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceFinishRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceStartResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/App.swift +OpenAPIClient/Classes/OpenAPIs/Models/AppleSocialConnection.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthMethods.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthResult.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnFinishWithTransactionRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/AuthenticatorAttachment.swift +OpenAPIClient/Classes/OpenAPIs/Models/CreatePasskeyReadinessRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/CreateUserParams.swift +OpenAPIClient/Classes/OpenAPIs/Models/Credential.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionChallenge.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponseResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreation.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationChallenge.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKey.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyAuthenticatorSelection.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyExcludeCredentialsInner.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyPubKeyCredParamsInner.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyRp.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyUser.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponseResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/CurrentUser.swift +OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevice.swift +OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevices.swift +OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevicesStartRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/ElementCustomization.swift +OpenAPIClient/Classes/OpenAPIs/Models/FontFamily.swift +OpenAPIClient/Classes/OpenAPIs/Models/GetAppResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/GetMagicLinkStatusRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/GithubSocialConnection.swift +OpenAPIClient/Classes/OpenAPIs/Models/GoogleSocialConnection.swift +OpenAPIClient/Classes/OpenAPIs/Models/IdTokenRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/JWKResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/JWKResponseKeysInner.swift +OpenAPIClient/Classes/OpenAPIs/Models/LayoutConfig.swift +OpenAPIClient/Classes/OpenAPIs/Models/Layouts.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginOneTimePasscodeRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnFinishRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/MagicLink.swift +OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkAuthMethod.swift +OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model400Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model400Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model401Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model401Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model403Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model403Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model404Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model404Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model409Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model409Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model500Code.swift +OpenAPIClient/Classes/OpenAPIs/Models/Model500Error.swift +OpenAPIClient/Classes/OpenAPIs/Models/Nonce.swift +OpenAPIClient/Classes/OpenAPIs/Models/OneTimePasscodeResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/OpenIdConfiguration.swift +OpenAPIClient/Classes/OpenAPIs/Models/OtpAuthMethod.swift +OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertion.swift +OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKey.swift +OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift +OpenAPIClient/Classes/OpenAPIs/Models/RefreshAuthTokenRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterOneTimePasscodeRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishWithTransactionRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/SocialConnections.swift +OpenAPIClient/Classes/OpenAPIs/Models/SocialConnectionsResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/TtlDisplayUnit.swift +OpenAPIClient/Classes/OpenAPIs/Models/UpdateDeviceRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/UpdateMetadataRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserEmailRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserPhoneRequest.swift +OpenAPIClient/Classes/OpenAPIs/Models/User.swift +OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataField.swift +OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/UserResponse.swift +OpenAPIClient/Classes/OpenAPIs/Models/UserSocialConnections.swift +OpenAPIClient/Classes/OpenAPIs/Models/UserStatus.swift +OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnIcons.swift +OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnType.swift +OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift +OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift +OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift +OpenAPIClient/Classes/OpenAPIs/Validation.swift +Package.swift +README.md +docs/ActivateMagicLinkRequest.md +docs/ActivateOneTimePasscodeRequest.md +docs/AddDeviceFinishRequest.md +docs/AddDeviceStartResponse.md +docs/App.md +docs/AppleSocialConnection.md +docs/AppsAPI.md +docs/AuthMethods.md +docs/AuthResponse.md +docs/AuthResult.md +docs/AuthenticateAPI.md +docs/AuthenticateWebAuthnFinishWithTransactionRequest.md +docs/AuthenticateWebAuthnStartWithTransactionRequest.md +docs/AuthenticateWebAuthnStartWithTransactionResponse.md +docs/AuthenticatorAttachment.md +docs/CreatePasskeyReadinessRequest.md +docs/CreateUserParams.md +docs/Credential.md +docs/CredentialAssertionChallenge.md +docs/CredentialAssertionResponse.md +docs/CredentialAssertionResponseResponse.md +docs/CredentialCreation.md +docs/CredentialCreationChallenge.md +docs/CredentialCreationPublicKey.md +docs/CredentialCreationPublicKeyAuthenticatorSelection.md +docs/CredentialCreationPublicKeyExcludeCredentialsInner.md +docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md +docs/CredentialCreationPublicKeyRp.md +docs/CredentialCreationPublicKeyUser.md +docs/CredentialCreationResponse.md +docs/CredentialCreationResponseResponse.md +docs/CurrentUser.md +docs/CurrentUserDevice.md +docs/CurrentUserDevices.md +docs/CurrentUserDevicesStartRequest.md +docs/CurrentUserResponse.md +docs/CurrentuserAPI.md +docs/ElementCustomization.md +docs/FontFamily.md +docs/GetAppResponse.md +docs/GetMagicLinkStatusRequest.md +docs/GithubSocialConnection.md +docs/GoogleSocialConnection.md +docs/IdTokenRequest.md +docs/JWKResponse.md +docs/JWKResponseKeysInner.md +docs/JWKSAPI.md +docs/LayoutConfig.md +docs/Layouts.md +docs/LoginAPI.md +docs/LoginMagicLinkRequest.md +docs/LoginMagicLinkResponse.md +docs/LoginOneTimePasscodeRequest.md +docs/LoginWebAuthnFinishRequest.md +docs/LoginWebAuthnStartRequest.md +docs/LoginWebAuthnStartResponse.md +docs/MagicLink.md +docs/MagicLinkAPI.md +docs/MagicLinkAuthMethod.md +docs/MagicLinkResponse.md +docs/Model400Code.md +docs/Model400Error.md +docs/Model401Code.md +docs/Model401Error.md +docs/Model403Code.md +docs/Model403Error.md +docs/Model404Code.md +docs/Model404Error.md +docs/Model409Code.md +docs/Model409Error.md +docs/Model500Code.md +docs/Model500Error.md +docs/Nonce.md +docs/OAuth2API.md +docs/OTPAPI.md +docs/OneTimePasscodeResponse.md +docs/OpenIDAPI.md +docs/OpenIdConfiguration.md +docs/OtpAuthMethod.md +docs/PasskeyReadinessAPI.md +docs/ProtocolCredentialAssertion.md +docs/ProtocolCredentialAssertionPublicKey.md +docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md +docs/RefreshAuthTokenRequest.md +docs/RegisterAPI.md +docs/RegisterMagicLinkRequest.md +docs/RegisterMagicLinkResponse.md +docs/RegisterOneTimePasscodeRequest.md +docs/RegisterWebAuthnFinishRequest.md +docs/RegisterWebAuthnFinishWithTransactionRequest.md +docs/RegisterWebAuthnStartRequest.md +docs/RegisterWebAuthnStartResponse.md +docs/RegisterWebAuthnStartWithTransactionRequest.md +docs/RegisterWebAuthnStartWithTransactionResponse.md +docs/SocialConnections.md +docs/SocialConnectionsResponse.md +docs/TokensAPI.md +docs/TtlDisplayUnit.md +docs/UpdateDeviceRequest.md +docs/UpdateMetadataRequest.md +docs/UpdateUserEmailRequest.md +docs/UpdateUserPhoneRequest.md +docs/User.md +docs/UserMetadataField.md +docs/UserMetadataResponse.md +docs/UserResponse.md +docs/UserSocialConnections.md +docs/UserStatus.md +docs/UsersAPI.md +docs/WebAuthnIcons.md +docs/WebAuthnType.md +git_push.sh +project.yml diff --git a/Sources/Passage/generated/.openapi-generator/VERSION b/Sources/Passage/generated/.openapi-generator/VERSION new file mode 100644 index 0000000..8b23b8d --- /dev/null +++ b/Sources/Passage/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.3.0 \ No newline at end of file diff --git a/Sources/Passage/generated/.swiftformat b/Sources/Passage/generated/.swiftformat new file mode 100644 index 0000000..9300725 --- /dev/null +++ b/Sources/Passage/generated/.swiftformat @@ -0,0 +1,45 @@ +# This file is auto-generated by OpenAPI Generator: https://openapi-generator.tech/ +# +# For rules on SwiftFormat, please refer to https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md +# +# file options + +# uncomment below to exclude files, folders +#--exclude path/to/test1.swift,Snapshots,Build + +# format options + +--allman false +--binarygrouping 4,8 +--commas always +--comments indent +--decimalgrouping 3,6 +--elseposition same-line +--empty void +--exponentcase lowercase +--exponentgrouping disabled +--fractiongrouping disabled +--header ignore +--hexgrouping 4,8 +--hexliteralcase uppercase +--ifdef indent +--indent 4 +--indentcase false +--importgrouping testable-bottom +--linebreaks lf +--maxwidth none +--octalgrouping 4,8 +--operatorfunc spaced +--patternlet hoist +--ranges spaced +--self remove +--semicolons inline +--stripunusedargs always +--swiftversion 5.4 +--trimwhitespace always +--wraparguments preserve +--wrapcollections preserve + +# rules + +--enable isEmpty diff --git a/Sources/Passage/generated/Cartfile b/Sources/Passage/generated/Cartfile new file mode 100644 index 0000000..92bac17 --- /dev/null +++ b/Sources/Passage/generated/Cartfile @@ -0,0 +1 @@ +github "Flight-School/AnyCodable" ~> 0.6 diff --git a/Sources/Passage/generated/OpenAPIClient.podspec b/Sources/Passage/generated/OpenAPIClient.podspec new file mode 100644 index 0000000..3fd28f1 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = 'OpenAPIClient' + s.ios.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '11.0' + s.watchos.deployment_target = '4.0' + s.version = '1' + s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1' } + s.authors = 'OpenAPI Generator' + s.license = 'Proprietary' + s.homepage = 'https://github.com/OpenAPITools/openapi-generator' + s.summary = 'OpenAPIClient Swift SDK' + s.source_files = 'OpenAPIClient/Classes/**/*.swift' + s.dependency 'AnyCodable-FlightSchool', '~> 0.6' +end diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIHelper.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 0000000..93c5c76 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,119 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + let destination = source.reduce(into: [String: Any]()) { result, item in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + return source.reduce(into: [String: String]()) { result, item in + if let collection = item.value as? [Any?] { + result[item.key] = collection + .compactMap { value in convertAnyToString(value) } + .joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = convertAnyToString(value) + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any]()) { result, item in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + } + } + + public static func convertAnyToString(_ value: Any?) -> String? { + guard let value = value else { return nil } + if let value = value as? any RawRepresentable { + return "\(value.rawValue)" + } else { + return "\(value)" + } + } + + public static func mapValueToPathItem(_ source: Any) -> Any { + if let collection = source as? [Any?] { + return collection + .compactMap { value in convertAnyToString(value) } + .joined(separator: ",") + } + return source + } + + /// maps all values from source to query parameters + /// + /// explode attribute is respected: collection values might be either joined or split up into separate key value pairs + public static func mapValuesToQueryItems(_ source: [String: (wrappedValue: Any?, isExplode: Bool)]) -> [URLQueryItem]? { + let destination = source.filter { $0.value.wrappedValue != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value.wrappedValue as? [Any?] { + + let collectionValues: [String] = collection.compactMap { value in convertAnyToString(value) } + + if !item.value.isExplode { + result.append(URLQueryItem(name: item.key, value: collectionValues.joined(separator: ","))) + } else { + collectionValues + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + } + + } else if let value = item.value.wrappedValue { + result.append(URLQueryItem(name: item.key, value: convertAnyToString(value))) + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + /// maps all values from source to query parameters + /// + /// collection values are always exploded + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value as? [Any?] { + collection + .compactMap { value in convertAnyToString(value) } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: convertAnyToString(value))) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 0000000..5dbaad1 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,93 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif +open class OpenAPIClientAPI { + public static var basePath = "https://auth.passage.id/v1" + public static var customHeaders: [String: String] = [:] + public static var credential: URLCredential? + public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + public static var apiResponseQueue: DispatchQueue = .main +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let method: String + public let URLString: String + public let requestTask: RequestTask = RequestTask() + public let requiresAuthentication: Bool + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.headers = headers + self.requiresAuthentication = requiresAuthentication + + addHeaders(OpenAPIClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask + } + + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @discardableResult + open func execute() async throws -> Response { + return try await withTaskCancellationHandler { + try Task.checkCancellation() + return try await withCheckedThrowingContinuation { continuation in + guard !Task.isCancelled else { + continuation.resume(throwing: CancellationError()) + return + } + + self.execute { result in + switch result { + case let .success(response): + continuation.resume(returning: response) + case let .failure(error): + continuation.resume(throwing: error) + } + } + } + } onCancel: { + self.requestTask.cancel() + } + } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + credential = OpenAPIClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AppsAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AppsAPI.swift new file mode 100644 index 0000000..b06e30e --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AppsAPI.swift @@ -0,0 +1,53 @@ +// +// AppsAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class AppsAPI { + + /** + Get App + + - parameter appId: (path) App ID + - returns: GetAppResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getApp(appId: String) async throws -> GetAppResponse { + return try await getAppWithRequestBuilder(appId: appId).execute().body + } + + /** + Get App + - GET /apps/{app_id} + - Get information about an application. + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getAppWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AuthenticateAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AuthenticateAPI.swift new file mode 100644 index 0000000..b6160aa --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/AuthenticateAPI.swift @@ -0,0 +1,96 @@ +// +// AuthenticateAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class AuthenticateAPI { + + /** + Finish WebAuthn authentication with an optional transaction + + - parameter appId: (path) App ID + - parameter authenticateWebAuthnFinishWithTransactionRequest: (body) + - returns: Nonce + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func authenticateWebauthnFinishWithTransaction(appId: String, authenticateWebAuthnFinishWithTransactionRequest: AuthenticateWebAuthnFinishWithTransactionRequest) async throws -> Nonce { + return try await authenticateWebauthnFinishWithTransactionWithRequestBuilder(appId: appId, authenticateWebAuthnFinishWithTransactionRequest: authenticateWebAuthnFinishWithTransactionRequest).execute().body + } + + /** + Finish WebAuthn authentication with an optional transaction + - POST /apps/{app_id}/authenticate/transactions/webauthn/finish + - Complete a WebAuthn authentication and authenticate the user via a transaction. This endpoint accepts and verifies the response from `navigator.credential.get()` and returns a nonce meant to be exchanged for an authentication token for the user. + - parameter appId: (path) App ID + - parameter authenticateWebAuthnFinishWithTransactionRequest: (body) + - returns: RequestBuilder + */ + open class func authenticateWebauthnFinishWithTransactionWithRequestBuilder(appId: String, authenticateWebAuthnFinishWithTransactionRequest: AuthenticateWebAuthnFinishWithTransactionRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/authenticate/transactions/webauthn/finish" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: authenticateWebAuthnFinishWithTransactionRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Start WebAuthn authentication with an optional transaction + + - parameter appId: (path) App ID + - parameter authenticateWebAuthnStartWithTransactionRequest: (body) (optional) + - returns: AuthenticateWebAuthnStartWithTransactionResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func authenticateWebauthnStartWithTransaction(appId: String, authenticateWebAuthnStartWithTransactionRequest: AuthenticateWebAuthnStartWithTransactionRequest? = nil) async throws -> AuthenticateWebAuthnStartWithTransactionResponse { + return try await authenticateWebauthnStartWithTransactionWithRequestBuilder(appId: appId, authenticateWebAuthnStartWithTransactionRequest: authenticateWebAuthnStartWithTransactionRequest).execute().body + } + + /** + Start WebAuthn authentication with an optional transaction + - POST /apps/{app_id}/authenticate/transactions/webauthn/start + - Initiate a WebAuthn authentication for a user via a transaction. This endpoint creates a WebAuthn credential assertion challenge that is used to perform the authentication ceremony from the browser. + - parameter appId: (path) App ID + - parameter authenticateWebAuthnStartWithTransactionRequest: (body) (optional) + - returns: RequestBuilder + */ + open class func authenticateWebauthnStartWithTransactionWithRequestBuilder(appId: String, authenticateWebAuthnStartWithTransactionRequest: AuthenticateWebAuthnStartWithTransactionRequest? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/authenticate/transactions/webauthn/start" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: authenticateWebAuthnStartWithTransactionRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/CurrentuserAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/CurrentuserAPI.swift new file mode 100644 index 0000000..2384782 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/CurrentuserAPI.swift @@ -0,0 +1,554 @@ +// +// CurrentuserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class CurrentuserAPI { + + /** + Revoke Device + + - parameter appId: (path) App ID + - parameter deviceId: (path) Device ID + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func deleteCurrentuserDevice(appId: String, deviceId: String) async throws { + return try await deleteCurrentuserDeviceWithRequestBuilder(appId: appId, deviceId: deviceId).execute().body + } + + /** + Revoke Device + - DELETE /apps/{app_id}/currentuser/devices/{device_id} + - Revoke a device by ID for the current user. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter deviceId: (path) Device ID + - returns: RequestBuilder + */ + open class func deleteCurrentuserDeviceWithRequestBuilder(appId: String, deviceId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/devices/{device_id}" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let deviceIdPreEscape = "\(APIHelper.mapValueToPathItem(deviceId))" + let deviceIdPostEscape = deviceIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{device_id}", with: deviceIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + * enum for parameter socialConnectionType + */ + public enum SocialConnectionType_deleteCurrentuserSocialConnection: String, CaseIterable { + case apple = "apple" + case github = "github" + case google = "google" + } + + /** + Delete Social Connection + + - parameter appId: (path) App ID + - parameter socialConnectionType: (path) The type of social connection + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func deleteCurrentuserSocialConnection(appId: String, socialConnectionType: SocialConnectionType_deleteCurrentuserSocialConnection) async throws { + return try await deleteCurrentuserSocialConnectionWithRequestBuilder(appId: appId, socialConnectionType: socialConnectionType).execute().body + } + + /** + Delete Social Connection + - DELETE /apps/{app_id}/currentuser/social-connections/{social_connection_type} + - Deletes a social connection for the current user. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter socialConnectionType: (path) The type of social connection + - returns: RequestBuilder + */ + open class func deleteCurrentuserSocialConnectionWithRequestBuilder(appId: String, socialConnectionType: SocialConnectionType_deleteCurrentuserSocialConnection) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/social-connections/{social_connection_type}" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let socialConnectionTypePreEscape = "\(socialConnectionType.rawValue)" + let socialConnectionTypePostEscape = socialConnectionTypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{social_connection_type}", with: socialConnectionTypePostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Get Current User + + - parameter appId: (path) App ID + - returns: CurrentUserResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getCurrentuser(appId: String) async throws -> CurrentUserResponse { + return try await getCurrentuserWithRequestBuilder(appId: appId).execute().body + } + + /** + Get Current User + - GET /apps/{app_id}/currentuser + - Get information about a user that is currently authenticated via bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getCurrentuserWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + List Devices + + - parameter appId: (path) App ID + - returns: CurrentUserDevices + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getCurrentuserDevices(appId: String) async throws -> CurrentUserDevices { + return try await getCurrentuserDevicesWithRequestBuilder(appId: appId).execute().body + } + + /** + List Devices + - GET /apps/{app_id}/currentuser/devices + - List all WebAuthn devices for the authenticated user. User must be authenticated via bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getCurrentuserDevicesWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/devices" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Get user's metadata + + - parameter appId: (path) App ID + - returns: UserMetadataResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getCurrentuserMetadata(appId: String) async throws -> UserMetadataResponse { + return try await getCurrentuserMetadataWithRequestBuilder(appId: appId).execute().body + } + + /** + Get user's metadata + - GET /apps/{app_id}/currentuser/user-metadata + - Get the user-metadata for the current user. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getCurrentuserMetadataWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/user-metadata" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Get Social Connections + + - parameter appId: (path) App ID + - returns: SocialConnectionsResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getCurrentuserSocialConnections(appId: String) async throws -> SocialConnectionsResponse { + return try await getCurrentuserSocialConnectionsWithRequestBuilder(appId: appId).execute().body + } + + /** + Get Social Connections + - GET /apps/{app_id}/currentuser/social-connections + - Gets social connections for the current user. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getCurrentuserSocialConnectionsWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/social-connections" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Finish WebAuthn Add Device + + - parameter appId: (path) App ID + - parameter addDeviceFinishRequest: (body) WebAuthn Response Data + - returns: CurrentUserDevice + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func postCurrentuserAddDeviceFinish(appId: String, addDeviceFinishRequest: AddDeviceFinishRequest) async throws -> CurrentUserDevice { + return try await postCurrentuserAddDeviceFinishWithRequestBuilder(appId: appId, addDeviceFinishRequest: addDeviceFinishRequest).execute().body + } + + /** + Finish WebAuthn Add Device + - POST /apps/{app_id}/currentuser/devices/finish + - Complete a WebAuthn add device operation for the current user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns the created device for the user. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter addDeviceFinishRequest: (body) WebAuthn Response Data + - returns: RequestBuilder + */ + open class func postCurrentuserAddDeviceFinishWithRequestBuilder(appId: String, addDeviceFinishRequest: AddDeviceFinishRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/devices/finish" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: addDeviceFinishRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Start WebAuthn Add Device + + - parameter appId: (path) App ID + - parameter currentUserDevicesStartRequest: (body) WebAuthn Start Response Data (optional) + - returns: AddDeviceStartResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func postCurrentuserAddDeviceStart(appId: String, currentUserDevicesStartRequest: CurrentUserDevicesStartRequest? = nil) async throws -> AddDeviceStartResponse { + return try await postCurrentuserAddDeviceStartWithRequestBuilder(appId: appId, currentUserDevicesStartRequest: currentUserDevicesStartRequest).execute().body + } + + /** + Start WebAuthn Add Device + - POST /apps/{app_id}/currentuser/devices/start + - Initiate a WebAuthn add device operation for the current user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter currentUserDevicesStartRequest: (body) WebAuthn Start Response Data (optional) + - returns: RequestBuilder + */ + open class func postCurrentuserAddDeviceStartWithRequestBuilder(appId: String, currentUserDevicesStartRequest: CurrentUserDevicesStartRequest? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/devices/start" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: currentUserDevicesStartRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Update Device + + - parameter appId: (path) App ID + - parameter deviceId: (path) Device ID + - parameter updateDeviceRequest: (body) Friendly Name + - returns: CurrentUserDevice + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func updateCurrentuserDevice(appId: String, deviceId: String, updateDeviceRequest: UpdateDeviceRequest) async throws -> CurrentUserDevice { + return try await updateCurrentuserDeviceWithRequestBuilder(appId: appId, deviceId: deviceId, updateDeviceRequest: updateDeviceRequest).execute().body + } + + /** + Update Device + - PATCH /apps/{app_id}/currentuser/devices/{device_id} + - Update a device by ID for the current user. Currently the only field that can be updated is the friendly name. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter deviceId: (path) Device ID + - parameter updateDeviceRequest: (body) Friendly Name + - returns: RequestBuilder + */ + open class func updateCurrentuserDeviceWithRequestBuilder(appId: String, deviceId: String, updateDeviceRequest: UpdateDeviceRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/devices/{device_id}" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let deviceIdPreEscape = "\(APIHelper.mapValueToPathItem(deviceId))" + let deviceIdPostEscape = deviceIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{device_id}", with: deviceIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateDeviceRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Update user's metadata + + - parameter appId: (path) App ID + - parameter updateMetadataRequest: (body) User Metadata + - returns: CurrentUserResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func updateCurrentuserMetadata(appId: String, updateMetadataRequest: UpdateMetadataRequest) async throws -> CurrentUserResponse { + return try await updateCurrentuserMetadataWithRequestBuilder(appId: appId, updateMetadataRequest: updateMetadataRequest).execute().body + } + + /** + Update user's metadata + - PATCH /apps/{app_id}/currentuser/user-metadata + - Update the metadata for the current user. Only valid metadata fields are accepted. Invalid metadata fields that are present will abort the update. User must be authenticated via a bearer token. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter updateMetadataRequest: (body) User Metadata + - returns: RequestBuilder + */ + open class func updateCurrentuserMetadataWithRequestBuilder(appId: String, updateMetadataRequest: UpdateMetadataRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/user-metadata" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateMetadataRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Change Email + + - parameter appId: (path) App ID + - parameter updateUserEmailRequest: (body) email + - returns: MagicLinkResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func updateEmailCurrentuser(appId: String, updateUserEmailRequest: UpdateUserEmailRequest) async throws -> MagicLinkResponse { + return try await updateEmailCurrentuserWithRequestBuilder(appId: appId, updateUserEmailRequest: updateUserEmailRequest).execute().body + } + + /** + Change Email + - PATCH /apps/{app_id}/currentuser/email + - Initiate an email change for the authenticated user. An email change requires verification, so an email will be sent to the user which they must verify before the email change takes effect. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter updateUserEmailRequest: (body) email + - returns: RequestBuilder + */ + open class func updateEmailCurrentuserWithRequestBuilder(appId: String, updateUserEmailRequest: UpdateUserEmailRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/email" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateUserEmailRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Change Phone + + - parameter appId: (path) App ID + - parameter updateUserPhoneRequest: (body) phone + - returns: MagicLinkResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func updatePhoneCurrentuser(appId: String, updateUserPhoneRequest: UpdateUserPhoneRequest) async throws -> MagicLinkResponse { + return try await updatePhoneCurrentuserWithRequestBuilder(appId: appId, updateUserPhoneRequest: updateUserPhoneRequest).execute().body + } + + /** + Change Phone + - PATCH /apps/{app_id}/currentuser/phone + - Initiate a phone number change for the authenticated user. An phone number change requires verification, so an SMS with a link will be sent to the user which they must verify before the phone number change takes effect. + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter updateUserPhoneRequest: (body) phone + - returns: RequestBuilder + */ + open class func updatePhoneCurrentuserWithRequestBuilder(appId: String, updateUserPhoneRequest: UpdateUserPhoneRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/phone" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: updateUserPhoneRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/JWKSAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/JWKSAPI.swift new file mode 100644 index 0000000..fe9f125 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/JWKSAPI.swift @@ -0,0 +1,53 @@ +// +// JWKSAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class JWKSAPI { + + /** + Get JWKS + + - parameter appId: (path) App ID + - returns: JWKResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getJwks(appId: String) async throws -> JWKResponse { + return try await getJwksWithRequestBuilder(appId: appId).execute().body + } + + /** + Get JWKS + - GET /apps/{app_id}/.well-known/jwks.json + - Get JWKS for an app. KIDs in the JWT can be used to match the appropriate JWK, and use the JWK's public key to verify the JWT. + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getJwksWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/.well-known/jwks.json" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/LoginAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/LoginAPI.swift new file mode 100644 index 0000000..22ab096 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/LoginAPI.swift @@ -0,0 +1,178 @@ +// +// LoginAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class LoginAPI { + + /** + Login with Magic Link + + - parameter appId: (path) App ID + - parameter loginMagicLinkRequest: (body) User Data + - returns: LoginMagicLinkResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func loginMagicLink(appId: String, loginMagicLinkRequest: LoginMagicLinkRequest) async throws -> LoginMagicLinkResponse { + return try await loginMagicLinkWithRequestBuilder(appId: appId, loginMagicLinkRequest: loginMagicLinkRequest).execute().body + } + + /** + Login with Magic Link + - POST /apps/{app_id}/login/magic-link + - Send a login email or SMS to the user. The user will receive an email or text with a link to complete their login. + - parameter appId: (path) App ID + - parameter loginMagicLinkRequest: (body) User Data + - returns: RequestBuilder + */ + open class func loginMagicLinkWithRequestBuilder(appId: String, loginMagicLinkRequest: LoginMagicLinkRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/login/magic-link" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: loginMagicLinkRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Login with OTP + + - parameter appId: (path) App ID + - parameter loginOneTimePasscodeRequest: (body) User Data + - returns: OneTimePasscodeResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func loginOneTimePasscode(appId: String, loginOneTimePasscodeRequest: LoginOneTimePasscodeRequest) async throws -> OneTimePasscodeResponse { + return try await loginOneTimePasscodeWithRequestBuilder(appId: appId, loginOneTimePasscodeRequest: loginOneTimePasscodeRequest).execute().body + } + + /** + Login with OTP + - POST /apps/{app_id}/login/otp + - Send a login email or SMS to the user. The user will receive an email or text with a one-time passcode to complete their login. + - parameter appId: (path) App ID + - parameter loginOneTimePasscodeRequest: (body) User Data + - returns: RequestBuilder + */ + open class func loginOneTimePasscodeWithRequestBuilder(appId: String, loginOneTimePasscodeRequest: LoginOneTimePasscodeRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/login/otp" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: loginOneTimePasscodeRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Finish WebAuthn Login + + - parameter appId: (path) App ID + - parameter loginWebAuthnFinishRequest: (body) User Data + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func loginWebauthnFinish(appId: String, loginWebAuthnFinishRequest: LoginWebAuthnFinishRequest) async throws -> AuthResponse { + return try await loginWebauthnFinishWithRequestBuilder(appId: appId, loginWebAuthnFinishRequest: loginWebAuthnFinishRequest).execute().body + } + + /** + Finish WebAuthn Login + - POST /apps/{app_id}/login/webauthn/finish + - Complete a WebAuthn login and authenticate the user. This endpoint accepts and verifies the response from `navigator.credential.get()` and returns an authentication token for the user. + - parameter appId: (path) App ID + - parameter loginWebAuthnFinishRequest: (body) User Data + - returns: RequestBuilder + */ + open class func loginWebauthnFinishWithRequestBuilder(appId: String, loginWebAuthnFinishRequest: LoginWebAuthnFinishRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/login/webauthn/finish" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: loginWebAuthnFinishRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Start WebAuthn Login + + - parameter appId: (path) App ID + - parameter loginWebAuthnStartRequest: (body) User Data (optional) + - returns: LoginWebAuthnStartResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func loginWebauthnStart(appId: String, loginWebAuthnStartRequest: LoginWebAuthnStartRequest? = nil) async throws -> LoginWebAuthnStartResponse { + return try await loginWebauthnStartWithRequestBuilder(appId: appId, loginWebAuthnStartRequest: loginWebAuthnStartRequest).execute().body + } + + /** + Start WebAuthn Login + - POST /apps/{app_id}/login/webauthn/start + - Initiate a WebAuthn login for a user. This endpoint creates a WebAuthn credential assertion challenge that is used to perform the login ceremony from the browser. + - parameter appId: (path) App ID + - parameter loginWebAuthnStartRequest: (body) User Data (optional) + - returns: RequestBuilder + */ + open class func loginWebauthnStartWithRequestBuilder(appId: String, loginWebAuthnStartRequest: LoginWebAuthnStartRequest? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/login/webauthn/start" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: loginWebAuthnStartRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/MagicLinkAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/MagicLinkAPI.swift new file mode 100644 index 0000000..d201a3c --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/MagicLinkAPI.swift @@ -0,0 +1,96 @@ +// +// MagicLinkAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class MagicLinkAPI { + + /** + Authenticate Magic Link + + - parameter appId: (path) App ID + - parameter activateMagicLinkRequest: (body) User Data + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func activateMagicLink(appId: String, activateMagicLinkRequest: ActivateMagicLinkRequest) async throws -> AuthResponse { + return try await activateMagicLinkWithRequestBuilder(appId: appId, activateMagicLinkRequest: activateMagicLinkRequest).execute().body + } + + /** + Authenticate Magic Link + - PATCH /apps/{app_id}/magic-link/activate + - Authenticate a magic link for a user. This endpoint checks that the magic link is valid, then returns an authentication token for the user. + - parameter appId: (path) App ID + - parameter activateMagicLinkRequest: (body) User Data + - returns: RequestBuilder + */ + open class func activateMagicLinkWithRequestBuilder(appId: String, activateMagicLinkRequest: ActivateMagicLinkRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/magic-link/activate" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: activateMagicLinkRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Magic Link Status + + - parameter appId: (path) App ID + - parameter getMagicLinkStatusRequest: (body) Magic Link ID + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func magicLinkStatus(appId: String, getMagicLinkStatusRequest: GetMagicLinkStatusRequest) async throws -> AuthResponse { + return try await magicLinkStatusWithRequestBuilder(appId: appId, getMagicLinkStatusRequest: getMagicLinkStatusRequest).execute().body + } + + /** + Magic Link Status + - POST /apps/{app_id}/magic-link/status + - Check if a magic link has been activated yet or not. Once the magic link has been activated, this endpoint will return an authentication token for the user. This endpoint can be used to initiate a login on one device and then poll and wait for the login to complete on another device. + - parameter appId: (path) App ID + - parameter getMagicLinkStatusRequest: (body) Magic Link ID + - returns: RequestBuilder + */ + open class func magicLinkStatusWithRequestBuilder(appId: String, getMagicLinkStatusRequest: GetMagicLinkStatusRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/magic-link/status" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getMagicLinkStatusRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OAuth2API.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OAuth2API.swift new file mode 100644 index 0000000..802433f --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OAuth2API.swift @@ -0,0 +1,470 @@ +// +// OAuth2API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class OAuth2API { + + /** + * enum for parameter error + */ + public enum ModelError_appleOauth2Callback: String, CaseIterable { + case userCancelledAuthorize = "user_cancelled_authorize" + } + + /** + Handle Apple's OAuth2 callback + + - parameter appId: (path) App ID + - parameter state: (form) The state contained in the authorization request. + - parameter code: (form) A single-use authorization grant code that’s valid for five minutes. (optional) + - parameter idToken: (form) A JWT containing the user’s identity information. (optional) + - parameter user: (form) A JSON string containing the data requested in the scope property. (optional) + - parameter error: (form) The error returned by Apple. (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func appleOauth2Callback(appId: String, state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2Callback? = nil) async throws { + return try await appleOauth2CallbackWithRequestBuilder(appId: appId, state: state, code: code, idToken: idToken, user: user, error: error).execute().body + } + + /** + Handle Apple's OAuth2 callback + - POST /apps/{app_id}/social/oauth2_callback + - parameter appId: (path) App ID + - parameter state: (form) The state contained in the authorization request. + - parameter code: (form) A single-use authorization grant code that’s valid for five minutes. (optional) + - parameter idToken: (form) A JWT containing the user’s identity information. (optional) + - parameter user: (form) A JSON string containing the data requested in the scope property. (optional) + - parameter error: (form) The error returned by Apple. (optional) + - returns: RequestBuilder + */ + open class func appleOauth2CallbackWithRequestBuilder(appId: String, state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2Callback? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/social/oauth2_callback" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "code": code?.encodeToJSON(), + "id_token": idToken?.encodeToJSON(), + "state": state.encodeToJSON(), + "user": user?.encodeToJSON(), + "error": error?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + * enum for parameter error + */ + public enum ModelError_appleOauth2CallbackDefaultDev: String, CaseIterable { + case userCancelledAuthorize = "user_cancelled_authorize" + } + + /** + Handle Apple's OAuth2 callback for the default developer credentials + + - parameter state: (form) The state contained in the authorization request. + - parameter code: (form) A single-use authorization grant code that’s valid for five minutes. (optional) + - parameter idToken: (form) A JWT containing the user’s identity information. (optional) + - parameter user: (form) A JSON string containing the data requested in the scope property. (optional) + - parameter error: (form) The error returned by Apple. (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func appleOauth2CallbackDefaultDev(state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2CallbackDefaultDev? = nil) async throws { + return try await appleOauth2CallbackDefaultDevWithRequestBuilder(state: state, code: code, idToken: idToken, user: user, error: error).execute().body + } + + /** + Handle Apple's OAuth2 callback for the default developer credentials + - POST /social/oauth2_callback + - parameter state: (form) The state contained in the authorization request. + - parameter code: (form) A single-use authorization grant code that’s valid for five minutes. (optional) + - parameter idToken: (form) A JWT containing the user’s identity information. (optional) + - parameter user: (form) A JSON string containing the data requested in the scope property. (optional) + - parameter error: (form) The error returned by Apple. (optional) + - returns: RequestBuilder + */ + open class func appleOauth2CallbackDefaultDevWithRequestBuilder(state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2CallbackDefaultDev? = nil) -> RequestBuilder { + let localVariablePath = "/social/oauth2_callback" + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "code": code?.encodeToJSON(), + "id_token": idToken?.encodeToJSON(), + "state": state.encodeToJSON(), + "user": user?.encodeToJSON(), + "error": error?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Link an existing account to an OAuth2 connection. + + - parameter appId: (path) App ID + - parameter code: (query) The code given from the OAuth2 redirect + - parameter verifier: (query) The verifier the client originally sent to the OAuth2 provider + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func currentuserSocialLinkAccount(appId: String, code: String, verifier: String) async throws { + return try await currentuserSocialLinkAccountWithRequestBuilder(appId: appId, code: code, verifier: verifier).execute().body + } + + /** + Link an existing account to an OAuth2 connection. + - GET /apps/{app_id}/currentuser/social/link_account + - Bearer Token: + - type: http + - name: bearerAuth + - parameter appId: (path) App ID + - parameter code: (query) The code given from the OAuth2 redirect + - parameter verifier: (query) The verifier the client originally sent to the OAuth2 provider + - returns: RequestBuilder + */ + open class func currentuserSocialLinkAccountWithRequestBuilder(appId: String, code: String, verifier: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/currentuser/social/link_account" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "code": (wrappedValue: code.encodeToJSON(), isExplode: true), + "verifier": (wrappedValue: verifier.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } + + /** + Exchange native mobile identity token for an auth token. + + - parameter appId: (path) App ID + - parameter idTokenRequest: (body) + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func exchangeSocialIdToken(appId: String, idTokenRequest: IdTokenRequest) async throws -> AuthResponse { + return try await exchangeSocialIdTokenWithRequestBuilder(appId: appId, idTokenRequest: idTokenRequest).execute().body + } + + /** + Exchange native mobile identity token for an auth token. + - POST /apps/{app_id}/social/id_token + - parameter appId: (path) App ID + - parameter idTokenRequest: (body) + - returns: RequestBuilder + */ + open class func exchangeSocialIdTokenWithRequestBuilder(appId: String, idTokenRequest: IdTokenRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/social/id_token" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: idTokenRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Exchange OAuth2 connection data for an auth token. + + - parameter appId: (path) App ID + - parameter code: (query) The code given from the OAuth2 redirect + - parameter verifier: (query) The verifier the client originally sent to the OAuth2 provider + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func exchangeSocialToken(appId: String, code: String, verifier: String) async throws -> AuthResponse { + return try await exchangeSocialTokenWithRequestBuilder(appId: appId, code: code, verifier: verifier).execute().body + } + + /** + Exchange OAuth2 connection data for an auth token. + - GET /apps/{app_id}/social/token + - parameter appId: (path) App ID + - parameter code: (query) The code given from the OAuth2 redirect + - parameter verifier: (query) The verifier the client originally sent to the OAuth2 provider + - returns: RequestBuilder + */ + open class func exchangeSocialTokenWithRequestBuilder(appId: String, code: String, verifier: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/social/token" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "code": (wrappedValue: code.encodeToJSON(), isExplode: true), + "verifier": (wrappedValue: verifier.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + * enum for parameter connectionType + */ + public enum ConnectionType_getAuthorize: String, CaseIterable { + case apple = "apple" + case github = "github" + case google = "google" + case passage = "passage" + } + + /** + Kick off OAuth2 flow + + - parameter appId: (path) App ID + - parameter redirectUri: (query) The URL to redirect to after the OAuth2 flow is complete. + - parameter codeChallenge: (query) Code challenge. + - parameter codeChallengeMethod: (query) Code challenge method. + - parameter connectionType: (query) connection type; google, github, apple, or passage to login with + - parameter state: (query) The state to pass through to the redirect URI. (optional) + - parameter loginHint: (query) Hint to the Authorization Server about the login identifier the end-user might use to log in. (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getAuthorize(appId: String, redirectUri: String, codeChallenge: String, codeChallengeMethod: String, connectionType: ConnectionType_getAuthorize, state: String? = nil, loginHint: String? = nil) async throws { + return try await getAuthorizeWithRequestBuilder(appId: appId, redirectUri: redirectUri, codeChallenge: codeChallenge, codeChallengeMethod: codeChallengeMethod, connectionType: connectionType, state: state, loginHint: loginHint).execute().body + } + + /** + Kick off OAuth2 flow + - GET /apps/{app_id}/social/authorize + - Kick off OAuth2 flow with connection provider request params described in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest + - parameter appId: (path) App ID + - parameter redirectUri: (query) The URL to redirect to after the OAuth2 flow is complete. + - parameter codeChallenge: (query) Code challenge. + - parameter codeChallengeMethod: (query) Code challenge method. + - parameter connectionType: (query) connection type; google, github, apple, or passage to login with + - parameter state: (query) The state to pass through to the redirect URI. (optional) + - parameter loginHint: (query) Hint to the Authorization Server about the login identifier the end-user might use to log in. (optional) + - returns: RequestBuilder + */ + open class func getAuthorizeWithRequestBuilder(appId: String, redirectUri: String, codeChallenge: String, codeChallengeMethod: String, connectionType: ConnectionType_getAuthorize, state: String? = nil, loginHint: String? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/social/authorize" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "redirect_uri": (wrappedValue: redirectUri.encodeToJSON(), isExplode: true), + "state": (wrappedValue: state?.encodeToJSON(), isExplode: true), + "login_hint": (wrappedValue: loginHint?.encodeToJSON(), isExplode: true), + "code_challenge": (wrappedValue: codeChallenge.encodeToJSON(), isExplode: true), + "code_challenge_method": (wrappedValue: codeChallengeMethod.encodeToJSON(), isExplode: true), + "connection_type": (wrappedValue: connectionType.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + * enum for parameter error + */ + public enum ModelError_oauth2Callback: String, CaseIterable { + case interactionRequired = "interaction_required" + case loginRequired = "login_required" + case accountSelectionRequired = "account_selection_required" + case consentRequired = "consent_required" + case invalidRequestUri = "invalid_request_uri" + case invalidRequestObject = "invalid_request_object" + case requestNotSupported = "request_not_supported" + case requestUriNotSupported = "request_uri_not_supported" + case registrationNotSupported = "registration_not_supported" + } + + /** + Handle OAuth2 callback + + - parameter appId: (path) App ID + - parameter code: (query) The authorization code returned by the OAuth2 provider. + - parameter state: (query) The state returned by the OAuth2 provider. (optional) + - parameter error: (query) The error returned by the OAuth2 provider. (optional) + - parameter errorDescription: (query) The error description returned by the OAuth2 provider. (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func oauth2Callback(appId: String, code: String, state: String? = nil, error: ModelError_oauth2Callback? = nil, errorDescription: String? = nil) async throws { + return try await oauth2CallbackWithRequestBuilder(appId: appId, code: code, state: state, error: error, errorDescription: errorDescription).execute().body + } + + /** + Handle OAuth2 callback + - GET /apps/{app_id}/social/oauth2_callback + - parameter appId: (path) App ID + - parameter code: (query) The authorization code returned by the OAuth2 provider. + - parameter state: (query) The state returned by the OAuth2 provider. (optional) + - parameter error: (query) The error returned by the OAuth2 provider. (optional) + - parameter errorDescription: (query) The error description returned by the OAuth2 provider. (optional) + - returns: RequestBuilder + */ + open class func oauth2CallbackWithRequestBuilder(appId: String, code: String, state: String? = nil, error: ModelError_oauth2Callback? = nil, errorDescription: String? = nil) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/social/oauth2_callback" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "code": (wrappedValue: code.encodeToJSON(), isExplode: true), + "state": (wrappedValue: state?.encodeToJSON(), isExplode: true), + "error": (wrappedValue: error?.encodeToJSON(), isExplode: true), + "error_description": (wrappedValue: errorDescription?.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + * enum for parameter error + */ + public enum ModelError_oauth2CallbackDefaultDev: String, CaseIterable { + case interactionRequired = "interaction_required" + case loginRequired = "login_required" + case accountSelectionRequired = "account_selection_required" + case consentRequired = "consent_required" + case invalidRequestUri = "invalid_request_uri" + case invalidRequestObject = "invalid_request_object" + case requestNotSupported = "request_not_supported" + case requestUriNotSupported = "request_uri_not_supported" + case registrationNotSupported = "registration_not_supported" + } + + /** + Handle OAuth2 callback for the default developer credentials + + - parameter code: (query) The authorization code returned by the OAuth2 provider. + - parameter state: (query) The state returned by the OAuth2 provider. (optional) + - parameter error: (query) The error returned by the OAuth2 provider. (optional) + - parameter errorDescription: (query) The error description returned by the OAuth2 provider. (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func oauth2CallbackDefaultDev(code: String, state: String? = nil, error: ModelError_oauth2CallbackDefaultDev? = nil, errorDescription: String? = nil) async throws { + return try await oauth2CallbackDefaultDevWithRequestBuilder(code: code, state: state, error: error, errorDescription: errorDescription).execute().body + } + + /** + Handle OAuth2 callback for the default developer credentials + - GET /social/oauth2_callback + - parameter code: (query) The authorization code returned by the OAuth2 provider. + - parameter state: (query) The state returned by the OAuth2 provider. (optional) + - parameter error: (query) The error returned by the OAuth2 provider. (optional) + - parameter errorDescription: (query) The error description returned by the OAuth2 provider. (optional) + - returns: RequestBuilder + */ + open class func oauth2CallbackDefaultDevWithRequestBuilder(code: String, state: String? = nil, error: ModelError_oauth2CallbackDefaultDev? = nil, errorDescription: String? = nil) -> RequestBuilder { + let localVariablePath = "/social/oauth2_callback" + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "code": (wrappedValue: code.encodeToJSON(), isExplode: true), + "state": (wrappedValue: state?.encodeToJSON(), isExplode: true), + "error": (wrappedValue: error?.encodeToJSON(), isExplode: true), + "error_description": (wrappedValue: errorDescription?.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OTPAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OTPAPI.swift new file mode 100644 index 0000000..1f71d84 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OTPAPI.swift @@ -0,0 +1,55 @@ +// +// OTPAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class OTPAPI { + + /** + Authenticate OTP + + - parameter appId: (path) App ID + - parameter activateOneTimePasscodeRequest: (body) User Data + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func activateOneTimePasscode(appId: String, activateOneTimePasscodeRequest: ActivateOneTimePasscodeRequest) async throws -> AuthResponse { + return try await activateOneTimePasscodeWithRequestBuilder(appId: appId, activateOneTimePasscodeRequest: activateOneTimePasscodeRequest).execute().body + } + + /** + Authenticate OTP + - POST /apps/{app_id}/otp/activate + - Authenticate a one-time passcode for a user. This endpoint checks that the one-time passcode is valid, then returns an authentication token for the user. + - parameter appId: (path) App ID + - parameter activateOneTimePasscodeRequest: (body) User Data + - returns: RequestBuilder + */ + open class func activateOneTimePasscodeWithRequestBuilder(appId: String, activateOneTimePasscodeRequest: ActivateOneTimePasscodeRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/otp/activate" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: activateOneTimePasscodeRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OpenIDAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OpenIDAPI.swift new file mode 100644 index 0000000..0bb99f2 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/OpenIDAPI.swift @@ -0,0 +1,53 @@ +// +// OpenIDAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class OpenIDAPI { + + /** + Get OpenID Configuration + + - parameter appId: (path) App ID + - returns: OpenIdConfiguration + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func getOpenIdConfiguration(appId: String) async throws -> OpenIdConfiguration { + return try await getOpenIdConfigurationWithRequestBuilder(appId: appId).execute().body + } + + /** + Get OpenID Configuration + - GET /apps/{app_id}/.well-known/openid-configuration + - Get OpenID Configuration for an app. + - parameter appId: (path) App ID + - returns: RequestBuilder + */ + open class func getOpenIdConfigurationWithRequestBuilder(appId: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/.well-known/openid-configuration" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/PasskeyReadinessAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/PasskeyReadinessAPI.swift new file mode 100644 index 0000000..60267b3 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/PasskeyReadinessAPI.swift @@ -0,0 +1,68 @@ +// +// PasskeyReadinessAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class PasskeyReadinessAPI { + + /** + Create Passkey Readiness Analytics + + - parameter createPasskeyReadinessRequest: (body) Passkey readiness metrics + - parameter userAgent: (header) (optional) + - parameter origin: (header) url for passkey readiness (optional) + - parameter deviceOS: (header) device os - mobile only (optional) + - parameter deviceOSVersion: (header) device os version - mobile only (optional) + - parameter appIdentifier: (header) app identifier - mobile only (optional) + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func createPasskeyReadiness(createPasskeyReadinessRequest: CreatePasskeyReadinessRequest, userAgent: String? = nil, origin: String? = nil, deviceOS: String? = nil, deviceOSVersion: String? = nil, appIdentifier: String? = nil) async throws { + return try await createPasskeyReadinessWithRequestBuilder(createPasskeyReadinessRequest: createPasskeyReadinessRequest, userAgent: userAgent, origin: origin, deviceOS: deviceOS, deviceOSVersion: deviceOSVersion, appIdentifier: appIdentifier).execute().body + } + + /** + Create Passkey Readiness Analytics + - POST /analytics/passkey-readiness + - Sends device's WebAuthn passkey readiness metrics + - API Key: + - type: apiKey X-API-KEY (HEADER) + - name: ApiKeyAuth + - parameter createPasskeyReadinessRequest: (body) Passkey readiness metrics + - parameter userAgent: (header) (optional) + - parameter origin: (header) url for passkey readiness (optional) + - parameter deviceOS: (header) device os - mobile only (optional) + - parameter deviceOSVersion: (header) device os version - mobile only (optional) + - parameter appIdentifier: (header) app identifier - mobile only (optional) + - returns: RequestBuilder + */ + open class func createPasskeyReadinessWithRequestBuilder(createPasskeyReadinessRequest: CreatePasskeyReadinessRequest, userAgent: String? = nil, origin: String? = nil, deviceOS: String? = nil, deviceOSVersion: String? = nil, appIdentifier: String? = nil) -> RequestBuilder { + let localVariablePath = "/analytics/passkey-readiness" + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createPasskeyReadinessRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + "User-Agent": userAgent?.encodeToJSON(), + "Origin": origin?.encodeToJSON(), + "Device-OS": deviceOS?.encodeToJSON(), + "Device-OS-Version": deviceOSVersion?.encodeToJSON(), + "App-Identifier": appIdentifier?.encodeToJSON(), + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/RegisterAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/RegisterAPI.swift new file mode 100644 index 0000000..f155ed6 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/RegisterAPI.swift @@ -0,0 +1,260 @@ +// +// RegisterAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class RegisterAPI { + + /** + Register with Magic Link + + - parameter appId: (path) App ID + - parameter user: (body) User Data + - returns: RegisterMagicLinkResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerMagicLink(appId: String, user: RegisterMagicLinkRequest) async throws -> RegisterMagicLinkResponse { + return try await registerMagicLinkWithRequestBuilder(appId: appId, user: user).execute().body + } + + /** + Register with Magic Link + - POST /apps/{app_id}/register/magic-link + - Create a user and send an registration email or SMS to the user. The user will receive an email or text with a link to complete their registration. + - parameter appId: (path) App ID + - parameter user: (body) User Data + - returns: RequestBuilder + */ + open class func registerMagicLinkWithRequestBuilder(appId: String, user: RegisterMagicLinkRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/magic-link" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Register with OTP + + - parameter appId: (path) App ID + - parameter registerOneTimePasscodeRequest: (body) User Data + - returns: OneTimePasscodeResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerOneTimePasscode(appId: String, registerOneTimePasscodeRequest: RegisterOneTimePasscodeRequest) async throws -> OneTimePasscodeResponse { + return try await registerOneTimePasscodeWithRequestBuilder(appId: appId, registerOneTimePasscodeRequest: registerOneTimePasscodeRequest).execute().body + } + + /** + Register with OTP + - POST /apps/{app_id}/register/otp + - Create a user and send a registration email or SMS to the user. The user will receive an email or text with a one-time passcode to complete their registration. + - parameter appId: (path) App ID + - parameter registerOneTimePasscodeRequest: (body) User Data + - returns: RequestBuilder + */ + open class func registerOneTimePasscodeWithRequestBuilder(appId: String, registerOneTimePasscodeRequest: RegisterOneTimePasscodeRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/otp" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerOneTimePasscodeRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Finish WebAuthn Registration + + - parameter appId: (path) App ID + - parameter registerWebAuthnFinishRequest: (body) WebAuthn Response Data + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerWebauthnFinish(appId: String, registerWebAuthnFinishRequest: RegisterWebAuthnFinishRequest) async throws -> AuthResponse { + return try await registerWebauthnFinishWithRequestBuilder(appId: appId, registerWebAuthnFinishRequest: registerWebAuthnFinishRequest).execute().body + } + + /** + Finish WebAuthn Registration + - POST /apps/{app_id}/register/webauthn/finish + - Complete a WebAuthn registration and authenticate the user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns an authentication token for the user. + - parameter appId: (path) App ID + - parameter registerWebAuthnFinishRequest: (body) WebAuthn Response Data + - returns: RequestBuilder + */ + open class func registerWebauthnFinishWithRequestBuilder(appId: String, registerWebAuthnFinishRequest: RegisterWebAuthnFinishRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/webauthn/finish" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerWebAuthnFinishRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Finish WebAuthn registration with a transaction + + - parameter appId: (path) App ID + - parameter registerWebAuthnFinishWithTransactionRequest: (body) + - returns: Nonce + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerWebauthnFinishWithTransaction(appId: String, registerWebAuthnFinishWithTransactionRequest: RegisterWebAuthnFinishWithTransactionRequest) async throws -> Nonce { + return try await registerWebauthnFinishWithTransactionWithRequestBuilder(appId: appId, registerWebAuthnFinishWithTransactionRequest: registerWebAuthnFinishWithTransactionRequest).execute().body + } + + /** + Finish WebAuthn registration with a transaction + - POST /apps/{app_id}/register/transactions/webauthn/finish + - Complete a WebAuthn registration and authenticate the user via a transaction. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns a nonce meant to be exchanged for an authentication token for the user. + - parameter appId: (path) App ID + - parameter registerWebAuthnFinishWithTransactionRequest: (body) + - returns: RequestBuilder + */ + open class func registerWebauthnFinishWithTransactionWithRequestBuilder(appId: String, registerWebAuthnFinishWithTransactionRequest: RegisterWebAuthnFinishWithTransactionRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/transactions/webauthn/finish" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerWebAuthnFinishWithTransactionRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Start WebAuthn Register + + - parameter appId: (path) App ID + - parameter registerWebAuthnStartRequest: (body) User Data + - returns: RegisterWebAuthnStartResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerWebauthnStart(appId: String, registerWebAuthnStartRequest: RegisterWebAuthnStartRequest) async throws -> RegisterWebAuthnStartResponse { + return try await registerWebauthnStartWithRequestBuilder(appId: appId, registerWebAuthnStartRequest: registerWebAuthnStartRequest).execute().body + } + + /** + Start WebAuthn Register + - POST /apps/{app_id}/register/webauthn/start + - Initiate a WebAuthn registration and create the user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. + - parameter appId: (path) App ID + - parameter registerWebAuthnStartRequest: (body) User Data + - returns: RequestBuilder + */ + open class func registerWebauthnStartWithRequestBuilder(appId: String, registerWebAuthnStartRequest: RegisterWebAuthnStartRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/webauthn/start" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerWebAuthnStartRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Start WebAuthn registration with a transaction + + - parameter appId: (path) App ID + - parameter registerWebAuthnStartWithTransactionRequest: (body) + - returns: RegisterWebAuthnStartWithTransactionResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func registerWebauthnStartWithTransaction(appId: String, registerWebAuthnStartWithTransactionRequest: RegisterWebAuthnStartWithTransactionRequest) async throws -> RegisterWebAuthnStartWithTransactionResponse { + return try await registerWebauthnStartWithTransactionWithRequestBuilder(appId: appId, registerWebAuthnStartWithTransactionRequest: registerWebAuthnStartWithTransactionRequest).execute().body + } + + /** + Start WebAuthn registration with a transaction + - POST /apps/{app_id}/register/transactions/webauthn/start + - Initiate a WebAuthn registration and create the user via a transaction. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. + - parameter appId: (path) App ID + - parameter registerWebAuthnStartWithTransactionRequest: (body) + - returns: RequestBuilder + */ + open class func registerWebauthnStartWithTransactionWithRequestBuilder(appId: String, registerWebAuthnStartWithTransactionRequest: RegisterWebAuthnStartWithTransactionRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/register/transactions/webauthn/start" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerWebAuthnStartWithTransactionRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/TokensAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/TokensAPI.swift new file mode 100644 index 0000000..462ada9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/TokensAPI.swift @@ -0,0 +1,99 @@ +// +// TokensAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class TokensAPI { + + /** + Creates new auth and refresh token + + - parameter appId: (path) App ID + - parameter refreshAuthTokenRequest: (body) Refresh token + - returns: AuthResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func refreshAuthToken(appId: String, refreshAuthTokenRequest: RefreshAuthTokenRequest) async throws -> AuthResponse { + return try await refreshAuthTokenWithRequestBuilder(appId: appId, refreshAuthTokenRequest: refreshAuthTokenRequest).execute().body + } + + /** + Creates new auth and refresh token + - POST /apps/{app_id}/tokens + - Creates and returns a new auth token and a new refresh token + - parameter appId: (path) App ID + - parameter refreshAuthTokenRequest: (body) Refresh token + - returns: RequestBuilder + */ + open class func refreshAuthTokenWithRequestBuilder(appId: String, refreshAuthTokenRequest: RefreshAuthTokenRequest) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/tokens" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: refreshAuthTokenRequest) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Revokes refresh token + + - parameter appId: (path) App ID + - parameter refreshToken: (query) Refresh token + - returns: Void + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func revokeRefreshToken(appId: String, refreshToken: String) async throws { + return try await revokeRefreshTokenWithRequestBuilder(appId: appId, refreshToken: refreshToken).execute().body + } + + /** + Revokes refresh token + - DELETE /apps/{app_id}/tokens + - Revokes the refresh token + - parameter appId: (path) App ID + - parameter refreshToken: (query) Refresh token + - returns: RequestBuilder + */ + open class func revokeRefreshTokenWithRequestBuilder(appId: String, refreshToken: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/tokens" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "refresh_token": (wrappedValue: refreshToken.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/UsersAPI.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/UsersAPI.swift new file mode 100644 index 0000000..6e38189 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/APIs/UsersAPI.swift @@ -0,0 +1,99 @@ +// +// UsersAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class UsersAPI { + + /** + Get User + + - parameter appId: (path) App ID + - parameter identifier: (query) email or phone number + - returns: UserResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func checkUserIdentifier(appId: String, identifier: String) async throws -> UserResponse { + return try await checkUserIdentifierWithRequestBuilder(appId: appId, identifier: identifier).execute().body + } + + /** + Get User + - GET /apps/{app_id}/users + - Get user information, if the user exists. This endpoint can be used to determine whether a user has an existing account and if they should login or register. + - parameter appId: (path) App ID + - parameter identifier: (query) email or phone number + - returns: RequestBuilder + */ + open class func checkUserIdentifierWithRequestBuilder(appId: String, identifier: String) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/users" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "identifier": (wrappedValue: identifier.encodeToJSON(), isExplode: true), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string?.removingPercentEncoding ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Create User + + - parameter appId: (path) App ID + - parameter createUserParams: (body) user options + - returns: UserResponse + */ + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + open class func createUser(appId: String, createUserParams: CreateUserParams) async throws -> UserResponse { + return try await createUserWithRequestBuilder(appId: appId, createUserParams: createUserParams).execute().body + } + + /** + Create User + - POST /apps/{app_id}/users + - Create a user + - parameter appId: (path) App ID + - parameter createUserParams: (body) user options + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(appId: String, createUserParams: CreateUserParams) -> RequestBuilder { + var localVariablePath = "/apps/{app_id}/users" + let appIdPreEscape = "\(APIHelper.mapValueToPathItem(appId))" + let appIdPostEscape = appIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{app_id}", with: appIdPostEscape, options: .literal, range: nil) + let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createUserParams) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/json", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = OpenAPIClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/CodableHelper.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 0000000..09c82e5 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,49 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class CodableHelper { + private static var customDateFormatter: DateFormatter? + private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() + + private static var customJSONDecoder: JSONDecoder? + private static var defaultJSONDecoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) + return decoder + }() + + private static var customJSONEncoder: JSONEncoder? + private static var defaultJSONEncoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) + encoder.outputFormatting = .prettyPrinted + return encoder + }() + + public static var dateFormatter: DateFormatter { + get { return customDateFormatter ?? defaultDateFormatter } + set { customDateFormatter = newValue } + } + public static var jsonDecoder: JSONDecoder { + get { return customJSONDecoder ?? defaultJSONDecoder } + set { customJSONDecoder = newValue } + } + public static var jsonEncoder: JSONEncoder { + get { return customJSONEncoder ?? defaultJSONEncoder } + set { customJSONEncoder = newValue } + } + + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try jsonDecoder.decode(type, from: data) } + } + + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try jsonEncoder.encode(value) } + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Configuration.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 0000000..0457d99 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,18 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +open class Configuration { + + /// Configures the range of HTTP status codes that will result in a successful response + /// + /// If a HTTP status code is outside of this range the response will be interpreted as failed. + public static var successfulStatusCodeRange: Range = 200..<300 +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Extensions.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 0000000..ac04dba --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,233 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif +#if canImport(AnyCodable) +import AnyCodable +#endif + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Decimal: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension RawRepresentable where RawValue: JSONEncodable { + func encodeToJSON() -> Any { return self.rawValue } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Set: JSONEncodable { + func encodeToJSON() -> Any { + return Array(self).encodeToJSON() + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return CodableHelper.dateFormatter.string(from: self) + } +} + +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + + public mutating func encode(_ value: Decimal, forKey key: Self.Key) throws { + var mutableValue = value + let stringValue = NSDecimalString(&mutableValue, Locale(identifier: "en_US")) + try encode(stringValue, forKey: key) + } + + public mutating func encodeIfPresent(_ value: Decimal?, forKey key: Self.Key) throws { + if let value = value { + try encode(value, forKey: key) + } + } +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + + public func decode(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal { + let stringValue = try decode(String.self, forKey: key) + guard let decimalValue = Decimal(string: stringValue) else { + let context = DecodingError.Context(codingPath: [key], debugDescription: "The key \(key) couldn't be converted to a Decimal value") + throw DecodingError.typeMismatch(type, context) + } + + return decimalValue + } + + public func decodeIfPresent(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal? { + guard let stringValue = try decodeIfPresent(String.self, forKey: key) else { + return nil + } + guard let decimalValue = Decimal(string: stringValue) else { + let context = DecodingError.Context(codingPath: [key], debugDescription: "The key \(key) couldn't be converted to a Decimal value") + throw DecodingError.typeMismatch(type, context) + } + + return decimalValue + } + +} + +extension HTTPURLResponse { + var isStatusCodeSuccessful: Bool { + return Configuration.successfulStatusCodeRange.contains(statusCode) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift new file mode 100644 index 0000000..cb3121a --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -0,0 +1,56 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +public struct JSONDataEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + var urlRequest = urlRequest + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + var returnedParams: [String: Any]? + if let jsonData = jsonData, !jsonData.isEmpty { + var params: [String: Any] = [:] + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 0000000..02f78ff --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,45 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj) + do { + let data = try encodeResult.get() + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + var params: [String: Any]? + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + return nil + } + } + + return params + } + +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 0000000..a32cdd6 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,129 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + +public enum ErrorResponse: Error { + case error(Int, Data?, URLResponse?, Error) +} + +public enum DownloadException: Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum DecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case unsuccessfulHTTPStatusCode + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T + public let bodyData: Data? + + public init(statusCode: Int, header: [String: String], body: T, bodyData: Data?) { + self.statusCode = statusCode + self.header = header + self.body = body + self.bodyData = bodyData + } + + public convenience init(response: HTTPURLResponse, body: T, bodyData: Data?) { + let rawHeader = response.allHeaderFields + var responseHeader = [String: String]() + for (key, value) in rawHeader { + if let key = key.base as? String, let value = value as? String { + responseHeader[key] = value + } + } + self.init(statusCode: response.statusCode, header: responseHeader, body: body, bodyData: bodyData) + } +} + +public final class RequestTask: @unchecked Sendable { + private var lock = NSRecursiveLock() + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + lock.lock() + defer { lock.unlock() } + self.task = task + } + + public func cancel() { + lock.lock() + defer { lock.unlock() } + task?.cancel() + task = nil + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateMagicLinkRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateMagicLinkRequest.swift new file mode 100644 index 0000000..fafb28c --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateMagicLinkRequest.swift @@ -0,0 +1,32 @@ +// +// ActivateMagicLinkRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ActivateMagicLinkRequest: Codable, JSONEncodable, Hashable { + + public var magicLink: String + + public init(magicLink: String) { + self.magicLink = magicLink + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case magicLink = "magic_link" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(magicLink, forKey: .magicLink) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateOneTimePasscodeRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateOneTimePasscodeRequest.swift new file mode 100644 index 0000000..11e43f3 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ActivateOneTimePasscodeRequest.swift @@ -0,0 +1,37 @@ +// +// ActivateOneTimePasscodeRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ActivateOneTimePasscodeRequest: Codable, JSONEncodable, Hashable { + + public var otp: String + /** The ID of the one-time passcode. */ + public var otpId: String + + public init(otp: String, otpId: String) { + self.otp = otp + self.otpId = otpId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case otp + case otpId = "otp_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(otp, forKey: .otp) + try container.encode(otpId, forKey: .otpId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceFinishRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceFinishRequest.swift new file mode 100644 index 0000000..b08b616 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceFinishRequest.swift @@ -0,0 +1,40 @@ +// +// AddDeviceFinishRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AddDeviceFinishRequest: Codable, JSONEncodable, Hashable { + + public var handshakeId: String + public var handshakeResponse: CredentialCreationResponse + public var userId: String + + public init(handshakeId: String, handshakeResponse: CredentialCreationResponse, userId: String) { + self.handshakeId = handshakeId + self.handshakeResponse = handshakeResponse + self.userId = userId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshakeId = "handshake_id" + case handshakeResponse = "handshake_response" + case userId = "user_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshakeId, forKey: .handshakeId) + try container.encode(handshakeResponse, forKey: .handshakeResponse) + try container.encode(userId, forKey: .userId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceStartResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceStartResponse.swift new file mode 100644 index 0000000..7f86464 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AddDeviceStartResponse.swift @@ -0,0 +1,36 @@ +// +// AddDeviceStartResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AddDeviceStartResponse: Codable, JSONEncodable, Hashable { + + public var handshake: CredentialCreationChallenge + public var user: User? + + public init(handshake: CredentialCreationChallenge, user: User? = nil) { + self.handshake = handshake + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshake + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshake, forKey: .handshake) + try container.encodeIfPresent(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/App.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/App.swift new file mode 100644 index 0000000..3bd2221 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/App.swift @@ -0,0 +1,133 @@ +// +// App.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct App: Codable, JSONEncodable, Hashable { + + public enum AuthFallbackMethod: String, Codable, CaseIterable { + case magicLink = "magic_link" + case otp = "otp" + case _none = "none" + } + public var allowedIdentifier: String + /** Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. */ + @available(*, deprecated, message: "This property is deprecated.") + public var authFallbackMethod: AuthFallbackMethod + /** Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. */ + @available(*, deprecated, message: "This property is deprecated.") + public var authFallbackMethodTtl: Int + public var authMethods: AuthMethods + public var authOrigin: String + public var defaultLanguage: String + public var elementCustomization: ElementCustomization + public var elementCustomizationDark: ElementCustomization + public var ephemeral: Bool + public var id: String + public var layouts: Layouts + public var loginUrl: String + public var name: String + public var passageBranding: Bool + public var publicSignup: Bool + public var profileManagement: Bool + public var redirectUrl: String + public var requireEmailVerification: Bool + public var requireIdentifierVerification: Bool + public var requiredIdentifier: String + public var rsaPublicKey: String + public var sessionTimeoutLength: Int + public var socialConnections: SocialConnections + public var userMetadataSchema: [UserMetadataField] + + public init(allowedIdentifier: String, authFallbackMethod: AuthFallbackMethod, authFallbackMethodTtl: Int, authMethods: AuthMethods, authOrigin: String, defaultLanguage: String, elementCustomization: ElementCustomization, elementCustomizationDark: ElementCustomization, ephemeral: Bool, id: String, layouts: Layouts, loginUrl: String, name: String, passageBranding: Bool, publicSignup: Bool, profileManagement: Bool, redirectUrl: String, requireEmailVerification: Bool, requireIdentifierVerification: Bool, requiredIdentifier: String, rsaPublicKey: String, sessionTimeoutLength: Int, socialConnections: SocialConnections, userMetadataSchema: [UserMetadataField]) { + self.allowedIdentifier = allowedIdentifier + self.authFallbackMethod = authFallbackMethod + self.authFallbackMethodTtl = authFallbackMethodTtl + self.authMethods = authMethods + self.authOrigin = authOrigin + self.defaultLanguage = defaultLanguage + self.elementCustomization = elementCustomization + self.elementCustomizationDark = elementCustomizationDark + self.ephemeral = ephemeral + self.id = id + self.layouts = layouts + self.loginUrl = loginUrl + self.name = name + self.passageBranding = passageBranding + self.publicSignup = publicSignup + self.profileManagement = profileManagement + self.redirectUrl = redirectUrl + self.requireEmailVerification = requireEmailVerification + self.requireIdentifierVerification = requireIdentifierVerification + self.requiredIdentifier = requiredIdentifier + self.rsaPublicKey = rsaPublicKey + self.sessionTimeoutLength = sessionTimeoutLength + self.socialConnections = socialConnections + self.userMetadataSchema = userMetadataSchema + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case allowedIdentifier = "allowed_identifier" + case authFallbackMethod = "auth_fallback_method" + case authFallbackMethodTtl = "auth_fallback_method_ttl" + case authMethods = "auth_methods" + case authOrigin = "auth_origin" + case defaultLanguage = "default_language" + case elementCustomization = "element_customization" + case elementCustomizationDark = "element_customization_dark" + case ephemeral + case id + case layouts + case loginUrl = "login_url" + case name + case passageBranding = "passage_branding" + case publicSignup = "public_signup" + case profileManagement = "profile_management" + case redirectUrl = "redirect_url" + case requireEmailVerification = "require_email_verification" + case requireIdentifierVerification = "require_identifier_verification" + case requiredIdentifier = "required_identifier" + case rsaPublicKey = "rsa_public_key" + case sessionTimeoutLength = "session_timeout_length" + case socialConnections = "social_connections" + case userMetadataSchema = "user_metadata_schema" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(allowedIdentifier, forKey: .allowedIdentifier) + try container.encode(authFallbackMethod, forKey: .authFallbackMethod) + try container.encode(authFallbackMethodTtl, forKey: .authFallbackMethodTtl) + try container.encode(authMethods, forKey: .authMethods) + try container.encode(authOrigin, forKey: .authOrigin) + try container.encode(defaultLanguage, forKey: .defaultLanguage) + try container.encode(elementCustomization, forKey: .elementCustomization) + try container.encode(elementCustomizationDark, forKey: .elementCustomizationDark) + try container.encode(ephemeral, forKey: .ephemeral) + try container.encode(id, forKey: .id) + try container.encode(layouts, forKey: .layouts) + try container.encode(loginUrl, forKey: .loginUrl) + try container.encode(name, forKey: .name) + try container.encode(passageBranding, forKey: .passageBranding) + try container.encode(publicSignup, forKey: .publicSignup) + try container.encode(profileManagement, forKey: .profileManagement) + try container.encode(redirectUrl, forKey: .redirectUrl) + try container.encode(requireEmailVerification, forKey: .requireEmailVerification) + try container.encode(requireIdentifierVerification, forKey: .requireIdentifierVerification) + try container.encode(requiredIdentifier, forKey: .requiredIdentifier) + try container.encode(rsaPublicKey, forKey: .rsaPublicKey) + try container.encode(sessionTimeoutLength, forKey: .sessionTimeoutLength) + try container.encode(socialConnections, forKey: .socialConnections) + try container.encode(userMetadataSchema, forKey: .userMetadataSchema) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AppleSocialConnection.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AppleSocialConnection.swift new file mode 100644 index 0000000..99f36d8 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AppleSocialConnection.swift @@ -0,0 +1,46 @@ +// +// AppleSocialConnection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AppleSocialConnection: Codable, JSONEncodable, Hashable { + + /** The external ID of the Social Connection. */ + public var providerId: String + public var createdAt: Date + public var lastLoginAt: Date + /** The email of connected social user. */ + public var providerIdentifier: String + + public init(providerId: String, createdAt: Date, lastLoginAt: Date, providerIdentifier: String) { + self.providerId = providerId + self.createdAt = createdAt + self.lastLoginAt = lastLoginAt + self.providerIdentifier = providerIdentifier + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case providerId = "provider_id" + case createdAt = "created_at" + case lastLoginAt = "last_login_at" + case providerIdentifier = "provider_identifier" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(providerId, forKey: .providerId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(lastLoginAt, forKey: .lastLoginAt) + try container.encode(providerIdentifier, forKey: .providerIdentifier) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthMethods.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthMethods.swift new file mode 100644 index 0000000..948939b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthMethods.swift @@ -0,0 +1,41 @@ +// +// AuthMethods.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Denotes what methods this app is allowed to use for authentication with configurations */ +public struct AuthMethods: Codable, JSONEncodable, Hashable { + + public var passkeys: AnyCodable? + public var otp: OtpAuthMethod? + public var magicLink: MagicLinkAuthMethod? + + public init(passkeys: AnyCodable? = nil, otp: OtpAuthMethod? = nil, magicLink: MagicLinkAuthMethod? = nil) { + self.passkeys = passkeys + self.otp = otp + self.magicLink = magicLink + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case passkeys + case otp + case magicLink = "magic_link" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(passkeys, forKey: .passkeys) + try container.encodeIfPresent(otp, forKey: .otp) + try container.encodeIfPresent(magicLink, forKey: .magicLink) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResponse.swift new file mode 100644 index 0000000..238b006 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResponse.swift @@ -0,0 +1,32 @@ +// +// AuthResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AuthResponse: Codable, JSONEncodable, Hashable { + + public var authResult: AuthResult + + public init(authResult: AuthResult) { + self.authResult = authResult + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authResult = "auth_result" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(authResult, forKey: .authResult) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResult.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResult.swift new file mode 100644 index 0000000..ec10d52 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthResult.swift @@ -0,0 +1,44 @@ +// +// AuthResult.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AuthResult: Codable, JSONEncodable, Hashable { + + public var authToken: String + public var redirectUrl: String + public var refreshToken: String? + public var refreshTokenExpiration: Int? + + public init(authToken: String, redirectUrl: String, refreshToken: String? = nil, refreshTokenExpiration: Int? = nil) { + self.authToken = authToken + self.redirectUrl = redirectUrl + self.refreshToken = refreshToken + self.refreshTokenExpiration = refreshTokenExpiration + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authToken = "auth_token" + case redirectUrl = "redirect_url" + case refreshToken = "refresh_token" + case refreshTokenExpiration = "refresh_token_expiration" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(authToken, forKey: .authToken) + try container.encode(redirectUrl, forKey: .redirectUrl) + try container.encodeIfPresent(refreshToken, forKey: .refreshToken) + try container.encodeIfPresent(refreshTokenExpiration, forKey: .refreshTokenExpiration) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnFinishWithTransactionRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnFinishWithTransactionRequest.swift new file mode 100644 index 0000000..19833b7 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnFinishWithTransactionRequest.swift @@ -0,0 +1,41 @@ +// +// AuthenticateWebAuthnFinishWithTransactionRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AuthenticateWebAuthnFinishWithTransactionRequest: Codable, JSONEncodable, Hashable { + + public var handshakeId: String + public var handshakeResponse: CredentialAssertionResponse + /** the transaction ID used when starting this login attempt (optional) */ + public var transactionId: String? + + public init(handshakeId: String, handshakeResponse: CredentialAssertionResponse, transactionId: String? = nil) { + self.handshakeId = handshakeId + self.handshakeResponse = handshakeResponse + self.transactionId = transactionId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshakeId = "handshake_id" + case handshakeResponse = "handshake_response" + case transactionId = "transaction_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshakeId, forKey: .handshakeId) + try container.encode(handshakeResponse, forKey: .handshakeResponse) + try container.encodeIfPresent(transactionId, forKey: .transactionId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionRequest.swift new file mode 100644 index 0000000..039bda4 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionRequest.swift @@ -0,0 +1,33 @@ +// +// AuthenticateWebAuthnStartWithTransactionRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AuthenticateWebAuthnStartWithTransactionRequest: Codable, JSONEncodable, Hashable { + + /** the transaction ID to associate with this authentication attempt (optional) */ + public var transactionId: String? + + public init(transactionId: String? = nil) { + self.transactionId = transactionId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case transactionId = "transaction_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(transactionId, forKey: .transactionId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionResponse.swift new file mode 100644 index 0000000..807cc39 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticateWebAuthnStartWithTransactionResponse.swift @@ -0,0 +1,37 @@ +// +// AuthenticateWebAuthnStartWithTransactionResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AuthenticateWebAuthnStartWithTransactionResponse: Codable, JSONEncodable, Hashable { + + public var handshake: CredentialAssertionChallenge + /** the transaction ID provided for this authentication attempt, null if not provided */ + public var transactionId: String? + + public init(handshake: CredentialAssertionChallenge, transactionId: String? = nil) { + self.handshake = handshake + self.transactionId = transactionId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshake + case transactionId = "transaction_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshake, forKey: .handshake) + try container.encodeIfPresent(transactionId, forKey: .transactionId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticatorAttachment.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticatorAttachment.swift new file mode 100644 index 0000000..5bb0a23 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/AuthenticatorAttachment.swift @@ -0,0 +1,18 @@ +// +// AuthenticatorAttachment.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** selects the type of authentication that will be used in this WebAuthN flow request */ +public enum AuthenticatorAttachment: String, Codable, CaseIterable { + case platform = "platform" + case crossPlatform = "cross-platform" + case any = "any" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreatePasskeyReadinessRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreatePasskeyReadinessRequest.swift new file mode 100644 index 0000000..2f9edad --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreatePasskeyReadinessRequest.swift @@ -0,0 +1,52 @@ +// +// CreatePasskeyReadinessRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CreatePasskeyReadinessRequest: Codable, JSONEncodable, Hashable { + + public var deviceId: String + public var securityKey: Bool + public var platform: Bool + public var syncedCredential: Bool + public var crossDeviceCredential: Bool + public var conditionalUi: Bool + + public init(deviceId: String, securityKey: Bool, platform: Bool, syncedCredential: Bool, crossDeviceCredential: Bool, conditionalUi: Bool) { + self.deviceId = deviceId + self.securityKey = securityKey + self.platform = platform + self.syncedCredential = syncedCredential + self.crossDeviceCredential = crossDeviceCredential + self.conditionalUi = conditionalUi + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case deviceId = "device_id" + case securityKey = "security_key" + case platform + case syncedCredential = "synced_credential" + case crossDeviceCredential = "cross_device_credential" + case conditionalUi = "conditional_ui" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(deviceId, forKey: .deviceId) + try container.encode(securityKey, forKey: .securityKey) + try container.encode(platform, forKey: .platform) + try container.encode(syncedCredential, forKey: .syncedCredential) + try container.encode(crossDeviceCredential, forKey: .crossDeviceCredential) + try container.encode(conditionalUi, forKey: .conditionalUi) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreateUserParams.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreateUserParams.swift new file mode 100644 index 0000000..644bcfa --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CreateUserParams.swift @@ -0,0 +1,36 @@ +// +// CreateUserParams.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CreateUserParams: Codable, JSONEncodable, Hashable { + + public var identifier: String + public var userMetadata: AnyCodable? + + public init(identifier: String, userMetadata: AnyCodable? = nil) { + self.identifier = identifier + self.userMetadata = userMetadata + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case userMetadata = "user_metadata" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(userMetadata, forKey: .userMetadata) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Credential.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Credential.swift new file mode 100644 index 0000000..eb737a2 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Credential.swift @@ -0,0 +1,76 @@ +// +// Credential.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Credential: Codable, JSONEncodable, Hashable { + + /** The first time this webAuthn device was used to authenticate the user */ + public var createdAt: String + /** The CredID for this webAuthn device (encoded to match what is stored in psg_cred_obj) */ + public var credId: String + /** The friendly name for the webAuthn device used to authenticate */ + public var friendlyName: String + /** The ID of the webAuthn device used for authentication */ + public var id: String + /** The last time this webAuthn device was used to authenticate the user */ + public var lastLoginAt: String + public var type: WebAuthnType + /** The last time this webAuthn device was updated */ + public var updatedAt: String + /** How many times this webAuthn device has been used to authenticate the user */ + public var usageCount: Int + /** The UserID for this webAuthn device */ + public var userId: String + public var icons: WebAuthnIcons + + public init(createdAt: String, credId: String, friendlyName: String, id: String, lastLoginAt: String, type: WebAuthnType, updatedAt: String, usageCount: Int, userId: String, icons: WebAuthnIcons) { + self.createdAt = createdAt + self.credId = credId + self.friendlyName = friendlyName + self.id = id + self.lastLoginAt = lastLoginAt + self.type = type + self.updatedAt = updatedAt + self.usageCount = usageCount + self.userId = userId + self.icons = icons + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case createdAt = "created_at" + case credId = "cred_id" + case friendlyName = "friendly_name" + case id + case lastLoginAt = "last_login_at" + case type + case updatedAt = "updated_at" + case usageCount = "usage_count" + case userId = "user_id" + case icons + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(credId, forKey: .credId) + try container.encode(friendlyName, forKey: .friendlyName) + try container.encode(id, forKey: .id) + try container.encode(lastLoginAt, forKey: .lastLoginAt) + try container.encode(type, forKey: .type) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(usageCount, forKey: .usageCount) + try container.encode(userId, forKey: .userId) + try container.encode(icons, forKey: .icons) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionChallenge.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionChallenge.swift new file mode 100644 index 0000000..4c9e189 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionChallenge.swift @@ -0,0 +1,36 @@ +// +// CredentialAssertionChallenge.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialAssertionChallenge: Codable, JSONEncodable, Hashable { + + public var challenge: ProtocolCredentialAssertion + public var id: String + + public init(challenge: ProtocolCredentialAssertion, id: String) { + self.challenge = challenge + self.id = id + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case challenge + case id + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(challenge, forKey: .challenge) + try container.encode(id, forKey: .id) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponse.swift new file mode 100644 index 0000000..ce15012 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponse.swift @@ -0,0 +1,54 @@ +// +// CredentialAssertionResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialAssertionResponse: Codable, JSONEncodable, Hashable { + + public var authenticatorAttachment: String? + public var clientExtensionResults: AnyCodable? + /** ID is The credential’s identifier. The requirements for the identifier are distinct for each type of credential. It might represent a username for username/password tuples, for example. */ + public var id: String? + public var rawId: String? + public var response: CredentialAssertionResponseResponse? + /** Type is the value of the object’s interface object's [[type]] slot, which specifies the credential type represented by this object. This should be type \"public-key\" for Webauthn credentials. */ + public var type: String? + + public init(authenticatorAttachment: String? = nil, clientExtensionResults: AnyCodable? = nil, id: String? = nil, rawId: String? = nil, response: CredentialAssertionResponseResponse? = nil, type: String? = nil) { + self.authenticatorAttachment = authenticatorAttachment + self.clientExtensionResults = clientExtensionResults + self.id = id + self.rawId = rawId + self.response = response + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authenticatorAttachment + case clientExtensionResults + case id + case rawId + case response + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + try container.encodeIfPresent(clientExtensionResults, forKey: .clientExtensionResults) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(rawId, forKey: .rawId) + try container.encodeIfPresent(response, forKey: .response) + try container.encodeIfPresent(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponseResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponseResponse.swift new file mode 100644 index 0000000..1403799 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialAssertionResponseResponse.swift @@ -0,0 +1,45 @@ +// +// CredentialAssertionResponseResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialAssertionResponseResponse: Codable, JSONEncodable, Hashable { + + public var authenticatorData: String? + /** From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson This attribute contains a JSON serialization of the client data passed to the authenticator by the client in its call to either create() or get(). */ + public var clientDataJSON: String? + public var signature: String? + public var userHandle: String? + + public init(authenticatorData: String? = nil, clientDataJSON: String? = nil, signature: String? = nil, userHandle: String? = nil) { + self.authenticatorData = authenticatorData + self.clientDataJSON = clientDataJSON + self.signature = signature + self.userHandle = userHandle + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authenticatorData + case clientDataJSON + case signature + case userHandle + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(authenticatorData, forKey: .authenticatorData) + try container.encodeIfPresent(clientDataJSON, forKey: .clientDataJSON) + try container.encodeIfPresent(signature, forKey: .signature) + try container.encodeIfPresent(userHandle, forKey: .userHandle) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreation.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreation.swift new file mode 100644 index 0000000..c9faea3 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreation.swift @@ -0,0 +1,32 @@ +// +// CredentialCreation.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreation: Codable, JSONEncodable, Hashable { + + public var publicKey: CredentialCreationPublicKey? + + public init(publicKey: CredentialCreationPublicKey? = nil) { + self.publicKey = publicKey + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case publicKey + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(publicKey, forKey: .publicKey) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationChallenge.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationChallenge.swift new file mode 100644 index 0000000..20f2ce4 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationChallenge.swift @@ -0,0 +1,36 @@ +// +// CredentialCreationChallenge.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationChallenge: Codable, JSONEncodable, Hashable { + + public var challenge: CredentialCreation + public var id: String + + public init(challenge: CredentialCreation, id: String) { + self.challenge = challenge + self.id = id + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case challenge + case id + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(challenge, forKey: .challenge) + try container.encode(id, forKey: .id) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKey.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKey.swift new file mode 100644 index 0000000..30f3986 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKey.swift @@ -0,0 +1,64 @@ +// +// CredentialCreationPublicKey.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKey: Codable, JSONEncodable, Hashable { + + public var attestation: String? + public var authenticatorSelection: CredentialCreationPublicKeyAuthenticatorSelection? + public var challenge: String? + public var excludeCredentials: [CredentialCreationPublicKeyExcludeCredentialsInner]? + public var extensions: AnyCodable? + public var pubKeyCredParams: [CredentialCreationPublicKeyPubKeyCredParamsInner]? + public var rp: CredentialCreationPublicKeyRp? + public var timeout: Int? + public var user: CredentialCreationPublicKeyUser? + + public init(attestation: String? = nil, authenticatorSelection: CredentialCreationPublicKeyAuthenticatorSelection? = nil, challenge: String? = nil, excludeCredentials: [CredentialCreationPublicKeyExcludeCredentialsInner]? = nil, extensions: AnyCodable? = nil, pubKeyCredParams: [CredentialCreationPublicKeyPubKeyCredParamsInner]? = nil, rp: CredentialCreationPublicKeyRp? = nil, timeout: Int? = nil, user: CredentialCreationPublicKeyUser? = nil) { + self.attestation = attestation + self.authenticatorSelection = authenticatorSelection + self.challenge = challenge + self.excludeCredentials = excludeCredentials + self.extensions = extensions + self.pubKeyCredParams = pubKeyCredParams + self.rp = rp + self.timeout = timeout + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case attestation + case authenticatorSelection + case challenge + case excludeCredentials + case extensions + case pubKeyCredParams + case rp + case timeout + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(attestation, forKey: .attestation) + try container.encodeIfPresent(authenticatorSelection, forKey: .authenticatorSelection) + try container.encodeIfPresent(challenge, forKey: .challenge) + try container.encodeIfPresent(excludeCredentials, forKey: .excludeCredentials) + try container.encodeIfPresent(extensions, forKey: .extensions) + try container.encodeIfPresent(pubKeyCredParams, forKey: .pubKeyCredParams) + try container.encodeIfPresent(rp, forKey: .rp) + try container.encodeIfPresent(timeout, forKey: .timeout) + try container.encodeIfPresent(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyAuthenticatorSelection.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyAuthenticatorSelection.swift new file mode 100644 index 0000000..9e5fc7d --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyAuthenticatorSelection.swift @@ -0,0 +1,48 @@ +// +// CredentialCreationPublicKeyAuthenticatorSelection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKeyAuthenticatorSelection: Codable, JSONEncodable, Hashable { + + /** AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only authenticators attached with the specified AuthenticatorAttachment enum. */ + public var authenticatorAttachment: String? + /** RequireResidentKey this member describes the Relying Party's requirements regarding resident credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident public key credential source when creating a public key credential. */ + public var requireResidentKey: Bool? + /** ResidentKey this member describes the Relying Party's requirements regarding resident credentials per Webauthn Level 2. */ + public var residentKey: String? + /** UserVerification This member describes the Relying Party's requirements regarding user verification for the create() operation. Eligible authenticators are filtered to only those capable of satisfying this requirement. */ + public var userVerification: String? + + public init(authenticatorAttachment: String? = nil, requireResidentKey: Bool? = nil, residentKey: String? = nil, userVerification: String? = nil) { + self.authenticatorAttachment = authenticatorAttachment + self.requireResidentKey = requireResidentKey + self.residentKey = residentKey + self.userVerification = userVerification + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authenticatorAttachment + case requireResidentKey + case residentKey + case userVerification + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + try container.encodeIfPresent(requireResidentKey, forKey: .requireResidentKey) + try container.encodeIfPresent(residentKey, forKey: .residentKey) + try container.encodeIfPresent(userVerification, forKey: .userVerification) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyExcludeCredentialsInner.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyExcludeCredentialsInner.swift new file mode 100644 index 0000000..dd39a3f --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyExcludeCredentialsInner.swift @@ -0,0 +1,43 @@ +// +// CredentialCreationPublicKeyExcludeCredentialsInner.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKeyExcludeCredentialsInner: Codable, JSONEncodable, Hashable { + + /** CredentialID The ID of a credential to allow/disallow. */ + public var id: String? + /** The authenticator transports that can be used. */ + public var transports: [String]? + /** The valid credential types. */ + public var type: String? + + public init(id: String? = nil, transports: [String]? = nil, type: String? = nil) { + self.id = id + self.transports = transports + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case transports + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(transports, forKey: .transports) + try container.encodeIfPresent(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyPubKeyCredParamsInner.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyPubKeyCredParamsInner.swift new file mode 100644 index 0000000..c0a00bc --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyPubKeyCredParamsInner.swift @@ -0,0 +1,36 @@ +// +// CredentialCreationPublicKeyPubKeyCredParamsInner.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKeyPubKeyCredParamsInner: Codable, JSONEncodable, Hashable { + + public var alg: Int? + public var type: String? + + public init(alg: Int? = nil, type: String? = nil) { + self.alg = alg + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case alg + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(alg, forKey: .alg) + try container.encodeIfPresent(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyRp.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyRp.swift new file mode 100644 index 0000000..f6b84f3 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyRp.swift @@ -0,0 +1,43 @@ +// +// CredentialCreationPublicKeyRp.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKeyRp: Codable, JSONEncodable, Hashable { + + /** A serialized URL which resolves to an image associated with the entity. For example, this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for an icon member’s value. Authenticators MAY ignore an icon member’s value if its length is greater than 128 bytes. The URL’s scheme MAY be \"data\" to avoid fetches of the URL, at the cost of needing more storage. Deprecated: this has been removed from the specification recommendations. */ + public var icon: String? + /** A unique identifier for the Relying Party entity, which sets the RP ID. */ + public var id: String? + /** A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, intended only for display. For example, \"ACME Corporation\", \"Wonderful Widgets, Inc.\" or \"ОАО Примертех\". When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is intended only for display, i.e., aiding the user in determining the difference between user accounts with similar displayNames. For example, \"alexm\", \"alex.p.mueller@example.com\" or \"+14255551234\". */ + public var name: String? + + public init(icon: String? = nil, id: String? = nil, name: String? = nil) { + self.icon = icon + self.id = id + self.name = name + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case icon + case id + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(icon, forKey: .icon) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(name, forKey: .name) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyUser.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyUser.swift new file mode 100644 index 0000000..98b529e --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationPublicKeyUser.swift @@ -0,0 +1,48 @@ +// +// CredentialCreationPublicKeyUser.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationPublicKeyUser: Codable, JSONEncodable, Hashable { + + /** A human-palatable name for the user account, intended only for display. For example, \"Alex P. Müller\" or \"田中 倫\". The Relying Party SHOULD let the user choose this, and SHOULD NOT restrict the choice more than necessary. */ + public var displayName: String? + /** A serialized URL which resolves to an image associated with the entity. For example, this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for an icon member’s value. Authenticators MAY ignore an icon member’s value if its length is greater than 128 bytes. The URL’s scheme MAY be \"data\" to avoid fetches of the URL, at the cost of needing more storage. Deprecated: this has been removed from the specification recommendations. */ + public var icon: String? + /** ID is the user handle of the user account entity. To ensure secure operation, authentication and authorization decisions MUST be made on the basis of this id member, not the displayName nor name members. See Section 6.1 of [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). */ + public var id: String? + /** A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, intended only for display. For example, \"ACME Corporation\", \"Wonderful Widgets, Inc.\" or \"ОАО Примертех\". When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is intended only for display, i.e., aiding the user in determining the difference between user accounts with similar displayNames. For example, \"alexm\", \"alex.p.mueller@example.com\" or \"+14255551234\". */ + public var name: String? + + public init(displayName: String? = nil, icon: String? = nil, id: String? = nil, name: String? = nil) { + self.displayName = displayName + self.icon = icon + self.id = id + self.name = name + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case displayName + case icon + case id + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(displayName, forKey: .displayName) + try container.encodeIfPresent(icon, forKey: .icon) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(name, forKey: .name) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponse.swift new file mode 100644 index 0000000..801385b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponse.swift @@ -0,0 +1,58 @@ +// +// CredentialCreationResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationResponse: Codable, JSONEncodable, Hashable { + + public var authenticatorAttachment: String? + public var clientExtensionResults: AnyCodable? + /** ID is The credential's identifier. The requirements for the identifier are distinct for each type of credential. It might represent a username for username/password tuples, for example. */ + public var id: String? + public var rawId: String? + public var response: CredentialCreationResponseResponse? + public var transports: [String]? + /** Type is the value of the object's interface object's [[type]] slot, which specifies the credential type represented by this object. This should be type \"public-key\" for Webauthn credentials. */ + public var type: String? + + public init(authenticatorAttachment: String? = nil, clientExtensionResults: AnyCodable? = nil, id: String? = nil, rawId: String? = nil, response: CredentialCreationResponseResponse? = nil, transports: [String]? = nil, type: String? = nil) { + self.authenticatorAttachment = authenticatorAttachment + self.clientExtensionResults = clientExtensionResults + self.id = id + self.rawId = rawId + self.response = response + self.transports = transports + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authenticatorAttachment + case clientExtensionResults + case id + case rawId + case response + case transports + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + try container.encodeIfPresent(clientExtensionResults, forKey: .clientExtensionResults) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(rawId, forKey: .rawId) + try container.encodeIfPresent(response, forKey: .response) + try container.encodeIfPresent(transports, forKey: .transports) + try container.encodeIfPresent(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponseResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponseResponse.swift new file mode 100644 index 0000000..a0a3f7c --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CredentialCreationResponseResponse.swift @@ -0,0 +1,42 @@ +// +// CredentialCreationResponseResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CredentialCreationResponseResponse: Codable, JSONEncodable, Hashable { + + /** AttestationObject is the byte slice version of attestationObject. This attribute contains an attestation object, which is opaque to, and cryptographically protected against tampering by, the client. The attestation object contains both authenticator data and an attestation statement. The former contains the AAGUID, a unique credential ID, and the credential public key. The contents of the attestation statement are determined by the attestation statement format used by the authenticator. It also contains any additional information that the Relying Party's server requires to validate the attestation statement, as well as to decode and validate the authenticator data along with the JSON-serialized client data. */ + public var attestationObject: String? + /** From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson This attribute contains a JSON serialization of the client data passed to the authenticator by the client in its call to either create() or get(). */ + public var clientDataJSON: String? + public var transports: [String]? + + public init(attestationObject: String? = nil, clientDataJSON: String? = nil, transports: [String]? = nil) { + self.attestationObject = attestationObject + self.clientDataJSON = clientDataJSON + self.transports = transports + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case attestationObject + case clientDataJSON + case transports + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(attestationObject, forKey: .attestationObject) + try container.encodeIfPresent(clientDataJSON, forKey: .clientDataJSON) + try container.encodeIfPresent(transports, forKey: .transports) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUser.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUser.swift new file mode 100644 index 0000000..7293369 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUser.swift @@ -0,0 +1,100 @@ +// +// CurrentUser.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CurrentUser: Codable, JSONEncodable, Hashable { + + /** When this user was created */ + public var createdAt: String + /** The user's email */ + public var email: String + /** Whether or not the user's email has been verified */ + public var emailVerified: Bool + /** The user ID */ + public var id: String + /** The last time this user logged in */ + public var lastLoginAt: String + /** How many times the user has successfully logged in */ + public var loginCount: Int + /** The user's phone */ + public var phone: String + /** Whether or not the user's phone has been verified */ + public var phoneVerified: Bool + public var socialConnections: UserSocialConnections + public var status: UserStatus + /** When this user was last updated */ + public var updatedAt: String + public var userMetadata: AnyCodable? + /** Whether or not the user has authenticated via webAuthn before (if len(WebAuthnDevices) > 0) */ + public var webauthn: Bool + /** The list of devices this user has authenticated with via webAuthn */ + public var webauthnDevices: [Credential] + /** List of credential types that user has created */ + public var webauthnTypes: [WebAuthnType]? + + public init(createdAt: String, email: String, emailVerified: Bool, id: String, lastLoginAt: String, loginCount: Int, phone: String, phoneVerified: Bool, socialConnections: UserSocialConnections, status: UserStatus, updatedAt: String, userMetadata: AnyCodable?, webauthn: Bool, webauthnDevices: [Credential], webauthnTypes: [WebAuthnType]) { + self.createdAt = createdAt + self.email = email + self.emailVerified = emailVerified + self.id = id + self.lastLoginAt = lastLoginAt + self.loginCount = loginCount + self.phone = phone + self.phoneVerified = phoneVerified + self.socialConnections = socialConnections + self.status = status + self.updatedAt = updatedAt + self.userMetadata = userMetadata + self.webauthn = webauthn + self.webauthnDevices = webauthnDevices + self.webauthnTypes = webauthnTypes + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case createdAt = "created_at" + case email + case emailVerified = "email_verified" + case id + case lastLoginAt = "last_login_at" + case loginCount = "login_count" + case phone + case phoneVerified = "phone_verified" + case socialConnections = "social_connections" + case status + case updatedAt = "updated_at" + case userMetadata = "user_metadata" + case webauthn + case webauthnDevices = "webauthn_devices" + case webauthnTypes = "webauthn_types" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(email, forKey: .email) + try container.encode(emailVerified, forKey: .emailVerified) + try container.encode(id, forKey: .id) + try container.encode(lastLoginAt, forKey: .lastLoginAt) + try container.encode(loginCount, forKey: .loginCount) + try container.encode(phone, forKey: .phone) + try container.encode(phoneVerified, forKey: .phoneVerified) + try container.encode(socialConnections, forKey: .socialConnections) + try container.encode(status, forKey: .status) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(userMetadata, forKey: .userMetadata) + try container.encode(webauthn, forKey: .webauthn) + try container.encode(webauthnDevices, forKey: .webauthnDevices) + try container.encode(webauthnTypes, forKey: .webauthnTypes) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevice.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevice.swift new file mode 100644 index 0000000..bba56a2 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevice.swift @@ -0,0 +1,32 @@ +// +// CurrentUserDevice.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CurrentUserDevice: Codable, JSONEncodable, Hashable { + + public var device: Credential + + public init(device: Credential) { + self.device = device + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case device + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(device, forKey: .device) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevices.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevices.swift new file mode 100644 index 0000000..ff5bc70 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevices.swift @@ -0,0 +1,32 @@ +// +// CurrentUserDevices.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CurrentUserDevices: Codable, JSONEncodable, Hashable { + + public var devices: [Credential] + + public init(devices: [Credential]) { + self.devices = devices + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case devices + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(devices, forKey: .devices) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevicesStartRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevicesStartRequest.swift new file mode 100644 index 0000000..500089d --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserDevicesStartRequest.swift @@ -0,0 +1,32 @@ +// +// CurrentUserDevicesStartRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CurrentUserDevicesStartRequest: Codable, JSONEncodable, Hashable { + + public var authenticatorAttachment: AuthenticatorAttachment? + + public init(authenticatorAttachment: AuthenticatorAttachment? = nil) { + self.authenticatorAttachment = authenticatorAttachment + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authenticatorAttachment = "authenticator_attachment" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserResponse.swift new file mode 100644 index 0000000..5306d41 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/CurrentUserResponse.swift @@ -0,0 +1,32 @@ +// +// CurrentUserResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CurrentUserResponse: Codable, JSONEncodable, Hashable { + + public var user: CurrentUser + + public init(user: CurrentUser) { + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ElementCustomization.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ElementCustomization.swift new file mode 100644 index 0000000..dc03c88 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ElementCustomization.swift @@ -0,0 +1,126 @@ +// +// ElementCustomization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ElementCustomization: Codable, JSONEncodable, Hashable { + + /** Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. */ + public var passageContainerBackgroundColor: String? + /** Maximum width of container (px) */ + public var passageContainerMaxWidth: Int? = 300 + /** Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. */ + public var passageInputBoxBackgroundColor: String? + /** Input box border radius (px) */ + public var passageInputBoxBorderRadius: Int? = 5 + public var passageHeaderFontFamily: FontFamily? + public var passageBodyFontFamily: FontFamily? + /** Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. */ + public var passageHeaderTextColor: String? + /** Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. */ + public var passageBodyTextColor: String? + /** Primary button background colour (hex) */ + public var passagePrimaryButtonBackgroundColor: String? = "#121212" + /** Primary button font colour (hex) */ + public var passagePrimaryButtonTextColor: String? = "#f3f3f3" + /** Primary button background on hover (hex) */ + public var passagePrimaryButtonHoverColor: String? = "#4d4d4d" + /** Primary button border radius (px) */ + public var passagePrimaryButtonBorderRadius: Int? = 5 + /** Primary button border color */ + public var passagePrimaryButtonBorderColor: String? = "#121212" + /** Primary button border width (px) */ + public var passagePrimaryButtonBorderWidth: Int? = 0 + /** Secondary button background colour (hex) */ + public var passageSecondaryButtonBackgroundColor: String? = "#ffffff" + /** Secondary button font colour (hex) */ + public var passageSecondaryButtonTextColor: String? = "#222222" + /** Secondary button background on hover (hex) */ + public var passageSecondaryButtonHoverColor: String? = "#d7d7d7" + /** Secondary button border radius (px) */ + public var passageSecondaryButtonBorderRadius: Int? = 5 + /** Secondary button border color */ + public var passageSecondaryButtonBorderColor: String? = "#d7d7d7" + /** Secondary button border width (px) */ + public var passageSecondaryButtonBorderWidth: Int? = 1 + + public init(passageContainerBackgroundColor: String? = nil, passageContainerMaxWidth: Int? = 300, passageInputBoxBackgroundColor: String? = nil, passageInputBoxBorderRadius: Int? = 5, passageHeaderFontFamily: FontFamily? = nil, passageBodyFontFamily: FontFamily? = nil, passageHeaderTextColor: String? = nil, passageBodyTextColor: String? = nil, passagePrimaryButtonBackgroundColor: String? = "#121212", passagePrimaryButtonTextColor: String? = "#f3f3f3", passagePrimaryButtonHoverColor: String? = "#4d4d4d", passagePrimaryButtonBorderRadius: Int? = 5, passagePrimaryButtonBorderColor: String? = "#121212", passagePrimaryButtonBorderWidth: Int? = 0, passageSecondaryButtonBackgroundColor: String? = "#ffffff", passageSecondaryButtonTextColor: String? = "#222222", passageSecondaryButtonHoverColor: String? = "#d7d7d7", passageSecondaryButtonBorderRadius: Int? = 5, passageSecondaryButtonBorderColor: String? = "#d7d7d7", passageSecondaryButtonBorderWidth: Int? = 1) { + self.passageContainerBackgroundColor = passageContainerBackgroundColor + self.passageContainerMaxWidth = passageContainerMaxWidth + self.passageInputBoxBackgroundColor = passageInputBoxBackgroundColor + self.passageInputBoxBorderRadius = passageInputBoxBorderRadius + self.passageHeaderFontFamily = passageHeaderFontFamily + self.passageBodyFontFamily = passageBodyFontFamily + self.passageHeaderTextColor = passageHeaderTextColor + self.passageBodyTextColor = passageBodyTextColor + self.passagePrimaryButtonBackgroundColor = passagePrimaryButtonBackgroundColor + self.passagePrimaryButtonTextColor = passagePrimaryButtonTextColor + self.passagePrimaryButtonHoverColor = passagePrimaryButtonHoverColor + self.passagePrimaryButtonBorderRadius = passagePrimaryButtonBorderRadius + self.passagePrimaryButtonBorderColor = passagePrimaryButtonBorderColor + self.passagePrimaryButtonBorderWidth = passagePrimaryButtonBorderWidth + self.passageSecondaryButtonBackgroundColor = passageSecondaryButtonBackgroundColor + self.passageSecondaryButtonTextColor = passageSecondaryButtonTextColor + self.passageSecondaryButtonHoverColor = passageSecondaryButtonHoverColor + self.passageSecondaryButtonBorderRadius = passageSecondaryButtonBorderRadius + self.passageSecondaryButtonBorderColor = passageSecondaryButtonBorderColor + self.passageSecondaryButtonBorderWidth = passageSecondaryButtonBorderWidth + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case passageContainerBackgroundColor = "passage_container_background_color" + case passageContainerMaxWidth = "passage_container_max_width" + case passageInputBoxBackgroundColor = "passage_input_box_background_color" + case passageInputBoxBorderRadius = "passage_input_box_border_radius" + case passageHeaderFontFamily = "passage_header_font_family" + case passageBodyFontFamily = "passage_body_font_family" + case passageHeaderTextColor = "passage_header_text_color" + case passageBodyTextColor = "passage_body_text_color" + case passagePrimaryButtonBackgroundColor = "passage_primary_button_background_color" + case passagePrimaryButtonTextColor = "passage_primary_button_text_color" + case passagePrimaryButtonHoverColor = "passage_primary_button_hover_color" + case passagePrimaryButtonBorderRadius = "passage_primary_button_border_radius" + case passagePrimaryButtonBorderColor = "passage_primary_button_border_color" + case passagePrimaryButtonBorderWidth = "passage_primary_button_border_width" + case passageSecondaryButtonBackgroundColor = "passage_secondary_button_background_color" + case passageSecondaryButtonTextColor = "passage_secondary_button_text_color" + case passageSecondaryButtonHoverColor = "passage_secondary_button_hover_color" + case passageSecondaryButtonBorderRadius = "passage_secondary_button_border_radius" + case passageSecondaryButtonBorderColor = "passage_secondary_button_border_color" + case passageSecondaryButtonBorderWidth = "passage_secondary_button_border_width" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(passageContainerBackgroundColor, forKey: .passageContainerBackgroundColor) + try container.encodeIfPresent(passageContainerMaxWidth, forKey: .passageContainerMaxWidth) + try container.encodeIfPresent(passageInputBoxBackgroundColor, forKey: .passageInputBoxBackgroundColor) + try container.encodeIfPresent(passageInputBoxBorderRadius, forKey: .passageInputBoxBorderRadius) + try container.encodeIfPresent(passageHeaderFontFamily, forKey: .passageHeaderFontFamily) + try container.encodeIfPresent(passageBodyFontFamily, forKey: .passageBodyFontFamily) + try container.encodeIfPresent(passageHeaderTextColor, forKey: .passageHeaderTextColor) + try container.encodeIfPresent(passageBodyTextColor, forKey: .passageBodyTextColor) + try container.encodeIfPresent(passagePrimaryButtonBackgroundColor, forKey: .passagePrimaryButtonBackgroundColor) + try container.encodeIfPresent(passagePrimaryButtonTextColor, forKey: .passagePrimaryButtonTextColor) + try container.encodeIfPresent(passagePrimaryButtonHoverColor, forKey: .passagePrimaryButtonHoverColor) + try container.encodeIfPresent(passagePrimaryButtonBorderRadius, forKey: .passagePrimaryButtonBorderRadius) + try container.encodeIfPresent(passagePrimaryButtonBorderColor, forKey: .passagePrimaryButtonBorderColor) + try container.encodeIfPresent(passagePrimaryButtonBorderWidth, forKey: .passagePrimaryButtonBorderWidth) + try container.encodeIfPresent(passageSecondaryButtonBackgroundColor, forKey: .passageSecondaryButtonBackgroundColor) + try container.encodeIfPresent(passageSecondaryButtonTextColor, forKey: .passageSecondaryButtonTextColor) + try container.encodeIfPresent(passageSecondaryButtonHoverColor, forKey: .passageSecondaryButtonHoverColor) + try container.encodeIfPresent(passageSecondaryButtonBorderRadius, forKey: .passageSecondaryButtonBorderRadius) + try container.encodeIfPresent(passageSecondaryButtonBorderColor, forKey: .passageSecondaryButtonBorderColor) + try container.encodeIfPresent(passageSecondaryButtonBorderWidth, forKey: .passageSecondaryButtonBorderWidth) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/FontFamily.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/FontFamily.swift new file mode 100644 index 0000000..30d959f --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/FontFamily.swift @@ -0,0 +1,35 @@ +// +// FontFamily.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Body font family */ +public enum FontFamily: String, Codable, CaseIterable { + case helvetica = "Helvetica" + case arial = "Arial" + case arialBlack = "Arial Black" + case verdana = "Verdana" + case tahoma = "Tahoma" + case trebuchetMs = "Trebuchet MS" + case impact = "Impact" + case gillSans = "Gill Sans" + case timesNewRoman = "Times New Roman" + case georgia = "Georgia" + case palatino = "Palatino" + case baskerville = "Baskerville" + case andalMono = "Andalé Mono" + case courier = "Courier" + case lucida = "Lucida" + case monaco = "Monaco" + case bradleyHand = "Bradley Hand" + case brushScriptMt = "Brush Script MT" + case luminari = "Luminari" + case comicSansMs = "Comic Sans MS" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetAppResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetAppResponse.swift new file mode 100644 index 0000000..d50b06d --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetAppResponse.swift @@ -0,0 +1,32 @@ +// +// GetAppResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct GetAppResponse: Codable, JSONEncodable, Hashable { + + public var app: App + + public init(app: App) { + self.app = app + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case app + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(app, forKey: .app) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetMagicLinkStatusRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetMagicLinkStatusRequest.swift new file mode 100644 index 0000000..499115f --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GetMagicLinkStatusRequest.swift @@ -0,0 +1,32 @@ +// +// GetMagicLinkStatusRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct GetMagicLinkStatusRequest: Codable, JSONEncodable, Hashable { + + public var id: String + + public init(id: String) { + self.id = id + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GithubSocialConnection.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GithubSocialConnection.swift new file mode 100644 index 0000000..c1f1a27 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GithubSocialConnection.swift @@ -0,0 +1,46 @@ +// +// GithubSocialConnection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct GithubSocialConnection: Codable, JSONEncodable, Hashable { + + /** The external ID of the Social Connection. */ + public var providerId: String + public var createdAt: Date + public var lastLoginAt: Date + /** The email of connected social user. */ + public var providerIdentifier: String + + public init(providerId: String, createdAt: Date, lastLoginAt: Date, providerIdentifier: String) { + self.providerId = providerId + self.createdAt = createdAt + self.lastLoginAt = lastLoginAt + self.providerIdentifier = providerIdentifier + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case providerId = "provider_id" + case createdAt = "created_at" + case lastLoginAt = "last_login_at" + case providerIdentifier = "provider_identifier" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(providerId, forKey: .providerId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(lastLoginAt, forKey: .lastLoginAt) + try container.encode(providerIdentifier, forKey: .providerIdentifier) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GoogleSocialConnection.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GoogleSocialConnection.swift new file mode 100644 index 0000000..c979ea8 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/GoogleSocialConnection.swift @@ -0,0 +1,46 @@ +// +// GoogleSocialConnection.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct GoogleSocialConnection: Codable, JSONEncodable, Hashable { + + /** The external ID of the Social Connection. */ + public var providerId: String + public var createdAt: Date + public var lastLoginAt: Date + /** The email of connected social user. */ + public var providerIdentifier: String + + public init(providerId: String, createdAt: Date, lastLoginAt: Date, providerIdentifier: String) { + self.providerId = providerId + self.createdAt = createdAt + self.lastLoginAt = lastLoginAt + self.providerIdentifier = providerIdentifier + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case providerId = "provider_id" + case createdAt = "created_at" + case lastLoginAt = "last_login_at" + case providerIdentifier = "provider_identifier" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(providerId, forKey: .providerId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(lastLoginAt, forKey: .lastLoginAt) + try container.encode(providerIdentifier, forKey: .providerIdentifier) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/IdTokenRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/IdTokenRequest.swift new file mode 100644 index 0000000..f7311a8 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/IdTokenRequest.swift @@ -0,0 +1,47 @@ +// +// IdTokenRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct IdTokenRequest: Codable, JSONEncodable, Hashable { + + public enum ConnectionType: String, Codable, CaseIterable { + case apple = "apple" + case google = "google" + } + /** The code given from the native mobile OS to create a token */ + public var code: String + /** The identity JWT token with security claims for validation */ + public var idToken: String + /** Connection type; google or apple */ + public var connectionType: ConnectionType + + public init(code: String, idToken: String, connectionType: ConnectionType) { + self.code = code + self.idToken = idToken + self.connectionType = connectionType + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case idToken = "id_token" + case connectionType = "connection_type" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(idToken, forKey: .idToken) + try container.encode(connectionType, forKey: .connectionType) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponse.swift new file mode 100644 index 0000000..e64efb5 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponse.swift @@ -0,0 +1,32 @@ +// +// JWKResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct JWKResponse: Codable, JSONEncodable, Hashable { + + public var keys: [JWKResponseKeysInner] + + public init(keys: [JWKResponseKeysInner]) { + self.keys = keys + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case keys + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(keys, forKey: .keys) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponseKeysInner.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponseKeysInner.swift new file mode 100644 index 0000000..7e5e850 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/JWKResponseKeysInner.swift @@ -0,0 +1,58 @@ +// +// JWKResponseKeysInner.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct JWKResponseKeysInner: Codable, JSONEncodable, Hashable { + + /** the algorithm for the key */ + public var alg: String + /** the exponent for the standard pem */ + public var e: String + /** the unique identifier for the key */ + public var kid: String + /** the key type (https://datatracker.ietf.org/doc/html/rfc7518) */ + public var kty: String + /** the modulus for a standard pem */ + public var n: String + /** how the key is meant to be used (i.e. 'sig' represents signature) */ + public var use: String + + public init(alg: String, e: String, kid: String, kty: String, n: String, use: String) { + self.alg = alg + self.e = e + self.kid = kid + self.kty = kty + self.n = n + self.use = use + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case alg + case e + case kid + case kty + case n + case use + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(alg, forKey: .alg) + try container.encode(e, forKey: .e) + try container.encode(kid, forKey: .kid) + try container.encode(kty, forKey: .kty) + try container.encode(n, forKey: .n) + try container.encode(use, forKey: .use) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LayoutConfig.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LayoutConfig.swift new file mode 100644 index 0000000..7f4bda0 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LayoutConfig.swift @@ -0,0 +1,48 @@ +// +// LayoutConfig.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LayoutConfig: Codable, JSONEncodable, Hashable { + + public var h: Int + public var id: String + public var w: Int + public var x: Int + public var y: Int + + public init(h: Int, id: String, w: Int, x: Int, y: Int) { + self.h = h + self.id = id + self.w = w + self.x = x + self.y = y + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case h + case id + case w + case x + case y + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(h, forKey: .h) + try container.encode(id, forKey: .id) + try container.encode(w, forKey: .w) + try container.encode(x, forKey: .x) + try container.encode(y, forKey: .y) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Layouts.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Layouts.swift new file mode 100644 index 0000000..9fa07cb --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Layouts.swift @@ -0,0 +1,36 @@ +// +// Layouts.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Layouts: Codable, JSONEncodable, Hashable { + + public var profile: [LayoutConfig] + public var registration: [LayoutConfig] + + public init(profile: [LayoutConfig], registration: [LayoutConfig]) { + self.profile = profile + self.registration = registration + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case profile + case registration + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(profile, forKey: .profile) + try container.encode(registration, forKey: .registration) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkRequest.swift new file mode 100644 index 0000000..b6b6592 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkRequest.swift @@ -0,0 +1,43 @@ +// +// LoginMagicLinkRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginMagicLinkRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String + /** language of the email or SMS to send (optional) */ + public var language: String? + /** path relative to the app's auth_origin (optional) */ + public var magicLinkPath: String? + + public init(identifier: String, language: String? = nil, magicLinkPath: String? = nil) { + self.identifier = identifier + self.language = language + self.magicLinkPath = magicLinkPath + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case language + case magicLinkPath = "magic_link_path" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(language, forKey: .language) + try container.encodeIfPresent(magicLinkPath, forKey: .magicLinkPath) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkResponse.swift new file mode 100644 index 0000000..3e51f35 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginMagicLinkResponse.swift @@ -0,0 +1,32 @@ +// +// LoginMagicLinkResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginMagicLinkResponse: Codable, JSONEncodable, Hashable { + + public var magicLink: MagicLink + + public init(magicLink: MagicLink) { + self.magicLink = magicLink + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case magicLink = "magic_link" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(magicLink, forKey: .magicLink) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginOneTimePasscodeRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginOneTimePasscodeRequest.swift new file mode 100644 index 0000000..1143383 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginOneTimePasscodeRequest.swift @@ -0,0 +1,38 @@ +// +// LoginOneTimePasscodeRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginOneTimePasscodeRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String + /** language of the email to send (optional) */ + public var language: String? + + public init(identifier: String, language: String? = nil) { + self.identifier = identifier + self.language = language + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case language + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(language, forKey: .language) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnFinishRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnFinishRequest.swift new file mode 100644 index 0000000..378b9c8 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnFinishRequest.swift @@ -0,0 +1,40 @@ +// +// LoginWebAuthnFinishRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginWebAuthnFinishRequest: Codable, JSONEncodable, Hashable { + + public var handshakeId: String + public var handshakeResponse: CredentialAssertionResponse + public var userId: String? + + public init(handshakeId: String, handshakeResponse: CredentialAssertionResponse, userId: String? = nil) { + self.handshakeId = handshakeId + self.handshakeResponse = handshakeResponse + self.userId = userId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshakeId = "handshake_id" + case handshakeResponse = "handshake_response" + case userId = "user_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshakeId, forKey: .handshakeId) + try container.encode(handshakeResponse, forKey: .handshakeResponse) + try container.encodeIfPresent(userId, forKey: .userId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartRequest.swift new file mode 100644 index 0000000..e25b6fc --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartRequest.swift @@ -0,0 +1,33 @@ +// +// LoginWebAuthnStartRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginWebAuthnStartRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String? + + public init(identifier: String? = nil) { + self.identifier = identifier + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(identifier, forKey: .identifier) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartResponse.swift new file mode 100644 index 0000000..0391836 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/LoginWebAuthnStartResponse.swift @@ -0,0 +1,36 @@ +// +// LoginWebAuthnStartResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct LoginWebAuthnStartResponse: Codable, JSONEncodable, Hashable { + + public var handshake: CredentialAssertionChallenge + public var user: User? + + public init(handshake: CredentialAssertionChallenge, user: User? = nil) { + self.handshake = handshake + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshake + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshake, forKey: .handshake) + try container.encodeIfPresent(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLink.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLink.swift new file mode 100644 index 0000000..c996c14 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLink.swift @@ -0,0 +1,33 @@ +// +// MagicLink.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct MagicLink: Codable, JSONEncodable, Hashable { + + /** the magic link id */ + public var id: String + + public init(id: String) { + self.id = id + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkAuthMethod.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkAuthMethod.swift new file mode 100644 index 0000000..63dcd64 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkAuthMethod.swift @@ -0,0 +1,39 @@ +// +// MagicLinkAuthMethod.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct MagicLinkAuthMethod: Codable, JSONEncodable, Hashable { + + static let ttlRule = NumericRule(minimum: 60, exclusiveMinimum: false, maximum: nil, exclusiveMaximum: false, multipleOf: nil) + /** Maximum time (IN SECONDS) for the auth to expire. */ + public var ttl: Int? = 300 + @available(*, deprecated, message: "This property is deprecated.") + public var ttlDisplayUnit: TtlDisplayUnit? + + public init(ttl: Int? = 300, ttlDisplayUnit: TtlDisplayUnit? = nil) { + self.ttl = ttl + self.ttlDisplayUnit = ttlDisplayUnit + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case ttl + case ttlDisplayUnit = "ttl_display_unit" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(ttl, forKey: .ttl) + try container.encodeIfPresent(ttlDisplayUnit, forKey: .ttlDisplayUnit) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkResponse.swift new file mode 100644 index 0000000..3ec09f9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/MagicLinkResponse.swift @@ -0,0 +1,32 @@ +// +// MagicLinkResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct MagicLinkResponse: Codable, JSONEncodable, Hashable { + + public var magicLink: MagicLink + + public init(magicLink: MagicLink) { + self.magicLink = magicLink + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case magicLink = "magic_link" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(magicLink, forKey: .magicLink) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Code.swift new file mode 100644 index 0000000..3d61cf9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Code.swift @@ -0,0 +1,16 @@ +// +// Model400Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model400Code: String, Codable, CaseIterable { + case request = "invalid_request" + case clientVersion = "invalid_client_version" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Error.swift new file mode 100644 index 0000000..67e92ea --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model400Error.swift @@ -0,0 +1,36 @@ +// +// Model400Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model400Error: Codable, JSONEncodable, Hashable { + + public var code: Model400Code + public var error: String + + public init(code: Model400Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Code.swift new file mode 100644 index 0000000..c6bf9f9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Code.swift @@ -0,0 +1,20 @@ +// +// Model401Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model401Code: String, Codable, CaseIterable { + case discoverableLoginFailed = "discoverable_login_failed" + case webauthnLoginFailed = "webauthn_login_failed" + case invalidMagicLink = "invalid_magic_link" + case invalidAccessToken = "invalid_access_token" + case invalidRefreshToken = "invalid_refresh_token" + case exceededAttempts = "exceeded_attempts" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Error.swift new file mode 100644 index 0000000..7bcec24 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model401Error.swift @@ -0,0 +1,36 @@ +// +// Model401Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model401Error: Codable, JSONEncodable, Hashable { + + public var code: Model401Code + public var error: String + + public init(code: Model401Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Code.swift new file mode 100644 index 0000000..1ebf4a1 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Code.swift @@ -0,0 +1,17 @@ +// +// Model403Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model403Code: String, Codable, CaseIterable { + case identifierNotVerified = "identifier_not_verified" + case operationNotAllowed = "operation_not_allowed" + case userNotActive = "user_not_active" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Error.swift new file mode 100644 index 0000000..99bd9bd --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model403Error.swift @@ -0,0 +1,36 @@ +// +// Model403Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model403Error: Codable, JSONEncodable, Hashable { + + public var code: Model403Code + public var error: String + + public init(code: Model403Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Code.swift new file mode 100644 index 0000000..10a6f24 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Code.swift @@ -0,0 +1,19 @@ +// +// Model404Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model404Code: String, Codable, CaseIterable { + case appNotFound = "app_not_found" + case userNotFound = "user_not_found" + case magicLinkNotFound = "magic_link_not_found" + case socialConnectionNotFound = "social_connection_not_found" + case transactionNotFound = "transaction_not_found" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Error.swift new file mode 100644 index 0000000..abf7dd2 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model404Error.swift @@ -0,0 +1,36 @@ +// +// Model404Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model404Error: Codable, JSONEncodable, Hashable { + + public var code: Model404Code + public var error: String + + public init(code: Model404Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Code.swift new file mode 100644 index 0000000..bd73834 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Code.swift @@ -0,0 +1,15 @@ +// +// Model409Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model409Code: String, Codable, CaseIterable { + case userHasNoPasskeys = "user_has_no_passkeys" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Error.swift new file mode 100644 index 0000000..af6f907 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model409Error.swift @@ -0,0 +1,36 @@ +// +// Model409Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model409Error: Codable, JSONEncodable, Hashable { + + public var code: Model409Code + public var error: String + + public init(code: Model409Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Code.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Code.swift new file mode 100644 index 0000000..18a0c09 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Code.swift @@ -0,0 +1,15 @@ +// +// Model500Code.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum Model500Code: String, Codable, CaseIterable { + case internalServerError = "internal_server_error" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Error.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Error.swift new file mode 100644 index 0000000..cf20f4d --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Model500Error.swift @@ -0,0 +1,36 @@ +// +// Model500Error.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Model500Error: Codable, JSONEncodable, Hashable { + + public var code: Model500Code + public var error: String + + public init(code: Model500Code, error: String) { + self.code = code + self.error = error + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case error + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(code, forKey: .code) + try container.encode(error, forKey: .error) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Nonce.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Nonce.swift new file mode 100644 index 0000000..9f2f995 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/Nonce.swift @@ -0,0 +1,33 @@ +// +// Nonce.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** the nonce to exchange for an authentication token */ +public struct Nonce: Codable, JSONEncodable, Hashable { + + public var nonce: String + + public init(nonce: String) { + self.nonce = nonce + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case nonce + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(nonce, forKey: .nonce) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OneTimePasscodeResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OneTimePasscodeResponse.swift new file mode 100644 index 0000000..56f85fa --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OneTimePasscodeResponse.swift @@ -0,0 +1,33 @@ +// +// OneTimePasscodeResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct OneTimePasscodeResponse: Codable, JSONEncodable, Hashable { + + /** The ID of the one-time passcode. Provide it when activating. */ + public var otpId: String + + public init(otpId: String) { + self.otpId = otpId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case otpId = "otp_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(otpId, forKey: .otpId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OpenIdConfiguration.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OpenIdConfiguration.swift new file mode 100644 index 0000000..099acf6 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OpenIdConfiguration.swift @@ -0,0 +1,40 @@ +// +// OpenIdConfiguration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct OpenIdConfiguration: Codable, JSONEncodable, Hashable { + + public var authorizationEndpoint: String + public var issuer: String + public var jwksUri: String + + public init(authorizationEndpoint: String, issuer: String, jwksUri: String) { + self.authorizationEndpoint = authorizationEndpoint + self.issuer = issuer + self.jwksUri = jwksUri + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case authorizationEndpoint = "authorization_endpoint" + case issuer + case jwksUri = "jwks_uri" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(authorizationEndpoint, forKey: .authorizationEndpoint) + try container.encode(issuer, forKey: .issuer) + try container.encode(jwksUri, forKey: .jwksUri) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OtpAuthMethod.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OtpAuthMethod.swift new file mode 100644 index 0000000..bcebefc --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/OtpAuthMethod.swift @@ -0,0 +1,39 @@ +// +// OtpAuthMethod.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct OtpAuthMethod: Codable, JSONEncodable, Hashable { + + static let ttlRule = NumericRule(minimum: 60, exclusiveMinimum: false, maximum: nil, exclusiveMaximum: false, multipleOf: nil) + /** Maximum time (IN SECONDS) for the auth to expire. */ + public var ttl: Int? = 300 + @available(*, deprecated, message: "This property is deprecated.") + public var ttlDisplayUnit: TtlDisplayUnit? + + public init(ttl: Int? = 300, ttlDisplayUnit: TtlDisplayUnit? = nil) { + self.ttl = ttl + self.ttlDisplayUnit = ttlDisplayUnit + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case ttl + case ttlDisplayUnit = "ttl_display_unit" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(ttl, forKey: .ttl) + try container.encodeIfPresent(ttlDisplayUnit, forKey: .ttlDisplayUnit) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertion.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertion.swift new file mode 100644 index 0000000..8e505ec --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertion.swift @@ -0,0 +1,32 @@ +// +// ProtocolCredentialAssertion.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ProtocolCredentialAssertion: Codable, JSONEncodable, Hashable { + + public var publicKey: ProtocolCredentialAssertionPublicKey + + public init(publicKey: ProtocolCredentialAssertionPublicKey) { + self.publicKey = publicKey + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case publicKey + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(publicKey, forKey: .publicKey) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKey.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKey.swift new file mode 100644 index 0000000..4d71a9b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKey.swift @@ -0,0 +1,53 @@ +// +// ProtocolCredentialAssertionPublicKey.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ProtocolCredentialAssertionPublicKey: Codable, JSONEncodable, Hashable { + + public var allowCredentials: [ProtocolCredentialAssertionPublicKeyAllowCredentialsInner]? + public var challenge: String + public var extensions: AnyCodable? + public var rpId: String? + public var timeout: Int? + /** UserVerification This member describes the Relying Party's requirements regarding user verification for the create() operation. Eligible authenticators are filtered to only those capable of satisfying this requirement. */ + public var userVerification: String? + + public init(allowCredentials: [ProtocolCredentialAssertionPublicKeyAllowCredentialsInner]? = nil, challenge: String, extensions: AnyCodable? = nil, rpId: String? = nil, timeout: Int? = nil, userVerification: String? = nil) { + self.allowCredentials = allowCredentials + self.challenge = challenge + self.extensions = extensions + self.rpId = rpId + self.timeout = timeout + self.userVerification = userVerification + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case allowCredentials + case challenge + case extensions + case rpId + case timeout + case userVerification + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(allowCredentials, forKey: .allowCredentials) + try container.encode(challenge, forKey: .challenge) + try container.encodeIfPresent(extensions, forKey: .extensions) + try container.encodeIfPresent(rpId, forKey: .rpId) + try container.encodeIfPresent(timeout, forKey: .timeout) + try container.encodeIfPresent(userVerification, forKey: .userVerification) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift new file mode 100644 index 0000000..62ee80b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift @@ -0,0 +1,43 @@ +// +// ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ProtocolCredentialAssertionPublicKeyAllowCredentialsInner: Codable, JSONEncodable, Hashable { + + /** CredentialID The ID of a credential to allow/disallow. */ + public var id: String + /** The authenticator transports that can be used. */ + public var transports: [String]? + /** The valid credential types. */ + public var type: String + + public init(id: String, transports: [String]? = nil, type: String) { + self.id = id + self.transports = transports + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case transports + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encodeIfPresent(transports, forKey: .transports) + try container.encode(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RefreshAuthTokenRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RefreshAuthTokenRequest.swift new file mode 100644 index 0000000..82059cc --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RefreshAuthTokenRequest.swift @@ -0,0 +1,32 @@ +// +// RefreshAuthTokenRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RefreshAuthTokenRequest: Codable, JSONEncodable, Hashable { + + public var refreshToken: String + + public init(refreshToken: String) { + self.refreshToken = refreshToken + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case refreshToken = "refresh_token" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(refreshToken, forKey: .refreshToken) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkRequest.swift new file mode 100644 index 0000000..fb8d7b9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkRequest.swift @@ -0,0 +1,43 @@ +// +// RegisterMagicLinkRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterMagicLinkRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String + /** language of the email or SMS to send (optional) */ + public var language: String? + /** path relative to the app's auth_origin (optional) */ + public var magicLinkPath: String? + + public init(identifier: String, language: String? = nil, magicLinkPath: String? = nil) { + self.identifier = identifier + self.language = language + self.magicLinkPath = magicLinkPath + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case language + case magicLinkPath = "magic_link_path" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(language, forKey: .language) + try container.encodeIfPresent(magicLinkPath, forKey: .magicLinkPath) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkResponse.swift new file mode 100644 index 0000000..7dc3994 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterMagicLinkResponse.swift @@ -0,0 +1,32 @@ +// +// RegisterMagicLinkResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterMagicLinkResponse: Codable, JSONEncodable, Hashable { + + public var magicLink: MagicLink + + public init(magicLink: MagicLink) { + self.magicLink = magicLink + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case magicLink = "magic_link" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(magicLink, forKey: .magicLink) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterOneTimePasscodeRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterOneTimePasscodeRequest.swift new file mode 100644 index 0000000..dd35822 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterOneTimePasscodeRequest.swift @@ -0,0 +1,38 @@ +// +// RegisterOneTimePasscodeRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterOneTimePasscodeRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String + /** language of the email to send (optional) */ + public var language: String? + + public init(identifier: String, language: String? = nil) { + self.identifier = identifier + self.language = language + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case language + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(language, forKey: .language) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishRequest.swift new file mode 100644 index 0000000..fccd38a --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishRequest.swift @@ -0,0 +1,40 @@ +// +// RegisterWebAuthnFinishRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnFinishRequest: Codable, JSONEncodable, Hashable { + + public var handshakeId: String + public var handshakeResponse: CredentialCreationResponse + public var userId: String + + public init(handshakeId: String, handshakeResponse: CredentialCreationResponse, userId: String) { + self.handshakeId = handshakeId + self.handshakeResponse = handshakeResponse + self.userId = userId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshakeId = "handshake_id" + case handshakeResponse = "handshake_response" + case userId = "user_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshakeId, forKey: .handshakeId) + try container.encode(handshakeResponse, forKey: .handshakeResponse) + try container.encode(userId, forKey: .userId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishWithTransactionRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishWithTransactionRequest.swift new file mode 100644 index 0000000..ea0968c --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnFinishWithTransactionRequest.swift @@ -0,0 +1,41 @@ +// +// RegisterWebAuthnFinishWithTransactionRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnFinishWithTransactionRequest: Codable, JSONEncodable, Hashable { + + public var handshakeId: String + public var handshakeResponse: CredentialCreationResponse + /** the transaction ID used to finish this webauthn registration */ + public var transactionId: String + + public init(handshakeId: String, handshakeResponse: CredentialCreationResponse, transactionId: String) { + self.handshakeId = handshakeId + self.handshakeResponse = handshakeResponse + self.transactionId = transactionId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshakeId = "handshake_id" + case handshakeResponse = "handshake_response" + case transactionId = "transaction_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshakeId, forKey: .handshakeId) + try container.encode(handshakeResponse, forKey: .handshakeResponse) + try container.encode(transactionId, forKey: .transactionId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartRequest.swift new file mode 100644 index 0000000..0079cb0 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartRequest.swift @@ -0,0 +1,37 @@ +// +// RegisterWebAuthnStartRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnStartRequest: Codable, JSONEncodable, Hashable { + + /** valid email or E164 phone number */ + public var identifier: String + public var authenticatorAttachment: AuthenticatorAttachment? + + public init(identifier: String, authenticatorAttachment: AuthenticatorAttachment? = nil) { + self.identifier = identifier + self.authenticatorAttachment = authenticatorAttachment + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case identifier + case authenticatorAttachment = "authenticator_attachment" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(identifier, forKey: .identifier) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartResponse.swift new file mode 100644 index 0000000..e44c590 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartResponse.swift @@ -0,0 +1,36 @@ +// +// RegisterWebAuthnStartResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnStartResponse: Codable, JSONEncodable, Hashable { + + public var handshake: CredentialCreationChallenge + public var user: User? + + public init(handshake: CredentialCreationChallenge, user: User? = nil) { + self.handshake = handshake + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshake + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshake, forKey: .handshake) + try container.encodeIfPresent(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionRequest.swift new file mode 100644 index 0000000..771c29c --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionRequest.swift @@ -0,0 +1,37 @@ +// +// RegisterWebAuthnStartWithTransactionRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnStartWithTransactionRequest: Codable, JSONEncodable, Hashable { + + /** the transaction ID to associate with this webauthn registration */ + public var transactionId: String + public var authenticatorAttachment: AuthenticatorAttachment? + + public init(transactionId: String, authenticatorAttachment: AuthenticatorAttachment? = nil) { + self.transactionId = transactionId + self.authenticatorAttachment = authenticatorAttachment + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case transactionId = "transaction_id" + case authenticatorAttachment = "authenticator_attachment" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(transactionId, forKey: .transactionId) + try container.encodeIfPresent(authenticatorAttachment, forKey: .authenticatorAttachment) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionResponse.swift new file mode 100644 index 0000000..1a75101 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/RegisterWebAuthnStartWithTransactionResponse.swift @@ -0,0 +1,37 @@ +// +// RegisterWebAuthnStartWithTransactionResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct RegisterWebAuthnStartWithTransactionResponse: Codable, JSONEncodable, Hashable { + + public var handshake: CredentialCreationChallenge + /** the transaction ID used to start this webauthn registration */ + public var transactionId: String? + + public init(handshake: CredentialCreationChallenge, transactionId: String? = nil) { + self.handshake = handshake + self.transactionId = transactionId + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case handshake + case transactionId = "transaction_id" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(handshake, forKey: .handshake) + try container.encodeIfPresent(transactionId, forKey: .transactionId) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnections.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnections.swift new file mode 100644 index 0000000..d5c2f6b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnections.swift @@ -0,0 +1,40 @@ +// +// SocialConnections.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct SocialConnections: Codable, JSONEncodable, Hashable { + + public var apple: AnyCodable? + public var google: AnyCodable? + public var github: AnyCodable? + + public init(apple: AnyCodable? = nil, google: AnyCodable? = nil, github: AnyCodable? = nil) { + self.apple = apple + self.google = google + self.github = github + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case apple + case google + case github + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(apple, forKey: .apple) + try container.encodeIfPresent(google, forKey: .google) + try container.encodeIfPresent(github, forKey: .github) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnectionsResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnectionsResponse.swift new file mode 100644 index 0000000..fa44124 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/SocialConnectionsResponse.swift @@ -0,0 +1,32 @@ +// +// SocialConnectionsResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct SocialConnectionsResponse: Codable, JSONEncodable, Hashable { + + public var socialConnections: UserSocialConnections + + public init(socialConnections: UserSocialConnections) { + self.socialConnections = socialConnections + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case socialConnections = "social_connections" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(socialConnections, forKey: .socialConnections) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/TtlDisplayUnit.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/TtlDisplayUnit.swift new file mode 100644 index 0000000..3bb0630 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/TtlDisplayUnit.swift @@ -0,0 +1,20 @@ +// +// TtlDisplayUnit.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days */ +@available(*, deprecated, message: "This schema is deprecated.") +public enum TtlDisplayUnit: String, Codable, CaseIterable { + case s = "s" + case m = "m" + case h = "h" + case d = "d" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateDeviceRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateDeviceRequest.swift new file mode 100644 index 0000000..dd67667 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateDeviceRequest.swift @@ -0,0 +1,32 @@ +// +// UpdateDeviceRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UpdateDeviceRequest: Codable, JSONEncodable, Hashable { + + public var friendlyName: String + + public init(friendlyName: String) { + self.friendlyName = friendlyName + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case friendlyName = "friendly_name" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(friendlyName, forKey: .friendlyName) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateMetadataRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateMetadataRequest.swift new file mode 100644 index 0000000..66ee201 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateMetadataRequest.swift @@ -0,0 +1,32 @@ +// +// UpdateMetadataRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UpdateMetadataRequest: Codable, JSONEncodable, Hashable { + + public var userMetadata: AnyCodable? + + public init(userMetadata: AnyCodable? = nil) { + self.userMetadata = userMetadata + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case userMetadata = "user_metadata" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(userMetadata, forKey: .userMetadata) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserEmailRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserEmailRequest.swift new file mode 100644 index 0000000..92a2cec --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserEmailRequest.swift @@ -0,0 +1,45 @@ +// +// UpdateUserEmailRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UpdateUserEmailRequest: Codable, JSONEncodable, Hashable { + + /** language of the email to send (optional) */ + public var language: String? + public var magicLinkPath: String? + public var newEmail: String + public var redirectUrl: String? + + public init(language: String? = nil, magicLinkPath: String? = nil, newEmail: String, redirectUrl: String? = nil) { + self.language = language + self.magicLinkPath = magicLinkPath + self.newEmail = newEmail + self.redirectUrl = redirectUrl + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case language + case magicLinkPath = "magic_link_path" + case newEmail = "new_email" + case redirectUrl = "redirect_url" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(language, forKey: .language) + try container.encodeIfPresent(magicLinkPath, forKey: .magicLinkPath) + try container.encode(newEmail, forKey: .newEmail) + try container.encodeIfPresent(redirectUrl, forKey: .redirectUrl) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserPhoneRequest.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserPhoneRequest.swift new file mode 100644 index 0000000..e747cc1 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UpdateUserPhoneRequest.swift @@ -0,0 +1,45 @@ +// +// UpdateUserPhoneRequest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UpdateUserPhoneRequest: Codable, JSONEncodable, Hashable { + + /** language of the email to send (optional) */ + public var language: String? + public var magicLinkPath: String? + public var newPhone: String? + public var redirectUrl: String? + + public init(language: String? = nil, magicLinkPath: String? = nil, newPhone: String? = nil, redirectUrl: String? = nil) { + self.language = language + self.magicLinkPath = magicLinkPath + self.newPhone = newPhone + self.redirectUrl = redirectUrl + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case language + case magicLinkPath = "magic_link_path" + case newPhone = "new_phone" + case redirectUrl = "redirect_url" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(language, forKey: .language) + try container.encodeIfPresent(magicLinkPath, forKey: .magicLinkPath) + try container.encodeIfPresent(newPhone, forKey: .newPhone) + try container.encodeIfPresent(redirectUrl, forKey: .redirectUrl) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/User.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 0000000..ec87cc1 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,66 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct User: Codable, JSONEncodable, Hashable { + + public var email: String + /** Whether or not the user's email has been verified */ + public var emailVerified: Bool + public var id: String + public var phone: String + /** Whether or not the user's phone has been verified */ + public var phoneVerified: Bool + public var status: UserStatus + public var userMetadata: AnyCodable? + public var webauthn: Bool + public var webauthnTypes: [WebAuthnType]? + + public init(email: String, emailVerified: Bool, id: String, phone: String, phoneVerified: Bool, status: UserStatus, userMetadata: AnyCodable?, webauthn: Bool, webauthnTypes: [WebAuthnType]) { + self.email = email + self.emailVerified = emailVerified + self.id = id + self.phone = phone + self.phoneVerified = phoneVerified + self.status = status + self.userMetadata = userMetadata + self.webauthn = webauthn + self.webauthnTypes = webauthnTypes + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case email + case emailVerified = "email_verified" + case id + case phone + case phoneVerified = "phone_verified" + case status + case userMetadata = "user_metadata" + case webauthn + case webauthnTypes = "webauthn_types" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(email, forKey: .email) + try container.encode(emailVerified, forKey: .emailVerified) + try container.encode(id, forKey: .id) + try container.encode(phone, forKey: .phone) + try container.encode(phoneVerified, forKey: .phoneVerified) + try container.encode(status, forKey: .status) + try container.encode(userMetadata, forKey: .userMetadata) + try container.encode(webauthn, forKey: .webauthn) + try container.encode(webauthnTypes, forKey: .webauthnTypes) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataField.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataField.swift new file mode 100644 index 0000000..7f69c77 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataField.swift @@ -0,0 +1,52 @@ +// +// UserMetadataField.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UserMetadataField: Codable, JSONEncodable, Hashable { + + public var fieldName: String + public var friendlyName: String + public var id: String + public var profile: Bool + public var registration: Bool + public var type: String + + public init(fieldName: String, friendlyName: String, id: String, profile: Bool, registration: Bool, type: String) { + self.fieldName = fieldName + self.friendlyName = friendlyName + self.id = id + self.profile = profile + self.registration = registration + self.type = type + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case fieldName = "field_name" + case friendlyName = "friendly_name" + case id + case profile + case registration + case type + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(fieldName, forKey: .fieldName) + try container.encode(friendlyName, forKey: .friendlyName) + try container.encode(id, forKey: .id) + try container.encode(profile, forKey: .profile) + try container.encode(registration, forKey: .registration) + try container.encode(type, forKey: .type) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataResponse.swift new file mode 100644 index 0000000..e09f707 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserMetadataResponse.swift @@ -0,0 +1,32 @@ +// +// UserMetadataResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UserMetadataResponse: Codable, JSONEncodable, Hashable { + + public var userMetadata: AnyCodable + + public init(userMetadata: AnyCodable) { + self.userMetadata = userMetadata + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case userMetadata = "user_metadata" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(userMetadata, forKey: .userMetadata) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserResponse.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserResponse.swift new file mode 100644 index 0000000..35238d2 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserResponse.swift @@ -0,0 +1,32 @@ +// +// UserResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UserResponse: Codable, JSONEncodable, Hashable { + + public var user: User? + + public init(user: User?) { + self.user = user + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case user + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(user, forKey: .user) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserSocialConnections.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserSocialConnections.swift new file mode 100644 index 0000000..5b26f02 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserSocialConnections.swift @@ -0,0 +1,40 @@ +// +// UserSocialConnections.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UserSocialConnections: Codable, JSONEncodable, Hashable { + + public var apple: AppleSocialConnection? + public var github: GithubSocialConnection? + public var google: GoogleSocialConnection? + + public init(apple: AppleSocialConnection? = nil, github: GithubSocialConnection? = nil, google: GoogleSocialConnection? = nil) { + self.apple = apple + self.github = github + self.google = google + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case apple + case github + case google + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(apple, forKey: .apple) + try container.encodeIfPresent(github, forKey: .github) + try container.encodeIfPresent(google, forKey: .google) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserStatus.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserStatus.swift new file mode 100644 index 0000000..6f24917 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/UserStatus.swift @@ -0,0 +1,19 @@ +// +// UserStatus.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** User status: active, inactive, pending */ +public enum UserStatus: String, Codable, CaseIterable { + case active = "active" + case inactive = "inactive" + case pending = "pending" + case statusUnavailable = "" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnIcons.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnIcons.swift new file mode 100644 index 0000000..a127b5b --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnIcons.swift @@ -0,0 +1,37 @@ +// +// WebAuthnIcons.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** 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: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4= */ +public struct WebAuthnIcons: Codable, JSONEncodable, Hashable { + + public var light: String? + public var dark: String? + + public init(light: String?, dark: String?) { + self.light = light + self.dark = dark + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case light + case dark + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(light, forKey: .light) + try container.encode(dark, forKey: .dark) + } +} + diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnType.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnType.swift new file mode 100644 index 0000000..6a4a9b9 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Models/WebAuthnType.swift @@ -0,0 +1,18 @@ +// +// WebAuthnType.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** The type of this credential */ +public enum WebAuthnType: String, Codable, CaseIterable { + case passkey = "passkey" + case securityKey = "security_key" + case platform = "platform" +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift new file mode 100644 index 0000000..cc32888 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift @@ -0,0 +1,56 @@ +// +// OpenISO8601DateFormatter.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// https://stackoverflow.com/a/50281094/976628 +public class OpenISO8601DateFormatter: DateFormatter { + static let withoutSeconds: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" + return formatter + }() + + static let withoutTime: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd" + return formatter + }() + + private func setup() { + calendar = Calendar(identifier: .iso8601) + locale = Locale(identifier: "en_US_POSIX") + timeZone = TimeZone(secondsFromGMT: 0) + dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + } + + override init() { + super.init() + setup() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setup() + } + + override public func date(from string: String) -> Date? { + if let result = super.date(from: string) { + return result + } else if let result = OpenISO8601DateFormatter.withoutSeconds.date(from: string) { + return result + } + + return OpenISO8601DateFormatter.withoutTime.date(from: string) + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift new file mode 100644 index 0000000..acf7ff4 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift @@ -0,0 +1,36 @@ +// SynchronizedDictionary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +internal struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + internal subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } +} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift new file mode 100644 index 0000000..def439d --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -0,0 +1,634 @@ +// URLSessionImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if !os(macOS) +import MobileCoreServices +#endif + +public protocol URLSessionProtocol { + func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +} + +extension URLSession: URLSessionProtocol {} + +class URLSessionRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return URLSessionRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return URLSessionDecodableRequestBuilder.self + } +} + +public typealias OpenAPIClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + +// Store the URLSession to retain its reference +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() + +open class URLSessionRequestBuilder: RequestBuilder { + + /** + May be assigned if you want to control the authentication challenges. + */ + public var taskDidReceiveChallenge: OpenAPIClientAPIChallengeHandler? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { + super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication) + } + + /** + May be overridden by a subclass if you want to control the URLSession + configuration. + */ + open func createURLSession() -> URLSessionProtocol { + return defaultURLSession + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the URLRequest + configuration (e.g. to override the cache policy). + */ + open func createURLRequest(urlSession: URLSessionProtocol, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + + guard let url = URL(string: URLString) else { + throw DownloadException.requestMissingURL + } + + var originalRequest = URLRequest(url: url) + + originalRequest.httpMethod = method.rawValue + + buildHeaders().forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) + + return modifiedRequest + } + + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + let urlSession = createURLSession() + + guard let xMethod = HTTPMethod(rawValue: method) else { + fatalError("Unsupported Http method - \(method)") + } + + let encoding: ParameterEncoding + + switch xMethod { + case .get, .head: + encoding = URLEncoding() + + case .options, .post, .put, .patch, .delete, .trace, .connect: + let contentType = headers["Content-Type"] ?? "application/json" + + if contentType.hasPrefix("application/json") { + encoding = JSONDataEncoding() + } else if contentType.hasPrefix("multipart/form-data") { + encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) + } else if contentType.hasPrefix("application/x-www-form-urlencoded") { + encoding = FormURLEncoding() + } else if contentType.hasPrefix("application/octet-stream"){ + encoding = OctetStreamEncoding() + } else { + fatalError("Unsupported Media Type - \(contentType)") + } + } + + do { + let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + + let dataTask = urlSession.dataTask(with: request) { data, response, error in + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + + onProgressReady?(dataTask.progress) + + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + + dataTask.resume() + + requestTask.set(task: dataTask) + } catch { + apiResponseQueue.async { + completion(.failure(ErrorResponse.error(415, nil, nil, error))) + } + } + + return requestTask + } + + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T, bodyData: data))) + + default: + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") + } + + } + + open func buildHeaders() -> [String: String] { + var httpHeaders: [String: String] = [:] + for (key, value) in OpenAPIClientAPI.customHeaders { + httpHeaders[key] = value + } + for (key, value) in headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename: String? + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + continue + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with: "") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url: URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as! T, bodyData: data))) + + case is URL.Type: + do { + + guard error == nil else { + throw DownloadException.responseFailed + } + + guard let data = data else { + throw DownloadException.responseDataMissing + } + + let fileManager = FileManager.default + let cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] + let requestURL = try getURL(from: urlRequest) + + var requestPath = try getPath(from: requestURL) + + if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } else { + requestPath = requestPath.appending("/tmp.OpenAPIClient.\(UUID().uuidString)") + } + + let filePath = cachesDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion(.success(Response(response: httpResponse, body: filePath as! T, bodyData: data))) + + } catch let requestParserError as DownloadException { + completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) + } catch { + completion(.failure(ErrorResponse.error(400, data, response, error))) + } + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T, bodyData: data))) + + case is Data.Type: + + completion(.success(Response(response: httpResponse, body: data as! T, bodyData: data))) + + default: + + guard let unwrappedData = data, !unwrappedData.isEmpty else { + if let expressibleByNilLiteralType = T.self as? ExpressibleByNilLiteral.Type { + completion(.success(Response(response: httpResponse, body: expressibleByNilLiteralType.init(nilLiteral: ()) as! T, bodyData: data))) + } else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, response, DecodableRequestBuilderError.emptyDataResponse))) + } + return + } + + let decodeResult = CodableHelper.decode(T.self, from: unwrappedData) + + switch decodeResult { + case let .success(decodableObj): + completion(.success(Response(response: httpResponse, body: decodableObj, bodyData: unwrappedData))) + case let .failure(error): + completion(.failure(ErrorResponse.error(httpResponse.statusCode, unwrappedData, response, error))) + } + } + } +} + +private class SessionDelegate: NSObject, URLSessionTaskDelegate { + func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + + var credential: URLCredential? + + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } +} + +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest +} + +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters else { return urlRequest } + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) + urlRequest.url = urlComponents.url + } + + return urlRequest + } +} + +private class FormDataEncoding: ParameterEncoding { + + let contentTypeForFormPart: (_ fileURL: URL) -> String? + + init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { + self.contentTypeForFormPart = contentTypeForFormPart + } + + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters, !parameters.isEmpty else { + return urlRequest + } + + let boundary = "Boundary-\(UUID().uuidString)" + + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + for (key, value) in parameters { + for value in (value as? Array ?? [value]) { + switch value { + case let fileURL as URL: + + urlRequest = try configureFileUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + fileURL: fileURL + ) + + case let string as String: + + if let data = string.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let number as NSNumber: + + if let data = number.stringValue.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + + case let uuid as UUID: + + if let data = uuid.uuidString.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + default: + fatalError("Unprocessable value \(value) with key \(key)") + } + } + } + + var body = urlRequest.httpBody.orEmpty + + body.append("\r\n--\(boundary)--\r\n") + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + let fileData = try Data(contentsOf: fileURL) + + let mimetype = contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) + + let fileName = fileURL.lastPathComponent + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(fileData) + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(data) + + urlRequest.httpBody = body + + return urlRequest + + } + + func mimeType(for url: URL) -> String { + let pathExtension = url.pathExtension + + if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue(), + let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { + return mimetype as String + } + return "application/octet-stream" + } + +} + +private class FormURLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + var requestBodyComponents = URLComponents() + requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:]) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8) + + return urlRequest + } +} + +private class OctetStreamEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let body = parameters?["body"] else { return urlRequest } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type") + } + + switch body { + case let fileURL as URL: + urlRequest.httpBody = try Data(contentsOf: fileURL) + case let data as Data: + urlRequest.httpBody = data + default: + fatalError("Unprocessable body \(body)") + } + + return urlRequest + } +} + +private extension Data { + /// Append string to Data + /// + /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. + /// + /// - parameter string: The string to be added to the `Data`. + + mutating func append(_ string: String) { + if let data = string.data(using: .utf8) { + append(data) + } + } +} + +private extension Optional where Wrapped == Data { + var orEmpty: Data { + self ?? Data() + } +} + +extension JSONDataEncoding: ParameterEncoding {} diff --git a/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Validation.swift b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Validation.swift new file mode 100644 index 0000000..b520bd7 --- /dev/null +++ b/Sources/Passage/generated/OpenAPIClient/Classes/OpenAPIs/Validation.swift @@ -0,0 +1,126 @@ +// Validation.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct StringRule { + public var minLength: Int? + public var maxLength: Int? + public var pattern: String? +} + +public struct NumericRule { + public var minimum: T? + public var exclusiveMinimum = false + public var maximum: T? + public var exclusiveMaximum = false + public var multipleOf: T? +} + +public enum StringValidationErrorKind: Error { + case minLength, maxLength, pattern +} + +public enum NumericValidationErrorKind: Error { + case minimum, maximum, multipleOf +} + +public struct ValidationError: Error { + public fileprivate(set) var kinds: Set +} + +public struct Validator { + /// Validate a string against a rule. + /// - Parameter string: The String you wish to validate. + /// - Parameter rule: The StringRule you wish to use for validation. + /// - Returns: A validated string. + /// - Throws: `ValidationError` if the string is invalid against the rule, + /// `NSError` if the rule.pattern is invalid. + public static func validate(_ string: String, against rule: StringRule) throws -> String { + var error = ValidationError(kinds: []) + if let minLength = rule.minLength, !(minLength <= string.count) { + error.kinds.insert(.minLength) + } + if let maxLength = rule.maxLength, !(string.count <= maxLength) { + error.kinds.insert(.maxLength) + } + if let pattern = rule.pattern { + let matches = try NSRegularExpression(pattern: pattern, options: .caseInsensitive) + .matches(in: string, range: .init(location: 0, length: string.utf16.count)) + if matches.isEmpty { + error.kinds.insert(.pattern) + } + } + guard error.kinds.isEmpty else { + throw error + } + return string + } + + /// Validate a integer against a rule. + /// - Parameter numeric: The integer you wish to validate. + /// - Parameter rule: The NumericRule you wish to use for validation. + /// - Returns: A validated integer. + /// - Throws: `ValidationError` if the numeric is invalid against the rule. + public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { + var error = ValidationError(kinds: []) + if let minium = rule.minimum { + if !rule.exclusiveMinimum, minium > numeric { + error.kinds.insert(.minimum) + } + if rule.exclusiveMinimum, minium >= numeric { + error.kinds.insert(.minimum) + } + } + if let maximum = rule.maximum { + if !rule.exclusiveMaximum, numeric > maximum { + error.kinds.insert(.maximum) + } + if rule.exclusiveMaximum, numeric >= maximum { + error.kinds.insert(.maximum) + } + } + if let multipleOf = rule.multipleOf, !numeric.isMultiple(of: multipleOf) { + error.kinds.insert(.multipleOf) + } + guard error.kinds.isEmpty else { + throw error + } + return numeric + } + + /// Validate a fractional number against a rule. + /// - Parameter numeric: The fractional number you wish to validate. + /// - Parameter rule: The NumericRule you wish to use for validation. + /// - Returns: A validated fractional number. + /// - Throws: `ValidationError` if the numeric is invalid against the rule. + public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { + var error = ValidationError(kinds: []) + if let minium = rule.minimum { + if !rule.exclusiveMinimum, minium > numeric { + error.kinds.insert(.minimum) + } + if rule.exclusiveMinimum, minium >= numeric { + error.kinds.insert(.minimum) + } + } + if let maximum = rule.maximum { + if !rule.exclusiveMaximum, numeric > maximum { + error.kinds.insert(.maximum) + } + if rule.exclusiveMaximum, numeric >= maximum { + error.kinds.insert(.maximum) + } + } + if let multipleOf = rule.multipleOf, numeric.remainder(dividingBy: multipleOf) != 0 { + error.kinds.insert(.multipleOf) + } + guard error.kinds.isEmpty else { + throw error + } + return numeric + } +} diff --git a/Sources/Passage/generated/README.md b/Sources/Passage/generated/README.md new file mode 100644 index 0000000..77565af --- /dev/null +++ b/Sources/Passage/generated/README.md @@ -0,0 +1,197 @@ +# Swift5 API client for OpenAPIClient + +Passage's authentication API to enable passwordless authentication. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1 +- Package version: +- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen +For more information, please visit [https://passage.id/support](https://passage.id/support) + +## Installation + +### Carthage + +Run `carthage update` + +### CocoaPods + +Run `pod install` + +## Documentation for API Endpoints + +All URIs are relative to *https://auth.passage.id/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppsAPI* | [**getApp**](docs/AppsAPI.md#getapp) | **GET** /apps/{app_id} | Get App +*AuthenticateAPI* | [**authenticateWebauthnFinishWithTransaction**](docs/AuthenticateAPI.md#authenticatewebauthnfinishwithtransaction) | **POST** /apps/{app_id}/authenticate/transactions/webauthn/finish | Finish WebAuthn authentication with an optional transaction +*AuthenticateAPI* | [**authenticateWebauthnStartWithTransaction**](docs/AuthenticateAPI.md#authenticatewebauthnstartwithtransaction) | **POST** /apps/{app_id}/authenticate/transactions/webauthn/start | Start WebAuthn authentication with an optional transaction +*CurrentuserAPI* | [**deleteCurrentuserDevice**](docs/CurrentuserAPI.md#deletecurrentuserdevice) | **DELETE** /apps/{app_id}/currentuser/devices/{device_id} | Revoke Device +*CurrentuserAPI* | [**deleteCurrentuserSocialConnection**](docs/CurrentuserAPI.md#deletecurrentusersocialconnection) | **DELETE** /apps/{app_id}/currentuser/social-connections/{social_connection_type} | Delete Social Connection +*CurrentuserAPI* | [**getCurrentuser**](docs/CurrentuserAPI.md#getcurrentuser) | **GET** /apps/{app_id}/currentuser | Get Current User +*CurrentuserAPI* | [**getCurrentuserDevices**](docs/CurrentuserAPI.md#getcurrentuserdevices) | **GET** /apps/{app_id}/currentuser/devices | List Devices +*CurrentuserAPI* | [**getCurrentuserMetadata**](docs/CurrentuserAPI.md#getcurrentusermetadata) | **GET** /apps/{app_id}/currentuser/user-metadata | Get user's metadata +*CurrentuserAPI* | [**getCurrentuserSocialConnections**](docs/CurrentuserAPI.md#getcurrentusersocialconnections) | **GET** /apps/{app_id}/currentuser/social-connections | Get Social Connections +*CurrentuserAPI* | [**postCurrentuserAddDeviceFinish**](docs/CurrentuserAPI.md#postcurrentuseradddevicefinish) | **POST** /apps/{app_id}/currentuser/devices/finish | Finish WebAuthn Add Device +*CurrentuserAPI* | [**postCurrentuserAddDeviceStart**](docs/CurrentuserAPI.md#postcurrentuseradddevicestart) | **POST** /apps/{app_id}/currentuser/devices/start | Start WebAuthn Add Device +*CurrentuserAPI* | [**updateCurrentuserDevice**](docs/CurrentuserAPI.md#updatecurrentuserdevice) | **PATCH** /apps/{app_id}/currentuser/devices/{device_id} | Update Device +*CurrentuserAPI* | [**updateCurrentuserMetadata**](docs/CurrentuserAPI.md#updatecurrentusermetadata) | **PATCH** /apps/{app_id}/currentuser/user-metadata | Update user's metadata +*CurrentuserAPI* | [**updateEmailCurrentuser**](docs/CurrentuserAPI.md#updateemailcurrentuser) | **PATCH** /apps/{app_id}/currentuser/email | Change Email +*CurrentuserAPI* | [**updatePhoneCurrentuser**](docs/CurrentuserAPI.md#updatephonecurrentuser) | **PATCH** /apps/{app_id}/currentuser/phone | Change Phone +*JWKSAPI* | [**getJwks**](docs/JWKSAPI.md#getjwks) | **GET** /apps/{app_id}/.well-known/jwks.json | Get JWKS +*LoginAPI* | [**loginMagicLink**](docs/LoginAPI.md#loginmagiclink) | **POST** /apps/{app_id}/login/magic-link | Login with Magic Link +*LoginAPI* | [**loginOneTimePasscode**](docs/LoginAPI.md#loginonetimepasscode) | **POST** /apps/{app_id}/login/otp | Login with OTP +*LoginAPI* | [**loginWebauthnFinish**](docs/LoginAPI.md#loginwebauthnfinish) | **POST** /apps/{app_id}/login/webauthn/finish | Finish WebAuthn Login +*LoginAPI* | [**loginWebauthnStart**](docs/LoginAPI.md#loginwebauthnstart) | **POST** /apps/{app_id}/login/webauthn/start | Start WebAuthn Login +*MagicLinkAPI* | [**activateMagicLink**](docs/MagicLinkAPI.md#activatemagiclink) | **PATCH** /apps/{app_id}/magic-link/activate | Authenticate Magic Link +*MagicLinkAPI* | [**magicLinkStatus**](docs/MagicLinkAPI.md#magiclinkstatus) | **POST** /apps/{app_id}/magic-link/status | Magic Link Status +*OAuth2API* | [**appleOauth2Callback**](docs/OAuth2API.md#appleoauth2callback) | **POST** /apps/{app_id}/social/oauth2_callback | Handle Apple's OAuth2 callback +*OAuth2API* | [**appleOauth2CallbackDefaultDev**](docs/OAuth2API.md#appleoauth2callbackdefaultdev) | **POST** /social/oauth2_callback | Handle Apple's OAuth2 callback for the default developer credentials +*OAuth2API* | [**currentuserSocialLinkAccount**](docs/OAuth2API.md#currentusersociallinkaccount) | **GET** /apps/{app_id}/currentuser/social/link_account | Link an existing account to an OAuth2 connection. +*OAuth2API* | [**exchangeSocialIdToken**](docs/OAuth2API.md#exchangesocialidtoken) | **POST** /apps/{app_id}/social/id_token | Exchange native mobile identity token for an auth token. +*OAuth2API* | [**exchangeSocialToken**](docs/OAuth2API.md#exchangesocialtoken) | **GET** /apps/{app_id}/social/token | Exchange OAuth2 connection data for an auth token. +*OAuth2API* | [**getAuthorize**](docs/OAuth2API.md#getauthorize) | **GET** /apps/{app_id}/social/authorize | Kick off OAuth2 flow +*OAuth2API* | [**oauth2Callback**](docs/OAuth2API.md#oauth2callback) | **GET** /apps/{app_id}/social/oauth2_callback | Handle OAuth2 callback +*OAuth2API* | [**oauth2CallbackDefaultDev**](docs/OAuth2API.md#oauth2callbackdefaultdev) | **GET** /social/oauth2_callback | Handle OAuth2 callback for the default developer credentials +*OTPAPI* | [**activateOneTimePasscode**](docs/OTPAPI.md#activateonetimepasscode) | **POST** /apps/{app_id}/otp/activate | Authenticate OTP +*OpenIDAPI* | [**getOpenIdConfiguration**](docs/OpenIDAPI.md#getopenidconfiguration) | **GET** /apps/{app_id}/.well-known/openid-configuration | Get OpenID Configuration +*PasskeyReadinessAPI* | [**createPasskeyReadiness**](docs/PasskeyReadinessAPI.md#createpasskeyreadiness) | **POST** /analytics/passkey-readiness | Create Passkey Readiness Analytics +*RegisterAPI* | [**registerMagicLink**](docs/RegisterAPI.md#registermagiclink) | **POST** /apps/{app_id}/register/magic-link | Register with Magic Link +*RegisterAPI* | [**registerOneTimePasscode**](docs/RegisterAPI.md#registeronetimepasscode) | **POST** /apps/{app_id}/register/otp | Register with OTP +*RegisterAPI* | [**registerWebauthnFinish**](docs/RegisterAPI.md#registerwebauthnfinish) | **POST** /apps/{app_id}/register/webauthn/finish | Finish WebAuthn Registration +*RegisterAPI* | [**registerWebauthnFinishWithTransaction**](docs/RegisterAPI.md#registerwebauthnfinishwithtransaction) | **POST** /apps/{app_id}/register/transactions/webauthn/finish | Finish WebAuthn registration with a transaction +*RegisterAPI* | [**registerWebauthnStart**](docs/RegisterAPI.md#registerwebauthnstart) | **POST** /apps/{app_id}/register/webauthn/start | Start WebAuthn Register +*RegisterAPI* | [**registerWebauthnStartWithTransaction**](docs/RegisterAPI.md#registerwebauthnstartwithtransaction) | **POST** /apps/{app_id}/register/transactions/webauthn/start | Start WebAuthn registration with a transaction +*TokensAPI* | [**refreshAuthToken**](docs/TokensAPI.md#refreshauthtoken) | **POST** /apps/{app_id}/tokens | Creates new auth and refresh token +*TokensAPI* | [**revokeRefreshToken**](docs/TokensAPI.md#revokerefreshtoken) | **DELETE** /apps/{app_id}/tokens | Revokes refresh token +*UsersAPI* | [**checkUserIdentifier**](docs/UsersAPI.md#checkuseridentifier) | **GET** /apps/{app_id}/users | Get User +*UsersAPI* | [**createUser**](docs/UsersAPI.md#createuser) | **POST** /apps/{app_id}/users | Create User + + +## Documentation For Models + + - [ActivateMagicLinkRequest](docs/ActivateMagicLinkRequest.md) + - [ActivateOneTimePasscodeRequest](docs/ActivateOneTimePasscodeRequest.md) + - [AddDeviceFinishRequest](docs/AddDeviceFinishRequest.md) + - [AddDeviceStartResponse](docs/AddDeviceStartResponse.md) + - [App](docs/App.md) + - [AppleSocialConnection](docs/AppleSocialConnection.md) + - [AuthMethods](docs/AuthMethods.md) + - [AuthResponse](docs/AuthResponse.md) + - [AuthResult](docs/AuthResult.md) + - [AuthenticateWebAuthnFinishWithTransactionRequest](docs/AuthenticateWebAuthnFinishWithTransactionRequest.md) + - [AuthenticateWebAuthnStartWithTransactionRequest](docs/AuthenticateWebAuthnStartWithTransactionRequest.md) + - [AuthenticateWebAuthnStartWithTransactionResponse](docs/AuthenticateWebAuthnStartWithTransactionResponse.md) + - [AuthenticatorAttachment](docs/AuthenticatorAttachment.md) + - [CreatePasskeyReadinessRequest](docs/CreatePasskeyReadinessRequest.md) + - [CreateUserParams](docs/CreateUserParams.md) + - [Credential](docs/Credential.md) + - [CredentialAssertionChallenge](docs/CredentialAssertionChallenge.md) + - [CredentialAssertionResponse](docs/CredentialAssertionResponse.md) + - [CredentialAssertionResponseResponse](docs/CredentialAssertionResponseResponse.md) + - [CredentialCreation](docs/CredentialCreation.md) + - [CredentialCreationChallenge](docs/CredentialCreationChallenge.md) + - [CredentialCreationPublicKey](docs/CredentialCreationPublicKey.md) + - [CredentialCreationPublicKeyAuthenticatorSelection](docs/CredentialCreationPublicKeyAuthenticatorSelection.md) + - [CredentialCreationPublicKeyExcludeCredentialsInner](docs/CredentialCreationPublicKeyExcludeCredentialsInner.md) + - [CredentialCreationPublicKeyPubKeyCredParamsInner](docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md) + - [CredentialCreationPublicKeyRp](docs/CredentialCreationPublicKeyRp.md) + - [CredentialCreationPublicKeyUser](docs/CredentialCreationPublicKeyUser.md) + - [CredentialCreationResponse](docs/CredentialCreationResponse.md) + - [CredentialCreationResponseResponse](docs/CredentialCreationResponseResponse.md) + - [CurrentUser](docs/CurrentUser.md) + - [CurrentUserDevice](docs/CurrentUserDevice.md) + - [CurrentUserDevices](docs/CurrentUserDevices.md) + - [CurrentUserDevicesStartRequest](docs/CurrentUserDevicesStartRequest.md) + - [CurrentUserResponse](docs/CurrentUserResponse.md) + - [ElementCustomization](docs/ElementCustomization.md) + - [FontFamily](docs/FontFamily.md) + - [GetAppResponse](docs/GetAppResponse.md) + - [GetMagicLinkStatusRequest](docs/GetMagicLinkStatusRequest.md) + - [GithubSocialConnection](docs/GithubSocialConnection.md) + - [GoogleSocialConnection](docs/GoogleSocialConnection.md) + - [IdTokenRequest](docs/IdTokenRequest.md) + - [JWKResponse](docs/JWKResponse.md) + - [JWKResponseKeysInner](docs/JWKResponseKeysInner.md) + - [LayoutConfig](docs/LayoutConfig.md) + - [Layouts](docs/Layouts.md) + - [LoginMagicLinkRequest](docs/LoginMagicLinkRequest.md) + - [LoginMagicLinkResponse](docs/LoginMagicLinkResponse.md) + - [LoginOneTimePasscodeRequest](docs/LoginOneTimePasscodeRequest.md) + - [LoginWebAuthnFinishRequest](docs/LoginWebAuthnFinishRequest.md) + - [LoginWebAuthnStartRequest](docs/LoginWebAuthnStartRequest.md) + - [LoginWebAuthnStartResponse](docs/LoginWebAuthnStartResponse.md) + - [MagicLink](docs/MagicLink.md) + - [MagicLinkAuthMethod](docs/MagicLinkAuthMethod.md) + - [MagicLinkResponse](docs/MagicLinkResponse.md) + - [Model400Code](docs/Model400Code.md) + - [Model400Error](docs/Model400Error.md) + - [Model401Code](docs/Model401Code.md) + - [Model401Error](docs/Model401Error.md) + - [Model403Code](docs/Model403Code.md) + - [Model403Error](docs/Model403Error.md) + - [Model404Code](docs/Model404Code.md) + - [Model404Error](docs/Model404Error.md) + - [Model409Code](docs/Model409Code.md) + - [Model409Error](docs/Model409Error.md) + - [Model500Code](docs/Model500Code.md) + - [Model500Error](docs/Model500Error.md) + - [Nonce](docs/Nonce.md) + - [OneTimePasscodeResponse](docs/OneTimePasscodeResponse.md) + - [OpenIdConfiguration](docs/OpenIdConfiguration.md) + - [OtpAuthMethod](docs/OtpAuthMethod.md) + - [ProtocolCredentialAssertion](docs/ProtocolCredentialAssertion.md) + - [ProtocolCredentialAssertionPublicKey](docs/ProtocolCredentialAssertionPublicKey.md) + - [ProtocolCredentialAssertionPublicKeyAllowCredentialsInner](docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md) + - [RefreshAuthTokenRequest](docs/RefreshAuthTokenRequest.md) + - [RegisterMagicLinkRequest](docs/RegisterMagicLinkRequest.md) + - [RegisterMagicLinkResponse](docs/RegisterMagicLinkResponse.md) + - [RegisterOneTimePasscodeRequest](docs/RegisterOneTimePasscodeRequest.md) + - [RegisterWebAuthnFinishRequest](docs/RegisterWebAuthnFinishRequest.md) + - [RegisterWebAuthnFinishWithTransactionRequest](docs/RegisterWebAuthnFinishWithTransactionRequest.md) + - [RegisterWebAuthnStartRequest](docs/RegisterWebAuthnStartRequest.md) + - [RegisterWebAuthnStartResponse](docs/RegisterWebAuthnStartResponse.md) + - [RegisterWebAuthnStartWithTransactionRequest](docs/RegisterWebAuthnStartWithTransactionRequest.md) + - [RegisterWebAuthnStartWithTransactionResponse](docs/RegisterWebAuthnStartWithTransactionResponse.md) + - [SocialConnections](docs/SocialConnections.md) + - [SocialConnectionsResponse](docs/SocialConnectionsResponse.md) + - [TtlDisplayUnit](docs/TtlDisplayUnit.md) + - [UpdateDeviceRequest](docs/UpdateDeviceRequest.md) + - [UpdateMetadataRequest](docs/UpdateMetadataRequest.md) + - [UpdateUserEmailRequest](docs/UpdateUserEmailRequest.md) + - [UpdateUserPhoneRequest](docs/UpdateUserPhoneRequest.md) + - [User](docs/User.md) + - [UserMetadataField](docs/UserMetadataField.md) + - [UserMetadataResponse](docs/UserMetadataResponse.md) + - [UserResponse](docs/UserResponse.md) + - [UserSocialConnections](docs/UserSocialConnections.md) + - [UserStatus](docs/UserStatus.md) + - [WebAuthnIcons](docs/WebAuthnIcons.md) + - [WebAuthnType](docs/WebAuthnType.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### bearerAuth + +- **Type**: HTTP Bearer Token authentication (JWT) + + +### ApiKeyAuth + +- **Type**: API key +- **API key parameter name**: X-API-KEY +- **Location**: HTTP header + + +## Author + +support@passage.id + diff --git a/Sources/Passage/generated/docs/ActivateMagicLinkRequest.md b/Sources/Passage/generated/docs/ActivateMagicLinkRequest.md new file mode 100644 index 0000000..9b45916 --- /dev/null +++ b/Sources/Passage/generated/docs/ActivateMagicLinkRequest.md @@ -0,0 +1,10 @@ +# ActivateMagicLinkRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**magicLink** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/ActivateOneTimePasscodeRequest.md b/Sources/Passage/generated/docs/ActivateOneTimePasscodeRequest.md new file mode 100644 index 0000000..228fefd --- /dev/null +++ b/Sources/Passage/generated/docs/ActivateOneTimePasscodeRequest.md @@ -0,0 +1,11 @@ +# ActivateOneTimePasscodeRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**otp** | **String** | | +**otpId** | **String** | The ID of the one-time passcode. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AddDeviceFinishRequest.md b/Sources/Passage/generated/docs/AddDeviceFinishRequest.md new file mode 100644 index 0000000..00c19d7 --- /dev/null +++ b/Sources/Passage/generated/docs/AddDeviceFinishRequest.md @@ -0,0 +1,12 @@ +# AddDeviceFinishRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshakeId** | **String** | | +**handshakeResponse** | [**CredentialCreationResponse**](CredentialCreationResponse.md) | | +**userId** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AddDeviceStartResponse.md b/Sources/Passage/generated/docs/AddDeviceStartResponse.md new file mode 100644 index 0000000..bf43214 --- /dev/null +++ b/Sources/Passage/generated/docs/AddDeviceStartResponse.md @@ -0,0 +1,11 @@ +# AddDeviceStartResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshake** | [**CredentialCreationChallenge**](CredentialCreationChallenge.md) | | +**user** | [**User**](User.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/App.md b/Sources/Passage/generated/docs/App.md new file mode 100644 index 0000000..7370c46 --- /dev/null +++ b/Sources/Passage/generated/docs/App.md @@ -0,0 +1,33 @@ +# App + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowedIdentifier** | **String** | | +**authFallbackMethod** | **String** | Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. | +**authFallbackMethodTtl** | **Int** | Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods. | +**authMethods** | [**AuthMethods**](AuthMethods.md) | | +**authOrigin** | **String** | | +**defaultLanguage** | **String** | | +**elementCustomization** | [**ElementCustomization**](ElementCustomization.md) | | +**elementCustomizationDark** | [**ElementCustomization**](ElementCustomization.md) | | +**ephemeral** | **Bool** | | +**id** | **String** | | +**layouts** | [**Layouts**](Layouts.md) | | +**loginUrl** | **String** | | +**name** | **String** | | +**passageBranding** | **Bool** | | +**publicSignup** | **Bool** | | +**profileManagement** | **Bool** | | +**redirectUrl** | **String** | | +**requireEmailVerification** | **Bool** | | +**requireIdentifierVerification** | **Bool** | | +**requiredIdentifier** | **String** | | +**rsaPublicKey** | **String** | | +**sessionTimeoutLength** | **Int** | | +**socialConnections** | [**SocialConnections**](SocialConnections.md) | | +**userMetadataSchema** | [UserMetadataField] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AppleSocialConnection.md b/Sources/Passage/generated/docs/AppleSocialConnection.md new file mode 100644 index 0000000..12f0752 --- /dev/null +++ b/Sources/Passage/generated/docs/AppleSocialConnection.md @@ -0,0 +1,13 @@ +# AppleSocialConnection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | **String** | The external ID of the Social Connection. | +**createdAt** | **Date** | | +**lastLoginAt** | **Date** | | +**providerIdentifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AppsAPI.md b/Sources/Passage/generated/docs/AppsAPI.md new file mode 100644 index 0000000..1812af1 --- /dev/null +++ b/Sources/Passage/generated/docs/AppsAPI.md @@ -0,0 +1,59 @@ +# AppsAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getApp**](AppsAPI.md#getapp) | **GET** /apps/{app_id} | Get App + + +# **getApp** +```swift + open class func getApp(appId: String, completion: @escaping (_ data: GetAppResponse?, _ error: Error?) -> Void) +``` + +Get App + +Get information about an application. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get App +AppsAPI.getApp(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**GetAppResponse**](GetAppResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/AuthMethods.md b/Sources/Passage/generated/docs/AuthMethods.md new file mode 100644 index 0000000..a500b6e --- /dev/null +++ b/Sources/Passage/generated/docs/AuthMethods.md @@ -0,0 +1,12 @@ +# AuthMethods + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passkeys** | **AnyCodable** | | [optional] +**otp** | [**OtpAuthMethod**](OtpAuthMethod.md) | | [optional] +**magicLink** | [**MagicLinkAuthMethod**](MagicLinkAuthMethod.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthResponse.md b/Sources/Passage/generated/docs/AuthResponse.md new file mode 100644 index 0000000..0ab2cea --- /dev/null +++ b/Sources/Passage/generated/docs/AuthResponse.md @@ -0,0 +1,10 @@ +# AuthResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authResult** | [**AuthResult**](AuthResult.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthResult.md b/Sources/Passage/generated/docs/AuthResult.md new file mode 100644 index 0000000..a6b411e --- /dev/null +++ b/Sources/Passage/generated/docs/AuthResult.md @@ -0,0 +1,13 @@ +# AuthResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authToken** | **String** | | +**redirectUrl** | **String** | | +**refreshToken** | **String** | | [optional] +**refreshTokenExpiration** | **Int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthenticateAPI.md b/Sources/Passage/generated/docs/AuthenticateAPI.md new file mode 100644 index 0000000..ee9db42 --- /dev/null +++ b/Sources/Passage/generated/docs/AuthenticateAPI.md @@ -0,0 +1,114 @@ +# AuthenticateAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authenticateWebauthnFinishWithTransaction**](AuthenticateAPI.md#authenticatewebauthnfinishwithtransaction) | **POST** /apps/{app_id}/authenticate/transactions/webauthn/finish | Finish WebAuthn authentication with an optional transaction +[**authenticateWebauthnStartWithTransaction**](AuthenticateAPI.md#authenticatewebauthnstartwithtransaction) | **POST** /apps/{app_id}/authenticate/transactions/webauthn/start | Start WebAuthn authentication with an optional transaction + + +# **authenticateWebauthnFinishWithTransaction** +```swift + open class func authenticateWebauthnFinishWithTransaction(appId: String, authenticateWebAuthnFinishWithTransactionRequest: AuthenticateWebAuthnFinishWithTransactionRequest, completion: @escaping (_ data: Nonce?, _ error: Error?) -> Void) +``` + +Finish WebAuthn authentication with an optional transaction + +Complete a WebAuthn authentication and authenticate the user via a transaction. This endpoint accepts and verifies the response from `navigator.credential.get()` and returns a nonce meant to be exchanged for an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let authenticateWebAuthnFinishWithTransactionRequest = AuthenticateWebAuthnFinishWithTransactionRequest(handshakeId: "handshakeId_example", handshakeResponse: CredentialAssertionResponse(authenticatorAttachment: "authenticatorAttachment_example", clientExtensionResults: 123, id: "id_example", rawId: "rawId_example", response: CredentialAssertionResponse_response(authenticatorData: "authenticatorData_example", clientDataJSON: "clientDataJSON_example", signature: "signature_example", userHandle: "userHandle_example"), type: "type_example"), transactionId: "transactionId_example") // AuthenticateWebAuthnFinishWithTransactionRequest | + +// Finish WebAuthn authentication with an optional transaction +AuthenticateAPI.authenticateWebauthnFinishWithTransaction(appId: appId, authenticateWebAuthnFinishWithTransactionRequest: authenticateWebAuthnFinishWithTransactionRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **authenticateWebAuthnFinishWithTransactionRequest** | [**AuthenticateWebAuthnFinishWithTransactionRequest**](AuthenticateWebAuthnFinishWithTransactionRequest.md) | | + +### Return type + +[**Nonce**](Nonce.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authenticateWebauthnStartWithTransaction** +```swift + open class func authenticateWebauthnStartWithTransaction(appId: String, authenticateWebAuthnStartWithTransactionRequest: AuthenticateWebAuthnStartWithTransactionRequest? = nil, completion: @escaping (_ data: AuthenticateWebAuthnStartWithTransactionResponse?, _ error: Error?) -> Void) +``` + +Start WebAuthn authentication with an optional transaction + +Initiate a WebAuthn authentication for a user via a transaction. This endpoint creates a WebAuthn credential assertion challenge that is used to perform the authentication ceremony from the browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let authenticateWebAuthnStartWithTransactionRequest = AuthenticateWebAuthnStartWithTransactionRequest(transactionId: "transactionId_example") // AuthenticateWebAuthnStartWithTransactionRequest | (optional) + +// Start WebAuthn authentication with an optional transaction +AuthenticateAPI.authenticateWebauthnStartWithTransaction(appId: appId, authenticateWebAuthnStartWithTransactionRequest: authenticateWebAuthnStartWithTransactionRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **authenticateWebAuthnStartWithTransactionRequest** | [**AuthenticateWebAuthnStartWithTransactionRequest**](AuthenticateWebAuthnStartWithTransactionRequest.md) | | [optional] + +### Return type + +[**AuthenticateWebAuthnStartWithTransactionResponse**](AuthenticateWebAuthnStartWithTransactionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/AuthenticateWebAuthnFinishWithTransactionRequest.md b/Sources/Passage/generated/docs/AuthenticateWebAuthnFinishWithTransactionRequest.md new file mode 100644 index 0000000..6aeaa8b --- /dev/null +++ b/Sources/Passage/generated/docs/AuthenticateWebAuthnFinishWithTransactionRequest.md @@ -0,0 +1,12 @@ +# AuthenticateWebAuthnFinishWithTransactionRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshakeId** | **String** | | +**handshakeResponse** | [**CredentialAssertionResponse**](CredentialAssertionResponse.md) | | +**transactionId** | **String** | the transaction ID used when starting this login attempt (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionRequest.md b/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionRequest.md new file mode 100644 index 0000000..36a0cfd --- /dev/null +++ b/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionRequest.md @@ -0,0 +1,10 @@ +# AuthenticateWebAuthnStartWithTransactionRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionId** | **String** | the transaction ID to associate with this authentication attempt (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionResponse.md b/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionResponse.md new file mode 100644 index 0000000..be3f368 --- /dev/null +++ b/Sources/Passage/generated/docs/AuthenticateWebAuthnStartWithTransactionResponse.md @@ -0,0 +1,11 @@ +# AuthenticateWebAuthnStartWithTransactionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshake** | [**CredentialAssertionChallenge**](CredentialAssertionChallenge.md) | | +**transactionId** | **String** | the transaction ID provided for this authentication attempt, null if not provided | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/AuthenticatorAttachment.md b/Sources/Passage/generated/docs/AuthenticatorAttachment.md new file mode 100644 index 0000000..d53b2eb --- /dev/null +++ b/Sources/Passage/generated/docs/AuthenticatorAttachment.md @@ -0,0 +1,9 @@ +# AuthenticatorAttachment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CreatePasskeyReadinessRequest.md b/Sources/Passage/generated/docs/CreatePasskeyReadinessRequest.md new file mode 100644 index 0000000..9a0eeef --- /dev/null +++ b/Sources/Passage/generated/docs/CreatePasskeyReadinessRequest.md @@ -0,0 +1,15 @@ +# CreatePasskeyReadinessRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceId** | **String** | | +**securityKey** | **Bool** | | +**platform** | **Bool** | | +**syncedCredential** | **Bool** | | +**crossDeviceCredential** | **Bool** | | +**conditionalUi** | **Bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CreateUserParams.md b/Sources/Passage/generated/docs/CreateUserParams.md new file mode 100644 index 0000000..f3ed8be --- /dev/null +++ b/Sources/Passage/generated/docs/CreateUserParams.md @@ -0,0 +1,11 @@ +# CreateUserParams + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | | +**userMetadata** | **AnyCodable** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Credential.md b/Sources/Passage/generated/docs/Credential.md new file mode 100644 index 0000000..0824299 --- /dev/null +++ b/Sources/Passage/generated/docs/Credential.md @@ -0,0 +1,19 @@ +# Credential + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | **String** | The first time this webAuthn device was used to authenticate the user | +**credId** | **String** | The CredID for this webAuthn device (encoded to match what is stored in psg_cred_obj) | +**friendlyName** | **String** | The friendly name for the webAuthn device used to authenticate | +**id** | **String** | The ID of the webAuthn device used for authentication | +**lastLoginAt** | **String** | The last time this webAuthn device was used to authenticate the user | +**type** | [**WebAuthnType**](WebAuthnType.md) | | +**updatedAt** | **String** | The last time this webAuthn device was updated | +**usageCount** | **Int** | How many times this webAuthn device has been used to authenticate the user | +**userId** | **String** | The UserID for this webAuthn device | +**icons** | [**WebAuthnIcons**](WebAuthnIcons.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialAssertionChallenge.md b/Sources/Passage/generated/docs/CredentialAssertionChallenge.md new file mode 100644 index 0000000..0c15a20 --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialAssertionChallenge.md @@ -0,0 +1,11 @@ +# CredentialAssertionChallenge + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**challenge** | [**ProtocolCredentialAssertion**](ProtocolCredentialAssertion.md) | | +**id** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialAssertionResponse.md b/Sources/Passage/generated/docs/CredentialAssertionResponse.md new file mode 100644 index 0000000..82ccd85 --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialAssertionResponse.md @@ -0,0 +1,15 @@ +# CredentialAssertionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticatorAttachment** | **String** | | [optional] +**clientExtensionResults** | **AnyCodable** | | [optional] +**id** | **String** | ID is The credential’s identifier. The requirements for the identifier are distinct for each type of credential. It might represent a username for username/password tuples, for example. | [optional] +**rawId** | **String** | | [optional] +**response** | [**CredentialAssertionResponseResponse**](CredentialAssertionResponseResponse.md) | | [optional] +**type** | **String** | Type is the value of the object’s interface object's [[type]] slot, which specifies the credential type represented by this object. This should be type \"public-key\" for Webauthn credentials. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialAssertionResponseResponse.md b/Sources/Passage/generated/docs/CredentialAssertionResponseResponse.md new file mode 100644 index 0000000..6a8bf1a --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialAssertionResponseResponse.md @@ -0,0 +1,13 @@ +# CredentialAssertionResponseResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticatorData** | **String** | | [optional] +**clientDataJSON** | **String** | From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson This attribute contains a JSON serialization of the client data passed to the authenticator by the client in its call to either create() or get(). | [optional] +**signature** | **String** | | [optional] +**userHandle** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreation.md b/Sources/Passage/generated/docs/CredentialCreation.md new file mode 100644 index 0000000..1ccce4e --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreation.md @@ -0,0 +1,10 @@ +# CredentialCreation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**publicKey** | [**CredentialCreationPublicKey**](CredentialCreationPublicKey.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationChallenge.md b/Sources/Passage/generated/docs/CredentialCreationChallenge.md new file mode 100644 index 0000000..0e3e79e --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationChallenge.md @@ -0,0 +1,11 @@ +# CredentialCreationChallenge + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**challenge** | [**CredentialCreation**](CredentialCreation.md) | | +**id** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKey.md b/Sources/Passage/generated/docs/CredentialCreationPublicKey.md new file mode 100644 index 0000000..7b35c85 --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKey.md @@ -0,0 +1,18 @@ +# CredentialCreationPublicKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attestation** | **String** | | [optional] +**authenticatorSelection** | [**CredentialCreationPublicKeyAuthenticatorSelection**](CredentialCreationPublicKeyAuthenticatorSelection.md) | | [optional] +**challenge** | **String** | | [optional] +**excludeCredentials** | [CredentialCreationPublicKeyExcludeCredentialsInner] | | [optional] +**extensions** | **AnyCodable** | | [optional] +**pubKeyCredParams** | [CredentialCreationPublicKeyPubKeyCredParamsInner] | | [optional] +**rp** | [**CredentialCreationPublicKeyRp**](CredentialCreationPublicKeyRp.md) | | [optional] +**timeout** | **Int** | | [optional] +**user** | [**CredentialCreationPublicKeyUser**](CredentialCreationPublicKeyUser.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKeyAuthenticatorSelection.md b/Sources/Passage/generated/docs/CredentialCreationPublicKeyAuthenticatorSelection.md new file mode 100644 index 0000000..3f8ab7b --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKeyAuthenticatorSelection.md @@ -0,0 +1,13 @@ +# CredentialCreationPublicKeyAuthenticatorSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticatorAttachment** | **String** | AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only authenticators attached with the specified AuthenticatorAttachment enum. | [optional] +**requireResidentKey** | **Bool** | RequireResidentKey this member describes the Relying Party's requirements regarding resident credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident public key credential source when creating a public key credential. | [optional] +**residentKey** | **String** | ResidentKey this member describes the Relying Party's requirements regarding resident credentials per Webauthn Level 2. | [optional] +**userVerification** | **String** | UserVerification This member describes the Relying Party's requirements regarding user verification for the create() operation. Eligible authenticators are filtered to only those capable of satisfying this requirement. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKeyExcludeCredentialsInner.md b/Sources/Passage/generated/docs/CredentialCreationPublicKeyExcludeCredentialsInner.md new file mode 100644 index 0000000..2b1095b --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKeyExcludeCredentialsInner.md @@ -0,0 +1,12 @@ +# CredentialCreationPublicKeyExcludeCredentialsInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | CredentialID The ID of a credential to allow/disallow. | [optional] +**transports** | **[String]** | The authenticator transports that can be used. | [optional] +**type** | **String** | The valid credential types. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md b/Sources/Passage/generated/docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md new file mode 100644 index 0000000..2e8a0ee --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKeyPubKeyCredParamsInner.md @@ -0,0 +1,11 @@ +# CredentialCreationPublicKeyPubKeyCredParamsInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alg** | **Int** | | [optional] +**type** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKeyRp.md b/Sources/Passage/generated/docs/CredentialCreationPublicKeyRp.md new file mode 100644 index 0000000..1cf913c --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKeyRp.md @@ -0,0 +1,12 @@ +# CredentialCreationPublicKeyRp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon** | **String** | A serialized URL which resolves to an image associated with the entity. For example, this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for an icon member’s value. Authenticators MAY ignore an icon member’s value if its length is greater than 128 bytes. The URL’s scheme MAY be \"data\" to avoid fetches of the URL, at the cost of needing more storage. Deprecated: this has been removed from the specification recommendations. | [optional] +**id** | **String** | A unique identifier for the Relying Party entity, which sets the RP ID. | [optional] +**name** | **String** | A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, intended only for display. For example, \"ACME Corporation\", \"Wonderful Widgets, Inc.\" or \"ОАО Примертех\". When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is intended only for display, i.e., aiding the user in determining the difference between user accounts with similar displayNames. For example, \"alexm\", \"alex.p.mueller@example.com\" or \"+14255551234\". | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationPublicKeyUser.md b/Sources/Passage/generated/docs/CredentialCreationPublicKeyUser.md new file mode 100644 index 0000000..05b1c4a --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationPublicKeyUser.md @@ -0,0 +1,13 @@ +# CredentialCreationPublicKeyUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**displayName** | **String** | A human-palatable name for the user account, intended only for display. For example, \"Alex P. Müller\" or \"田中 倫\". The Relying Party SHOULD let the user choose this, and SHOULD NOT restrict the choice more than necessary. | [optional] +**icon** | **String** | A serialized URL which resolves to an image associated with the entity. For example, this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori authenticated URL. Authenticators MUST accept and store a 128-byte minimum length for an icon member’s value. Authenticators MAY ignore an icon member’s value if its length is greater than 128 bytes. The URL’s scheme MAY be \"data\" to avoid fetches of the URL, at the cost of needing more storage. Deprecated: this has been removed from the specification recommendations. | [optional] +**id** | **String** | ID is the user handle of the user account entity. To ensure secure operation, authentication and authorization decisions MUST be made on the basis of this id member, not the displayName nor name members. See Section 6.1 of [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). | [optional] +**name** | **String** | A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, intended only for display. For example, \"ACME Corporation\", \"Wonderful Widgets, Inc.\" or \"ОАО Примертех\". When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is intended only for display, i.e., aiding the user in determining the difference between user accounts with similar displayNames. For example, \"alexm\", \"alex.p.mueller@example.com\" or \"+14255551234\". | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationResponse.md b/Sources/Passage/generated/docs/CredentialCreationResponse.md new file mode 100644 index 0000000..4c5dc20 --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationResponse.md @@ -0,0 +1,16 @@ +# CredentialCreationResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticatorAttachment** | **String** | | [optional] +**clientExtensionResults** | **AnyCodable** | | [optional] +**id** | **String** | ID is The credential's identifier. The requirements for the identifier are distinct for each type of credential. It might represent a username for username/password tuples, for example. | [optional] +**rawId** | **String** | | [optional] +**response** | [**CredentialCreationResponseResponse**](CredentialCreationResponseResponse.md) | | [optional] +**transports** | **[String]** | | [optional] +**type** | **String** | Type is the value of the object's interface object's [[type]] slot, which specifies the credential type represented by this object. This should be type \"public-key\" for Webauthn credentials. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CredentialCreationResponseResponse.md b/Sources/Passage/generated/docs/CredentialCreationResponseResponse.md new file mode 100644 index 0000000..f8fbcdb --- /dev/null +++ b/Sources/Passage/generated/docs/CredentialCreationResponseResponse.md @@ -0,0 +1,12 @@ +# CredentialCreationResponseResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attestationObject** | **String** | AttestationObject is the byte slice version of attestationObject. This attribute contains an attestation object, which is opaque to, and cryptographically protected against tampering by, the client. The attestation object contains both authenticator data and an attestation statement. The former contains the AAGUID, a unique credential ID, and the credential public key. The contents of the attestation statement are determined by the attestation statement format used by the authenticator. It also contains any additional information that the Relying Party's server requires to validate the attestation statement, as well as to decode and validate the authenticator data along with the JSON-serialized client data. | [optional] +**clientDataJSON** | **String** | From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson This attribute contains a JSON serialization of the client data passed to the authenticator by the client in its call to either create() or get(). | [optional] +**transports** | **[String]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentUser.md b/Sources/Passage/generated/docs/CurrentUser.md new file mode 100644 index 0000000..9803dcb --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentUser.md @@ -0,0 +1,24 @@ +# CurrentUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | **String** | When this user was created | +**email** | **String** | The user's email | +**emailVerified** | **Bool** | Whether or not the user's email has been verified | +**id** | **String** | The user ID | +**lastLoginAt** | **String** | The last time this user logged in | +**loginCount** | **Int** | How many times the user has successfully logged in | +**phone** | **String** | The user's phone | +**phoneVerified** | **Bool** | Whether or not the user's phone has been verified | +**socialConnections** | [**UserSocialConnections**](UserSocialConnections.md) | | +**status** | [**UserStatus**](UserStatus.md) | | +**updatedAt** | **String** | When this user was last updated | +**userMetadata** | **AnyCodable** | | +**webauthn** | **Bool** | Whether or not the user has authenticated via webAuthn before (if len(WebAuthnDevices) > 0) | +**webauthnDevices** | [Credential] | The list of devices this user has authenticated with via webAuthn | +**webauthnTypes** | [WebAuthnType] | List of credential types that user has created | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentUserDevice.md b/Sources/Passage/generated/docs/CurrentUserDevice.md new file mode 100644 index 0000000..70e4811 --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentUserDevice.md @@ -0,0 +1,10 @@ +# CurrentUserDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device** | [**Credential**](Credential.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentUserDevices.md b/Sources/Passage/generated/docs/CurrentUserDevices.md new file mode 100644 index 0000000..12427ec --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentUserDevices.md @@ -0,0 +1,10 @@ +# CurrentUserDevices + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [Credential] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentUserDevicesStartRequest.md b/Sources/Passage/generated/docs/CurrentUserDevicesStartRequest.md new file mode 100644 index 0000000..503f8e2 --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentUserDevicesStartRequest.md @@ -0,0 +1,10 @@ +# CurrentUserDevicesStartRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticatorAttachment** | [**AuthenticatorAttachment**](AuthenticatorAttachment.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentUserResponse.md b/Sources/Passage/generated/docs/CurrentUserResponse.md new file mode 100644 index 0000000..dcc37b7 --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentUserResponse.md @@ -0,0 +1,10 @@ +# CurrentUserResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**CurrentUser**](CurrentUser.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/CurrentuserAPI.md b/Sources/Passage/generated/docs/CurrentuserAPI.md new file mode 100644 index 0000000..d5b2976 --- /dev/null +++ b/Sources/Passage/generated/docs/CurrentuserAPI.md @@ -0,0 +1,638 @@ +# CurrentuserAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteCurrentuserDevice**](CurrentuserAPI.md#deletecurrentuserdevice) | **DELETE** /apps/{app_id}/currentuser/devices/{device_id} | Revoke Device +[**deleteCurrentuserSocialConnection**](CurrentuserAPI.md#deletecurrentusersocialconnection) | **DELETE** /apps/{app_id}/currentuser/social-connections/{social_connection_type} | Delete Social Connection +[**getCurrentuser**](CurrentuserAPI.md#getcurrentuser) | **GET** /apps/{app_id}/currentuser | Get Current User +[**getCurrentuserDevices**](CurrentuserAPI.md#getcurrentuserdevices) | **GET** /apps/{app_id}/currentuser/devices | List Devices +[**getCurrentuserMetadata**](CurrentuserAPI.md#getcurrentusermetadata) | **GET** /apps/{app_id}/currentuser/user-metadata | Get user's metadata +[**getCurrentuserSocialConnections**](CurrentuserAPI.md#getcurrentusersocialconnections) | **GET** /apps/{app_id}/currentuser/social-connections | Get Social Connections +[**postCurrentuserAddDeviceFinish**](CurrentuserAPI.md#postcurrentuseradddevicefinish) | **POST** /apps/{app_id}/currentuser/devices/finish | Finish WebAuthn Add Device +[**postCurrentuserAddDeviceStart**](CurrentuserAPI.md#postcurrentuseradddevicestart) | **POST** /apps/{app_id}/currentuser/devices/start | Start WebAuthn Add Device +[**updateCurrentuserDevice**](CurrentuserAPI.md#updatecurrentuserdevice) | **PATCH** /apps/{app_id}/currentuser/devices/{device_id} | Update Device +[**updateCurrentuserMetadata**](CurrentuserAPI.md#updatecurrentusermetadata) | **PATCH** /apps/{app_id}/currentuser/user-metadata | Update user's metadata +[**updateEmailCurrentuser**](CurrentuserAPI.md#updateemailcurrentuser) | **PATCH** /apps/{app_id}/currentuser/email | Change Email +[**updatePhoneCurrentuser**](CurrentuserAPI.md#updatephonecurrentuser) | **PATCH** /apps/{app_id}/currentuser/phone | Change Phone + + +# **deleteCurrentuserDevice** +```swift + open class func deleteCurrentuserDevice(appId: String, deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Revoke Device + +Revoke a device by ID for the current user. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let deviceId = "deviceId_example" // String | Device ID + +// Revoke Device +CurrentuserAPI.deleteCurrentuserDevice(appId: appId, deviceId: deviceId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **deviceId** | **String** | Device ID | + +### Return type + +Void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteCurrentuserSocialConnection** +```swift + open class func deleteCurrentuserSocialConnection(appId: String, socialConnectionType: SocialConnectionType_deleteCurrentuserSocialConnection, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Delete Social Connection + +Deletes a social connection for the current user. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let socialConnectionType = "socialConnectionType_example" // String | The type of social connection + +// Delete Social Connection +CurrentuserAPI.deleteCurrentuserSocialConnection(appId: appId, socialConnectionType: socialConnectionType) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **socialConnectionType** | **String** | The type of social connection | + +### Return type + +Void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getCurrentuser** +```swift + open class func getCurrentuser(appId: String, completion: @escaping (_ data: CurrentUserResponse?, _ error: Error?) -> Void) +``` + +Get Current User + +Get information about a user that is currently authenticated via bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get Current User +CurrentuserAPI.getCurrentuser(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**CurrentUserResponse**](CurrentUserResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getCurrentuserDevices** +```swift + open class func getCurrentuserDevices(appId: String, completion: @escaping (_ data: CurrentUserDevices?, _ error: Error?) -> Void) +``` + +List Devices + +List all WebAuthn devices for the authenticated user. User must be authenticated via bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// List Devices +CurrentuserAPI.getCurrentuserDevices(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**CurrentUserDevices**](CurrentUserDevices.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getCurrentuserMetadata** +```swift + open class func getCurrentuserMetadata(appId: String, completion: @escaping (_ data: UserMetadataResponse?, _ error: Error?) -> Void) +``` + +Get user's metadata + +Get the user-metadata for the current user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get user's metadata +CurrentuserAPI.getCurrentuserMetadata(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**UserMetadataResponse**](UserMetadataResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getCurrentuserSocialConnections** +```swift + open class func getCurrentuserSocialConnections(appId: String, completion: @escaping (_ data: SocialConnectionsResponse?, _ error: Error?) -> Void) +``` + +Get Social Connections + +Gets social connections for the current user. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get Social Connections +CurrentuserAPI.getCurrentuserSocialConnections(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**SocialConnectionsResponse**](SocialConnectionsResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **postCurrentuserAddDeviceFinish** +```swift + open class func postCurrentuserAddDeviceFinish(appId: String, addDeviceFinishRequest: AddDeviceFinishRequest, completion: @escaping (_ data: CurrentUserDevice?, _ error: Error?) -> Void) +``` + +Finish WebAuthn Add Device + +Complete a WebAuthn add device operation for the current user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns the created device for the user. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let addDeviceFinishRequest = AddDeviceFinishRequest(handshakeId: "handshakeId_example", handshakeResponse: CredentialCreationResponse(authenticatorAttachment: "authenticatorAttachment_example", clientExtensionResults: 123, id: "id_example", rawId: "rawId_example", response: CredentialCreationResponse_response(attestationObject: "attestationObject_example", clientDataJSON: "clientDataJSON_example", transports: ["transports_example"]), transports: ["transports_example"], type: "type_example"), userId: "userId_example") // AddDeviceFinishRequest | WebAuthn Response Data + +// Finish WebAuthn Add Device +CurrentuserAPI.postCurrentuserAddDeviceFinish(appId: appId, addDeviceFinishRequest: addDeviceFinishRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **addDeviceFinishRequest** | [**AddDeviceFinishRequest**](AddDeviceFinishRequest.md) | WebAuthn Response Data | + +### Return type + +[**CurrentUserDevice**](CurrentUserDevice.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **postCurrentuserAddDeviceStart** +```swift + open class func postCurrentuserAddDeviceStart(appId: String, currentUserDevicesStartRequest: CurrentUserDevicesStartRequest? = nil, completion: @escaping (_ data: AddDeviceStartResponse?, _ error: Error?) -> Void) +``` + +Start WebAuthn Add Device + +Initiate a WebAuthn add device operation for the current user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let currentUserDevicesStartRequest = CurrentUserDevicesStartRequest(authenticatorAttachment: AuthenticatorAttachment()) // CurrentUserDevicesStartRequest | WebAuthn Start Response Data (optional) + +// Start WebAuthn Add Device +CurrentuserAPI.postCurrentuserAddDeviceStart(appId: appId, currentUserDevicesStartRequest: currentUserDevicesStartRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **currentUserDevicesStartRequest** | [**CurrentUserDevicesStartRequest**](CurrentUserDevicesStartRequest.md) | WebAuthn Start Response Data | [optional] + +### Return type + +[**AddDeviceStartResponse**](AddDeviceStartResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateCurrentuserDevice** +```swift + open class func updateCurrentuserDevice(appId: String, deviceId: String, updateDeviceRequest: UpdateDeviceRequest, completion: @escaping (_ data: CurrentUserDevice?, _ error: Error?) -> Void) +``` + +Update Device + +Update a device by ID for the current user. Currently the only field that can be updated is the friendly name. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let deviceId = "deviceId_example" // String | Device ID +let updateDeviceRequest = UpdateDeviceRequest(friendlyName: "friendlyName_example") // UpdateDeviceRequest | Friendly Name + +// Update Device +CurrentuserAPI.updateCurrentuserDevice(appId: appId, deviceId: deviceId, updateDeviceRequest: updateDeviceRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **deviceId** | **String** | Device ID | + **updateDeviceRequest** | [**UpdateDeviceRequest**](UpdateDeviceRequest.md) | Friendly Name | + +### Return type + +[**CurrentUserDevice**](CurrentUserDevice.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateCurrentuserMetadata** +```swift + open class func updateCurrentuserMetadata(appId: String, updateMetadataRequest: UpdateMetadataRequest, completion: @escaping (_ data: CurrentUserResponse?, _ error: Error?) -> Void) +``` + +Update user's metadata + +Update the metadata for the current user. Only valid metadata fields are accepted. Invalid metadata fields that are present will abort the update. User must be authenticated via a bearer token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let updateMetadataRequest = UpdateMetadataRequest(userMetadata: 123) // UpdateMetadataRequest | User Metadata + +// Update user's metadata +CurrentuserAPI.updateCurrentuserMetadata(appId: appId, updateMetadataRequest: updateMetadataRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **updateMetadataRequest** | [**UpdateMetadataRequest**](UpdateMetadataRequest.md) | User Metadata | + +### Return type + +[**CurrentUserResponse**](CurrentUserResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateEmailCurrentuser** +```swift + open class func updateEmailCurrentuser(appId: String, updateUserEmailRequest: UpdateUserEmailRequest, completion: @escaping (_ data: MagicLinkResponse?, _ error: Error?) -> Void) +``` + +Change Email + +Initiate an email change for the authenticated user. An email change requires verification, so an email will be sent to the user which they must verify before the email change takes effect. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let updateUserEmailRequest = UpdateUserEmailRequest(language: "language_example", magicLinkPath: "magicLinkPath_example", newEmail: "newEmail_example", redirectUrl: "redirectUrl_example") // UpdateUserEmailRequest | email + +// Change Email +CurrentuserAPI.updateEmailCurrentuser(appId: appId, updateUserEmailRequest: updateUserEmailRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **updateUserEmailRequest** | [**UpdateUserEmailRequest**](UpdateUserEmailRequest.md) | email | + +### Return type + +[**MagicLinkResponse**](MagicLinkResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePhoneCurrentuser** +```swift + open class func updatePhoneCurrentuser(appId: String, updateUserPhoneRequest: UpdateUserPhoneRequest, completion: @escaping (_ data: MagicLinkResponse?, _ error: Error?) -> Void) +``` + +Change Phone + +Initiate a phone number change for the authenticated user. An phone number change requires verification, so an SMS with a link will be sent to the user which they must verify before the phone number change takes effect. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let updateUserPhoneRequest = UpdateUserPhoneRequest(language: "language_example", magicLinkPath: "magicLinkPath_example", newPhone: "newPhone_example", redirectUrl: "redirectUrl_example") // UpdateUserPhoneRequest | phone + +// Change Phone +CurrentuserAPI.updatePhoneCurrentuser(appId: appId, updateUserPhoneRequest: updateUserPhoneRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **updateUserPhoneRequest** | [**UpdateUserPhoneRequest**](UpdateUserPhoneRequest.md) | phone | + +### Return type + +[**MagicLinkResponse**](MagicLinkResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/ElementCustomization.md b/Sources/Passage/generated/docs/ElementCustomization.md new file mode 100644 index 0000000..4992ee7 --- /dev/null +++ b/Sources/Passage/generated/docs/ElementCustomization.md @@ -0,0 +1,29 @@ +# ElementCustomization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passageContainerBackgroundColor** | **String** | Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. | [optional] +**passageContainerMaxWidth** | **Int** | Maximum width of container (px) | [optional] [default to 300] +**passageInputBoxBackgroundColor** | **String** | Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. | [optional] +**passageInputBoxBorderRadius** | **Int** | Input box border radius (px) | [optional] [default to 5] +**passageHeaderFontFamily** | [**FontFamily**](FontFamily.md) | | [optional] +**passageBodyFontFamily** | [**FontFamily**](FontFamily.md) | | [optional] +**passageHeaderTextColor** | **String** | Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] +**passageBodyTextColor** | **String** | Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. | [optional] +**passagePrimaryButtonBackgroundColor** | **String** | Primary button background colour (hex) | [optional] [default to "#121212"] +**passagePrimaryButtonTextColor** | **String** | Primary button font colour (hex) | [optional] [default to "#f3f3f3"] +**passagePrimaryButtonHoverColor** | **String** | Primary button background on hover (hex) | [optional] [default to "#4d4d4d"] +**passagePrimaryButtonBorderRadius** | **Int** | Primary button border radius (px) | [optional] [default to 5] +**passagePrimaryButtonBorderColor** | **String** | Primary button border color | [optional] [default to "#121212"] +**passagePrimaryButtonBorderWidth** | **Int** | Primary button border width (px) | [optional] [default to 0] +**passageSecondaryButtonBackgroundColor** | **String** | Secondary button background colour (hex) | [optional] [default to "#ffffff"] +**passageSecondaryButtonTextColor** | **String** | Secondary button font colour (hex) | [optional] [default to "#222222"] +**passageSecondaryButtonHoverColor** | **String** | Secondary button background on hover (hex) | [optional] [default to "#d7d7d7"] +**passageSecondaryButtonBorderRadius** | **Int** | Secondary button border radius (px) | [optional] [default to 5] +**passageSecondaryButtonBorderColor** | **String** | Secondary button border color | [optional] [default to "#d7d7d7"] +**passageSecondaryButtonBorderWidth** | **Int** | Secondary button border width (px) | [optional] [default to 1] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/FontFamily.md b/Sources/Passage/generated/docs/FontFamily.md new file mode 100644 index 0000000..102801d --- /dev/null +++ b/Sources/Passage/generated/docs/FontFamily.md @@ -0,0 +1,9 @@ +# FontFamily + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/GetAppResponse.md b/Sources/Passage/generated/docs/GetAppResponse.md new file mode 100644 index 0000000..7e15b69 --- /dev/null +++ b/Sources/Passage/generated/docs/GetAppResponse.md @@ -0,0 +1,10 @@ +# GetAppResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app** | [**App**](App.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/GetMagicLinkStatusRequest.md b/Sources/Passage/generated/docs/GetMagicLinkStatusRequest.md new file mode 100644 index 0000000..3159f8a --- /dev/null +++ b/Sources/Passage/generated/docs/GetMagicLinkStatusRequest.md @@ -0,0 +1,10 @@ +# GetMagicLinkStatusRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/GithubSocialConnection.md b/Sources/Passage/generated/docs/GithubSocialConnection.md new file mode 100644 index 0000000..7a5b2a9 --- /dev/null +++ b/Sources/Passage/generated/docs/GithubSocialConnection.md @@ -0,0 +1,13 @@ +# GithubSocialConnection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | **String** | The external ID of the Social Connection. | +**createdAt** | **Date** | | +**lastLoginAt** | **Date** | | +**providerIdentifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/GoogleSocialConnection.md b/Sources/Passage/generated/docs/GoogleSocialConnection.md new file mode 100644 index 0000000..db3769b --- /dev/null +++ b/Sources/Passage/generated/docs/GoogleSocialConnection.md @@ -0,0 +1,13 @@ +# GoogleSocialConnection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | **String** | The external ID of the Social Connection. | +**createdAt** | **Date** | | +**lastLoginAt** | **Date** | | +**providerIdentifier** | **String** | The email of connected social user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/IdTokenRequest.md b/Sources/Passage/generated/docs/IdTokenRequest.md new file mode 100644 index 0000000..d49f65f --- /dev/null +++ b/Sources/Passage/generated/docs/IdTokenRequest.md @@ -0,0 +1,12 @@ +# IdTokenRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | The code given from the native mobile OS to create a token | +**idToken** | **String** | The identity JWT token with security claims for validation | +**connectionType** | **String** | Connection type; google or apple | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/JWKResponse.md b/Sources/Passage/generated/docs/JWKResponse.md new file mode 100644 index 0000000..011d516 --- /dev/null +++ b/Sources/Passage/generated/docs/JWKResponse.md @@ -0,0 +1,10 @@ +# JWKResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | [JWKResponseKeysInner] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/JWKResponseKeysInner.md b/Sources/Passage/generated/docs/JWKResponseKeysInner.md new file mode 100644 index 0000000..cb7593b --- /dev/null +++ b/Sources/Passage/generated/docs/JWKResponseKeysInner.md @@ -0,0 +1,15 @@ +# JWKResponseKeysInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alg** | **String** | the algorithm for the key | +**e** | **String** | the exponent for the standard pem | +**kid** | **String** | the unique identifier for the key | +**kty** | **String** | the key type (https://datatracker.ietf.org/doc/html/rfc7518) | +**n** | **String** | the modulus for a standard pem | +**use** | **String** | how the key is meant to be used (i.e. 'sig' represents signature) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/JWKSAPI.md b/Sources/Passage/generated/docs/JWKSAPI.md new file mode 100644 index 0000000..d339ebb --- /dev/null +++ b/Sources/Passage/generated/docs/JWKSAPI.md @@ -0,0 +1,59 @@ +# JWKSAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getJwks**](JWKSAPI.md#getjwks) | **GET** /apps/{app_id}/.well-known/jwks.json | Get JWKS + + +# **getJwks** +```swift + open class func getJwks(appId: String, completion: @escaping (_ data: JWKResponse?, _ error: Error?) -> Void) +``` + +Get JWKS + +Get JWKS for an app. KIDs in the JWT can be used to match the appropriate JWK, and use the JWK's public key to verify the JWT. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get JWKS +JWKSAPI.getJwks(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**JWKResponse**](JWKResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/LayoutConfig.md b/Sources/Passage/generated/docs/LayoutConfig.md new file mode 100644 index 0000000..b531e31 --- /dev/null +++ b/Sources/Passage/generated/docs/LayoutConfig.md @@ -0,0 +1,14 @@ +# LayoutConfig + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**h** | **Int** | | +**id** | **String** | | +**w** | **Int** | | +**x** | **Int** | | +**y** | **Int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Layouts.md b/Sources/Passage/generated/docs/Layouts.md new file mode 100644 index 0000000..2b60607 --- /dev/null +++ b/Sources/Passage/generated/docs/Layouts.md @@ -0,0 +1,11 @@ +# Layouts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile** | [LayoutConfig] | | +**registration** | [LayoutConfig] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginAPI.md b/Sources/Passage/generated/docs/LoginAPI.md new file mode 100644 index 0000000..4b092fc --- /dev/null +++ b/Sources/Passage/generated/docs/LoginAPI.md @@ -0,0 +1,220 @@ +# LoginAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**loginMagicLink**](LoginAPI.md#loginmagiclink) | **POST** /apps/{app_id}/login/magic-link | Login with Magic Link +[**loginOneTimePasscode**](LoginAPI.md#loginonetimepasscode) | **POST** /apps/{app_id}/login/otp | Login with OTP +[**loginWebauthnFinish**](LoginAPI.md#loginwebauthnfinish) | **POST** /apps/{app_id}/login/webauthn/finish | Finish WebAuthn Login +[**loginWebauthnStart**](LoginAPI.md#loginwebauthnstart) | **POST** /apps/{app_id}/login/webauthn/start | Start WebAuthn Login + + +# **loginMagicLink** +```swift + open class func loginMagicLink(appId: String, loginMagicLinkRequest: LoginMagicLinkRequest, completion: @escaping (_ data: LoginMagicLinkResponse?, _ error: Error?) -> Void) +``` + +Login with Magic Link + +Send a login email or SMS to the user. The user will receive an email or text with a link to complete their login. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let loginMagicLinkRequest = LoginMagicLinkRequest(identifier: "identifier_example", language: "language_example", magicLinkPath: "magicLinkPath_example") // LoginMagicLinkRequest | User Data + +// Login with Magic Link +LoginAPI.loginMagicLink(appId: appId, loginMagicLinkRequest: loginMagicLinkRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **loginMagicLinkRequest** | [**LoginMagicLinkRequest**](LoginMagicLinkRequest.md) | User Data | + +### Return type + +[**LoginMagicLinkResponse**](LoginMagicLinkResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginOneTimePasscode** +```swift + open class func loginOneTimePasscode(appId: String, loginOneTimePasscodeRequest: LoginOneTimePasscodeRequest, completion: @escaping (_ data: OneTimePasscodeResponse?, _ error: Error?) -> Void) +``` + +Login with OTP + +Send a login email or SMS to the user. The user will receive an email or text with a one-time passcode to complete their login. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let loginOneTimePasscodeRequest = LoginOneTimePasscodeRequest(identifier: "identifier_example", language: "language_example") // LoginOneTimePasscodeRequest | User Data + +// Login with OTP +LoginAPI.loginOneTimePasscode(appId: appId, loginOneTimePasscodeRequest: loginOneTimePasscodeRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **loginOneTimePasscodeRequest** | [**LoginOneTimePasscodeRequest**](LoginOneTimePasscodeRequest.md) | User Data | + +### Return type + +[**OneTimePasscodeResponse**](OneTimePasscodeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginWebauthnFinish** +```swift + open class func loginWebauthnFinish(appId: String, loginWebAuthnFinishRequest: LoginWebAuthnFinishRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Finish WebAuthn Login + +Complete a WebAuthn login and authenticate the user. This endpoint accepts and verifies the response from `navigator.credential.get()` and returns an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let loginWebAuthnFinishRequest = LoginWebAuthnFinishRequest(handshakeId: "handshakeId_example", handshakeResponse: CredentialAssertionResponse(authenticatorAttachment: "authenticatorAttachment_example", clientExtensionResults: 123, id: "id_example", rawId: "rawId_example", response: CredentialAssertionResponse_response(authenticatorData: "authenticatorData_example", clientDataJSON: "clientDataJSON_example", signature: "signature_example", userHandle: "userHandle_example"), type: "type_example"), userId: "userId_example") // LoginWebAuthnFinishRequest | User Data + +// Finish WebAuthn Login +LoginAPI.loginWebauthnFinish(appId: appId, loginWebAuthnFinishRequest: loginWebAuthnFinishRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **loginWebAuthnFinishRequest** | [**LoginWebAuthnFinishRequest**](LoginWebAuthnFinishRequest.md) | User Data | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginWebauthnStart** +```swift + open class func loginWebauthnStart(appId: String, loginWebAuthnStartRequest: LoginWebAuthnStartRequest? = nil, completion: @escaping (_ data: LoginWebAuthnStartResponse?, _ error: Error?) -> Void) +``` + +Start WebAuthn Login + +Initiate a WebAuthn login for a user. This endpoint creates a WebAuthn credential assertion challenge that is used to perform the login ceremony from the browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let loginWebAuthnStartRequest = LoginWebAuthnStartRequest(identifier: "identifier_example") // LoginWebAuthnStartRequest | User Data (optional) + +// Start WebAuthn Login +LoginAPI.loginWebauthnStart(appId: appId, loginWebAuthnStartRequest: loginWebAuthnStartRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **loginWebAuthnStartRequest** | [**LoginWebAuthnStartRequest**](LoginWebAuthnStartRequest.md) | User Data | [optional] + +### Return type + +[**LoginWebAuthnStartResponse**](LoginWebAuthnStartResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/LoginMagicLinkRequest.md b/Sources/Passage/generated/docs/LoginMagicLinkRequest.md new file mode 100644 index 0000000..2eef6a7 --- /dev/null +++ b/Sources/Passage/generated/docs/LoginMagicLinkRequest.md @@ -0,0 +1,12 @@ +# LoginMagicLinkRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | +**language** | **String** | language of the email or SMS to send (optional) | [optional] +**magicLinkPath** | **String** | path relative to the app's auth_origin (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginMagicLinkResponse.md b/Sources/Passage/generated/docs/LoginMagicLinkResponse.md new file mode 100644 index 0000000..d915595 --- /dev/null +++ b/Sources/Passage/generated/docs/LoginMagicLinkResponse.md @@ -0,0 +1,10 @@ +# LoginMagicLinkResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**magicLink** | [**MagicLink**](MagicLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginOneTimePasscodeRequest.md b/Sources/Passage/generated/docs/LoginOneTimePasscodeRequest.md new file mode 100644 index 0000000..f209fe8 --- /dev/null +++ b/Sources/Passage/generated/docs/LoginOneTimePasscodeRequest.md @@ -0,0 +1,11 @@ +# LoginOneTimePasscodeRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | +**language** | **String** | language of the email to send (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginWebAuthnFinishRequest.md b/Sources/Passage/generated/docs/LoginWebAuthnFinishRequest.md new file mode 100644 index 0000000..80606dc --- /dev/null +++ b/Sources/Passage/generated/docs/LoginWebAuthnFinishRequest.md @@ -0,0 +1,12 @@ +# LoginWebAuthnFinishRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshakeId** | **String** | | +**handshakeResponse** | [**CredentialAssertionResponse**](CredentialAssertionResponse.md) | | +**userId** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginWebAuthnStartRequest.md b/Sources/Passage/generated/docs/LoginWebAuthnStartRequest.md new file mode 100644 index 0000000..9b24691 --- /dev/null +++ b/Sources/Passage/generated/docs/LoginWebAuthnStartRequest.md @@ -0,0 +1,10 @@ +# LoginWebAuthnStartRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/LoginWebAuthnStartResponse.md b/Sources/Passage/generated/docs/LoginWebAuthnStartResponse.md new file mode 100644 index 0000000..fb5d8b5 --- /dev/null +++ b/Sources/Passage/generated/docs/LoginWebAuthnStartResponse.md @@ -0,0 +1,11 @@ +# LoginWebAuthnStartResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshake** | [**CredentialAssertionChallenge**](CredentialAssertionChallenge.md) | | +**user** | [**User**](User.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/MagicLink.md b/Sources/Passage/generated/docs/MagicLink.md new file mode 100644 index 0000000..3797804 --- /dev/null +++ b/Sources/Passage/generated/docs/MagicLink.md @@ -0,0 +1,10 @@ +# MagicLink + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | the magic link id | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/MagicLinkAPI.md b/Sources/Passage/generated/docs/MagicLinkAPI.md new file mode 100644 index 0000000..57b6f08 --- /dev/null +++ b/Sources/Passage/generated/docs/MagicLinkAPI.md @@ -0,0 +1,114 @@ +# MagicLinkAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**activateMagicLink**](MagicLinkAPI.md#activatemagiclink) | **PATCH** /apps/{app_id}/magic-link/activate | Authenticate Magic Link +[**magicLinkStatus**](MagicLinkAPI.md#magiclinkstatus) | **POST** /apps/{app_id}/magic-link/status | Magic Link Status + + +# **activateMagicLink** +```swift + open class func activateMagicLink(appId: String, activateMagicLinkRequest: ActivateMagicLinkRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Authenticate Magic Link + +Authenticate a magic link for a user. This endpoint checks that the magic link is valid, then returns an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let activateMagicLinkRequest = ActivateMagicLinkRequest(magicLink: "magicLink_example") // ActivateMagicLinkRequest | User Data + +// Authenticate Magic Link +MagicLinkAPI.activateMagicLink(appId: appId, activateMagicLinkRequest: activateMagicLinkRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **activateMagicLinkRequest** | [**ActivateMagicLinkRequest**](ActivateMagicLinkRequest.md) | User Data | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **magicLinkStatus** +```swift + open class func magicLinkStatus(appId: String, getMagicLinkStatusRequest: GetMagicLinkStatusRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Magic Link Status + +Check if a magic link has been activated yet or not. Once the magic link has been activated, this endpoint will return an authentication token for the user. This endpoint can be used to initiate a login on one device and then poll and wait for the login to complete on another device. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let getMagicLinkStatusRequest = GetMagicLinkStatusRequest(id: "id_example") // GetMagicLinkStatusRequest | Magic Link ID + +// Magic Link Status +MagicLinkAPI.magicLinkStatus(appId: appId, getMagicLinkStatusRequest: getMagicLinkStatusRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **getMagicLinkStatusRequest** | [**GetMagicLinkStatusRequest**](GetMagicLinkStatusRequest.md) | Magic Link ID | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/MagicLinkAuthMethod.md b/Sources/Passage/generated/docs/MagicLinkAuthMethod.md new file mode 100644 index 0000000..fbe7761 --- /dev/null +++ b/Sources/Passage/generated/docs/MagicLinkAuthMethod.md @@ -0,0 +1,11 @@ +# MagicLinkAuthMethod + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ttl** | **Int** | Maximum time (IN SECONDS) for the auth to expire. | [optional] [default to 300] +**ttlDisplayUnit** | [**TtlDisplayUnit**](TtlDisplayUnit.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/MagicLinkResponse.md b/Sources/Passage/generated/docs/MagicLinkResponse.md new file mode 100644 index 0000000..261cb27 --- /dev/null +++ b/Sources/Passage/generated/docs/MagicLinkResponse.md @@ -0,0 +1,10 @@ +# MagicLinkResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**magicLink** | [**MagicLink**](MagicLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model400Code.md b/Sources/Passage/generated/docs/Model400Code.md new file mode 100644 index 0000000..907737b --- /dev/null +++ b/Sources/Passage/generated/docs/Model400Code.md @@ -0,0 +1,9 @@ +# Model400Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model400Error.md b/Sources/Passage/generated/docs/Model400Error.md new file mode 100644 index 0000000..ca83172 --- /dev/null +++ b/Sources/Passage/generated/docs/Model400Error.md @@ -0,0 +1,11 @@ +# Model400Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model400Code**](Model400Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model401Code.md b/Sources/Passage/generated/docs/Model401Code.md new file mode 100644 index 0000000..24e8094 --- /dev/null +++ b/Sources/Passage/generated/docs/Model401Code.md @@ -0,0 +1,9 @@ +# Model401Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model401Error.md b/Sources/Passage/generated/docs/Model401Error.md new file mode 100644 index 0000000..f4380ff --- /dev/null +++ b/Sources/Passage/generated/docs/Model401Error.md @@ -0,0 +1,11 @@ +# Model401Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model401Code**](Model401Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model403Code.md b/Sources/Passage/generated/docs/Model403Code.md new file mode 100644 index 0000000..71eca46 --- /dev/null +++ b/Sources/Passage/generated/docs/Model403Code.md @@ -0,0 +1,9 @@ +# Model403Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model403Error.md b/Sources/Passage/generated/docs/Model403Error.md new file mode 100644 index 0000000..5ada8a0 --- /dev/null +++ b/Sources/Passage/generated/docs/Model403Error.md @@ -0,0 +1,11 @@ +# Model403Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model403Code**](Model403Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model404Code.md b/Sources/Passage/generated/docs/Model404Code.md new file mode 100644 index 0000000..8a04dfe --- /dev/null +++ b/Sources/Passage/generated/docs/Model404Code.md @@ -0,0 +1,9 @@ +# Model404Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model404Error.md b/Sources/Passage/generated/docs/Model404Error.md new file mode 100644 index 0000000..0fa6b13 --- /dev/null +++ b/Sources/Passage/generated/docs/Model404Error.md @@ -0,0 +1,11 @@ +# Model404Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model404Code**](Model404Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model409Code.md b/Sources/Passage/generated/docs/Model409Code.md new file mode 100644 index 0000000..bd36623 --- /dev/null +++ b/Sources/Passage/generated/docs/Model409Code.md @@ -0,0 +1,9 @@ +# Model409Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model409Error.md b/Sources/Passage/generated/docs/Model409Error.md new file mode 100644 index 0000000..450b067 --- /dev/null +++ b/Sources/Passage/generated/docs/Model409Error.md @@ -0,0 +1,11 @@ +# Model409Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model409Code**](Model409Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model500Code.md b/Sources/Passage/generated/docs/Model500Code.md new file mode 100644 index 0000000..6e5845e --- /dev/null +++ b/Sources/Passage/generated/docs/Model500Code.md @@ -0,0 +1,9 @@ +# Model500Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Model500Error.md b/Sources/Passage/generated/docs/Model500Error.md new file mode 100644 index 0000000..a3ad853 --- /dev/null +++ b/Sources/Passage/generated/docs/Model500Error.md @@ -0,0 +1,11 @@ +# Model500Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Model500Code**](Model500Code.md) | | +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/Nonce.md b/Sources/Passage/generated/docs/Nonce.md new file mode 100644 index 0000000..4aa83f3 --- /dev/null +++ b/Sources/Passage/generated/docs/Nonce.md @@ -0,0 +1,10 @@ +# Nonce + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nonce** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/OAuth2API.md b/Sources/Passage/generated/docs/OAuth2API.md new file mode 100644 index 0000000..b264992 --- /dev/null +++ b/Sources/Passage/generated/docs/OAuth2API.md @@ -0,0 +1,456 @@ +# OAuth2API + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**appleOauth2Callback**](OAuth2API.md#appleoauth2callback) | **POST** /apps/{app_id}/social/oauth2_callback | Handle Apple's OAuth2 callback +[**appleOauth2CallbackDefaultDev**](OAuth2API.md#appleoauth2callbackdefaultdev) | **POST** /social/oauth2_callback | Handle Apple's OAuth2 callback for the default developer credentials +[**currentuserSocialLinkAccount**](OAuth2API.md#currentusersociallinkaccount) | **GET** /apps/{app_id}/currentuser/social/link_account | Link an existing account to an OAuth2 connection. +[**exchangeSocialIdToken**](OAuth2API.md#exchangesocialidtoken) | **POST** /apps/{app_id}/social/id_token | Exchange native mobile identity token for an auth token. +[**exchangeSocialToken**](OAuth2API.md#exchangesocialtoken) | **GET** /apps/{app_id}/social/token | Exchange OAuth2 connection data for an auth token. +[**getAuthorize**](OAuth2API.md#getauthorize) | **GET** /apps/{app_id}/social/authorize | Kick off OAuth2 flow +[**oauth2Callback**](OAuth2API.md#oauth2callback) | **GET** /apps/{app_id}/social/oauth2_callback | Handle OAuth2 callback +[**oauth2CallbackDefaultDev**](OAuth2API.md#oauth2callbackdefaultdev) | **GET** /social/oauth2_callback | Handle OAuth2 callback for the default developer credentials + + +# **appleOauth2Callback** +```swift + open class func appleOauth2Callback(appId: String, state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2Callback? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Handle Apple's OAuth2 callback + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let state = "state_example" // String | The state contained in the authorization request. +let code = "code_example" // String | A single-use authorization grant code that’s valid for five minutes. (optional) +let idToken = "idToken_example" // String | A JWT containing the user’s identity information. (optional) +let user = "user_example" // String | A JSON string containing the data requested in the scope property. (optional) +let error = "error_example" // String | The error returned by Apple. (optional) + +// Handle Apple's OAuth2 callback +OAuth2API.appleOauth2Callback(appId: appId, state: state, code: code, idToken: idToken, user: user, error: error) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **state** | **String** | The state contained in the authorization request. | + **code** | **String** | A single-use authorization grant code that’s valid for five minutes. | [optional] + **idToken** | **String** | A JWT containing the user’s identity information. | [optional] + **user** | **String** | A JSON string containing the data requested in the scope property. | [optional] + **error** | **String** | The error returned by Apple. | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **appleOauth2CallbackDefaultDev** +```swift + open class func appleOauth2CallbackDefaultDev(state: String, code: String? = nil, idToken: String? = nil, user: String? = nil, error: ModelError_appleOauth2CallbackDefaultDev? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Handle Apple's OAuth2 callback for the default developer credentials + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let state = "state_example" // String | The state contained in the authorization request. +let code = "code_example" // String | A single-use authorization grant code that’s valid for five minutes. (optional) +let idToken = "idToken_example" // String | A JWT containing the user’s identity information. (optional) +let user = "user_example" // String | A JSON string containing the data requested in the scope property. (optional) +let error = "error_example" // String | The error returned by Apple. (optional) + +// Handle Apple's OAuth2 callback for the default developer credentials +OAuth2API.appleOauth2CallbackDefaultDev(state: state, code: code, idToken: idToken, user: user, error: error) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **state** | **String** | The state contained in the authorization request. | + **code** | **String** | A single-use authorization grant code that’s valid for five minutes. | [optional] + **idToken** | **String** | A JWT containing the user’s identity information. | [optional] + **user** | **String** | A JSON string containing the data requested in the scope property. | [optional] + **error** | **String** | The error returned by Apple. | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **currentuserSocialLinkAccount** +```swift + open class func currentuserSocialLinkAccount(appId: String, code: String, verifier: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Link an existing account to an OAuth2 connection. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let code = "code_example" // String | The code given from the OAuth2 redirect +let verifier = "verifier_example" // String | The verifier the client originally sent to the OAuth2 provider + +// Link an existing account to an OAuth2 connection. +OAuth2API.currentuserSocialLinkAccount(appId: appId, code: code, verifier: verifier) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **code** | **String** | The code given from the OAuth2 redirect | + **verifier** | **String** | The verifier the client originally sent to the OAuth2 provider | + +### Return type + +Void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **exchangeSocialIdToken** +```swift + open class func exchangeSocialIdToken(appId: String, idTokenRequest: IdTokenRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Exchange native mobile identity token for an auth token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let idTokenRequest = IdTokenRequest(code: "code_example", idToken: "idToken_example", connectionType: "connectionType_example") // IdTokenRequest | + +// Exchange native mobile identity token for an auth token. +OAuth2API.exchangeSocialIdToken(appId: appId, idTokenRequest: idTokenRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **idTokenRequest** | [**IdTokenRequest**](IdTokenRequest.md) | | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **exchangeSocialToken** +```swift + open class func exchangeSocialToken(appId: String, code: String, verifier: String, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Exchange OAuth2 connection data for an auth token. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let code = "code_example" // String | The code given from the OAuth2 redirect +let verifier = "verifier_example" // String | The verifier the client originally sent to the OAuth2 provider + +// Exchange OAuth2 connection data for an auth token. +OAuth2API.exchangeSocialToken(appId: appId, code: code, verifier: verifier) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **code** | **String** | The code given from the OAuth2 redirect | + **verifier** | **String** | The verifier the client originally sent to the OAuth2 provider | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getAuthorize** +```swift + open class func getAuthorize(appId: String, redirectUri: String, codeChallenge: String, codeChallengeMethod: String, connectionType: ConnectionType_getAuthorize, state: String? = nil, loginHint: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Kick off OAuth2 flow + +Kick off OAuth2 flow with connection provider request params described in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let redirectUri = "redirectUri_example" // String | The URL to redirect to after the OAuth2 flow is complete. +let codeChallenge = "codeChallenge_example" // String | Code challenge. +let codeChallengeMethod = "codeChallengeMethod_example" // String | Code challenge method. +let connectionType = "connectionType_example" // String | connection type; google, github, apple, or passage to login with +let state = "state_example" // String | The state to pass through to the redirect URI. (optional) +let loginHint = "loginHint_example" // String | Hint to the Authorization Server about the login identifier the end-user might use to log in. (optional) + +// Kick off OAuth2 flow +OAuth2API.getAuthorize(appId: appId, redirectUri: redirectUri, codeChallenge: codeChallenge, codeChallengeMethod: codeChallengeMethod, connectionType: connectionType, state: state, loginHint: loginHint) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **redirectUri** | **String** | The URL to redirect to after the OAuth2 flow is complete. | + **codeChallenge** | **String** | Code challenge. | + **codeChallengeMethod** | **String** | Code challenge method. | + **connectionType** | **String** | connection type; google, github, apple, or passage to login with | + **state** | **String** | The state to pass through to the redirect URI. | [optional] + **loginHint** | **String** | Hint to the Authorization Server about the login identifier the end-user might use to log in. | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **oauth2Callback** +```swift + open class func oauth2Callback(appId: String, code: String, state: String? = nil, error: ModelError_oauth2Callback? = nil, errorDescription: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Handle OAuth2 callback + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let code = "code_example" // String | The authorization code returned by the OAuth2 provider. +let state = "state_example" // String | The state returned by the OAuth2 provider. (optional) +let error = "error_example" // String | The error returned by the OAuth2 provider. (optional) +let errorDescription = "errorDescription_example" // String | The error description returned by the OAuth2 provider. (optional) + +// Handle OAuth2 callback +OAuth2API.oauth2Callback(appId: appId, code: code, state: state, error: error, errorDescription: errorDescription) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **code** | **String** | The authorization code returned by the OAuth2 provider. | + **state** | **String** | The state returned by the OAuth2 provider. | [optional] + **error** | **String** | The error returned by the OAuth2 provider. | [optional] + **errorDescription** | **String** | The error description returned by the OAuth2 provider. | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **oauth2CallbackDefaultDev** +```swift + open class func oauth2CallbackDefaultDev(code: String, state: String? = nil, error: ModelError_oauth2CallbackDefaultDev? = nil, errorDescription: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Handle OAuth2 callback for the default developer credentials + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let code = "code_example" // String | The authorization code returned by the OAuth2 provider. +let state = "state_example" // String | The state returned by the OAuth2 provider. (optional) +let error = "error_example" // String | The error returned by the OAuth2 provider. (optional) +let errorDescription = "errorDescription_example" // String | The error description returned by the OAuth2 provider. (optional) + +// Handle OAuth2 callback for the default developer credentials +OAuth2API.oauth2CallbackDefaultDev(code: code, state: state, error: error, errorDescription: errorDescription) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **String** | The authorization code returned by the OAuth2 provider. | + **state** | **String** | The state returned by the OAuth2 provider. | [optional] + **error** | **String** | The error returned by the OAuth2 provider. | [optional] + **errorDescription** | **String** | The error description returned by the OAuth2 provider. | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/OTPAPI.md b/Sources/Passage/generated/docs/OTPAPI.md new file mode 100644 index 0000000..a84b825 --- /dev/null +++ b/Sources/Passage/generated/docs/OTPAPI.md @@ -0,0 +1,61 @@ +# OTPAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**activateOneTimePasscode**](OTPAPI.md#activateonetimepasscode) | **POST** /apps/{app_id}/otp/activate | Authenticate OTP + + +# **activateOneTimePasscode** +```swift + open class func activateOneTimePasscode(appId: String, activateOneTimePasscodeRequest: ActivateOneTimePasscodeRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Authenticate OTP + +Authenticate a one-time passcode for a user. This endpoint checks that the one-time passcode is valid, then returns an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let activateOneTimePasscodeRequest = ActivateOneTimePasscodeRequest(otp: "otp_example", otpId: "otpId_example") // ActivateOneTimePasscodeRequest | User Data + +// Authenticate OTP +OTPAPI.activateOneTimePasscode(appId: appId, activateOneTimePasscodeRequest: activateOneTimePasscodeRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **activateOneTimePasscodeRequest** | [**ActivateOneTimePasscodeRequest**](ActivateOneTimePasscodeRequest.md) | User Data | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/OneTimePasscodeResponse.md b/Sources/Passage/generated/docs/OneTimePasscodeResponse.md new file mode 100644 index 0000000..6b885dd --- /dev/null +++ b/Sources/Passage/generated/docs/OneTimePasscodeResponse.md @@ -0,0 +1,10 @@ +# OneTimePasscodeResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**otpId** | **String** | The ID of the one-time passcode. Provide it when activating. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/OpenIDAPI.md b/Sources/Passage/generated/docs/OpenIDAPI.md new file mode 100644 index 0000000..598c5d9 --- /dev/null +++ b/Sources/Passage/generated/docs/OpenIDAPI.md @@ -0,0 +1,59 @@ +# OpenIDAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getOpenIdConfiguration**](OpenIDAPI.md#getopenidconfiguration) | **GET** /apps/{app_id}/.well-known/openid-configuration | Get OpenID Configuration + + +# **getOpenIdConfiguration** +```swift + open class func getOpenIdConfiguration(appId: String, completion: @escaping (_ data: OpenIdConfiguration?, _ error: Error?) -> Void) +``` + +Get OpenID Configuration + +Get OpenID Configuration for an app. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID + +// Get OpenID Configuration +OpenIDAPI.getOpenIdConfiguration(appId: appId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + +### Return type + +[**OpenIdConfiguration**](OpenIdConfiguration.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/OpenIdConfiguration.md b/Sources/Passage/generated/docs/OpenIdConfiguration.md new file mode 100644 index 0000000..3bb0dfc --- /dev/null +++ b/Sources/Passage/generated/docs/OpenIdConfiguration.md @@ -0,0 +1,12 @@ +# OpenIdConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authorizationEndpoint** | **String** | | +**issuer** | **String** | | +**jwksUri** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/OtpAuthMethod.md b/Sources/Passage/generated/docs/OtpAuthMethod.md new file mode 100644 index 0000000..793f030 --- /dev/null +++ b/Sources/Passage/generated/docs/OtpAuthMethod.md @@ -0,0 +1,11 @@ +# OtpAuthMethod + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ttl** | **Int** | Maximum time (IN SECONDS) for the auth to expire. | [optional] [default to 300] +**ttlDisplayUnit** | [**TtlDisplayUnit**](TtlDisplayUnit.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/PasskeyReadinessAPI.md b/Sources/Passage/generated/docs/PasskeyReadinessAPI.md new file mode 100644 index 0000000..66b3e97 --- /dev/null +++ b/Sources/Passage/generated/docs/PasskeyReadinessAPI.md @@ -0,0 +1,69 @@ +# PasskeyReadinessAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createPasskeyReadiness**](PasskeyReadinessAPI.md#createpasskeyreadiness) | **POST** /analytics/passkey-readiness | Create Passkey Readiness Analytics + + +# **createPasskeyReadiness** +```swift + open class func createPasskeyReadiness(createPasskeyReadinessRequest: CreatePasskeyReadinessRequest, userAgent: String? = nil, origin: String? = nil, deviceOS: String? = nil, deviceOSVersion: String? = nil, appIdentifier: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Create Passkey Readiness Analytics + +Sends device's WebAuthn passkey readiness metrics + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let createPasskeyReadinessRequest = CreatePasskeyReadinessRequest(deviceId: "deviceId_example", securityKey: false, platform: false, syncedCredential: false, crossDeviceCredential: false, conditionalUi: false) // CreatePasskeyReadinessRequest | Passkey readiness metrics +let userAgent = "userAgent_example" // String | (optional) +let origin = "origin_example" // String | url for passkey readiness (optional) +let deviceOS = "deviceOS_example" // String | device os - mobile only (optional) +let deviceOSVersion = "deviceOSVersion_example" // String | device os version - mobile only (optional) +let appIdentifier = "appIdentifier_example" // String | app identifier - mobile only (optional) + +// Create Passkey Readiness Analytics +PasskeyReadinessAPI.createPasskeyReadiness(createPasskeyReadinessRequest: createPasskeyReadinessRequest, userAgent: userAgent, origin: origin, deviceOS: deviceOS, deviceOSVersion: deviceOSVersion, appIdentifier: appIdentifier) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createPasskeyReadinessRequest** | [**CreatePasskeyReadinessRequest**](CreatePasskeyReadinessRequest.md) | Passkey readiness metrics | + **userAgent** | **String** | | [optional] + **origin** | **String** | url for passkey readiness | [optional] + **deviceOS** | **String** | device os - mobile only | [optional] + **deviceOSVersion** | **String** | device os version - mobile only | [optional] + **appIdentifier** | **String** | app identifier - mobile only | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/ProtocolCredentialAssertion.md b/Sources/Passage/generated/docs/ProtocolCredentialAssertion.md new file mode 100644 index 0000000..191ef1e --- /dev/null +++ b/Sources/Passage/generated/docs/ProtocolCredentialAssertion.md @@ -0,0 +1,10 @@ +# ProtocolCredentialAssertion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**publicKey** | [**ProtocolCredentialAssertionPublicKey**](ProtocolCredentialAssertionPublicKey.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKey.md b/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKey.md new file mode 100644 index 0000000..0e30530 --- /dev/null +++ b/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKey.md @@ -0,0 +1,15 @@ +# ProtocolCredentialAssertionPublicKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowCredentials** | [ProtocolCredentialAssertionPublicKeyAllowCredentialsInner] | | [optional] +**challenge** | **String** | | +**extensions** | **AnyCodable** | | [optional] +**rpId** | **String** | | [optional] +**timeout** | **Int** | | [optional] +**userVerification** | **String** | UserVerification This member describes the Relying Party's requirements regarding user verification for the create() operation. Eligible authenticators are filtered to only those capable of satisfying this requirement. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md b/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md new file mode 100644 index 0000000..4845428 --- /dev/null +++ b/Sources/Passage/generated/docs/ProtocolCredentialAssertionPublicKeyAllowCredentialsInner.md @@ -0,0 +1,12 @@ +# ProtocolCredentialAssertionPublicKeyAllowCredentialsInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | CredentialID The ID of a credential to allow/disallow. | +**transports** | **[String]** | The authenticator transports that can be used. | [optional] +**type** | **String** | The valid credential types. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RefreshAuthTokenRequest.md b/Sources/Passage/generated/docs/RefreshAuthTokenRequest.md new file mode 100644 index 0000000..6f49730 --- /dev/null +++ b/Sources/Passage/generated/docs/RefreshAuthTokenRequest.md @@ -0,0 +1,10 @@ +# RefreshAuthTokenRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**refreshToken** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterAPI.md b/Sources/Passage/generated/docs/RegisterAPI.md new file mode 100644 index 0000000..0cc46af --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterAPI.md @@ -0,0 +1,326 @@ +# RegisterAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**registerMagicLink**](RegisterAPI.md#registermagiclink) | **POST** /apps/{app_id}/register/magic-link | Register with Magic Link +[**registerOneTimePasscode**](RegisterAPI.md#registeronetimepasscode) | **POST** /apps/{app_id}/register/otp | Register with OTP +[**registerWebauthnFinish**](RegisterAPI.md#registerwebauthnfinish) | **POST** /apps/{app_id}/register/webauthn/finish | Finish WebAuthn Registration +[**registerWebauthnFinishWithTransaction**](RegisterAPI.md#registerwebauthnfinishwithtransaction) | **POST** /apps/{app_id}/register/transactions/webauthn/finish | Finish WebAuthn registration with a transaction +[**registerWebauthnStart**](RegisterAPI.md#registerwebauthnstart) | **POST** /apps/{app_id}/register/webauthn/start | Start WebAuthn Register +[**registerWebauthnStartWithTransaction**](RegisterAPI.md#registerwebauthnstartwithtransaction) | **POST** /apps/{app_id}/register/transactions/webauthn/start | Start WebAuthn registration with a transaction + + +# **registerMagicLink** +```swift + open class func registerMagicLink(appId: String, user: RegisterMagicLinkRequest, completion: @escaping (_ data: RegisterMagicLinkResponse?, _ error: Error?) -> Void) +``` + +Register with Magic Link + +Create a user and send an registration email or SMS to the user. The user will receive an email or text with a link to complete their registration. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let user = RegisterMagicLinkRequest(identifier: "identifier_example", language: "language_example", magicLinkPath: "magicLinkPath_example") // RegisterMagicLinkRequest | User Data + +// Register with Magic Link +RegisterAPI.registerMagicLink(appId: appId, user: user) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **user** | [**RegisterMagicLinkRequest**](RegisterMagicLinkRequest.md) | User Data | + +### Return type + +[**RegisterMagicLinkResponse**](RegisterMagicLinkResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **registerOneTimePasscode** +```swift + open class func registerOneTimePasscode(appId: String, registerOneTimePasscodeRequest: RegisterOneTimePasscodeRequest, completion: @escaping (_ data: OneTimePasscodeResponse?, _ error: Error?) -> Void) +``` + +Register with OTP + +Create a user and send a registration email or SMS to the user. The user will receive an email or text with a one-time passcode to complete their registration. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let registerOneTimePasscodeRequest = RegisterOneTimePasscodeRequest(identifier: "identifier_example", language: "language_example") // RegisterOneTimePasscodeRequest | User Data + +// Register with OTP +RegisterAPI.registerOneTimePasscode(appId: appId, registerOneTimePasscodeRequest: registerOneTimePasscodeRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **registerOneTimePasscodeRequest** | [**RegisterOneTimePasscodeRequest**](RegisterOneTimePasscodeRequest.md) | User Data | + +### Return type + +[**OneTimePasscodeResponse**](OneTimePasscodeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **registerWebauthnFinish** +```swift + open class func registerWebauthnFinish(appId: String, registerWebAuthnFinishRequest: RegisterWebAuthnFinishRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Finish WebAuthn Registration + +Complete a WebAuthn registration and authenticate the user. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let registerWebAuthnFinishRequest = RegisterWebAuthnFinishRequest(handshakeId: "handshakeId_example", handshakeResponse: CredentialCreationResponse(authenticatorAttachment: "authenticatorAttachment_example", clientExtensionResults: 123, id: "id_example", rawId: "rawId_example", response: CredentialCreationResponse_response(attestationObject: "attestationObject_example", clientDataJSON: "clientDataJSON_example", transports: ["transports_example"]), transports: ["transports_example"], type: "type_example"), userId: "userId_example") // RegisterWebAuthnFinishRequest | WebAuthn Response Data + +// Finish WebAuthn Registration +RegisterAPI.registerWebauthnFinish(appId: appId, registerWebAuthnFinishRequest: registerWebAuthnFinishRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **registerWebAuthnFinishRequest** | [**RegisterWebAuthnFinishRequest**](RegisterWebAuthnFinishRequest.md) | WebAuthn Response Data | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **registerWebauthnFinishWithTransaction** +```swift + open class func registerWebauthnFinishWithTransaction(appId: String, registerWebAuthnFinishWithTransactionRequest: RegisterWebAuthnFinishWithTransactionRequest, completion: @escaping (_ data: Nonce?, _ error: Error?) -> Void) +``` + +Finish WebAuthn registration with a transaction + +Complete a WebAuthn registration and authenticate the user via a transaction. This endpoint accepts and verifies the response from `navigator.credential.create()` and returns a nonce meant to be exchanged for an authentication token for the user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let registerWebAuthnFinishWithTransactionRequest = RegisterWebAuthnFinishWithTransactionRequest(handshakeId: "handshakeId_example", handshakeResponse: CredentialCreationResponse(authenticatorAttachment: "authenticatorAttachment_example", clientExtensionResults: 123, id: "id_example", rawId: "rawId_example", response: CredentialCreationResponse_response(attestationObject: "attestationObject_example", clientDataJSON: "clientDataJSON_example", transports: ["transports_example"]), transports: ["transports_example"], type: "type_example"), transactionId: "transactionId_example") // RegisterWebAuthnFinishWithTransactionRequest | + +// Finish WebAuthn registration with a transaction +RegisterAPI.registerWebauthnFinishWithTransaction(appId: appId, registerWebAuthnFinishWithTransactionRequest: registerWebAuthnFinishWithTransactionRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **registerWebAuthnFinishWithTransactionRequest** | [**RegisterWebAuthnFinishWithTransactionRequest**](RegisterWebAuthnFinishWithTransactionRequest.md) | | + +### Return type + +[**Nonce**](Nonce.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **registerWebauthnStart** +```swift + open class func registerWebauthnStart(appId: String, registerWebAuthnStartRequest: RegisterWebAuthnStartRequest, completion: @escaping (_ data: RegisterWebAuthnStartResponse?, _ error: Error?) -> Void) +``` + +Start WebAuthn Register + +Initiate a WebAuthn registration and create the user. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let registerWebAuthnStartRequest = RegisterWebAuthnStartRequest(identifier: "identifier_example", authenticatorAttachment: AuthenticatorAttachment()) // RegisterWebAuthnStartRequest | User Data + +// Start WebAuthn Register +RegisterAPI.registerWebauthnStart(appId: appId, registerWebAuthnStartRequest: registerWebAuthnStartRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **registerWebAuthnStartRequest** | [**RegisterWebAuthnStartRequest**](RegisterWebAuthnStartRequest.md) | User Data | + +### Return type + +[**RegisterWebAuthnStartResponse**](RegisterWebAuthnStartResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **registerWebauthnStartWithTransaction** +```swift + open class func registerWebauthnStartWithTransaction(appId: String, registerWebAuthnStartWithTransactionRequest: RegisterWebAuthnStartWithTransactionRequest, completion: @escaping (_ data: RegisterWebAuthnStartWithTransactionResponse?, _ error: Error?) -> Void) +``` + +Start WebAuthn registration with a transaction + +Initiate a WebAuthn registration and create the user via a transaction. This endpoint creates a WebAuthn credential creation challenge that is used to perform the registration ceremony from the browser. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let registerWebAuthnStartWithTransactionRequest = RegisterWebAuthnStartWithTransactionRequest(transactionId: "transactionId_example", authenticatorAttachment: AuthenticatorAttachment()) // RegisterWebAuthnStartWithTransactionRequest | + +// Start WebAuthn registration with a transaction +RegisterAPI.registerWebauthnStartWithTransaction(appId: appId, registerWebAuthnStartWithTransactionRequest: registerWebAuthnStartWithTransactionRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **registerWebAuthnStartWithTransactionRequest** | [**RegisterWebAuthnStartWithTransactionRequest**](RegisterWebAuthnStartWithTransactionRequest.md) | | + +### Return type + +[**RegisterWebAuthnStartWithTransactionResponse**](RegisterWebAuthnStartWithTransactionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/RegisterMagicLinkRequest.md b/Sources/Passage/generated/docs/RegisterMagicLinkRequest.md new file mode 100644 index 0000000..6afbc06 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterMagicLinkRequest.md @@ -0,0 +1,12 @@ +# RegisterMagicLinkRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | +**language** | **String** | language of the email or SMS to send (optional) | [optional] +**magicLinkPath** | **String** | path relative to the app's auth_origin (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterMagicLinkResponse.md b/Sources/Passage/generated/docs/RegisterMagicLinkResponse.md new file mode 100644 index 0000000..98e7b48 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterMagicLinkResponse.md @@ -0,0 +1,10 @@ +# RegisterMagicLinkResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**magicLink** | [**MagicLink**](MagicLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterOneTimePasscodeRequest.md b/Sources/Passage/generated/docs/RegisterOneTimePasscodeRequest.md new file mode 100644 index 0000000..493ed14 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterOneTimePasscodeRequest.md @@ -0,0 +1,11 @@ +# RegisterOneTimePasscodeRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | +**language** | **String** | language of the email to send (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnFinishRequest.md b/Sources/Passage/generated/docs/RegisterWebAuthnFinishRequest.md new file mode 100644 index 0000000..c5834a7 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnFinishRequest.md @@ -0,0 +1,12 @@ +# RegisterWebAuthnFinishRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshakeId** | **String** | | +**handshakeResponse** | [**CredentialCreationResponse**](CredentialCreationResponse.md) | | +**userId** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnFinishWithTransactionRequest.md b/Sources/Passage/generated/docs/RegisterWebAuthnFinishWithTransactionRequest.md new file mode 100644 index 0000000..67b5705 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnFinishWithTransactionRequest.md @@ -0,0 +1,12 @@ +# RegisterWebAuthnFinishWithTransactionRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshakeId** | **String** | | +**handshakeResponse** | [**CredentialCreationResponse**](CredentialCreationResponse.md) | | +**transactionId** | **String** | the transaction ID used to finish this webauthn registration | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnStartRequest.md b/Sources/Passage/generated/docs/RegisterWebAuthnStartRequest.md new file mode 100644 index 0000000..6bfbb76 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnStartRequest.md @@ -0,0 +1,11 @@ +# RegisterWebAuthnStartRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | valid email or E164 phone number | +**authenticatorAttachment** | [**AuthenticatorAttachment**](AuthenticatorAttachment.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnStartResponse.md b/Sources/Passage/generated/docs/RegisterWebAuthnStartResponse.md new file mode 100644 index 0000000..1225e5f --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnStartResponse.md @@ -0,0 +1,11 @@ +# RegisterWebAuthnStartResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshake** | [**CredentialCreationChallenge**](CredentialCreationChallenge.md) | | +**user** | [**User**](User.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionRequest.md b/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionRequest.md new file mode 100644 index 0000000..dc1371a --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionRequest.md @@ -0,0 +1,11 @@ +# RegisterWebAuthnStartWithTransactionRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionId** | **String** | the transaction ID to associate with this webauthn registration | +**authenticatorAttachment** | [**AuthenticatorAttachment**](AuthenticatorAttachment.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionResponse.md b/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionResponse.md new file mode 100644 index 0000000..9a2d572 --- /dev/null +++ b/Sources/Passage/generated/docs/RegisterWebAuthnStartWithTransactionResponse.md @@ -0,0 +1,11 @@ +# RegisterWebAuthnStartWithTransactionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**handshake** | [**CredentialCreationChallenge**](CredentialCreationChallenge.md) | | +**transactionId** | **String** | the transaction ID used to start this webauthn registration | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/SocialConnections.md b/Sources/Passage/generated/docs/SocialConnections.md new file mode 100644 index 0000000..65b1cc1 --- /dev/null +++ b/Sources/Passage/generated/docs/SocialConnections.md @@ -0,0 +1,12 @@ +# SocialConnections + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apple** | **AnyCodable** | | [optional] +**google** | **AnyCodable** | | [optional] +**github** | **AnyCodable** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/SocialConnectionsResponse.md b/Sources/Passage/generated/docs/SocialConnectionsResponse.md new file mode 100644 index 0000000..3195f0f --- /dev/null +++ b/Sources/Passage/generated/docs/SocialConnectionsResponse.md @@ -0,0 +1,10 @@ +# SocialConnectionsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**socialConnections** | [**UserSocialConnections**](UserSocialConnections.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/TokensAPI.md b/Sources/Passage/generated/docs/TokensAPI.md new file mode 100644 index 0000000..706b4ae --- /dev/null +++ b/Sources/Passage/generated/docs/TokensAPI.md @@ -0,0 +1,114 @@ +# TokensAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**refreshAuthToken**](TokensAPI.md#refreshauthtoken) | **POST** /apps/{app_id}/tokens | Creates new auth and refresh token +[**revokeRefreshToken**](TokensAPI.md#revokerefreshtoken) | **DELETE** /apps/{app_id}/tokens | Revokes refresh token + + +# **refreshAuthToken** +```swift + open class func refreshAuthToken(appId: String, refreshAuthTokenRequest: RefreshAuthTokenRequest, completion: @escaping (_ data: AuthResponse?, _ error: Error?) -> Void) +``` + +Creates new auth and refresh token + +Creates and returns a new auth token and a new refresh token + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let refreshAuthTokenRequest = RefreshAuthTokenRequest(refreshToken: "refreshToken_example") // RefreshAuthTokenRequest | Refresh token + +// Creates new auth and refresh token +TokensAPI.refreshAuthToken(appId: appId, refreshAuthTokenRequest: refreshAuthTokenRequest) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **refreshAuthTokenRequest** | [**RefreshAuthTokenRequest**](RefreshAuthTokenRequest.md) | Refresh token | + +### Return type + +[**AuthResponse**](AuthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **revokeRefreshToken** +```swift + open class func revokeRefreshToken(appId: String, refreshToken: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Revokes refresh token + +Revokes the refresh token + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let refreshToken = "refreshToken_example" // String | Refresh token + +// Revokes refresh token +TokensAPI.revokeRefreshToken(appId: appId, refreshToken: refreshToken) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **refreshToken** | **String** | Refresh token | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/TtlDisplayUnit.md b/Sources/Passage/generated/docs/TtlDisplayUnit.md new file mode 100644 index 0000000..b1d319f --- /dev/null +++ b/Sources/Passage/generated/docs/TtlDisplayUnit.md @@ -0,0 +1,9 @@ +# TtlDisplayUnit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UpdateDeviceRequest.md b/Sources/Passage/generated/docs/UpdateDeviceRequest.md new file mode 100644 index 0000000..67da88e --- /dev/null +++ b/Sources/Passage/generated/docs/UpdateDeviceRequest.md @@ -0,0 +1,10 @@ +# UpdateDeviceRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**friendlyName** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UpdateMetadataRequest.md b/Sources/Passage/generated/docs/UpdateMetadataRequest.md new file mode 100644 index 0000000..bd072e9 --- /dev/null +++ b/Sources/Passage/generated/docs/UpdateMetadataRequest.md @@ -0,0 +1,10 @@ +# UpdateMetadataRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userMetadata** | **AnyCodable** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UpdateUserEmailRequest.md b/Sources/Passage/generated/docs/UpdateUserEmailRequest.md new file mode 100644 index 0000000..03d477c --- /dev/null +++ b/Sources/Passage/generated/docs/UpdateUserEmailRequest.md @@ -0,0 +1,13 @@ +# UpdateUserEmailRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language** | **String** | language of the email to send (optional) | [optional] +**magicLinkPath** | **String** | | [optional] +**newEmail** | **String** | | +**redirectUrl** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UpdateUserPhoneRequest.md b/Sources/Passage/generated/docs/UpdateUserPhoneRequest.md new file mode 100644 index 0000000..b3e1c43 --- /dev/null +++ b/Sources/Passage/generated/docs/UpdateUserPhoneRequest.md @@ -0,0 +1,13 @@ +# UpdateUserPhoneRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language** | **String** | language of the email to send (optional) | [optional] +**magicLinkPath** | **String** | | [optional] +**newPhone** | **String** | | [optional] +**redirectUrl** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/User.md b/Sources/Passage/generated/docs/User.md new file mode 100644 index 0000000..e79159f --- /dev/null +++ b/Sources/Passage/generated/docs/User.md @@ -0,0 +1,18 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | +**emailVerified** | **Bool** | Whether or not the user's email has been verified | +**id** | **String** | | +**phone** | **String** | | +**phoneVerified** | **Bool** | Whether or not the user's phone has been verified | +**status** | [**UserStatus**](UserStatus.md) | | +**userMetadata** | **AnyCodable** | | +**webauthn** | **Bool** | | +**webauthnTypes** | [WebAuthnType] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UserMetadataField.md b/Sources/Passage/generated/docs/UserMetadataField.md new file mode 100644 index 0000000..ac7162c --- /dev/null +++ b/Sources/Passage/generated/docs/UserMetadataField.md @@ -0,0 +1,15 @@ +# UserMetadataField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fieldName** | **String** | | +**friendlyName** | **String** | | +**id** | **String** | | +**profile** | **Bool** | | +**registration** | **Bool** | | +**type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UserMetadataResponse.md b/Sources/Passage/generated/docs/UserMetadataResponse.md new file mode 100644 index 0000000..65f5df6 --- /dev/null +++ b/Sources/Passage/generated/docs/UserMetadataResponse.md @@ -0,0 +1,10 @@ +# UserMetadataResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userMetadata** | **AnyCodable** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UserResponse.md b/Sources/Passage/generated/docs/UserResponse.md new file mode 100644 index 0000000..2ca7da3 --- /dev/null +++ b/Sources/Passage/generated/docs/UserResponse.md @@ -0,0 +1,10 @@ +# UserResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**User**](User.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UserSocialConnections.md b/Sources/Passage/generated/docs/UserSocialConnections.md new file mode 100644 index 0000000..45be3b2 --- /dev/null +++ b/Sources/Passage/generated/docs/UserSocialConnections.md @@ -0,0 +1,12 @@ +# UserSocialConnections + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apple** | [**AppleSocialConnection**](AppleSocialConnection.md) | | [optional] +**github** | [**GithubSocialConnection**](GithubSocialConnection.md) | | [optional] +**google** | [**GoogleSocialConnection**](GoogleSocialConnection.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UserStatus.md b/Sources/Passage/generated/docs/UserStatus.md new file mode 100644 index 0000000..35e0d71 --- /dev/null +++ b/Sources/Passage/generated/docs/UserStatus.md @@ -0,0 +1,9 @@ +# UserStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/UsersAPI.md b/Sources/Passage/generated/docs/UsersAPI.md new file mode 100644 index 0000000..0dd6bd4 --- /dev/null +++ b/Sources/Passage/generated/docs/UsersAPI.md @@ -0,0 +1,114 @@ +# UsersAPI + +All URIs are relative to *https://auth.passage.id/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**checkUserIdentifier**](UsersAPI.md#checkuseridentifier) | **GET** /apps/{app_id}/users | Get User +[**createUser**](UsersAPI.md#createuser) | **POST** /apps/{app_id}/users | Create User + + +# **checkUserIdentifier** +```swift + open class func checkUserIdentifier(appId: String, identifier: String, completion: @escaping (_ data: UserResponse?, _ error: Error?) -> Void) +``` + +Get User + +Get user information, if the user exists. This endpoint can be used to determine whether a user has an existing account and if they should login or register. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let identifier = "identifier_example" // String | email or phone number + +// Get User +UsersAPI.checkUserIdentifier(appId: appId, identifier: identifier) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **identifier** | **String** | email or phone number | + +### Return type + +[**UserResponse**](UserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUser** +```swift + open class func createUser(appId: String, createUserParams: CreateUserParams, completion: @escaping (_ data: UserResponse?, _ error: Error?) -> Void) +``` + +Create User + +Create a user + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import OpenAPIClient + +let appId = "appId_example" // String | App ID +let createUserParams = CreateUserParams(identifier: "identifier_example", userMetadata: 123) // CreateUserParams | user options + +// Create User +UsersAPI.createUser(appId: appId, createUserParams: createUserParams) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **String** | App ID | + **createUserParams** | [**CreateUserParams**](CreateUserParams.md) | user options | + +### Return type + +[**UserResponse**](UserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/Sources/Passage/generated/docs/WebAuthnIcons.md b/Sources/Passage/generated/docs/WebAuthnIcons.md new file mode 100644 index 0000000..dd3e7d7 --- /dev/null +++ b/Sources/Passage/generated/docs/WebAuthnIcons.md @@ -0,0 +1,11 @@ +# WebAuthnIcons + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**light** | **String** | | +**dark** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/docs/WebAuthnType.md b/Sources/Passage/generated/docs/WebAuthnType.md new file mode 100644 index 0000000..4a3890f --- /dev/null +++ b/Sources/Passage/generated/docs/WebAuthnType.md @@ -0,0 +1,9 @@ +# WebAuthnType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/Sources/Passage/generated/git_push.sh b/Sources/Passage/generated/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/Sources/Passage/generated/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/Sources/Passage/generated/project.yml b/Sources/Passage/generated/project.yml new file mode 100644 index 0000000..d6c28af --- /dev/null +++ b/Sources/Passage/generated/project.yml @@ -0,0 +1,15 @@ +name: OpenAPIClient +targets: + OpenAPIClient: + type: framework + platform: iOS + deploymentTarget: "11.0" + sources: [OpenAPIClient] + info: + path: ./Info.plist + version: 1 + settings: + APPLICATION_EXTENSION_API_ONLY: true + scheme: {} + dependencies: + - carthage: AnyCodable