La API de almacenamiento de StudioCMS proporciona varios asistentes de JavaScript para facilitar la interacción con los backends de almacenamiento. Estos asistentes simplifican tareas como resolver identificadores y claves de almacenamiento, además de proporcionar definiciones de tipos para una mejor seguridad de tipos y autocompletado de código.
This type defines a function that takes a ParsedContext
and returns a Promise resolving to an object containing data and status.
ContextHandler,
typeContextHandlerFn<C, R> = (context: C) =>Promise<R>
Context Handler Function type.
This type defines a function that takes a context of type C
and returns a Promise resolving to a response of type R.
ContextHandlerFn,
interfaceContextDriverDefinition<C, R>
Context Driver Definition interface.
This interface defines the structure and methods for a context driver,
including parsing the context, building responses, and handling endpoints.
ContextDriverDefinition,
typeStorageAPIEndpointFn<C, R> = (context: C) =>Promise<R>
Storage API Endpoint Function type.
This type defines a function that takes a context of type C
and returns a Promise resolving to a response of type R.
StorageAPIEndpointFn,
interfaceStorageApiBuilderDefinition<C, R>
Storage API Builder Definition interface.
This interface defines the structure and methods for building storage API endpoints,
including handling POST and PUT requests.
StorageApiBuilderDefinition,
(alias) interfaceUrlMappingDatabaseDefinition
importUrlMappingDatabaseDefinition
URL Mapping Database Definition interface.
This interface defines the structure and methods for the URL Mapping Database,
which is responsible for storing and retrieving URL mappings.
UrlMappingDatabaseDefinition,
(alias) interfaceUrlMappingServiceDefinition
importUrlMappingServiceDefinition
URL Mapping Service Definition interface.
This interface defines the structure and methods for the URL Mapping Service,
which manages the mapping between storage file identifiers and their corresponding URLs.
UrlMappingServiceDefinition,
interfaceAPICoreDefinition<C, R>
API Core Definition interface.
This interface defines the structure and methods for the core API of the Storage Manager,
including access to the context driver, URL mapping service, and storage API builder.