cloudflare
Version:
The official TypeScript library for the Cloudflare API
29 lines • 1.33 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import { multipartFormRequestOptions } from 'cloudflare/core';
export class Versions extends 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`, 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);
}
}
(function (Versions) {
})(Versions || (Versions = {}));
//# sourceMappingURL=versions.mjs.map