UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

42 lines • 1.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Versions = exports.BaseVersions = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const pagination_1 = require("../../core/pagination.js"); const path_1 = require("../../internal/utils/path.js"); var BaseVersions = /* @__PURE__ */ (() => { class BaseVersions extends resource_1.APIResource { /** * Lists all deployed versions of a workflow. */ list(workflowName, params, options) { const { account_id, ...query } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/workflows/${workflowName}/versions`, (pagination_1.V4PagePaginationArray), { query, ...options }); } /** * Retrieves details for a specific deployed workflow version. */ get(versionID, params, options) { const { account_id, workflow_name } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/workflows/${workflow_name}/versions/${versionID}`, options)._thenUnwrap((obj) => obj.result); } /** * Retrieves the graph visualization of a workflow version. */ graph(versionID, params, options) { const { account_id, workflow_name } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/workflows/${workflow_name}/versions/${versionID}/graph`, options)._thenUnwrap((obj) => obj.result); } } BaseVersions._key = Object.freeze([ 'workflows', 'versions', ]); return BaseVersions; })(); exports.BaseVersions = BaseVersions; class Versions extends BaseVersions { } exports.Versions = Versions; //# sourceMappingURL=versions.js.map