UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

33 lines 1.48 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Versions = void 0; const resource_1 = require("cloudflare/resource"); const core_1 = require("cloudflare/core"); class Versions extends resource_1.APIResource { /** * Upload a Worker Version without deploying to Cloudflare's network. */ create(scriptName, params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/versions`, (0, core_1.multipartFormRequestOptions)({ body, ...options }))._thenUnwrap((obj) => obj.result); } /** * List of Worker Versions. The first version in the list is the latest version. */ list(scriptName, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/versions`, options)._thenUnwrap((obj) => obj.result); } /** * Get Version Detail */ get(scriptName, versionId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/versions/${versionId}`, options)._thenUnwrap((obj) => obj.result); } } exports.Versions = Versions; (function (Versions) { })(Versions = exports.Versions || (exports.Versions = {})); //# sourceMappingURL=versions.js.map