diff --git a/src/frontend/generated/internet_identity_idl.js b/src/frontend/generated/internet_identity_idl.js index ff4b6e0675..02bf4b8856 100644 --- a/src/frontend/generated/internet_identity_idl.js +++ b/src/frontend/generated/internet_identity_idl.js @@ -70,17 +70,17 @@ export const idlFactory = ({ IDL }) => { }); const IdentityNumber = IDL.Nat64; const AuthnMethodProtection = IDL.Variant({ - 'unprotected' : IDL.Null, - 'protected' : IDL.Null, + 'Protected' : IDL.Null, + 'Unprotected' : IDL.Null, }); + const PublicKeyAuthn = IDL.Record({ 'pubkey' : PublicKey }); const WebAuthn = IDL.Record({ 'pubkey' : PublicKey, 'credential_id' : CredentialId, }); - const PublicKeyAuthn = IDL.Record({ 'pubkey' : PublicKey }); const AuthnMethod = IDL.Variant({ - 'webauthn' : WebAuthn, - 'pubkey' : PublicKeyAuthn, + 'Puubkey' : PublicKeyAuthn, + 'WebAuthn' : WebAuthn, }); const AuthnMethodData = IDL.Record({ 'metadata' : MetadataMap, @@ -89,17 +89,12 @@ export const idlFactory = ({ IDL }) => { 'authn_method' : AuthnMethod, 'purpose' : Purpose, }); - const AuthnMethodAddResponse = IDL.Variant({ - 'ok' : IDL.Null, - 'invalid_metadata' : IDL.Text, - }); - const AuthnMethodRemoveResponse = IDL.Variant({ 'ok' : IDL.Null }); + const AuthnMethodAddError = IDL.Variant({ 'InvalidMetadata' : IDL.Text }); const ChallengeKey = IDL.Text; const Challenge = IDL.Record({ 'png_base64' : IDL.Text, 'challenge_key' : ChallengeKey, }); - const CaptchaCreateResponse = IDL.Variant({ 'ok' : Challenge }); const DeployArchiveResult = IDL.Variant({ 'creation_in_progress' : IDL.Null, 'success' : IDL.Principal, @@ -213,18 +208,15 @@ export const idlFactory = ({ IDL }) => { 'metadata' : MetadataMap, 'authn_method_registration' : IDL.Opt(AuthnMethodRegistrationInfo), }); - const IdentityInfoResponse = IDL.Variant({ 'ok' : IdentityInfo }); - const IdentityMetadataReplaceResponse = IDL.Variant({ 'ok' : IDL.Null }); const ChallengeResult = IDL.Record({ 'key' : ChallengeKey, 'chars' : IDL.Text, }); const CaptchaResult = ChallengeResult; - const IdentityRegisterResponse = IDL.Variant({ - 'ok' : IdentityNumber, - 'invalid_metadata' : IDL.Text, - 'bad_captcha' : IDL.Null, - 'canister_full' : IDL.Null, + const IdentityRegisterError = IDL.Variant({ + 'BadCaptcha' : IDL.Null, + 'CanisterFull' : IDL.Null, + 'InvalidMetadata' : IDL.Text, }); const UserKey = PublicKey; const PrepareIdAliasRequest = IDL.Record({ @@ -274,15 +266,23 @@ export const idlFactory = ({ IDL }) => { ), 'authn_method_add' : IDL.Func( [IdentityNumber, AuthnMethodData], - [IDL.Opt(AuthnMethodAddResponse)], + [ + IDL.Opt( + IDL.Variant({ 'Ok' : IDL.Null, 'Err' : AuthnMethodAddError }) + ), + ], [], ), 'authn_method_remove' : IDL.Func( [IdentityNumber, PublicKey], - [IDL.Opt(AuthnMethodRemoveResponse)], + [IDL.Opt(IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Null }))], + [], + ), + 'captcha_create' : IDL.Func( + [], + [IDL.Opt(IDL.Variant({ 'Ok' : Challenge, 'Err' : IDL.Null }))], [], ), - 'captcha_create' : IDL.Func([], [IDL.Opt(CaptchaCreateResponse)], []), 'create_challenge' : IDL.Func([], [Challenge], []), 'deploy_archive' : IDL.Func([IDL.Vec(IDL.Nat8)], [DeployArchiveResult], []), 'enter_device_registration_mode' : IDL.Func([UserNumber], [Timestamp], []), @@ -313,17 +313,24 @@ export const idlFactory = ({ IDL }) => { 'http_request_update' : IDL.Func([HttpRequest], [HttpResponse], []), 'identity_info' : IDL.Func( [IdentityNumber], - [IDL.Opt(IdentityInfoResponse)], + [IDL.Opt(IDL.Variant({ 'Ok' : IdentityInfo, 'Err' : IDL.Null }))], [], ), 'identity_metadata_replace' : IDL.Func( [IdentityNumber, MetadataMap], - [IDL.Opt(IdentityMetadataReplaceResponse)], + [IDL.Opt(IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Null }))], [], ), 'identity_register' : IDL.Func( [AuthnMethodData, CaptchaResult, IDL.Opt(IDL.Principal)], - [IDL.Opt(IdentityRegisterResponse)], + [ + IDL.Opt( + IDL.Variant({ + 'Ok' : IdentityNumber, + 'Err' : IdentityRegisterError, + }) + ), + ], [], ), 'init_salt' : IDL.Func([], [], []), diff --git a/src/frontend/generated/internet_identity_types.d.ts b/src/frontend/generated/internet_identity_types.d.ts index 4a4274da15..2a6ac8d02e 100644 --- a/src/frontend/generated/internet_identity_types.d.ts +++ b/src/frontend/generated/internet_identity_types.d.ts @@ -27,10 +27,9 @@ export interface ArchiveInfo { 'archive_config' : [] | [ArchiveConfig], 'archive_canister' : [] | [Principal], } -export type AuthnMethod = { 'webauthn' : WebAuthn } | - { 'pubkey' : PublicKeyAuthn }; -export type AuthnMethodAddResponse = { 'ok' : null } | - { 'invalid_metadata' : string }; +export type AuthnMethod = { 'Puubkey' : PublicKeyAuthn } | + { 'WebAuthn' : WebAuthn }; +export type AuthnMethodAddError = { 'InvalidMetadata' : string }; export interface AuthnMethodData { 'metadata' : MetadataMap, 'protection' : AuthnMethodProtection, @@ -38,20 +37,18 @@ export interface AuthnMethodData { 'authn_method' : AuthnMethod, 'purpose' : Purpose, } -export type AuthnMethodProtection = { 'unprotected' : null } | - { 'protected' : null }; +export type AuthnMethodProtection = { 'Protected' : null } | + { 'Unprotected' : null }; export interface AuthnMethodRegistrationInfo { 'expiration' : Timestamp, 'authn_method' : [] | [AuthnMethodData], } -export type AuthnMethodRemoveResponse = { 'ok' : null }; export interface BufferedArchiveEntry { 'sequence_number' : bigint, 'entry' : Uint8Array | number[], 'anchor_number' : UserNumber, 'timestamp' : Timestamp, } -export type CaptchaCreateResponse = { 'ok' : Challenge }; export type CaptchaResult = ChallengeResult; export interface Challenge { 'png_base64' : string, @@ -136,13 +133,10 @@ export interface IdentityInfo { 'metadata' : MetadataMap, 'authn_method_registration' : [] | [AuthnMethodRegistrationInfo], } -export type IdentityInfoResponse = { 'ok' : IdentityInfo }; -export type IdentityMetadataReplaceResponse = { 'ok' : null }; export type IdentityNumber = bigint; -export type IdentityRegisterResponse = { 'ok' : IdentityNumber } | - { 'invalid_metadata' : string } | - { 'bad_captcha' : null } | - { 'canister_full' : null }; +export type IdentityRegisterError = { 'BadCaptcha' : null } | + { 'CanisterFull' : null } | + { 'InvalidMetadata' : string }; export interface InternetIdentityInit { 'max_num_latest_delegation_origins' : [] | [bigint], 'assigned_user_number_range' : [] | [[bigint, bigint]], @@ -239,13 +233,16 @@ export interface _SERVICE { >, 'authn_method_add' : ActorMethod< [IdentityNumber, AuthnMethodData], - [] | [AuthnMethodAddResponse] + [] | [{ 'Ok' : null } | { 'Err' : AuthnMethodAddError }] >, 'authn_method_remove' : ActorMethod< [IdentityNumber, PublicKey], - [] | [AuthnMethodRemoveResponse] + [] | [{ 'Ok' : null } | { 'Err' : null }] + >, + 'captcha_create' : ActorMethod< + [], + [] | [{ 'Ok' : Challenge } | { 'Err' : null }] >, - 'captcha_create' : ActorMethod<[], [] | [CaptchaCreateResponse]>, 'create_challenge' : ActorMethod<[], Challenge>, 'deploy_archive' : ActorMethod<[Uint8Array | number[]], DeployArchiveResult>, 'enter_device_registration_mode' : ActorMethod<[UserNumber], Timestamp>, @@ -265,14 +262,17 @@ export interface _SERVICE { 'get_principal' : ActorMethod<[UserNumber, FrontendHostname], Principal>, 'http_request' : ActorMethod<[HttpRequest], HttpResponse>, 'http_request_update' : ActorMethod<[HttpRequest], HttpResponse>, - 'identity_info' : ActorMethod<[IdentityNumber], [] | [IdentityInfoResponse]>, + 'identity_info' : ActorMethod< + [IdentityNumber], + [] | [{ 'Ok' : IdentityInfo } | { 'Err' : null }] + >, 'identity_metadata_replace' : ActorMethod< [IdentityNumber, MetadataMap], - [] | [IdentityMetadataReplaceResponse] + [] | [{ 'Ok' : null } | { 'Err' : null }] >, 'identity_register' : ActorMethod< [AuthnMethodData, CaptchaResult, [] | [Principal]], - [] | [IdentityRegisterResponse] + [] | [{ 'Ok' : IdentityNumber } | { 'Err' : IdentityRegisterError }] >, 'init_salt' : ActorMethod<[], undefined>, 'lookup' : ActorMethod<[UserNumber], Array>,