t-comm
Version:
专业、稳定、纯粹的工具库
43 lines (40 loc) • 1.39 kB
JavaScript
import _regeneratorRuntime from '@babel/runtime/regenerator';
import { _ as __awaiter } from '../../tslib.es6-848120af.js';
import { fetchCloudData } from '../base/base.mjs';
import 'axios';
import '../../nodejs/crypto.mjs';
function createPurgeTask(_ref) {
var secretId = _ref.secretId,
secretKey = _ref.secretKey,
targets = _ref.targets,
zoneId = _ref.zoneId,
_ref$method = _ref.method,
method = _ref$method === void 0 ? 'invalidate' : _ref$method,
_ref$type = _ref.type,
type = _ref$type === void 0 ? 'purge_url' : _ref$type;
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function (_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", fetchCloudData({
secretId: secretId,
secretKey: secretKey,
action: 'CreatePurgeTask',
version: '2022-09-01',
endpoint: 'teo.tencentcloudapi.com',
service: 'teo',
payload: JSON.stringify({
ZoneId: zoneId,
Type: type,
Targets: targets,
Method: method
})
}));
case 1:
case "end":
return _context.stop();
}
}, _callee);
}));
}
export { createPurgeTask };