import * as v from "@exodus/schemasafe"; import { IIdObject } from "./../id_object"; import { IDate } from "./../date"; import { INull } from "./../null"; import { IDateObject } from "./../date_object"; export interface IAccountDocument { _id: IIdObject; /** * Account's email address */ email: string; passwords: { hash: string; salt: string; ts: IDate; }[]; mfa: { enabled: boolean; totp_token: string | INull; }; /** * Account's display name */ display_name: string; updated_at: IDateObject; deleted_at: IDateObject | INull; } export declare const AccountDocumentSchema: Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "account/document"; readonly title: "AccountDocument"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["_id", "email", "mfa", "passwords", "display_name", "updated_at", "deleted_at"]; readonly properties: { readonly _id: Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "id_object"; readonly title: "IdObject"; readonly tsType: "import(\"bson\").ObjectId"; readonly type: "object"; readonly additionalProperties: true; readonly readOnly: true; }>; readonly email: { readonly type: "string"; readonly format: "email"; readonly description: "Account's email address"; }; readonly passwords: { readonly type: "array"; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["hash", "salt", "ts"]; readonly properties: { readonly hash: { readonly type: "string"; readonly contentEncoding: "base64"; readonly format: "any"; }; readonly salt: { readonly type: "string"; readonly contentEncoding: "base64"; readonly format: "any"; }; readonly ts: Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date"; readonly title: "Date"; readonly oneOf: readonly [Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date_string"; readonly title: "DateString"; readonly type: "string"; readonly format: "date-time"; readonly examples: readonly ["2021-11-12T01:59:23.718Z"]; }>, Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date_number"; readonly title: "DateNumber"; readonly type: "number"; readonly examples: readonly ["1636234281248"]; }>, Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date_object"; readonly title: "DateObject"; readonly tsType: "Date"; readonly type: "object"; readonly additionalProperties: true; readonly readOnly: true; }>]; }>; }; }; readonly minItems: 0; }; readonly mfa: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["enabled", "totp_token"]; readonly properties: { readonly enabled: { readonly type: "boolean"; }; readonly totp_token: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "any"; }, Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "null"; readonly title: "Null"; readonly type: "null"; readonly nullable: true; readonly examples: readonly ["null"]; readonly readOnly: true; }>]; }; }; }; readonly display_name: { readonly type: "string"; readonly format: "any"; readonly minLength: 3; readonly maxLength: 32; readonly description: "Account's display name"; }; readonly updated_at: Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date_object"; readonly title: "DateObject"; readonly tsType: "Date"; readonly type: "object"; readonly additionalProperties: true; readonly readOnly: true; }>; readonly deleted_at: { readonly oneOf: readonly [Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "date_object"; readonly title: "DateObject"; readonly tsType: "Date"; readonly type: "object"; readonly additionalProperties: true; readonly readOnly: true; }>, Readonly<{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "null"; readonly title: "Null"; readonly type: "null"; readonly nullable: true; readonly examples: readonly ["null"]; readonly readOnly: true; }>]; }; }; }>; export declare function validateAccountDocument(value: unknown, options?: v.ValidatorOptions): v.ParseResult; export declare function assertAccountDocument(value: unknown): asserts value is IAccountDocument;