Welcome
User Guide
Developer guide
Reference Guide
Frequently Asked Questions
Pricing policy
Data retention policy
Draft: Default Space How to upgrade by payment?
How to re-subscribe to an expired DID Space
Connecting to the DID Space using the Gateway Address
Switch the DID Space bound to NFT Blender.
The automatic backup of Blocklet is stuck, how can it be quickly restored?
Fix CORS error when connecting DID Space
Change log
Draft: Purchase DID Space
DID Spaces v0.6.0: OAuth Integration in DID Spaces
DID Spaces v0.5.83: OAuth integrated DID Space
Prod Spaces data retention policy updated
DID Spaces v0.4.26 released: subscription fully adopts pay-as-you-go & supports paid upgrade Default Space
DID Spaces v0.3.75 released: Supports reading and writing component spaces
DID Spaces v1.0.48: 支持预览 post/bookmark/blog/doc
DeletePreviewObjectCommand
Interface Description#
DeletePreviewObjectCommand
The interface is designed to delete a preview object located at a specified path. This command utilizes the given path to identify and remove the targeted object.
Parameter Type#
#
The parameter type is DeletePreviewObjectCommandInput
. Below are the details:
Name | Type | Essential | Default Value | Instructions |
---|---|---|---|---|
key | string | Y | None | The folder path must begin with / Conclusion |
Return Type#
The return type is DeletePreviewObjectCommandOutput
, and it is described as follows:
Field Name | Type | Essential | Instructions |
---|---|---|---|
statusCode | number | Y | HTTP Status Codes |
statusMessage | string | N | Status Message |
Code Example#
#
The following code example demonstrates how to use the DeletePreviewObjectCommand
interface to delete a preview object:
async function deletePreviewObject(req, res) {
const { spaceEndpoint } = await spacesEndpointRepository.readUser(req.user.did);
const spaceClient = new SpaceClient({
endpoint: spaceEndpoint,
wallet,
});
const output = await spaceClient.send(
new DeletePreviewObjectCommand({
key: '/test-nft/',
})
);
if (output.statusCode !== 200) {
logger.error(output);
return res.status(output.statusCode).send(output.statusMessage);
}
return res.send(output);
}
In this example, the function deletePreviewObject
takes in the request and response objects, uses the spaceEndpoint
obtained from the repository to create a space client, spaceClient
, and then issues a DeletePreviewObjectCommand
command to remove the preview object at the specified path. If the deletion operation fails, it logs the error and returns the appropriate status code and message in the response.