DeleteObjectCommand
DeleteObjectCommand 可以用于删除 DID Space 上指定的对象。
参数类型#
参数名 | 类型 | 必要 | 默认值 | 说明 |
---|---|---|---|---|
key | string | Y | 无 | 可以是一个文件名或者文件夹 |
返回类型#
参数名 | 类型 | 必要 | 说明 |
---|---|---|---|
statusCode | number | Y | 返回状态码 |
statusMessage | string | N | 一般来说,发生错误的时候才会有值 |
stack? | string | N | 堆栈信息 |
data | void | Y |
代码示例#
- 删除单个对象
const { SpaceClient, DeleteObjectCommand } = require('@blocklet/did-space-js');
const getWallet = require('@blocklet/sdk/lib/wallet');
const spaceClient = new SpaceClient({
endpoint,
wallet: getWallet(),
});
await spaceClient.send(
new DeleteObjectCommand({
key: 'demo.txt',
})
);