hexo/node_modules/ali-oss/lib/common/bucket/getBucketWorm.ts

23 lines
601 B
TypeScript
Raw Normal View History

2023-10-03 11:14:36 +08:00
import { checkBucketName } from '../utils/checkBucketName';
import { dataFix } from '../utils/dataFix';
export async function getBucketWorm(this: any, name: string, options) {
checkBucketName(name);
const params = this._bucketRequestParams('GET', name, 'worm', options);
params.successStatuses = [200];
params.xmlResponse = true;
const result = await this.request(params);
dataFix(result.data, {
lowerFirst: true,
rename: {
RetentionPeriodInDays: 'days'
}
});
return {
...result.data,
res: result.res,
status: result.status
};
}