From 24e7e5221c43ce07abec5f4a23f63dbd198d3fb5 Mon Sep 17 00:00:00 2001 From: Incorbador Date: Tue, 24 Sep 2024 18:52:27 +0200 Subject: [PATCH] Release new versions --- packages/corbado_api_client/CHANGELOG.md | 3 + .../lib/corbado_api_client.dart | 15 +- .../lib/frontendapi/.openapi-generator/FILES | 91 +++++++ .../lib/frontendapi/CHANGELOG.md | 22 ++ .../lib/frontendapi/LICENSE | 27 +++ .../lib/frontendapi/README.md | 2 +- .../frontendapi/doc/AuthenticationResponse.md | 17 -- .../lib/frontendapi/doc/BlockBodyData.md | 2 +- .../frontendapi/doc/ClientInformationV2.md | 21 -- .../frontendapi/doc/GeneralBlockCompleted.md | 2 +- .../lib/frontendapi/doc/PhoneCollectReq.md | 15 -- .../lib/frontendapi/doc/UsernameCollectReq.md | 15 -- .../src/model/authentication_response.dart | 153 ------------ .../src/model/authentication_response.g.dart | 138 ----------- .../lib/src/model/block_body_data.dart | 2 +- .../lib/src/model/client_information_v2.dart | 226 ------------------ .../src/model/client_information_v2.g.dart | 204 ---------------- .../src/model/general_block_completed.dart | 4 +- .../lib/src/model/phone_collect_req.dart | 111 --------- .../lib/src/model/phone_collect_req.g.dart | 95 -------- .../lib/src/model/username_collect_req.dart | 111 --------- .../lib/src/model/username_collect_req.g.dart | 98 -------- .../lib/frontendapi/pubspec.yaml | 8 +- .../lib/frontendapi/test/auth_api_test.dart | 18 +- .../test/authentication_response_test.dart | 26 -- .../test/block_body_data_test.dart | 12 +- .../test/client_information_test.dart | 5 + .../test/client_information_v2_test.dart | 46 ---- .../test/connect_append_init_req_test.dart | 2 +- .../test/connect_login_init_req_test.dart | 2 +- .../test/connect_manage_init_req_test.dart | 2 +- .../test/general_block_completed_test.dart | 2 +- .../test/general_block_login_init_test.dart | 5 + .../general_block_passkey_append_test.dart | 5 + .../general_block_passkey_verify_test.dart | 5 + ...l_block_post_signup_email_verify_test.dart | 5 + .../test/general_block_signup_init_test.dart | 5 + .../general_block_verify_identifier_test.dart | 5 + .../test/passkey_append_start_req_test.dart | 2 +- .../test/passkey_login_start_req_test.dart | 2 +- .../test/phone_collect_req_test.dart | 15 -- .../test/username_collect_req_test.dart | 15 -- .../lib/src/services/corbado/corbado.dart | 96 ++++---- packages/corbado_auth/pubspec.yaml | 6 +- packages/passkeys/passkeys/pubspec.yaml | 9 +- .../passkeys/passkeys_android/pubspec.yaml | 2 +- packages/passkeys/passkeys_ios/pubspec.yaml | 2 +- packages/passkeys/passkeys_web/pubspec.yaml | 2 +- 48 files changed, 271 insertions(+), 1407 deletions(-) create mode 100644 packages/corbado_api_client/lib/frontendapi/CHANGELOG.md create mode 100644 packages/corbado_api_client/lib/frontendapi/LICENSE delete mode 100644 packages/corbado_api_client/lib/frontendapi/doc/AuthenticationResponse.md delete mode 100644 packages/corbado_api_client/lib/frontendapi/doc/ClientInformationV2.md delete mode 100644 packages/corbado_api_client/lib/frontendapi/doc/PhoneCollectReq.md delete mode 100644 packages/corbado_api_client/lib/frontendapi/doc/UsernameCollectReq.md delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.g.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.g.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.g.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.g.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/test/authentication_response_test.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/test/client_information_v2_test.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/test/phone_collect_req_test.dart delete mode 100644 packages/corbado_api_client/lib/frontendapi/test/username_collect_req_test.dart diff --git a/packages/corbado_api_client/CHANGELOG.md b/packages/corbado_api_client/CHANGELOG.md index 087c9382..50acd474 100644 --- a/packages/corbado_api_client/CHANGELOG.md +++ b/packages/corbado_api_client/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.0.0 +* Changed to FrontendAPI v2. + ## 1.1.1 * Bump dependency versions (intl, meta, http). diff --git a/packages/corbado_api_client/lib/corbado_api_client.dart b/packages/corbado_api_client/lib/corbado_api_client.dart index 957506c0..a140a79b 100644 --- a/packages/corbado_api_client/lib/corbado_api_client.dart +++ b/packages/corbado_api_client/lib/corbado_api_client.dart @@ -1,11 +1,16 @@ -// Openapi Generator last run: : 2024-09-18T16:49:29.483494 +// Openapi Generator last run: : 2024-09-24T18:31:23.928402 import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @Openapi( - additionalProperties: AdditionalProperties(pubName: 'corbado_frontend_api_client'), - inputSpec: InputSpec(path: './lib/openapi/corbado_public_api.yml'), - generatorName: Generator.dio, - outputDirectory: './lib/frontendapi', + additionalProperties: AdditionalProperties( + pubName: 'corbado_frontend_api_client', + pubVersion: '2.0.0', + pubDescription: 'Client for the Corbado Frontend API', + pubHomepage: 'https://docs.corbado.com/overview/welcome', + ), + inputSpec: InputSpec(path: './lib/openapi/corbado_public_api.yml'), + generatorName: Generator.dio, + outputDirectory: './lib/frontendapi', ) /// Represents the Corbado API client diff --git a/packages/corbado_api_client/lib/frontendapi/.openapi-generator/FILES b/packages/corbado_api_client/lib/frontendapi/.openapi-generator/FILES index e0623b26..e6511e1b 100644 --- a/packages/corbado_api_client/lib/frontendapi/.openapi-generator/FILES +++ b/packages/corbado_api_client/lib/frontendapi/.openapi-generator/FILES @@ -195,3 +195,94 @@ lib/src/model/user_details_config_rsp.dart lib/src/model/verification_method.dart lib/src/serializers.dart pubspec.yaml +test/auth_api_test.dart +test/auth_type_test.dart +test/block_body_data_test.dart +test/block_body_test.dart +test/block_type_test.dart +test/client_capabilities_test.dart +test/client_information_test.dart +test/configs_api_test.dart +test/connect_append_finish_req_test.dart +test/connect_append_finish_rsp_test.dart +test/connect_append_init_req_test.dart +test/connect_append_init_rsp_test.dart +test/connect_append_start_req_test.dart +test/connect_append_start_rsp_test.dart +test/connect_event_create_req_test.dart +test/connect_login_finish_req_test.dart +test/connect_login_finish_rsp_test.dart +test/connect_login_init_req_test.dart +test/connect_login_init_rsp_test.dart +test/connect_login_start_req_test.dart +test/connect_login_start_rsp_test.dart +test/connect_manage_delete_req_test.dart +test/connect_manage_delete_rsp_test.dart +test/connect_manage_init_req_test.dart +test/connect_manage_init_rsp_test.dart +test/connect_manage_list_req_test.dart +test/connect_manage_list_rsp_test.dart +test/continue_on_other_device_test.dart +test/corbado_connect_api_test.dart +test/event_create_req_test.dart +test/full_name_with_error_test.dart +test/general_block_completed_test.dart +test/general_block_login_init_test.dart +test/general_block_passkey_append_test.dart +test/general_block_passkey_appended_test.dart +test/general_block_passkey_verify_test.dart +test/general_block_post_signup_email_verify_test.dart +test/general_block_signup_init_test.dart +test/general_block_verify_identifier_alternative_verification_methods_inner_test.dart +test/general_block_verify_identifier_test.dart +test/generic_rsp_test.dart +test/identifier_test.dart +test/identifier_update_req_test.dart +test/identifier_verify_finish_req_test.dart +test/identifier_verify_start_req_test.dart +test/java_script_high_entropy_test.dart +test/login_identifier_config_test.dart +test/login_identifier_test.dart +test/login_identifier_type_test.dart +test/login_identifier_with_error_test.dart +test/login_init_req_test.dart +test/me_identifier_create_req_test.dart +test/me_identifier_delete_req_test.dart +test/me_identifier_update_req_test.dart +test/me_identifier_verify_finish_req_test.dart +test/me_identifier_verify_start_req_test.dart +test/me_passkey_delete_rsp_test.dart +test/me_passkey_rsp_test.dart +test/me_passkeys_append_finish_req_test.dart +test/me_passkeys_append_start_req_test.dart +test/me_passkeys_append_start_rsp_test.dart +test/me_refresh_rsp_test.dart +test/me_rsp_test.dart +test/me_update_req_test.dart +test/paging_test.dart +test/passkey_append_finish_req_test.dart +test/passkey_append_start_req_test.dart +test/passkey_event_type_test.dart +test/passkey_icon_set_test.dart +test/passkey_login_finish_req_test.dart +test/passkey_login_start_req_test.dart +test/passkey_mediation_finish_req_test.dart +test/passkey_operation_test.dart +test/passkey_test.dart +test/process_common_test.dart +test/process_init_req_test.dart +test/process_init_rsp_test.dart +test/process_response_test.dart +test/process_static_info_test.dart +test/request_data_test.dart +test/request_error_test.dart +test/session_config_rsp_test.dart +test/short_session_cookie_config_test.dart +test/signup_init_req_test.dart +test/social_account_test.dart +test/social_data_test.dart +test/social_provider_type_test.dart +test/social_verify_start_req_test.dart +test/user_details_config_rsp_test.dart +test/users_api_test.dart +test/verification_method_test.dart diff --git a/packages/corbado_api_client/lib/frontendapi/CHANGELOG.md b/packages/corbado_api_client/lib/frontendapi/CHANGELOG.md new file mode 100644 index 00000000..50acd474 --- /dev/null +++ b/packages/corbado_api_client/lib/frontendapi/CHANGELOG.md @@ -0,0 +1,22 @@ +## 2.0.0 +* Changed to FrontendAPI v2. + +## 1.1.1 + +* Bump dependency versions (intl, meta, http). + +## 1.1.0 + +* Added support for email OTP endpoints. + +## 1.0.0 + +* Better comments. Stable release. + +## 0.1.1 + +* Add a short README.md. + +## 0.1.0 + +* Initial Open Source release. diff --git a/packages/corbado_api_client/lib/frontendapi/LICENSE b/packages/corbado_api_client/lib/frontendapi/LICENSE new file mode 100644 index 00000000..81800359 --- /dev/null +++ b/packages/corbado_api_client/lib/frontendapi/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2023, Corbado GmbH + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of {{ project }} nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/corbado_api_client/lib/frontendapi/README.md b/packages/corbado_api_client/lib/frontendapi/README.md index bfef3ea0..7a8d0834 100644 --- a/packages/corbado_api_client/lib/frontendapi/README.md +++ b/packages/corbado_api_client/lib/frontendapi/README.md @@ -18,7 +18,7 @@ For more information, please visit [https://www.corbado.com](https://www.corbado To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml ```yaml dependencies: - corbado_frontend_api_client: 1.0.0 + corbado_frontend_api_client: 2.0.0 ``` ### Github diff --git a/packages/corbado_api_client/lib/frontendapi/doc/AuthenticationResponse.md b/packages/corbado_api_client/lib/frontendapi/doc/AuthenticationResponse.md deleted file mode 100644 index dff341fb..00000000 --- a/packages/corbado_api_client/lib/frontendapi/doc/AuthenticationResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# corbado_frontend_api_client.model.AuthenticationResponse - -## Load the model package -```dart -import 'package:corbado_frontend_api_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shortSession** | **String** | | -**longSession** | **String** | Only given when project environment is dev | [optional] -**passkeyOperation** | [**PasskeyOperation**](PasskeyOperation.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/packages/corbado_api_client/lib/frontendapi/doc/BlockBodyData.md b/packages/corbado_api_client/lib/frontendapi/doc/BlockBodyData.md index 12c45e47..76263062 100644 --- a/packages/corbado_api_client/lib/frontendapi/doc/BlockBodyData.md +++ b/packages/corbado_api_client/lib/frontendapi/doc/BlockBodyData.md @@ -29,7 +29,7 @@ Name | Type | Description | Notes **loginHint** | **String** | | [optional] **retryNotBefore** | **int** | | [optional] **error** | [**RequestError**](RequestError.md) | | [optional] -**longSession** | **String** | Only given when project environment is dev | [optional] +**longSession** | **String** | Only given when project environment is dev 1 | [optional] **passkeyOperation** | [**PasskeyOperation**](PasskeyOperation.md) | | [optional] **fullName** | [**FullNameWithError**](FullNameWithError.md) | | [optional] **conditionalUIChallenge** | **String** | | [optional] diff --git a/packages/corbado_api_client/lib/frontendapi/doc/ClientInformationV2.md b/packages/corbado_api_client/lib/frontendapi/doc/ClientInformationV2.md deleted file mode 100644 index 5b4b89a8..00000000 --- a/packages/corbado_api_client/lib/frontendapi/doc/ClientInformationV2.md +++ /dev/null @@ -1,21 +0,0 @@ -# corbado_frontend_api_client.model.ClientInformationV2 - -## Load the model package -```dart -import 'package:corbado_frontend_api_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bluetoothAvailable** | **bool** | | [optional] -**clientEnvHandle** | **String** | | [optional] -**visitorId** | **String** | | [optional] -**isUserVerifyingPlatformAuthenticatorAvailable** | **bool** | | [optional] -**isConditionalMediationAvailable** | **bool** | | [optional] -**clientCapabilities** | [**ClientCapabilities**](ClientCapabilities.md) | | [optional] -**javaScriptHighEntropy** | [**JavaScriptHighEntropy**](JavaScriptHighEntropy.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/packages/corbado_api_client/lib/frontendapi/doc/GeneralBlockCompleted.md b/packages/corbado_api_client/lib/frontendapi/doc/GeneralBlockCompleted.md index 4a8d2ab5..2f7356ad 100644 --- a/packages/corbado_api_client/lib/frontendapi/doc/GeneralBlockCompleted.md +++ b/packages/corbado_api_client/lib/frontendapi/doc/GeneralBlockCompleted.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **blockType** | **String** | | **shortSession** | **String** | | -**longSession** | **String** | Only given when project environment is dev | [optional] +**longSession** | **String** | Only given when project environment is dev 1 | [optional] **passkeyOperation** | [**PasskeyOperation**](PasskeyOperation.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/packages/corbado_api_client/lib/frontendapi/doc/PhoneCollectReq.md b/packages/corbado_api_client/lib/frontendapi/doc/PhoneCollectReq.md deleted file mode 100644 index f7f4f8d4..00000000 --- a/packages/corbado_api_client/lib/frontendapi/doc/PhoneCollectReq.md +++ /dev/null @@ -1,15 +0,0 @@ -# corbado_frontend_api_client.model.PhoneCollectReq - -## Load the model package -```dart -import 'package:corbado_frontend_api_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **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/packages/corbado_api_client/lib/frontendapi/doc/UsernameCollectReq.md b/packages/corbado_api_client/lib/frontendapi/doc/UsernameCollectReq.md deleted file mode 100644 index 93864379..00000000 --- a/packages/corbado_api_client/lib/frontendapi/doc/UsernameCollectReq.md +++ /dev/null @@ -1,15 +0,0 @@ -# corbado_frontend_api_client.model.UsernameCollectReq - -## Load the model package -```dart -import 'package:corbado_frontend_api_client/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **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/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.dart deleted file mode 100644 index 7a96081a..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.dart +++ /dev/null @@ -1,153 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:corbado_frontend_api_client/src/model/passkey_operation.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'authentication_response.g.dart'; - -/// AuthenticationResponse -/// -/// Properties: -/// * [shortSession] -/// * [longSession] - Only given when project environment is dev -/// * [passkeyOperation] -@BuiltValue() -abstract class AuthenticationResponse - implements Built { - @BuiltValueField(wireName: r'shortSession') - String get shortSession; - - /// Only given when project environment is dev - @BuiltValueField(wireName: r'longSession') - String? get longSession; - - @BuiltValueField(wireName: r'passkeyOperation') - PasskeyOperation? get passkeyOperation; - - AuthenticationResponse._(); - - factory AuthenticationResponse( - [void updates(AuthenticationResponseBuilder b)]) = - _$AuthenticationResponse; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AuthenticationResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AuthenticationResponseSerializer(); -} - -class _$AuthenticationResponseSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [ - AuthenticationResponse, - _$AuthenticationResponse - ]; - - @override - final String wireName = r'AuthenticationResponse'; - - Iterable _serializeProperties( - Serializers serializers, - AuthenticationResponse object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'shortSession'; - yield serializers.serialize( - object.shortSession, - specifiedType: const FullType(String), - ); - if (object.longSession != null) { - yield r'longSession'; - yield serializers.serialize( - object.longSession, - specifiedType: const FullType(String), - ); - } - if (object.passkeyOperation != null) { - yield r'passkeyOperation'; - yield serializers.serialize( - object.passkeyOperation, - specifiedType: const FullType(PasskeyOperation), - ); - } - } - - @override - Object serialize( - Serializers serializers, - AuthenticationResponse object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required AuthenticationResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'shortSession': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.shortSession = valueDes; - break; - case r'longSession': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.longSession = valueDes; - break; - case r'passkeyOperation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(PasskeyOperation), - ) as PasskeyOperation; - result.passkeyOperation.replace(valueDes); - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - AuthenticationResponse deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = AuthenticationResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.g.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.g.dart deleted file mode 100644 index 4a7d28a5..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/authentication_response.g.dart +++ /dev/null @@ -1,138 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'authentication_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$AuthenticationResponse extends AuthenticationResponse { - @override - final String shortSession; - @override - final String? longSession; - @override - final PasskeyOperation? passkeyOperation; - - factory _$AuthenticationResponse( - [void Function(AuthenticationResponseBuilder)? updates]) => - (new AuthenticationResponseBuilder()..update(updates))._build(); - - _$AuthenticationResponse._( - {required this.shortSession, this.longSession, this.passkeyOperation}) - : super._() { - BuiltValueNullFieldError.checkNotNull( - shortSession, r'AuthenticationResponse', 'shortSession'); - } - - @override - AuthenticationResponse rebuild( - void Function(AuthenticationResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - AuthenticationResponseBuilder toBuilder() => - new AuthenticationResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is AuthenticationResponse && - shortSession == other.shortSession && - longSession == other.longSession && - passkeyOperation == other.passkeyOperation; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, shortSession.hashCode); - _$hash = $jc(_$hash, longSession.hashCode); - _$hash = $jc(_$hash, passkeyOperation.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'AuthenticationResponse') - ..add('shortSession', shortSession) - ..add('longSession', longSession) - ..add('passkeyOperation', passkeyOperation)) - .toString(); - } -} - -class AuthenticationResponseBuilder - implements Builder { - _$AuthenticationResponse? _$v; - - String? _shortSession; - String? get shortSession => _$this._shortSession; - set shortSession(String? shortSession) => _$this._shortSession = shortSession; - - String? _longSession; - String? get longSession => _$this._longSession; - set longSession(String? longSession) => _$this._longSession = longSession; - - PasskeyOperationBuilder? _passkeyOperation; - PasskeyOperationBuilder get passkeyOperation => - _$this._passkeyOperation ??= new PasskeyOperationBuilder(); - set passkeyOperation(PasskeyOperationBuilder? passkeyOperation) => - _$this._passkeyOperation = passkeyOperation; - - AuthenticationResponseBuilder() { - AuthenticationResponse._defaults(this); - } - - AuthenticationResponseBuilder get _$this { - final $v = _$v; - if ($v != null) { - _shortSession = $v.shortSession; - _longSession = $v.longSession; - _passkeyOperation = $v.passkeyOperation?.toBuilder(); - _$v = null; - } - return this; - } - - @override - void replace(AuthenticationResponse other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$AuthenticationResponse; - } - - @override - void update(void Function(AuthenticationResponseBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - AuthenticationResponse build() => _build(); - - _$AuthenticationResponse _build() { - _$AuthenticationResponse _$result; - try { - _$result = _$v ?? - new _$AuthenticationResponse._( - shortSession: BuiltValueNullFieldError.checkNotNull( - shortSession, r'AuthenticationResponse', 'shortSession'), - longSession: longSession, - passkeyOperation: _passkeyOperation?.build()); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'passkeyOperation'; - _passkeyOperation?.build(); - } catch (e) { - throw new BuiltValueNestedFieldError( - r'AuthenticationResponse', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/block_body_data.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/block_body_data.dart index 728bf158..85d8facb 100644 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/block_body_data.dart +++ b/packages/corbado_api_client/lib/frontendapi/lib/src/model/block_body_data.dart @@ -51,7 +51,7 @@ part 'block_body_data.g.dart'; /// * [loginHint] /// * [retryNotBefore] /// * [error] -/// * [longSession] - Only given when project environment is dev +/// * [longSession] - Only given when project environment is dev 1 /// * [passkeyOperation] /// * [fullName] /// * [conditionalUIChallenge] diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.dart deleted file mode 100644 index 4a880eef..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.dart +++ /dev/null @@ -1,226 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:corbado_frontend_api_client/src/model/client_capabilities.dart'; -import 'package:corbado_frontend_api_client/src/model/java_script_high_entropy.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'client_information_v2.g.dart'; - -/// ClientInformationV2 -/// -/// Properties: -/// * [bluetoothAvailable] -/// * [clientEnvHandle] -/// * [visitorId] -/// * [isUserVerifyingPlatformAuthenticatorAvailable] -/// * [isConditionalMediationAvailable] -/// * [clientCapabilities] -/// * [javaScriptHighEntropy] -@BuiltValue() -abstract class ClientInformationV2 - implements Built { - @BuiltValueField(wireName: r'bluetoothAvailable') - bool? get bluetoothAvailable; - - @BuiltValueField(wireName: r'clientEnvHandle') - String? get clientEnvHandle; - - @BuiltValueField(wireName: r'visitorId') - String? get visitorId; - - @BuiltValueField(wireName: r'isUserVerifyingPlatformAuthenticatorAvailable') - bool? get isUserVerifyingPlatformAuthenticatorAvailable; - - @BuiltValueField(wireName: r'isConditionalMediationAvailable') - bool? get isConditionalMediationAvailable; - - @BuiltValueField(wireName: r'clientCapabilities') - ClientCapabilities? get clientCapabilities; - - @BuiltValueField(wireName: r'javaScriptHighEntropy') - JavaScriptHighEntropy? get javaScriptHighEntropy; - - ClientInformationV2._(); - - factory ClientInformationV2([void updates(ClientInformationV2Builder b)]) = - _$ClientInformationV2; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ClientInformationV2Builder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ClientInformationV2Serializer(); -} - -class _$ClientInformationV2Serializer - implements PrimitiveSerializer { - @override - final Iterable types = const [ - ClientInformationV2, - _$ClientInformationV2 - ]; - - @override - final String wireName = r'ClientInformationV2'; - - Iterable _serializeProperties( - Serializers serializers, - ClientInformationV2 object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.bluetoothAvailable != null) { - yield r'bluetoothAvailable'; - yield serializers.serialize( - object.bluetoothAvailable, - specifiedType: const FullType(bool), - ); - } - if (object.clientEnvHandle != null) { - yield r'clientEnvHandle'; - yield serializers.serialize( - object.clientEnvHandle, - specifiedType: const FullType(String), - ); - } - if (object.visitorId != null) { - yield r'visitorId'; - yield serializers.serialize( - object.visitorId, - specifiedType: const FullType(String), - ); - } - if (object.isUserVerifyingPlatformAuthenticatorAvailable != null) { - yield r'isUserVerifyingPlatformAuthenticatorAvailable'; - yield serializers.serialize( - object.isUserVerifyingPlatformAuthenticatorAvailable, - specifiedType: const FullType(bool), - ); - } - if (object.isConditionalMediationAvailable != null) { - yield r'isConditionalMediationAvailable'; - yield serializers.serialize( - object.isConditionalMediationAvailable, - specifiedType: const FullType(bool), - ); - } - if (object.clientCapabilities != null) { - yield r'clientCapabilities'; - yield serializers.serialize( - object.clientCapabilities, - specifiedType: const FullType(ClientCapabilities), - ); - } - if (object.javaScriptHighEntropy != null) { - yield r'javaScriptHighEntropy'; - yield serializers.serialize( - object.javaScriptHighEntropy, - specifiedType: const FullType(JavaScriptHighEntropy), - ); - } - } - - @override - Object serialize( - Serializers serializers, - ClientInformationV2 object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ClientInformationV2Builder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'bluetoothAvailable': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.bluetoothAvailable = valueDes; - break; - case r'clientEnvHandle': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.clientEnvHandle = valueDes; - break; - case r'visitorId': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.visitorId = valueDes; - break; - case r'isUserVerifyingPlatformAuthenticatorAvailable': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.isUserVerifyingPlatformAuthenticatorAvailable = valueDes; - break; - case r'isConditionalMediationAvailable': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.isConditionalMediationAvailable = valueDes; - break; - case r'clientCapabilities': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(ClientCapabilities), - ) as ClientCapabilities; - result.clientCapabilities.replace(valueDes); - break; - case r'javaScriptHighEntropy': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(JavaScriptHighEntropy), - ) as JavaScriptHighEntropy; - result.javaScriptHighEntropy.replace(valueDes); - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - ClientInformationV2 deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ClientInformationV2Builder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.g.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.g.dart deleted file mode 100644 index 5aa74436..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/client_information_v2.g.dart +++ /dev/null @@ -1,204 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'client_information_v2.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$ClientInformationV2 extends ClientInformationV2 { - @override - final bool? bluetoothAvailable; - @override - final String? clientEnvHandle; - @override - final String? visitorId; - @override - final bool? isUserVerifyingPlatformAuthenticatorAvailable; - @override - final bool? isConditionalMediationAvailable; - @override - final ClientCapabilities? clientCapabilities; - @override - final JavaScriptHighEntropy? javaScriptHighEntropy; - - factory _$ClientInformationV2( - [void Function(ClientInformationV2Builder)? updates]) => - (new ClientInformationV2Builder()..update(updates))._build(); - - _$ClientInformationV2._( - {this.bluetoothAvailable, - this.clientEnvHandle, - this.visitorId, - this.isUserVerifyingPlatformAuthenticatorAvailable, - this.isConditionalMediationAvailable, - this.clientCapabilities, - this.javaScriptHighEntropy}) - : super._(); - - @override - ClientInformationV2 rebuild( - void Function(ClientInformationV2Builder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ClientInformationV2Builder toBuilder() => - new ClientInformationV2Builder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ClientInformationV2 && - bluetoothAvailable == other.bluetoothAvailable && - clientEnvHandle == other.clientEnvHandle && - visitorId == other.visitorId && - isUserVerifyingPlatformAuthenticatorAvailable == - other.isUserVerifyingPlatformAuthenticatorAvailable && - isConditionalMediationAvailable == - other.isConditionalMediationAvailable && - clientCapabilities == other.clientCapabilities && - javaScriptHighEntropy == other.javaScriptHighEntropy; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, bluetoothAvailable.hashCode); - _$hash = $jc(_$hash, clientEnvHandle.hashCode); - _$hash = $jc(_$hash, visitorId.hashCode); - _$hash = - $jc(_$hash, isUserVerifyingPlatformAuthenticatorAvailable.hashCode); - _$hash = $jc(_$hash, isConditionalMediationAvailable.hashCode); - _$hash = $jc(_$hash, clientCapabilities.hashCode); - _$hash = $jc(_$hash, javaScriptHighEntropy.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'ClientInformationV2') - ..add('bluetoothAvailable', bluetoothAvailable) - ..add('clientEnvHandle', clientEnvHandle) - ..add('visitorId', visitorId) - ..add('isUserVerifyingPlatformAuthenticatorAvailable', - isUserVerifyingPlatformAuthenticatorAvailable) - ..add('isConditionalMediationAvailable', - isConditionalMediationAvailable) - ..add('clientCapabilities', clientCapabilities) - ..add('javaScriptHighEntropy', javaScriptHighEntropy)) - .toString(); - } -} - -class ClientInformationV2Builder - implements Builder { - _$ClientInformationV2? _$v; - - bool? _bluetoothAvailable; - bool? get bluetoothAvailable => _$this._bluetoothAvailable; - set bluetoothAvailable(bool? bluetoothAvailable) => - _$this._bluetoothAvailable = bluetoothAvailable; - - String? _clientEnvHandle; - String? get clientEnvHandle => _$this._clientEnvHandle; - set clientEnvHandle(String? clientEnvHandle) => - _$this._clientEnvHandle = clientEnvHandle; - - String? _visitorId; - String? get visitorId => _$this._visitorId; - set visitorId(String? visitorId) => _$this._visitorId = visitorId; - - bool? _isUserVerifyingPlatformAuthenticatorAvailable; - bool? get isUserVerifyingPlatformAuthenticatorAvailable => - _$this._isUserVerifyingPlatformAuthenticatorAvailable; - set isUserVerifyingPlatformAuthenticatorAvailable( - bool? isUserVerifyingPlatformAuthenticatorAvailable) => - _$this._isUserVerifyingPlatformAuthenticatorAvailable = - isUserVerifyingPlatformAuthenticatorAvailable; - - bool? _isConditionalMediationAvailable; - bool? get isConditionalMediationAvailable => - _$this._isConditionalMediationAvailable; - set isConditionalMediationAvailable(bool? isConditionalMediationAvailable) => - _$this._isConditionalMediationAvailable = isConditionalMediationAvailable; - - ClientCapabilitiesBuilder? _clientCapabilities; - ClientCapabilitiesBuilder get clientCapabilities => - _$this._clientCapabilities ??= new ClientCapabilitiesBuilder(); - set clientCapabilities(ClientCapabilitiesBuilder? clientCapabilities) => - _$this._clientCapabilities = clientCapabilities; - - JavaScriptHighEntropyBuilder? _javaScriptHighEntropy; - JavaScriptHighEntropyBuilder get javaScriptHighEntropy => - _$this._javaScriptHighEntropy ??= new JavaScriptHighEntropyBuilder(); - set javaScriptHighEntropy( - JavaScriptHighEntropyBuilder? javaScriptHighEntropy) => - _$this._javaScriptHighEntropy = javaScriptHighEntropy; - - ClientInformationV2Builder() { - ClientInformationV2._defaults(this); - } - - ClientInformationV2Builder get _$this { - final $v = _$v; - if ($v != null) { - _bluetoothAvailable = $v.bluetoothAvailable; - _clientEnvHandle = $v.clientEnvHandle; - _visitorId = $v.visitorId; - _isUserVerifyingPlatformAuthenticatorAvailable = - $v.isUserVerifyingPlatformAuthenticatorAvailable; - _isConditionalMediationAvailable = $v.isConditionalMediationAvailable; - _clientCapabilities = $v.clientCapabilities?.toBuilder(); - _javaScriptHighEntropy = $v.javaScriptHighEntropy?.toBuilder(); - _$v = null; - } - return this; - } - - @override - void replace(ClientInformationV2 other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$ClientInformationV2; - } - - @override - void update(void Function(ClientInformationV2Builder)? updates) { - if (updates != null) updates(this); - } - - @override - ClientInformationV2 build() => _build(); - - _$ClientInformationV2 _build() { - _$ClientInformationV2 _$result; - try { - _$result = _$v ?? - new _$ClientInformationV2._( - bluetoothAvailable: bluetoothAvailable, - clientEnvHandle: clientEnvHandle, - visitorId: visitorId, - isUserVerifyingPlatformAuthenticatorAvailable: - isUserVerifyingPlatformAuthenticatorAvailable, - isConditionalMediationAvailable: isConditionalMediationAvailable, - clientCapabilities: _clientCapabilities?.build(), - javaScriptHighEntropy: _javaScriptHighEntropy?.build()); - } catch (_) { - late String _$failedField; - try { - _$failedField = 'clientCapabilities'; - _clientCapabilities?.build(); - _$failedField = 'javaScriptHighEntropy'; - _javaScriptHighEntropy?.build(); - } catch (e) { - throw new BuiltValueNestedFieldError( - r'ClientInformationV2', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/general_block_completed.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/general_block_completed.dart index 5e4974cb..51aab9d7 100644 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/general_block_completed.dart +++ b/packages/corbado_api_client/lib/frontendapi/lib/src/model/general_block_completed.dart @@ -14,7 +14,7 @@ part 'general_block_completed.g.dart'; /// Properties: /// * [blockType] /// * [shortSession] -/// * [longSession] - Only given when project environment is dev +/// * [longSession] - Only given when project environment is dev 1 /// * [passkeyOperation] @BuiltValue() abstract class GeneralBlockCompleted @@ -25,7 +25,7 @@ abstract class GeneralBlockCompleted @BuiltValueField(wireName: r'shortSession') String get shortSession; - /// Only given when project environment is dev + /// Only given when project environment is dev 1 @BuiltValueField(wireName: r'longSession') String? get longSession; diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.dart deleted file mode 100644 index ad31bfe9..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.dart +++ /dev/null @@ -1,111 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'phone_collect_req.g.dart'; - -/// PhoneCollectReq -/// -/// Properties: -/// * [value] -@BuiltValue() -abstract class PhoneCollectReq - implements Built { - @BuiltValueField(wireName: r'value') - String get value; - - PhoneCollectReq._(); - - factory PhoneCollectReq([void updates(PhoneCollectReqBuilder b)]) = - _$PhoneCollectReq; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(PhoneCollectReqBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$PhoneCollectReqSerializer(); -} - -class _$PhoneCollectReqSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [PhoneCollectReq, _$PhoneCollectReq]; - - @override - final String wireName = r'PhoneCollectReq'; - - Iterable _serializeProperties( - Serializers serializers, - PhoneCollectReq object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'value'; - yield serializers.serialize( - object.value, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - PhoneCollectReq object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required PhoneCollectReqBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'value': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.value = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - PhoneCollectReq deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = PhoneCollectReqBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.g.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.g.dart deleted file mode 100644 index 5d903374..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/phone_collect_req.g.dart +++ /dev/null @@ -1,95 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'phone_collect_req.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$PhoneCollectReq extends PhoneCollectReq { - @override - final String value; - - factory _$PhoneCollectReq([void Function(PhoneCollectReqBuilder)? updates]) => - (new PhoneCollectReqBuilder()..update(updates))._build(); - - _$PhoneCollectReq._({required this.value}) : super._() { - BuiltValueNullFieldError.checkNotNull(value, r'PhoneCollectReq', 'value'); - } - - @override - PhoneCollectReq rebuild(void Function(PhoneCollectReqBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - PhoneCollectReqBuilder toBuilder() => - new PhoneCollectReqBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is PhoneCollectReq && value == other.value; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, value.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'PhoneCollectReq') - ..add('value', value)) - .toString(); - } -} - -class PhoneCollectReqBuilder - implements Builder { - _$PhoneCollectReq? _$v; - - String? _value; - String? get value => _$this._value; - set value(String? value) => _$this._value = value; - - PhoneCollectReqBuilder() { - PhoneCollectReq._defaults(this); - } - - PhoneCollectReqBuilder get _$this { - final $v = _$v; - if ($v != null) { - _value = $v.value; - _$v = null; - } - return this; - } - - @override - void replace(PhoneCollectReq other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$PhoneCollectReq; - } - - @override - void update(void Function(PhoneCollectReqBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - PhoneCollectReq build() => _build(); - - _$PhoneCollectReq _build() { - final _$result = _$v ?? - new _$PhoneCollectReq._( - value: BuiltValueNullFieldError.checkNotNull( - value, r'PhoneCollectReq', 'value')); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.dart deleted file mode 100644 index 6baf94c9..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.dart +++ /dev/null @@ -1,111 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'username_collect_req.g.dart'; - -/// UsernameCollectReq -/// -/// Properties: -/// * [value] -@BuiltValue() -abstract class UsernameCollectReq - implements Built { - @BuiltValueField(wireName: r'value') - String get value; - - UsernameCollectReq._(); - - factory UsernameCollectReq([void updates(UsernameCollectReqBuilder b)]) = - _$UsernameCollectReq; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(UsernameCollectReqBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$UsernameCollectReqSerializer(); -} - -class _$UsernameCollectReqSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [UsernameCollectReq, _$UsernameCollectReq]; - - @override - final String wireName = r'UsernameCollectReq'; - - Iterable _serializeProperties( - Serializers serializers, - UsernameCollectReq object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'value'; - yield serializers.serialize( - object.value, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - UsernameCollectReq object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required UsernameCollectReqBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'value': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.value = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - UsernameCollectReq deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = UsernameCollectReqBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.g.dart b/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.g.dart deleted file mode 100644 index dd8ac8a5..00000000 --- a/packages/corbado_api_client/lib/frontendapi/lib/src/model/username_collect_req.g.dart +++ /dev/null @@ -1,98 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'username_collect_req.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -class _$UsernameCollectReq extends UsernameCollectReq { - @override - final String value; - - factory _$UsernameCollectReq( - [void Function(UsernameCollectReqBuilder)? updates]) => - (new UsernameCollectReqBuilder()..update(updates))._build(); - - _$UsernameCollectReq._({required this.value}) : super._() { - BuiltValueNullFieldError.checkNotNull( - value, r'UsernameCollectReq', 'value'); - } - - @override - UsernameCollectReq rebuild( - void Function(UsernameCollectReqBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - UsernameCollectReqBuilder toBuilder() => - new UsernameCollectReqBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is UsernameCollectReq && value == other.value; - } - - @override - int get hashCode { - var _$hash = 0; - _$hash = $jc(_$hash, value.hashCode); - _$hash = $jf(_$hash); - return _$hash; - } - - @override - String toString() { - return (newBuiltValueToStringHelper(r'UsernameCollectReq') - ..add('value', value)) - .toString(); - } -} - -class UsernameCollectReqBuilder - implements Builder { - _$UsernameCollectReq? _$v; - - String? _value; - String? get value => _$this._value; - set value(String? value) => _$this._value = value; - - UsernameCollectReqBuilder() { - UsernameCollectReq._defaults(this); - } - - UsernameCollectReqBuilder get _$this { - final $v = _$v; - if ($v != null) { - _value = $v.value; - _$v = null; - } - return this; - } - - @override - void replace(UsernameCollectReq other) { - ArgumentError.checkNotNull(other, 'other'); - _$v = other as _$UsernameCollectReq; - } - - @override - void update(void Function(UsernameCollectReqBuilder)? updates) { - if (updates != null) updates(this); - } - - @override - UsernameCollectReq build() => _build(); - - _$UsernameCollectReq _build() { - final _$result = _$v ?? - new _$UsernameCollectReq._( - value: BuiltValueNullFieldError.checkNotNull( - value, r'UsernameCollectReq', 'value')); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/corbado_api_client/lib/frontendapi/pubspec.yaml b/packages/corbado_api_client/lib/frontendapi/pubspec.yaml index 0f05945a..e6a0d637 100644 --- a/packages/corbado_api_client/lib/frontendapi/pubspec.yaml +++ b/packages/corbado_api_client/lib/frontendapi/pubspec.yaml @@ -1,10 +1,10 @@ name: corbado_frontend_api_client -version: 1.0.0 -description: OpenAPI API client -homepage: homepage +version: 2.0.0 +description: Client for the Corbado Frontend API +homepage: https://docs.corbado.com/overview/welcome environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/packages/corbado_api_client/lib/frontendapi/test/auth_api_test.dart b/packages/corbado_api_client/lib/frontendapi/test/auth_api_test.dart index 40e221d5..da373816 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/auth_api_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/auth_api_test.dart @@ -64,7 +64,7 @@ void main() { // tbd // - //Future passkeyAppendStart(JsonObject body) async + //Future passkeyAppendStart(PasskeyAppendStartReq passkeyAppendStartReq) async test('test passkeyAppendStart', () async { // TODO }); @@ -78,7 +78,7 @@ void main() { // tbd // - //Future passkeyLoginStart(JsonObject body) async + //Future passkeyLoginStart(PasskeyLoginStartReq passkeyLoginStartReq) async test('test passkeyLoginStart', () async { // TODO }); @@ -90,13 +90,6 @@ void main() { // TODO }); - // tbd - // - //Future phoneCollect(PhoneCollectReq phoneCollectReq) async - test('test phoneCollect', () async { - // TODO - }); - // tbd // //Future processComplete() async @@ -152,12 +145,5 @@ void main() { test('test socialVerifyStart', () async { // TODO }); - - // tbd - // - //Future usernameCollect(UsernameCollectReq usernameCollectReq) async - test('test usernameCollect', () async { - // TODO - }); }); } diff --git a/packages/corbado_api_client/lib/frontendapi/test/authentication_response_test.dart b/packages/corbado_api_client/lib/frontendapi/test/authentication_response_test.dart deleted file mode 100644 index b13554cb..00000000 --- a/packages/corbado_api_client/lib/frontendapi/test/authentication_response_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart'; - -// tests for AuthenticationResponse -void main() { - final instance = AuthenticationResponseBuilder(); - // TODO add properties to the builder and call build() - - group(AuthenticationResponse, () { - // String shortSession - test('to test the property `shortSession`', () async { - // TODO - }); - - // Only given when project environment is dev - // String longSession - test('to test the property `longSession`', () async { - // TODO - }); - - // PasskeyOperation passkeyOperation - test('to test the property `passkeyOperation`', () async { - // TODO - }); - }); -} diff --git a/packages/corbado_api_client/lib/frontendapi/test/block_body_data_test.dart b/packages/corbado_api_client/lib/frontendapi/test/block_body_data_test.dart index ab7a47cb..fd068d6c 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/block_body_data_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/block_body_data_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(BlockBodyData, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // String challenge test('to test the property `challenge`', () async { // TODO @@ -72,11 +77,6 @@ void main() { // TODO }); - // LoginIdentifierType type - test('to test the property `type`', () async { - // TODO - }); - // bool isPhone test('to test the property `isPhone`', () async { // TODO @@ -112,7 +112,7 @@ void main() { // TODO }); - // Only given when project environment is dev + // Only given when project environment is dev 1 // String longSession test('to test the property `longSession`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/client_information_test.dart b/packages/corbado_api_client/lib/frontendapi/test/client_information_test.dart index f75be820..202aba35 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/client_information_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/client_information_test.dart @@ -48,5 +48,10 @@ void main() { test('to test the property `javaScriptHighEntropy`', () async { // TODO }); + + // bool isNative + test('to test the property `isNative`', () async { + // TODO + }); }); } diff --git a/packages/corbado_api_client/lib/frontendapi/test/client_information_v2_test.dart b/packages/corbado_api_client/lib/frontendapi/test/client_information_v2_test.dart deleted file mode 100644 index 40621cbb..00000000 --- a/packages/corbado_api_client/lib/frontendapi/test/client_information_v2_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart'; - -// tests for ClientInformationV2 -void main() { - final instance = ClientInformationV2Builder(); - // TODO add properties to the builder and call build() - - group(ClientInformationV2, () { - // bool bluetoothAvailable - test('to test the property `bluetoothAvailable`', () async { - // TODO - }); - - // String clientEnvHandle - test('to test the property `clientEnvHandle`', () async { - // TODO - }); - - // String visitorId - test('to test the property `visitorId`', () async { - // TODO - }); - - // bool isUserVerifyingPlatformAuthenticatorAvailable - test('to test the property `isUserVerifyingPlatformAuthenticatorAvailable`', - () async { - // TODO - }); - - // bool isConditionalMediationAvailable - test('to test the property `isConditionalMediationAvailable`', () async { - // TODO - }); - - // ClientCapabilities clientCapabilities - test('to test the property `clientCapabilities`', () async { - // TODO - }); - - // JavaScriptHighEntropy javaScriptHighEntropy - test('to test the property `javaScriptHighEntropy`', () async { - // TODO - }); - }); -} diff --git a/packages/corbado_api_client/lib/frontendapi/test/connect_append_init_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/connect_append_init_req_test.dart index 913aeecf..4b64bb3d 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/connect_append_init_req_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/connect_append_init_req_test.dart @@ -7,7 +7,7 @@ void main() { // TODO add properties to the builder and call build() group(ConnectAppendInitReq, () { - // ClientInformationV2 clientInformation + // ClientInformation clientInformation test('to test the property `clientInformation`', () async { // TODO }); diff --git a/packages/corbado_api_client/lib/frontendapi/test/connect_login_init_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/connect_login_init_req_test.dart index 25557300..d6da729c 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/connect_login_init_req_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/connect_login_init_req_test.dart @@ -7,7 +7,7 @@ void main() { // TODO add properties to the builder and call build() group(ConnectLoginInitReq, () { - // ClientInformationV2 clientInformation + // ClientInformation clientInformation test('to test the property `clientInformation`', () async { // TODO }); diff --git a/packages/corbado_api_client/lib/frontendapi/test/connect_manage_init_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/connect_manage_init_req_test.dart index dee075b9..9cacbd8d 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/connect_manage_init_req_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/connect_manage_init_req_test.dart @@ -7,7 +7,7 @@ void main() { // TODO add properties to the builder and call build() group(ConnectManageInitReq, () { - // ClientInformationV2 clientInformation + // ClientInformation clientInformation test('to test the property `clientInformation`', () async { // TODO }); diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_completed_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_completed_test.dart index d96b52f8..e446e2ab 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_completed_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_completed_test.dart @@ -17,7 +17,7 @@ void main() { // TODO }); - // Only given when project environment is dev + // Only given when project environment is dev 1 // String longSession test('to test the property `longSession`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_login_init_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_login_init_test.dart index 6c17fd05..46699ee6 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_login_init_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_login_init_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockLoginInit, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // String identifierValue test('to test the property `identifierValue`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_append_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_append_test.dart index 05ea1655..021b7dac 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_append_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_append_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockPasskeyAppend, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // String challenge test('to test the property `challenge`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_verify_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_verify_test.dart index 48aa0683..247fd7a3 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_verify_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_passkey_verify_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockPasskeyVerify, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // String challenge test('to test the property `challenge`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_post_signup_email_verify_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_post_signup_email_verify_test.dart index e3416328..1b3302bc 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_post_signup_email_verify_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_post_signup_email_verify_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockPostSignupEmailVerify, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // RequestError error test('to test the property `error`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_signup_init_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_signup_init_test.dart index 85792377..aefda5d5 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_signup_init_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_signup_init_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockSignupInit, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // BuiltList identifiers test('to test the property `identifiers`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/general_block_verify_identifier_test.dart b/packages/corbado_api_client/lib/frontendapi/test/general_block_verify_identifier_test.dart index 0e99031b..2ab63faf 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/general_block_verify_identifier_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/general_block_verify_identifier_test.dart @@ -7,6 +7,11 @@ void main() { // TODO add properties to the builder and call build() group(GeneralBlockVerifyIdentifier, () { + // String blockType + test('to test the property `blockType`', () async { + // TODO + }); + // VerificationMethod verificationMethod test('to test the property `verificationMethod`', () async { // TODO diff --git a/packages/corbado_api_client/lib/frontendapi/test/passkey_append_start_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/passkey_append_start_req_test.dart index 16f8081c..22a62540 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/passkey_append_start_req_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/passkey_append_start_req_test.dart @@ -7,7 +7,7 @@ void main() { // TODO add properties to the builder and call build() group(PasskeyAppendStartReq, () { - // ClientInformationV2 clientInformation + // ClientInformation clientInformation test('to test the property `clientInformation`', () async { // TODO }); diff --git a/packages/corbado_api_client/lib/frontendapi/test/passkey_login_start_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/passkey_login_start_req_test.dart index 76b03c79..e87d6057 100644 --- a/packages/corbado_api_client/lib/frontendapi/test/passkey_login_start_req_test.dart +++ b/packages/corbado_api_client/lib/frontendapi/test/passkey_login_start_req_test.dart @@ -7,7 +7,7 @@ void main() { // TODO add properties to the builder and call build() group(PasskeyLoginStartReq, () { - // ClientInformationV2 clientInformation + // ClientInformation clientInformation test('to test the property `clientInformation`', () async { // TODO }); diff --git a/packages/corbado_api_client/lib/frontendapi/test/phone_collect_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/phone_collect_req_test.dart deleted file mode 100644 index 0be7b20a..00000000 --- a/packages/corbado_api_client/lib/frontendapi/test/phone_collect_req_test.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:test/test.dart'; -import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart'; - -// tests for PhoneCollectReq -void main() { - final instance = PhoneCollectReqBuilder(); - // TODO add properties to the builder and call build() - - group(PhoneCollectReq, () { - // String value - test('to test the property `value`', () async { - // TODO - }); - }); -} diff --git a/packages/corbado_api_client/lib/frontendapi/test/username_collect_req_test.dart b/packages/corbado_api_client/lib/frontendapi/test/username_collect_req_test.dart deleted file mode 100644 index 1d582a17..00000000 --- a/packages/corbado_api_client/lib/frontendapi/test/username_collect_req_test.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:test/test.dart'; -import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart'; - -// tests for UsernameCollectReq -void main() { - final instance = UsernameCollectReqBuilder(); - // TODO add properties to the builder and call build() - - group(UsernameCollectReq, () { - // String value - test('to test the property `value`', () async { - // TODO - }); - }); -} diff --git a/packages/corbado_auth/lib/src/services/corbado/corbado.dart b/packages/corbado_auth/lib/src/services/corbado/corbado.dart index b764f126..0c37d518 100644 --- a/packages/corbado_auth/lib/src/services/corbado/corbado.dart +++ b/packages/corbado_auth/lib/src/services/corbado/corbado.dart @@ -2,25 +2,25 @@ import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:corbado_auth/corbado_auth.dart'; -import 'package:corbado_auth/src/blocks/passkey_append_block.dart'; import 'package:corbado_auth/src/blocks/types.dart'; -import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart' as Api; +import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart' as api; import 'package:corbado_frontend_api_client/corbado_frontend_api_client.dart'; import 'package:dio/dio.dart'; import 'package:passkeys/authenticator.dart'; abstract class CorbadoService { - final Api.CorbadoFrontendApiClient frontendAPIClient; + + CorbadoService(this.frontendAPIClient, this.passkeyAuthenticator); + + final api.CorbadoFrontendApiClient frontendAPIClient; final PasskeyAuthenticator passkeyAuthenticator; String? _processID; DateTime? _processExpiresAt; - CorbadoService(this.frontendAPIClient, this.passkeyAuthenticator); - - Future initAuthProcess() async { + Future initAuthProcess() async { final ciBuilder = await _buildClientInformation(); - final processInitReq = Api.ProcessInitReq((b) => b..clientInformation = ciBuilder); + final processInitReq = api.ProcessInitReq((b) => b..clientInformation = ciBuilder); final res = await frontendAPIClient.getAuthApi().processInit(processInitReq: processInitReq); if (res.data == null) { throw CorbadoError.fromMissingServerResponse(); @@ -31,11 +31,11 @@ abstract class CorbadoService { return res.data!.processResponse; } - Future completeAuthProcess() async { + Future completeAuthProcess() async { return _wrapWithError(() => frontendAPIClient.getAuthApi().processComplete()); } - Future resetAuthProcess() async { + Future resetAuthProcess() async { final out = await _wrapWithError(() => frontendAPIClient.getAuthApi().processReset()); final newProcess = out.newProcess; @@ -51,19 +51,19 @@ abstract class CorbadoService { _processExpiresAt = null; } - Future signupInit({String? email, String? fullName}) async { - final identifierBuilder = ListBuilder(); + Future signupInit({String? email, String? fullName}) async { + final identifierBuilder = ListBuilder(); if (email != null) { identifierBuilder.add( - Api.LoginIdentifier( + api.LoginIdentifier( (b) => b - ..type = Api.LoginIdentifierType.email + ..type = api.LoginIdentifierType.email ..identifier = email, ), ); } - final signupInitReq = Api.SignupInitReq((b) => b + final signupInitReq = api.SignupInitReq((b) => b ..fullName = fullName ..identifiers = identifierBuilder); @@ -74,63 +74,63 @@ abstract class CorbadoService { ); } - Future loginInit(String loginIdentifier, bool isPhone) async { - final req = Api.LoginInitReq((b) => b + Future loginInit(String loginIdentifier, bool isPhone) async { + final req = api.LoginInitReq((b) => b ..identifierValue = loginIdentifier ..isPhone = isPhone); return _wrapWithError(() => frontendAPIClient.getAuthApi().loginInit(loginInitReq: req)); } - Future finishPasskeyMediation(String signedChallenge) async { - final req = Api.PasskeyMediationFinishReq((b) => b..signedChallenge = signedChallenge); + Future finishPasskeyMediation(String signedChallenge) async { + final req = api.PasskeyMediationFinishReq((b) => b..signedChallenge = signedChallenge); return _wrapWithError(() => frontendAPIClient.getAuthApi().passkeyMediationFinish(passkeyMediationFinishReq: req)); } - Future verifyEmailOtpCode(String code) async { - final req = Api.IdentifierVerifyFinishReq((b) => b + Future verifyEmailOtpCode(String code) async { + final req = api.IdentifierVerifyFinishReq((b) => b ..code = code - ..identifierType = Api.LoginIdentifierType.email - ..verificationType = Api.VerificationMethod.emailOtp + ..identifierType = api.LoginIdentifierType.email + ..verificationType = api.VerificationMethod.emailOtp ..isNewDevice = false); return _wrapWithError(() => frontendAPIClient.getAuthApi().identifierVerifyFinish(identifierVerifyFinishReq: req)); } - Future sendEmailOtpCode() async { - final req = Api.IdentifierVerifyStartReq((b) => b - ..identifierType = Api.LoginIdentifierType.email - ..verificationType = Api.VerificationMethod.emailOtp); + Future sendEmailOtpCode() async { + final req = api.IdentifierVerifyStartReq((b) => b + ..identifierType = api.LoginIdentifierType.email + ..verificationType = api.VerificationMethod.emailOtp); return _wrapWithError(() => frontendAPIClient.getAuthApi().identifierVerifyStart(identifierVerifyStartReq: req)); } - Future sendEmailLink() async { - final req = Api.IdentifierVerifyStartReq((b) => b - ..identifierType = Api.LoginIdentifierType.email - ..verificationType = Api.VerificationMethod.emailLink); + Future sendEmailLink() async { + final req = api.IdentifierVerifyStartReq((b) => b + ..identifierType = api.LoginIdentifierType.email + ..verificationType = api.VerificationMethod.emailLink); return _wrapWithError(() => frontendAPIClient.getAuthApi().identifierVerifyStart(identifierVerifyStartReq: req)); } - Future updateEmail(String email) async { - final req = Api.IdentifierUpdateReq((b) => b - ..identifierType = Api.LoginIdentifierType.email + Future updateEmail(String email) async { + final req = api.IdentifierUpdateReq((b) => b + ..identifierType = api.LoginIdentifierType.email ..value = email); return _wrapWithError(() => frontendAPIClient.getAuthApi().identifierUpdate(identifierUpdateReq: req)); } /// passkey related functionalities - Future appendPasskey() async { + Future appendPasskey() async { final startRes = await _wrapWithError( () => frontendAPIClient.getAuthApi().passkeyAppendStart(passkeyAppendStartReq: PasskeyAppendStartReq())); if (startRes.blockBody.error != null) { throw CorbadoError.fromMissingServerResponse(); } - final body = startRes.blockBody.data.oneOf.value as Api.GeneralBlockPasskeyAppend; + final body = startRes.blockBody.data.oneOf.value as api.GeneralBlockPasskeyAppend; final json = jsonDecode(body.challenge) as Map; final authenticatorReq = StartRegisterResponse.fromJson(json).toPlatformType(); @@ -139,7 +139,7 @@ abstract class CorbadoService { final authenticatorRes = await passkeyAuthenticator.register(authenticatorReq); final attestationResponse = jsonEncode(FinishRegisterRequest.fromRegisterCompleteRequest(authenticatorRes).toJson()); - final passkeyAppendReq = Api.PasskeyAppendFinishReq((b) => b..signedChallenge = attestationResponse); + final passkeyAppendReq = api.PasskeyAppendFinishReq((b) => b..signedChallenge = attestationResponse); return _wrapWithError( () => frontendAPIClient.getAuthApi().passkeyAppendFinish(passkeyAppendFinishReq: passkeyAppendReq)); @@ -150,7 +150,7 @@ abstract class CorbadoService { Future sessionAppendPasskey() async { final ci = await _buildClientInformation(); - final startReq = Api.MePasskeysAppendStartReq((b) => b..clientInformation = ci); + final startReq = api.MePasskeysAppendStartReq((b) => b..clientInformation = ci); final startRes = await _wrapWithError( () => frontendAPIClient.getUsersApi().currentUserPasskeyAppendStart(mePasskeysAppendStartReq: startReq)); @@ -164,7 +164,7 @@ abstract class CorbadoService { final authenticatorRes = await passkeyAuthenticator.register(authenticatorReq); final attestationResponse = jsonEncode(FinishRegisterRequest.fromRegisterCompleteRequest(authenticatorRes).toJson()); - final mePasskeysAppendFinishReq = Api.MePasskeysAppendFinishReq((b) => b + final mePasskeysAppendFinishReq = api.MePasskeysAppendFinishReq((b) => b ..attestationResponse = attestationResponse ..clientInformation = ci); @@ -178,7 +178,7 @@ abstract class CorbadoService { } } - Future> sessionListPasskeys({String? token}) async { + Future> sessionListPasskeys({String? token}) async { final res = await _wrapWithError(() => frontendAPIClient.getUsersApi().currentUserPasskeyGet()); return res.passkeys.toList(); @@ -189,18 +189,18 @@ abstract class CorbadoService { } Future sessionUpdateUser({String? fullname}) async { - final meUpdateReq = Api.MeUpdateReq((b) => b..fullName = fullname); + final meUpdateReq = api.MeUpdateReq((b) => b..fullName = fullname); await _wrapWithError(() => frontendAPIClient.getUsersApi().currentUserUpdate(meUpdateReq: meUpdateReq)); } - Future verifyPasskey() async { + Future verifyPasskey() async { final startRes = await _wrapWithError( - () => frontendAPIClient.getAuthApi().passkeyLoginStart(passkeyLoginStartReq: Api.PasskeyLoginStartReq())); + () => frontendAPIClient.getAuthApi().passkeyLoginStart(passkeyLoginStartReq: api.PasskeyLoginStartReq())); if (startRes.blockBody.error != null) { throw CorbadoError.fromMissingServerResponse(); } - final body = startRes.blockBody.data.oneOf.value as Api.GeneralBlockPasskeyVerify; + final body = startRes.blockBody.data.oneOf.value as api.GeneralBlockPasskeyVerify; final json = jsonDecode(body.challenge) as Map; final authenticatorReq = StartLoginResponse.fromJson(json) @@ -208,7 +208,7 @@ abstract class CorbadoService { try { final authenticatorRes = await passkeyAuthenticator.authenticate(authenticatorReq); final assertionResponse = jsonEncode(FinishLoginRequest.fromPlatformType(authenticatorRes).toJson()); - final passkeyLoginFinishReq = Api.PasskeyLoginFinishReq((b) => b..signedChallenge = assertionResponse); + final passkeyLoginFinishReq = api.PasskeyLoginFinishReq((b) => b..signedChallenge = assertionResponse); return _wrapWithError( () => frontendAPIClient.getAuthApi().passkeyLoginFinish(passkeyLoginFinishReq: passkeyLoginFinishReq)); @@ -221,7 +221,7 @@ abstract class CorbadoService { } } - Future verifyPasskeyConditional(String challenge, bool silent) async { + Future verifyPasskeyConditional(String challenge, bool silent) async { final json = jsonDecode(challenge) as Map; final authenticatorReq = StartLoginResponse.fromJson(json) .toPlatformType(conditional: silent, preferImmediatelyAvailableCredentials: !silent); @@ -229,7 +229,7 @@ abstract class CorbadoService { try { final authenticatorRes = await passkeyAuthenticator.authenticate(authenticatorReq); final assertionResponse = jsonEncode(FinishLoginRequest.fromPlatformType(authenticatorRes).toJson()); - final passkeyLoginFinishReq = Api.PasskeyMediationFinishReq((b) => b..signedChallenge = assertionResponse); + final passkeyLoginFinishReq = api.PasskeyMediationFinishReq((b) => b..signedChallenge = assertionResponse); return _wrapWithError(() => frontendAPIClient.getAuthApi().passkeyMediationFinish(passkeyMediationFinishReq: passkeyLoginFinishReq)); @@ -280,10 +280,10 @@ abstract class CorbadoService { return; } - Future _buildClientInformation() async { + Future _buildClientInformation() async { final passkeyAvailability = await passkeyAuthenticator.getAvailability(); - return Api.ClientInformationBuilder() + return api.ClientInformationBuilder() ..isNative = passkeyAvailability.isNative ..isUserVerifyingPlatformAuthenticatorAvailable = passkeyAvailability.isUserVerifyingPlatformAuthenticatorAvailable diff --git a/packages/corbado_auth/pubspec.yaml b/packages/corbado_auth/pubspec.yaml index 3de2fa8b..f97b07f9 100644 --- a/packages/corbado_auth/pubspec.yaml +++ b/packages/corbado_auth/pubspec.yaml @@ -2,14 +2,16 @@ name: corbado_auth description: Flutter package for Corbado Auth. Enables authentication on Android and iOS using passkeys. homepage: https://docs.corbado.com/overview/welcome repository: https://github.com/corbado/flutter-passkeys/tree/main/packages/corbado_auth -version: 2.0.8 +version: 3.0.0 environment: sdk: ">=3.0.0 <4.0.0" flutter: ">=3.0.0" dependencies: + built_collection: ^5.1.1 corbado_frontend_api_client: ^1.1.1 + dio: ^5.7.0 flutter: sdk: flutter flutter_keychain: ^2.4.0 @@ -17,7 +19,7 @@ dependencies: json_annotation: ^4.8.1 jwt_decoder: ^2.0.1 meta: ^1.15.0 - passkeys: ^2.0.9 + passkeys: ^2.1.0 rxdart: ^0.27.7 ua_client_hints: ^1.1.3 universal_html: ^2.2.4 diff --git a/packages/passkeys/passkeys/pubspec.yaml b/packages/passkeys/passkeys/pubspec.yaml index 3e5de231..e0e5e460 100644 --- a/packages/passkeys/passkeys/pubspec.yaml +++ b/packages/passkeys/passkeys/pubspec.yaml @@ -20,14 +20,13 @@ flutter: dependencies: convert: ^3.1.1 - corbado_frontend_api_client: ^1.1.1 flutter: sdk: flutter json_annotation: ^4.8.1 - passkeys_android: ^2.0.4 - passkeys_ios: ^2.0.3 - passkeys_platform_interface: ^2.0.1 - passkeys_web: ^2.0.2 + passkeys_android: ^2.1.0 + passkeys_ios: ^2.1.0 + passkeys_platform_interface: ^2.1.0 + passkeys_web: ^2.1.0 ua_client_hints: ^1.1.3 dev_dependencies: diff --git a/packages/passkeys/passkeys_android/pubspec.yaml b/packages/passkeys/passkeys_android/pubspec.yaml index 74dd3b14..c9201d75 100644 --- a/packages/passkeys/passkeys_android/pubspec.yaml +++ b/packages/passkeys/passkeys_android/pubspec.yaml @@ -20,7 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - passkeys_platform_interface: ^2.0.1 + passkeys_platform_interface: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/passkeys/passkeys_ios/pubspec.yaml b/packages/passkeys/passkeys_ios/pubspec.yaml index 19b67f7d..0e9dddb4 100644 --- a/packages/passkeys/passkeys_ios/pubspec.yaml +++ b/packages/passkeys/passkeys_ios/pubspec.yaml @@ -19,7 +19,7 @@ flutter: dependencies: flutter: sdk: flutter - passkeys_platform_interface: ^2.0.1 + passkeys_platform_interface: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/passkeys/passkeys_web/pubspec.yaml b/packages/passkeys/passkeys_web/pubspec.yaml index a3735c19..4afeab55 100644 --- a/packages/passkeys/passkeys_web/pubspec.yaml +++ b/packages/passkeys/passkeys_web/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: sdk: flutter js: ^0.7.1 json_annotation: ^4.8.1 - passkeys_platform_interface: ^2.0.1 + passkeys_platform_interface: ^2.1.0 dev_dependencies: build_runner: ^2.4.5