@runwayml/sdk 3.15.1 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/index.d.mts +1 -1
  11. package/index.d.mts.map +1 -1
  12. package/index.d.ts +1 -1
  13. package/index.d.ts.map +1 -1
  14. package/index.js +3 -1
  15. package/index.js.map +1 -1
  16. package/index.mjs +1 -1
  17. package/index.mjs.map +1 -1
  18. package/lib/polling.d.mts +22 -0
  19. package/lib/polling.d.mts.map +1 -1
  20. package/lib/polling.d.ts +22 -0
  21. package/lib/polling.d.ts.map +1 -1
  22. package/lib/polling.js +54 -1
  23. package/lib/polling.js.map +1 -1
  24. package/lib/polling.mjs +50 -0
  25. package/lib/polling.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/resources/documents.d.mts +23 -1
  28. package/resources/documents.d.mts.map +1 -1
  29. package/resources/documents.d.ts +23 -1
  30. package/resources/documents.d.ts.map +1 -1
  31. package/resources/documents.js +18 -0
  32. package/resources/documents.js.map +1 -1
  33. package/resources/documents.mjs +18 -0
  34. package/resources/documents.mjs.map +1 -1
  35. package/resources/image-to-video.d.mts +41 -41
  36. package/resources/image-to-video.d.mts.map +1 -1
  37. package/resources/image-to-video.d.ts +41 -41
  38. package/resources/image-to-video.d.ts.map +1 -1
  39. package/resources/index.d.mts +3 -1
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +3 -1
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +5 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +2 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/organization.d.mts +2 -2
  48. package/resources/organization.d.mts.map +1 -1
  49. package/resources/organization.d.ts +2 -2
  50. package/resources/organization.d.ts.map +1 -1
  51. package/resources/realtime-sessions.d.mts +10 -0
  52. package/resources/realtime-sessions.d.mts.map +1 -1
  53. package/resources/realtime-sessions.d.ts +10 -0
  54. package/resources/realtime-sessions.d.ts.map +1 -1
  55. package/resources/workflow-invocations.d.mts +195 -0
  56. package/resources/workflow-invocations.d.mts.map +1 -0
  57. package/resources/workflow-invocations.d.ts +195 -0
  58. package/resources/workflow-invocations.d.ts.map +1 -0
  59. package/resources/workflow-invocations.js +19 -0
  60. package/resources/workflow-invocations.js.map +1 -0
  61. package/resources/workflow-invocations.mjs +15 -0
  62. package/resources/workflow-invocations.mjs.map +1 -0
  63. package/resources/workflows.d.mts +171 -0
  64. package/resources/workflows.d.mts.map +1 -0
  65. package/resources/workflows.d.ts +171 -0
  66. package/resources/workflows.d.ts.map +1 -0
  67. package/resources/workflows.js +31 -0
  68. package/resources/workflows.js.map +1 -0
  69. package/resources/workflows.mjs +27 -0
  70. package/resources/workflows.mjs.map +1 -0
  71. package/src/client.ts +27 -0
  72. package/src/index.ts +3 -0
  73. package/src/lib/polling.ts +81 -0
  74. package/src/resources/documents.ts +36 -0
  75. package/src/resources/image-to-video.ts +48 -48
  76. package/src/resources/index.ts +9 -0
  77. package/src/resources/organization.ts +2 -0
  78. package/src/resources/realtime-sessions.ts +12 -0
  79. package/src/resources/workflow-invocations.ts +236 -0
  80. package/src/resources/workflows.ts +222 -0
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
@@ -0,0 +1,195 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { RequestOptions } from "../internal/request-options.js";
3
+ import { APIPromiseWithAwaitableWorkflowInvocation } from "../lib/polling.js";
4
+ export declare class WorkflowInvocations extends APIResource {
5
+ /**
6
+ * Return details about a workflow invocation. Consumers of this API should not
7
+ * expect updates more frequent than once every five seconds for a given workflow
8
+ * invocation.
9
+ */
10
+ retrieve(id: string, options?: RequestOptions): APIPromiseWithAwaitableWorkflowInvocation<WorkflowInvocationRetrieveResponse>;
11
+ }
12
+ /**
13
+ * A pending workflow invocation
14
+ */
15
+ export type WorkflowInvocationRetrieveResponse = WorkflowInvocationRetrieveResponse.Pending | WorkflowInvocationRetrieveResponse.Throttled | WorkflowInvocationRetrieveResponse.Cancelled | WorkflowInvocationRetrieveResponse.Running | WorkflowInvocationRetrieveResponse.Failed | WorkflowInvocationRetrieveResponse.Succeeded;
16
+ export declare namespace WorkflowInvocationRetrieveResponse {
17
+ /**
18
+ * A pending workflow invocation
19
+ */
20
+ interface Pending {
21
+ /**
22
+ * The ID of the workflow invocation being returned.
23
+ */
24
+ id: string;
25
+ /**
26
+ * The timestamp that the workflow invocation was submitted at.
27
+ */
28
+ createdAt: string;
29
+ status: 'PENDING';
30
+ }
31
+ /**
32
+ * A throttled workflow invocation
33
+ */
34
+ interface Throttled {
35
+ /**
36
+ * The ID of the workflow invocation being returned.
37
+ */
38
+ id: string;
39
+ /**
40
+ * The timestamp that the workflow invocation was submitted at.
41
+ */
42
+ createdAt: string;
43
+ status: 'THROTTLED';
44
+ }
45
+ /**
46
+ * A cancelled or deleted workflow invocation
47
+ */
48
+ interface Cancelled {
49
+ /**
50
+ * The ID of the workflow invocation being returned.
51
+ */
52
+ id: string;
53
+ /**
54
+ * The timestamp that the workflow invocation was submitted at.
55
+ */
56
+ createdAt: string;
57
+ status: 'CANCELLED';
58
+ }
59
+ /**
60
+ * A running workflow invocation
61
+ */
62
+ interface Running {
63
+ /**
64
+ * The ID of the workflow invocation being returned.
65
+ */
66
+ id: string;
67
+ /**
68
+ * The timestamp that the workflow invocation was submitted at.
69
+ */
70
+ createdAt: string;
71
+ /**
72
+ * A record mapping workflow node IDs to arrays of output URLs for nodes that have
73
+ * already completed. This allows streaming partial results while the workflow is
74
+ * still running.
75
+ */
76
+ output: {
77
+ [key: string]: Array<string>;
78
+ };
79
+ /**
80
+ * A number between 0 and 1 representing the overall workflow execution progress.
81
+ */
82
+ progress: number;
83
+ status: 'RUNNING';
84
+ /**
85
+ * A record mapping workflow node IDs to their error details. Only present when one
86
+ * or more nodes have errored.
87
+ */
88
+ nodeErrors?: {
89
+ [key: string]: Running.NodeErrors;
90
+ };
91
+ }
92
+ namespace Running {
93
+ interface NodeErrors {
94
+ /**
95
+ * A human-readable description of the node error.
96
+ */
97
+ message: string;
98
+ /**
99
+ * The human-readable name of the node that errored.
100
+ */
101
+ nodeName?: string;
102
+ }
103
+ }
104
+ /**
105
+ * A failed workflow invocation
106
+ */
107
+ interface Failed {
108
+ /**
109
+ * The ID of the workflow invocation being returned.
110
+ */
111
+ id: string;
112
+ /**
113
+ * The timestamp that the workflow invocation was submitted at.
114
+ */
115
+ createdAt: string;
116
+ /**
117
+ * A human-friendly reason for the failure. We do not recommend returning this to
118
+ * users directly without adding context.
119
+ */
120
+ failure: string;
121
+ status: 'FAILED';
122
+ /**
123
+ * A machine-readable error code for the failure. See
124
+ * https://docs.dev.runwayml.com/errors/task-failures/ for more information.
125
+ */
126
+ failureCode?: string;
127
+ /**
128
+ * A record mapping workflow node IDs to their error details. Only present when one
129
+ * or more nodes have errored.
130
+ */
131
+ nodeErrors?: {
132
+ [key: string]: Failed.NodeErrors;
133
+ };
134
+ }
135
+ namespace Failed {
136
+ interface NodeErrors {
137
+ /**
138
+ * A human-readable description of the node error.
139
+ */
140
+ message: string;
141
+ /**
142
+ * The human-readable name of the node that errored.
143
+ */
144
+ nodeName?: string;
145
+ }
146
+ }
147
+ /**
148
+ * A succeeded workflow invocation
149
+ */
150
+ interface Succeeded {
151
+ /**
152
+ * The ID of the workflow invocation being returned.
153
+ */
154
+ id: string;
155
+ /**
156
+ * The timestamp that the workflow invocation was submitted at.
157
+ */
158
+ createdAt: string;
159
+ /**
160
+ * A record mapping workflow node IDs to arrays of output URLs. Each key is the
161
+ * UUID of a workflow node that produced output, and each value is an array of URLs
162
+ * for that node's artifacts. These URLs will expire within 24-48 hours; fetch the
163
+ * invocation again to get fresh URLs. It is expected that you download the assets
164
+ * at these URLs and store them in your own storage system.
165
+ */
166
+ output: {
167
+ [key: string]: Array<string>;
168
+ };
169
+ status: 'SUCCEEDED';
170
+ /**
171
+ * A record mapping workflow node IDs to their error details. Even when the overall
172
+ * workflow succeeds, individual nodes may have encountered non-fatal errors. Only
173
+ * present when one or more nodes have errored.
174
+ */
175
+ nodeErrors?: {
176
+ [key: string]: Succeeded.NodeErrors;
177
+ };
178
+ }
179
+ namespace Succeeded {
180
+ interface NodeErrors {
181
+ /**
182
+ * A human-readable description of the node error.
183
+ */
184
+ message: string;
185
+ /**
186
+ * The human-readable name of the node that errored.
187
+ */
188
+ nodeName?: string;
189
+ }
190
+ }
191
+ }
192
+ export declare namespace WorkflowInvocations {
193
+ export { type WorkflowInvocationRetrieveResponse as WorkflowInvocationRetrieveResponse };
194
+ }
195
+ //# sourceMappingURL=workflow-invocations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-invocations.d.ts","sourceRoot":"","sources":["../src/resources/workflow-invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAElB,EAAE,yCAAyC,EAAoC;AAEtF,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,GACvB,yCAAyC,CAAC,kCAAkC,CAAC;CAMjF;AAED;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,kCAAkC,CAAC,OAAO,GAC1C,kCAAkC,CAAC,SAAS,GAC5C,kCAAkC,CAAC,SAAS,GAC5C,kCAAkC,CAAC,OAAO,GAC1C,kCAAkC,CAAC,MAAM,GACzC,kCAAkC,CAAC,SAAS,CAAC;AAEjD,yBAAiB,kCAAkC,CAAC;IAClD;;OAEG;IACH,UAAiB,OAAO;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;WAGG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAAA;SAAE,CAAC;KACnD;IAED,UAAiB,MAAM,CAAC;QACtB,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;eAEG;YACH,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB;KACF;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;;;;WAMG;QACH,MAAM,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;SAAE,CAAC;QAEzC,MAAM,EAAE,WAAW,CAAC;QAEpB;;;;WAIG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,CAAA;SAAE,CAAC;KACtD;IAED,UAAiB,SAAS,CAAC;QACzB,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;eAEG;YACH,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,OAAO,EAAE,KAAK,kCAAkC,IAAI,kCAAkC,EAAE,CAAC;CAC1F"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.WorkflowInvocations = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ const polling_1 = require("../lib/polling.js");
8
+ class WorkflowInvocations extends resource_1.APIResource {
9
+ /**
10
+ * Return details about a workflow invocation. Consumers of this API should not
11
+ * expect updates more frequent than once every five seconds for a given workflow
12
+ * invocation.
13
+ */
14
+ retrieve(id, options) {
15
+ return (0, polling_1.wrapAsWaitableWorkflowInvocation)(this._client)(this._client.get((0, path_1.path) `/v1/workflow_invocations/${id}`, options), true);
16
+ }
17
+ }
18
+ exports.WorkflowInvocations = WorkflowInvocations;
19
+ //# sourceMappingURL=workflow-invocations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-invocations.js","sourceRoot":"","sources":["../src/resources/workflow-invocations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAA8C;AAC9C,+CAA6G;AAE7G,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;;OAIG;IACH,QAAQ,CACN,EAAU,EACV,OAAwB;QAExB,OAAO,IAAA,0CAAgC,EAAqC,IAAI,CAAC,OAAO,CAAC,CACvF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,4BAA4B,EAAE,EAAE,EAAE,OAAO,CAAC,EAC/D,IAAI,CACL,CAAC;IACJ,CAAC;CACF;AAfD,kDAeC"}
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { path } from "../internal/utils/path.mjs";
4
+ import { wrapAsWaitableWorkflowInvocation } from "../lib/polling.mjs";
5
+ export class WorkflowInvocations extends APIResource {
6
+ /**
7
+ * Return details about a workflow invocation. Consumers of this API should not
8
+ * expect updates more frequent than once every five seconds for a given workflow
9
+ * invocation.
10
+ */
11
+ retrieve(id, options) {
12
+ return wrapAsWaitableWorkflowInvocation(this._client)(this._client.get(path `/v1/workflow_invocations/${id}`, options), true);
13
+ }
14
+ }
15
+ //# sourceMappingURL=workflow-invocations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-invocations.mjs","sourceRoot":"","sources":["../src/resources/workflow-invocations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,IAAI,EAAE;OACR,EAA6C,gCAAgC,EAAE;AAEtF,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,QAAQ,CACN,EAAU,EACV,OAAwB;QAExB,OAAO,gCAAgC,CAAqC,IAAI,CAAC,OAAO,CAAC,CACvF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,4BAA4B,EAAE,EAAE,EAAE,OAAO,CAAC,EAC/D,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,171 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class Workflows extends APIResource {
5
+ /**
6
+ * Returns details about a specific published workflow, including its graph schema.
7
+ */
8
+ retrieve(id: string, options?: RequestOptions): APIPromise<WorkflowRetrieveResponse>;
9
+ /**
10
+ * Returns a list of all published workflows for the authenticated user, grouped by
11
+ * source workflow with their published versions.
12
+ */
13
+ list(options?: RequestOptions): APIPromise<WorkflowListResponse>;
14
+ /**
15
+ * Start a new task to execute a published workflow. You can optionally provide
16
+ * custom input values via `nodeOutputs` to override the defaults defined in the
17
+ * workflow graph.
18
+ */
19
+ run(id: string, body?: WorkflowRunParams | null | undefined, options?: RequestOptions): APIPromise<WorkflowRunResponse>;
20
+ }
21
+ export interface WorkflowRetrieveResponse {
22
+ /**
23
+ * The globally unique ID of the published workflow.
24
+ */
25
+ id: string;
26
+ /**
27
+ * When this version was published
28
+ */
29
+ createdAt: string;
30
+ /**
31
+ * The description of the published workflow.
32
+ */
33
+ description: string | null;
34
+ /**
35
+ * The workflow graph definition.
36
+ */
37
+ graph: WorkflowRetrieveResponse.Graph;
38
+ /**
39
+ * The name of the published workflow.
40
+ */
41
+ name: string;
42
+ /**
43
+ * When this version was last updated
44
+ */
45
+ updatedAt: string;
46
+ /**
47
+ * A monotonically increasing version number. Each workflow version for the same
48
+ * published workflow has a unique version number.
49
+ */
50
+ version: number;
51
+ }
52
+ export declare namespace WorkflowRetrieveResponse {
53
+ /**
54
+ * The workflow graph definition.
55
+ */
56
+ interface Graph {
57
+ /**
58
+ * The list of edges connecting nodes in the workflow graph.
59
+ */
60
+ edges: Array<unknown>;
61
+ /**
62
+ * The list of nodes in the workflow graph.
63
+ */
64
+ nodes: Array<unknown>;
65
+ /**
66
+ * The schema version of the workflow graph format.
67
+ */
68
+ version: number;
69
+ }
70
+ }
71
+ export interface WorkflowListResponse {
72
+ /**
73
+ * A list of published workflows grouped by source workflow.
74
+ */
75
+ data: Array<WorkflowListResponse.Data>;
76
+ }
77
+ export declare namespace WorkflowListResponse {
78
+ /**
79
+ * A published workflow with all its available versions.
80
+ */
81
+ interface Data {
82
+ /**
83
+ * The name of the published workflow.
84
+ */
85
+ name: string;
86
+ /**
87
+ * The published versions of this workflow, newest first.
88
+ */
89
+ versions: Array<Data.Version>;
90
+ }
91
+ namespace Data {
92
+ /**
93
+ * A specific published version of a workflow.
94
+ */
95
+ interface Version {
96
+ /**
97
+ * The globally unique ID of this published workflow version.
98
+ */
99
+ id: string;
100
+ /**
101
+ * When this version was published
102
+ */
103
+ createdAt: string;
104
+ /**
105
+ * A monotonically increasing version number. Each workflow version for the same
106
+ * published workflow has a unique version number.
107
+ */
108
+ version: number;
109
+ }
110
+ }
111
+ }
112
+ export interface WorkflowRunResponse {
113
+ /**
114
+ * The ID of the workflow invocation that was created.
115
+ */
116
+ id: string;
117
+ }
118
+ export interface WorkflowRunParams {
119
+ /**
120
+ * Optional node outputs to override default values. Keys are node IDs from the
121
+ * workflow graph, values are objects mapping output keys to typed values.
122
+ */
123
+ nodeOutputs?: {
124
+ [key: string]: {
125
+ [key: string]: WorkflowRunParams.Primitive | WorkflowRunParams.Image | WorkflowRunParams.Video | WorkflowRunParams.Audio;
126
+ };
127
+ };
128
+ }
129
+ export declare namespace WorkflowRunParams {
130
+ /**
131
+ * A primitive value (string, number, or boolean)
132
+ */
133
+ interface Primitive {
134
+ type: 'primitive';
135
+ value: string | number | boolean;
136
+ }
137
+ /**
138
+ * An image asset
139
+ */
140
+ interface Image {
141
+ type: 'image';
142
+ /**
143
+ * A HTTPS URL.
144
+ */
145
+ uri: string;
146
+ }
147
+ /**
148
+ * A video asset
149
+ */
150
+ interface Video {
151
+ type: 'video';
152
+ /**
153
+ * A HTTPS URL.
154
+ */
155
+ uri: string;
156
+ }
157
+ /**
158
+ * An audio asset
159
+ */
160
+ interface Audio {
161
+ type: 'audio';
162
+ /**
163
+ * A HTTPS URL.
164
+ */
165
+ uri: string;
166
+ }
167
+ }
168
+ export declare namespace Workflows {
169
+ export { type WorkflowRetrieveResponse as WorkflowRetrieveResponse, type WorkflowListResponse as WorkflowListResponse, type WorkflowRunResponse as WorkflowRunResponse, type WorkflowRunParams as WorkflowRunParams, };
170
+ }
171
+ //# sourceMappingURL=workflows.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.mts","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpF;;;OAGG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIhE;;;;OAIG;IACH,GAAG,CACD,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAGnC;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;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iB,CAAC,KAAK,GACvB,iBAAiB,CAAC,KAAK,CAAC;SAC7B,CAAC;KACH,CAAC;CACH;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,SAAS;QACxB,IAAI,EAAE,WAAW,CAAC;QAElB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KAClC;IAED;;OAEG;IACH,UAAiB,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC;QAEd;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;IAED;;OAEG;IACH,UAAiB,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC;QAEd;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;IAED;;OAEG;IACH,UAAiB,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC;QAEd;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;CACF;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,171 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class Workflows extends APIResource {
5
+ /**
6
+ * Returns details about a specific published workflow, including its graph schema.
7
+ */
8
+ retrieve(id: string, options?: RequestOptions): APIPromise<WorkflowRetrieveResponse>;
9
+ /**
10
+ * Returns a list of all published workflows for the authenticated user, grouped by
11
+ * source workflow with their published versions.
12
+ */
13
+ list(options?: RequestOptions): APIPromise<WorkflowListResponse>;
14
+ /**
15
+ * Start a new task to execute a published workflow. You can optionally provide
16
+ * custom input values via `nodeOutputs` to override the defaults defined in the
17
+ * workflow graph.
18
+ */
19
+ run(id: string, body?: WorkflowRunParams | null | undefined, options?: RequestOptions): APIPromise<WorkflowRunResponse>;
20
+ }
21
+ export interface WorkflowRetrieveResponse {
22
+ /**
23
+ * The globally unique ID of the published workflow.
24
+ */
25
+ id: string;
26
+ /**
27
+ * When this version was published
28
+ */
29
+ createdAt: string;
30
+ /**
31
+ * The description of the published workflow.
32
+ */
33
+ description: string | null;
34
+ /**
35
+ * The workflow graph definition.
36
+ */
37
+ graph: WorkflowRetrieveResponse.Graph;
38
+ /**
39
+ * The name of the published workflow.
40
+ */
41
+ name: string;
42
+ /**
43
+ * When this version was last updated
44
+ */
45
+ updatedAt: string;
46
+ /**
47
+ * A monotonically increasing version number. Each workflow version for the same
48
+ * published workflow has a unique version number.
49
+ */
50
+ version: number;
51
+ }
52
+ export declare namespace WorkflowRetrieveResponse {
53
+ /**
54
+ * The workflow graph definition.
55
+ */
56
+ interface Graph {
57
+ /**
58
+ * The list of edges connecting nodes in the workflow graph.
59
+ */
60
+ edges: Array<unknown>;
61
+ /**
62
+ * The list of nodes in the workflow graph.
63
+ */
64
+ nodes: Array<unknown>;
65
+ /**
66
+ * The schema version of the workflow graph format.
67
+ */
68
+ version: number;
69
+ }
70
+ }
71
+ export interface WorkflowListResponse {
72
+ /**
73
+ * A list of published workflows grouped by source workflow.
74
+ */
75
+ data: Array<WorkflowListResponse.Data>;
76
+ }
77
+ export declare namespace WorkflowListResponse {
78
+ /**
79
+ * A published workflow with all its available versions.
80
+ */
81
+ interface Data {
82
+ /**
83
+ * The name of the published workflow.
84
+ */
85
+ name: string;
86
+ /**
87
+ * The published versions of this workflow, newest first.
88
+ */
89
+ versions: Array<Data.Version>;
90
+ }
91
+ namespace Data {
92
+ /**
93
+ * A specific published version of a workflow.
94
+ */
95
+ interface Version {
96
+ /**
97
+ * The globally unique ID of this published workflow version.
98
+ */
99
+ id: string;
100
+ /**
101
+ * When this version was published
102
+ */
103
+ createdAt: string;
104
+ /**
105
+ * A monotonically increasing version number. Each workflow version for the same
106
+ * published workflow has a unique version number.
107
+ */
108
+ version: number;
109
+ }
110
+ }
111
+ }
112
+ export interface WorkflowRunResponse {
113
+ /**
114
+ * The ID of the workflow invocation that was created.
115
+ */
116
+ id: string;
117
+ }
118
+ export interface WorkflowRunParams {
119
+ /**
120
+ * Optional node outputs to override default values. Keys are node IDs from the
121
+ * workflow graph, values are objects mapping output keys to typed values.
122
+ */
123
+ nodeOutputs?: {
124
+ [key: string]: {
125
+ [key: string]: WorkflowRunParams.Primitive | WorkflowRunParams.Image | WorkflowRunParams.Video | WorkflowRunParams.Audio;
126
+ };
127
+ };
128
+ }
129
+ export declare namespace WorkflowRunParams {
130
+ /**
131
+ * A primitive value (string, number, or boolean)
132
+ */
133
+ interface Primitive {
134
+ type: 'primitive';
135
+ value: string | number | boolean;
136
+ }
137
+ /**
138
+ * An image asset
139
+ */
140
+ interface Image {
141
+ type: 'image';
142
+ /**
143
+ * A HTTPS URL.
144
+ */
145
+ uri: string;
146
+ }
147
+ /**
148
+ * A video asset
149
+ */
150
+ interface Video {
151
+ type: 'video';
152
+ /**
153
+ * A HTTPS URL.
154
+ */
155
+ uri: string;
156
+ }
157
+ /**
158
+ * An audio asset
159
+ */
160
+ interface Audio {
161
+ type: 'audio';
162
+ /**
163
+ * A HTTPS URL.
164
+ */
165
+ uri: string;
166
+ }
167
+ }
168
+ export declare namespace Workflows {
169
+ export { type WorkflowRetrieveResponse as WorkflowRetrieveResponse, type WorkflowListResponse as WorkflowListResponse, type WorkflowRunResponse as WorkflowRunResponse, type WorkflowRunParams as WorkflowRunParams, };
170
+ }
171
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,E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// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Workflows = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ class Workflows extends resource_1.APIResource {
8
+ /**
9
+ * Returns details about a specific published workflow, including its graph schema.
10
+ */
11
+ retrieve(id, options) {
12
+ return this._client.get((0, path_1.path) `/v1/workflows/${id}`, options);
13
+ }
14
+ /**
15
+ * Returns a list of all published workflows for the authenticated user, grouped by
16
+ * source workflow with their published versions.
17
+ */
18
+ list(options) {
19
+ return this._client.get('/v1/workflows', options);
20
+ }
21
+ /**
22
+ * Start a new task to execute a published workflow. You can optionally provide
23
+ * custom input values via `nodeOutputs` to override the defaults defined in the
24
+ * workflow graph.
25
+ */
26
+ run(id, body = {}, options) {
27
+ return this._client.post((0, path_1.path) `/v1/workflows/${id}`, { body, ...options });
28
+ }
29
+ }
30
+ exports.Workflows = Workflows;
31
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,SAAU,SAAQ,sBAAW;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACH,GAAG,CACD,EAAU,EACV,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AA5BD,8BA4BC"}
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { path } from "../internal/utils/path.mjs";
4
+ export class Workflows extends APIResource {
5
+ /**
6
+ * Returns details about a specific published workflow, including its graph schema.
7
+ */
8
+ retrieve(id, options) {
9
+ return this._client.get(path `/v1/workflows/${id}`, options);
10
+ }
11
+ /**
12
+ * Returns a list of all published workflows for the authenticated user, grouped by
13
+ * source workflow with their published versions.
14
+ */
15
+ list(options) {
16
+ return this._client.get('/v1/workflows', options);
17
+ }
18
+ /**
19
+ * Start a new task to execute a published workflow. You can optionally provide
20
+ * custom input values via `nodeOutputs` to override the defaults defined in the
21
+ * workflow graph.
22
+ */
23
+ run(id, body = {}, options) {
24
+ return this._client.post(path `/v1/workflows/${id}`, { body, ...options });
25
+ }
26
+ }
27
+ //# sourceMappingURL=workflows.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.mjs","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACH,GAAG,CACD,EAAU,EACV,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}