import * as plugins from '../plugins.js'; import * as dto from '../dto/index.js'; export interface IRegistrationUserDataInput { name?: string; password?: string; } export interface IReq_FirstRegistration extends plugins.typedRequestInterfaces.implementsTR { method: 'firstRegistrationRequest'; request: { email: string; productSlugOfInterest: string; /** * Optional opaque OIDC authorization transaction to resume after the * registration session has established an authenticated browser session. */ oidcTransactionId?: string; }; response: { status: 'ok' | 'not ok'; testOnlyToken?: string; }; } export interface IReq_AfterRegistrationEmailClicked extends plugins.typedRequestInterfaces.implementsTR { method: 'afterRegistrationEmailClicked'; request: { /** * the token that has been sent with the registation email to verify access */ token: string; }; response: { status: 'ok' | 'not ok'; /** * the email thats associated with the given request token */ email: string; /** * Authoritative transaction retained by the server-side registration * session. It is returned only after the email token has been proved. */ oidcTransactionId?: string; }; } export interface IReq_VerifyRegistrationEmailCode extends plugins.typedRequestInterfaces.implementsTR { method: 'verifyRegistrationEmailCode'; request: { email: string; /** * the 6-digit code delivered in the verification email alongside the link */ code: string; }; response: { status: 'ok' | 'not ok'; /** * continuation token equivalent to the emailed link token; feeds the * registration stepper exactly like a clicked link */ token: string; email: string; /** * Authoritative transaction retained by the server-side registration * session. It is returned only after the email code has been proved. */ oidcTransactionId?: string; }; } export interface IReq_SetDataForRegistration extends plugins.typedRequestInterfaces.implementsTR { method: 'setDataForRegistration'; request: { token: string; userData: IRegistrationUserDataInput; }; response: { status: 'ok' | 'not ok'; }; } export interface IReq_FinishRegistration extends plugins.typedRequestInterfaces.implementsTR { method: 'finishRegistration'; request: { token: string; }; response: { status: 'ok' | 'not ok'; accountData?: dto.IUserProfileDto; /** * Refresh token for the session minted on completion. The registration * token proves email ownership, so no separate credential round trip is * needed. Absent when a session cannot be issued directly (for example a * crash-retried completion for an account that has since enrolled MFA) — * the client then routes to the normal sign-in. */ refreshToken?: string; /** * Authoritative transaction retained by the completed registration * session so the authenticated client can resume the OIDC handoff. */ oidcTransactionId?: string; }; }