sanity-plugin-s3-files
Version:
Store Sanity media files in AWS S3
52 lines (51 loc) • 1.55 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.credentialsFields = exports.schemaConfig = void 0;
const icons_1 = require("@sanity/icons");
exports.schemaConfig = {
title: 'Media file hosted in AWS S3',
customFields: ['key', 'bucket', 'region'],
};
exports.credentialsFields = [
{
name: 'bucketKey',
title: 'S3 bucket key',
icon: icons_1.LockIcon,
type: 'string',
validation: (Rule) => Rule.required(),
},
{
name: 'bucketRegion',
title: 'S3 bucket region',
icon: icons_1.EarthGlobeIcon,
type: 'string',
validation: (Rule) => Rule.required(),
},
{
name: 'getSignedUrlEndpoint',
title: "Endpoint for getting S3's signed URL",
icon: icons_1.PinIcon,
type: 'url',
validation: (Rule) => Rule.required(),
},
{
name: 'deleteObjectEndpoint',
title: 'Endpoint for deleting an object in S3',
icon: icons_1.TrashIcon,
type: 'url',
validation: (Rule) => Rule.required(),
},
{
name: 'folder',
title: 'Folder in Space',
description: "Folder to store files inside the bucket. If none provided, will upload files to the bucket's root (optional)",
icon: icons_1.FolderIcon,
type: 'string',
},
{
name: 'secretForValidating',
title: 'Secret for validating the signed URL request (optional)',
icon: icons_1.EyeClosedIcon,
type: 'string',
},
];
;