Ce contenu n’est pas encore disponible dans votre langue.
The StudioCMS Storage API provides several JavaScript helpers to facilitate interaction with storage backends. These helpers simplify tasks such as resolving storage identifiers and keys, as well as providing type definitions for better type safety and code completion.
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.