cloudflare
Version:
The official TypeScript library for the Cloudflare API
418 lines • 14.3 kB
text/typescript
import { APIResource } from "../../core/resource.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../core/pagination.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class BaseVersions extends APIResource {
static readonly _key: readonly ['workflows', 'versions'];
/**
* Lists all deployed versions of a workflow.
*/
list(workflowName: string, params: VersionListParams, options?: RequestOptions): PagePromise<VersionListResponsesV4PagePaginationArray, VersionListResponse>;
/**
* Retrieves details for a specific deployed workflow version.
*/
get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise<VersionGetResponse>;
/**
* Retrieves the graph visualization of a workflow version.
*/
graph(versionID: string, params: VersionGraphParams, options?: RequestOptions): APIPromise<VersionGraphResponse>;
}
export declare class Versions extends BaseVersions {
}
export type VersionListResponsesV4PagePaginationArray = V4PagePaginationArray<VersionListResponse>;
export interface VersionListResponse {
id: string;
class_name: string;
created_on: string;
has_dag: boolean;
/**
* The programming language of the workflow implementation.
*/
language: 'javascript' | 'python';
modified_on: string;
workflow_id: string;
concurrency?: VersionListResponse.Concurrency;
default_retention?: VersionListResponse.DefaultRetention;
limits?: VersionListResponse.Limits;
}
export declare namespace VersionListResponse {
interface Concurrency {
/**
* Maximum number of instances of this workflow that can run concurrently.
* Additional instances are queued and started as running instances complete. Must
* not exceed the account concurrency limit.
*/
limit?: number;
}
interface DefaultRetention {
/**
* Default error retention in milliseconds.
*/
error_retention?: number;
/**
* Default success retention in milliseconds.
*/
success_retention?: number;
}
interface Limits {
steps?: number;
}
}
export interface VersionGetResponse {
id: string;
class_name: string;
created_on: string;
has_dag: boolean;
/**
* The programming language of the workflow implementation.
*/
language: 'javascript' | 'python';
modified_on: string;
workflow_id: string;
concurrency?: VersionGetResponse.Concurrency;
default_retention?: VersionGetResponse.DefaultRetention;
limits?: VersionGetResponse.Limits;
}
export declare namespace VersionGetResponse {
interface Concurrency {
/**
* Maximum number of instances of this workflow that can run concurrently.
* Additional instances are queued and started as running instances complete. Must
* not exceed the account concurrency limit.
*/
limit?: number;
}
interface DefaultRetention {
/**
* Default error retention in milliseconds.
*/
error_retention?: number;
/**
* Default success retention in milliseconds.
*/
success_retention?: number;
}
interface Limits {
steps?: number;
}
}
export interface VersionGraphResponse {
id: string;
class_name: string;
created_on: string;
/**
* Versioned workflow graph payload.
*/
graph: VersionGraphResponse.Graph | null;
modified_on: string;
workflow_id: string;
}
export declare namespace VersionGraphResponse {
/**
* Versioned workflow graph payload.
*/
interface Graph {
version: number;
/**
* A parsed workflow entrypoint with its step graph.
*/
workflow: Graph.Workflow;
}
namespace Graph {
/**
* A parsed workflow entrypoint with its step graph.
*/
interface Workflow {
class_name: string;
functions: {
[]: Workflow.Functions;
};
nodes: Array<Workflow.UnionMember0 | Workflow.UnionMember1 | Workflow.UnionMember2 | Workflow.UnionMember3 | Workflow.UnionMember4 | Workflow.UnionMember5 | Workflow.UnionMember6 | Workflow.UnionMember7 | Workflow.UnionMember8 | Workflow.UnionMember9 | Workflow.UnionMember10 | Workflow.UnionMember11 | Workflow.UnionMember12 | Workflow.UnionMember13>;
/**
* Shape descriptor for JSON payloads.
*/
payload?: Workflow.Payload.Type | Workflow.Payload.UnionMember1;
}
namespace Workflow {
interface Functions {
name: string;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'function_def';
}
interface UnionMember0 {
/**
* Duration as milliseconds (number) or human-readable string.
*/
duration: number | string;
name: string;
type: 'step_sleep';
resolves?: number;
starts?: number;
}
interface UnionMember1 {
/**
* Configuration for a step (retries and timeout).
*/
config: UnionMember1.Config;
name: string;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'step_do';
resolves?: number;
starts?: number;
}
namespace UnionMember1 {
/**
* Configuration for a step (retries and timeout).
*/
interface Config {
/**
* Retry policy for a step.
*/
retries: Config.Retries;
/**
* Duration as milliseconds (number) or human-readable string.
*/
timeout: number | string;
}
namespace Config {
/**
* Retry policy for a step.
*/
interface Retries {
/**
* Backoff strategy for step retries.
*/
backoff: 'constant' | 'linear' | 'exponential';
/**
* Duration as milliseconds (number) or human-readable string.
*/
delay: number | string;
limit: number;
}
}
}
interface UnionMember2 {
name: string;
/**
* Options for a waitForEvent step.
*/
options: UnionMember2.Options | null;
type: 'step_wait_for_event';
/**
* Shape descriptor for JSON payloads.
*/
payload?: UnionMember2.Type | UnionMember2.UnionMember1;
resolves?: number;
starts?: number;
}
namespace UnionMember2 {
/**
* Options for a waitForEvent step.
*/
interface Options {
event_type: string;
/**
* Duration as milliseconds (number) or human-readable string.
*/
timeout: number | string;
}
interface Type {
type: 'unknown';
}
interface UnionMember1 {
/**
* Nested JsonShape fields (recursive structure).
*/
fields: {
[]: unknown;
};
type: 'object';
}
}
interface UnionMember3 {
name: string;
timestamp: string;
type: 'step_sleep_until';
resolves?: number;
starts?: number;
}
interface UnionMember4 {
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'loop';
}
interface UnionMember5 {
/**
* Parallel execution strategy.
*/
kind: 'all' | 'any' | 'all_settled' | 'race';
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'parallel';
}
interface UnionMember6 {
catch_block: UnionMember6.CatchBlock | null;
finally_block: UnionMember6.FinallyBlock | null;
try_block: UnionMember6.TryBlock | null;
type: 'try';
}
namespace UnionMember6 {
interface CatchBlock {
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'block';
}
interface FinallyBlock {
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'block';
}
interface TryBlock {
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'block';
}
}
interface UnionMember7 {
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'block';
}
interface UnionMember8 {
branches: Array<UnionMember8.Branch>;
type: 'if';
}
namespace UnionMember8 {
interface Branch {
condition: string | null;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
}
}
interface UnionMember9 {
branches: Array<UnionMember9.Branch>;
discriminant: string;
type: 'switch';
}
namespace UnionMember9 {
interface Branch {
condition: string | null;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
}
}
interface UnionMember10 {
class_name: string;
functions: {
[]: UnionMember10.Functions;
};
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'start';
/**
* Shape descriptor for JSON payloads.
*/
payload?: UnionMember10.Type | UnionMember10.UnionMember1;
}
namespace UnionMember10 {
interface Functions {
name: string;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'function_def';
}
interface Type {
type: 'unknown';
}
interface UnionMember1 {
/**
* Nested JsonShape fields (recursive structure).
*/
fields: {
[]: unknown;
};
type: 'object';
}
}
interface UnionMember11 {
name: string;
type: 'function_call';
resolves?: number;
starts?: number;
}
interface UnionMember12 {
name: string;
/**
* Child nodes (recursive).
*/
nodes: Array<unknown>;
type: 'function_def';
}
interface UnionMember13 {
/**
* Break or return from a loop.
*/
kind: 'break' | 'return';
type: 'break';
}
namespace Payload {
interface Type {
type: 'unknown';
}
interface UnionMember1 {
/**
* Nested JsonShape fields (recursive structure).
*/
fields: {
[]: unknown;
};
type: 'object';
}
}
}
}
}
export interface VersionListParams extends V4PagePaginationArrayParams {
/**
* Path param
*/
account_id: string;
}
export interface VersionGetParams {
account_id: string;
workflow_name: string;
}
export interface VersionGraphParams {
account_id: string;
workflow_name: string;
}
export declare namespace Versions {
export { type VersionListResponse as VersionListResponse, type VersionGetResponse as VersionGetResponse, type VersionGraphResponse as VersionGraphResponse, type VersionListResponsesV4PagePaginationArray as VersionListResponsesV4PagePaginationArray, type VersionListParams as VersionListParams, type VersionGetParams as VersionGetParams, type VersionGraphParams as VersionGraphParams, };
}
//# sourceMappingURL=versions.d.mts.map