cloudflare
Version:
The official TypeScript library for the Cloudflare API
36 lines • 1.32 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Script = void 0;
const resource_1 = require("cloudflare/resource");
class Script extends resource_1.APIResource {
/**
* Upload a worker, or a new version of a worker.
*/
update(params, options) {
const { zone_id } = params;
return this._client.put(`/zones/${zone_id}/workers/script`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Delete your Worker. This call has no response body on a successful delete.
*/
delete(params, options) {
const { zone_id } = params;
return this._client.delete(`/zones/${zone_id}/workers/script`, {
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
/**
* Fetch raw script content for your worker. Note this is the original script
* content, not JSON encoded.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/workers/script`, { ...options, __binaryResponse: true });
}
}
exports.Script = Script;
(function (Script) {
})(Script = exports.Script || (exports.Script = {}));
//# sourceMappingURL=script.js.map