L’API de stockage de StudioCMS fournit plusieurs fonctions d’assistance JavaScript pour faciliter l’interaction avec les systèmes de stockage. Ces fonctions d’assistance simplifient des tâches telles que la résolution des identifiants et des clés de stockage, ainsi que la fourniture de définitions de type pour une sûreté du typage et une complétion de code améliorées.
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.