最新の型の追加
This commit is contained in:
parent
41736196a9
commit
d56b336349
|
@ -1,13 +1,15 @@
|
||||||
import { Endpoints as Gen } from './autogen/endpoint.js';
|
import { Endpoints as Gen } from './autogen/endpoint.js';
|
||||||
import { UserDetailed } from './autogen/models.js';
|
import { UserDetailed } from './autogen/models.js';
|
||||||
import { AdminRolesCreateRequest, AdminRolesCreateResponse, UsersShowRequest, UsersShowErrors } from './autogen/entities.js';
|
import { AdminRolesCreateRequest, AdminRolesCreateResponse, UsersShowRequest, UsersShowErrors, AdminRolesCreateErrors } from './autogen/entities.js';
|
||||||
import {
|
import {
|
||||||
PartialRolePolicyOverride,
|
PartialRolePolicyOverride,
|
||||||
SigninFlowRequest,
|
SigninFlowRequest,
|
||||||
SigninFlowResponse,
|
SigninFlowResponse,
|
||||||
|
SigninFlowErrors,
|
||||||
SigninWithPasskeyInitResponse,
|
SigninWithPasskeyInitResponse,
|
||||||
SigninWithPasskeyRequest,
|
SigninWithPasskeyRequest,
|
||||||
SigninWithPasskeyResponse,
|
SigninWithPasskeyResponse,
|
||||||
|
SigninWithPasskeyErrors,
|
||||||
SignupPendingRequest,
|
SignupPendingRequest,
|
||||||
SignupPendingResponse,
|
SignupPendingResponse,
|
||||||
SignupRequest,
|
SignupRequest,
|
||||||
|
@ -88,6 +90,7 @@ export type Endpoints = Overwrite<
|
||||||
'signin-flow': {
|
'signin-flow': {
|
||||||
req: SigninFlowRequest;
|
req: SigninFlowRequest;
|
||||||
res: SigninFlowResponse;
|
res: SigninFlowResponse;
|
||||||
|
errors: SigninFlowErrors;
|
||||||
},
|
},
|
||||||
'signin-with-passkey': {
|
'signin-with-passkey': {
|
||||||
req: SigninWithPasskeyRequest;
|
req: SigninWithPasskeyRequest;
|
||||||
|
@ -104,10 +107,12 @@ export type Endpoints = Overwrite<
|
||||||
$default: SigninWithPasskeyInitResponse;
|
$default: SigninWithPasskeyInitResponse;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
errors: SigninWithPasskeyErrors;
|
||||||
},
|
},
|
||||||
'admin/roles/create': {
|
'admin/roles/create': {
|
||||||
req: Overwrite<AdminRolesCreateRequest, { policies: PartialRolePolicyOverride }>;
|
req: Overwrite<AdminRolesCreateRequest, { policies: PartialRolePolicyOverride }>;
|
||||||
res: AdminRolesCreateResponse;
|
res: AdminRolesCreateResponse;
|
||||||
|
errors: AdminRolesCreateErrors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
@ -309,7 +309,15 @@ export type SigninFlowResponse = {
|
||||||
authRequest: PublicKeyCredentialRequestOptionsJSON;
|
authRequest: PublicKeyCredentialRequestOptionsJSON;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SigninErrors = {
|
type WebAuthnServiceErrors = {
|
||||||
|
id: '2d16e51c-007b-4edd-afd2-f7dd02c947f6', // Invalid context (WebAuthnService)
|
||||||
|
} | {
|
||||||
|
id: '36b96a7d-b547-412d-aeed-2d611cdc8cdc', // Unknown WebAuthn Key (WebAuthnService)
|
||||||
|
} | {
|
||||||
|
id: 'b18c89a7-5b5e-4cec-bb5b-0419f332d430', // Verification failed (WebAuthnService)
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SigninFlowErrors = {
|
||||||
message: 'Too many failed attempts to sign in. Try again later.',
|
message: 'Too many failed attempts to sign in. Try again later.',
|
||||||
code: 'TOO_MANY_AUTHENTICATION_FAILURES',
|
code: 'TOO_MANY_AUTHENTICATION_FAILURES',
|
||||||
id: '22d05606-fbcf-421a-a2db-b32610dcfd1b',
|
id: '22d05606-fbcf-421a-a2db-b32610dcfd1b',
|
||||||
|
@ -325,7 +333,7 @@ export type SigninErrors = {
|
||||||
id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', // Invalid one-time password
|
id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', // Invalid one-time password
|
||||||
} | {
|
} | {
|
||||||
id: '93b86c4b-72f9-40eb-9815-798928603d1e', // Invalid passkey credential
|
id: '93b86c4b-72f9-40eb-9815-798928603d1e', // Invalid passkey credential
|
||||||
};
|
} | WebAuthnServiceErrors;
|
||||||
|
|
||||||
export type SigninWithPasskeyRequest = {
|
export type SigninWithPasskeyRequest = {
|
||||||
credential?: AuthenticationResponseJSON;
|
credential?: AuthenticationResponseJSON;
|
||||||
|
@ -341,6 +349,24 @@ export type SigninWithPasskeyResponse = {
|
||||||
signinResponse: SigninFlowResponse & { finished: true };
|
signinResponse: SigninFlowResponse & { finished: true };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type SigninWithPasskeyErrors = {
|
||||||
|
message: 'Too many failed attempts to sign in. Try again later.',
|
||||||
|
code: 'TOO_MANY_AUTHENTICATION_FAILURES',
|
||||||
|
id: '22d05606-fbcf-421a-a2db-b32610dcfd1b',
|
||||||
|
} | {
|
||||||
|
id: '4e30e80c-e338-45a0-8c8f-44455efa3b76', // Internal server error
|
||||||
|
} | {
|
||||||
|
id: '1658cc2e-4495-461f-aee4-d403cdf073c1', // No Context
|
||||||
|
} | {
|
||||||
|
id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', // Invalid credentials
|
||||||
|
} | {
|
||||||
|
id: '652f899f-66d4-490e-993e-6606c8ec04c3', // User not found
|
||||||
|
} | {
|
||||||
|
id: 'e03a5f46-d309-4865-9b69-56282d94e1eb', // User is suspended
|
||||||
|
} | {
|
||||||
|
id: '2d84773e-f7b7-4d0b-8f72-bb69b584c912', // Passwordless Login is disabled
|
||||||
|
} | WebAuthnServiceErrors;
|
||||||
|
|
||||||
type Values<T extends Record<PropertyKey, unknown>> = T[keyof T];
|
type Values<T extends Record<PropertyKey, unknown>> = T[keyof T];
|
||||||
|
|
||||||
export type PartialRolePolicyOverride = Partial<{[k in keyof RolePolicies]: Omit<Values<Role['policies']>, 'value'> & { value: RolePolicies[k] }}>;
|
export type PartialRolePolicyOverride = Partial<{[k in keyof RolePolicies]: Omit<Values<Role['policies']>, 'value'> & { value: RolePolicies[k] }}>;
|
||||||
|
|
Loading…
Reference in New Issue