UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 6.56 kB
import{translate as e}from"../libs/i18n/translate.mjs";import{mediaCropInputSchema as t,mediaOriginSchema as n}from"./media.mjs";import{userResponseSchema as r}from"./users.mjs";import i from"zod";const a=i.object({localeCode:i.string().trim().meta({description:`The locale code for the translated profile picture metadata`,example:`en`}),value:i.string().trim().nullable().meta({description:`The translated value`,example:`Profile photo`})}),o=i.object({token:i.string().meta({description:`A unique token granted when an email change is requested`,example:`838ece1033bf7c7468e873e79ba2a3ec`})}),s={getMe:{body:void 0,query:{string:void 0,formatted:void 0},params:void 0,response:r},resetPassword:{body:i.object({password:i.string().min(8).max(128).meta({description:`Your new password`,example:`password123`}),passwordConfirmation:i.string().min(8).max(128).meta({description:`A repeat of your new password`,example:`password123`})}).refine(e=>e.password===e.passwordConfirmation,{message:e(`server:core.input.ensure.passwords.match`),path:[`passwordConfirmation`]}),query:{string:void 0,formatted:void 0},params:i.object({token:i.string().meta({description:`A unique token granted to you when you request a password reset`,example:`838ece1033bf7c7468e873e79ba2a3ec`})}),response:void 0},sendResetPassword:{body:i.object({email:i.email().trim().toLowerCase().meta({description:`Your email address`,example:`admin@lucidcms.io`})}),query:{string:void 0,formatted:void 0},params:void 0,response:i.object({message:i.string().meta({description:`A status message`,example:e(`server:core.auth.password.reset.request.accepted`)})})},verifyResetPassword:{body:void 0,query:{string:void 0,formatted:void 0},params:i.object({token:i.string().meta({description:`A unique token granted to you when you request a password reset`,example:`838ece1033bf7c7468e873e79ba2a3ec`})}),response:void 0},verifyEmailChangeConfirm:{body:void 0,query:{string:void 0,formatted:void 0},params:o,response:void 0},confirmEmailChange:{body:void 0,query:{string:void 0,formatted:void 0},params:o,response:void 0},verifyEmailChangeRevert:{body:void 0,query:{string:void 0,formatted:void 0},params:o,response:void 0},revertEmailChange:{body:void 0,query:{string:void 0,formatted:void 0},params:o,response:void 0},cancelEmailChange:{body:void 0,query:{string:void 0,formatted:void 0},params:void 0,response:void 0},unlinkAuthProvider:{body:void 0,query:{string:void 0,formatted:void 0},params:i.object({providerId:i.string().trim().min(1).meta({description:`The provider key you wish to unlink`,example:`github`})}),response:void 0},revokeAllRefreshTokens:{body:void 0,query:{string:void 0,formatted:void 0},params:void 0,response:void 0},updateMe:{body:i.object({firstName:i.string().trim().meta({description:`Your new first name`,example:`John`}).optional(),lastName:i.string().trim().meta({description:`Your new last name`,example:`Smith`}).optional(),username:i.string().trim().min(3).meta({description:`Your new username`,example:`admin`}).optional(),email:i.email().trim().toLowerCase().meta({description:`your new email address`,example:`admin@lucidcms.io`}).optional(),currentPassword:i.string().meta({description:`Your current password`,example:`password`}).optional(),newPassword:i.string().min(8).max(128).meta({description:`Your new password`,example:`password123`}).optional(),passwordConfirmation:i.string().min(8).max(128).meta({description:`A repeat of your new password`,example:`password123`}).optional()}),query:{string:void 0,formatted:void 0},params:void 0,response:void 0},createProfilePictureUploadSession:{body:i.object({fileName:i.string().trim().meta({description:`The profile picture file name`,example:`profile.png`}),mimeType:i.string().trim().meta({description:`The profile picture MIME type`,example:`image/png`}),size:i.number().nonnegative().meta({description:`The file size in bytes`,example:1048576})}),query:{string:void 0,formatted:void 0},params:void 0,response:i.discriminatedUnion(`mode`,[i.object({mode:i.literal(`single`),key:i.string(),url:i.string(),headers:i.record(i.string(),i.string()).optional()}),i.object({mode:i.literal(`resumable`),key:i.string(),sessionId:i.string(),partSize:i.number(),expiresAt:i.string(),uploadedParts:i.array(i.object({partNumber:i.number().int().positive(),etag:i.string().trim(),size:i.number().nonnegative().optional()}))})])},updateProfilePicture:{body:i.object({crop:t.nullable().optional(),key:i.string().trim().optional().meta({description:`The uploaded media key`,example:`public/123e4567e89b12d3a456426614174000`}),fileName:i.string().trim().optional().meta({description:`The profile picture file name`,example:`profile.png`}),width:i.number().optional().meta({description:`The image width`,example:100}),height:i.number().optional().meta({description:`The image height`,example:100}),focalPoint:i.object({x:i.number().min(0).max(1).meta({description:`Horizontal focal point, normalized from 0 to 1`,example:.5}),y:i.number().min(0).max(1).meta({description:`Vertical focal point, normalized from 0 to 1`,example:.5})}).nullable().optional().meta({description:`The image focal point`}),blurHash:i.string().trim().optional().meta({description:`The blur hash`,example:`AQABAAAABAAAAgAA...`}),averageColor:i.string().trim().optional().meta({description:`The average color`,example:`rgba(255, 255, 255, 1)`}),base64:i.string().trim().nullable().optional().meta({description:`Tiny base64-encoded image placeholder`,example:`data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoKAAcAAUAmJQBOgCH5AQAA`}),isDark:i.boolean().optional().meta({description:`Whether the image is dark`,example:!0}),isLight:i.boolean().optional().meta({description:`Whether the image is light`,example:!0}),origin:n.optional().meta({description:`The provenance origin of the profile picture`,example:`human`}),aiGenerationRequestId:i.string().trim().optional().meta({description:`The AI generation request ID to link to this profile picture`,example:`123e4567-e89b-12d3-a456-426614174000`}),title:i.array(a).optional().meta({description:`Translated profile picture titles`}),alt:i.array(a).optional().meta({description:`Translated profile picture alt text`})}).refine(e=>e.key===void 0==(e.fileName===void 0),{message:e(`server:core.profile.picture.file.name.key.required`),path:[`fileName`]}),query:{string:void 0,formatted:void 0},params:void 0,response:void 0},deleteProfilePicture:{body:void 0,query:{string:void 0,formatted:void 0},params:void 0,response:void 0}};export{s as controllerSchemas}; //# sourceMappingURL=account.mjs.map