UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

32 lines 1.38 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Deployments = void 0; const resource_1 = require("cloudflare/resource"); class Deployments extends resource_1.APIResource { /** * Deployments configure how * [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) * are deployed to traffic. A deployment can consist of one or two versions of a * Worker. */ create(scriptName, params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * List of Worker Deployments. The first deployment in the list is the latest * deployment actively serving traffic. */ get(scriptName, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, options)._thenUnwrap((obj) => obj.result); } } exports.Deployments = Deployments; (function (Deployments) { })(Deployments = exports.Deployments || (exports.Deployments = {})); //# sourceMappingURL=deployments.js.map