@workglow/javascript 0.2.28

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.
@@ -0,0 +1,153 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { TaskEntitlements } from "@workglow/task-graph";
7
+ import { CreateWorkflow, Task, TaskConfig } from "@workglow/task-graph";
8
+ import { FromSchema } from "@workglow/util/schema";
9
+ declare const inputSchema: {
10
+ readonly type: "object";
11
+ readonly properties: {
12
+ readonly javascript_code: {
13
+ readonly type: "string";
14
+ readonly title: "Code";
15
+ readonly minLength: 1;
16
+ readonly description: "JavaScript code to execute";
17
+ readonly format: "code:javascript";
18
+ };
19
+ };
20
+ readonly required: readonly ["javascript_code"];
21
+ readonly additionalProperties: true;
22
+ };
23
+ declare const outputSchema: {
24
+ readonly type: "object";
25
+ readonly properties: {
26
+ readonly output: {
27
+ readonly title: "Output";
28
+ readonly description: "The output of the JavaScript code";
29
+ };
30
+ };
31
+ readonly required: readonly ["output"];
32
+ readonly additionalProperties: false;
33
+ };
34
+ export type JavaScriptTaskInput = FromSchema<typeof inputSchema>;
35
+ export type JavaScriptTaskOutput = FromSchema<typeof outputSchema>;
36
+ export type JavaScriptTaskConfig = TaskConfig & {
37
+ javascript_code?: string;
38
+ };
39
+ export declare class JavaScriptTask extends Task<JavaScriptTaskInput, JavaScriptTaskOutput, JavaScriptTaskConfig> {
40
+ static type: string;
41
+ static category: string;
42
+ static title: string;
43
+ static description: string;
44
+ static customizable: boolean;
45
+ static hasDynamicSchemas: boolean;
46
+ static entitlements(): TaskEntitlements;
47
+ static configSchema(): {
48
+ readonly type: "object";
49
+ readonly properties: {
50
+ readonly id: {
51
+ readonly "x-ui-hidden": true;
52
+ };
53
+ readonly title: {
54
+ readonly type: "string";
55
+ };
56
+ readonly description: {
57
+ readonly type: "string";
58
+ };
59
+ readonly cacheable: {
60
+ readonly type: "boolean";
61
+ };
62
+ readonly timeout: {
63
+ readonly type: "number";
64
+ readonly description: "Max execution time in milliseconds";
65
+ };
66
+ readonly inputSchema: {
67
+ readonly type: "object";
68
+ readonly properties: {};
69
+ readonly additionalProperties: true;
70
+ readonly "x-ui-hidden": true;
71
+ };
72
+ readonly outputSchema: {
73
+ readonly type: "object";
74
+ readonly properties: {};
75
+ readonly additionalProperties: true;
76
+ readonly "x-ui-hidden": true;
77
+ };
78
+ readonly extras: {
79
+ readonly type: "object";
80
+ readonly additionalProperties: true;
81
+ readonly "x-ui-hidden": true;
82
+ };
83
+ readonly defaults: {
84
+ readonly type: "object";
85
+ readonly additionalProperties: true;
86
+ readonly "x-ui-hidden": true;
87
+ };
88
+ readonly javascript_code: {
89
+ readonly type: "string";
90
+ readonly title: "Code";
91
+ readonly minLength: 1;
92
+ readonly description: "JavaScript code to execute";
93
+ readonly format: "code:javascript";
94
+ };
95
+ };
96
+ readonly additionalProperties: false;
97
+ };
98
+ static inputSchema(): {
99
+ readonly type: "object";
100
+ readonly properties: {
101
+ readonly javascript_code: {
102
+ readonly type: "string";
103
+ readonly title: "Code";
104
+ readonly minLength: 1;
105
+ readonly description: "JavaScript code to execute";
106
+ readonly format: "code:javascript";
107
+ };
108
+ };
109
+ readonly required: readonly ["javascript_code"];
110
+ readonly additionalProperties: true;
111
+ };
112
+ static outputSchema(): {
113
+ readonly type: "object";
114
+ readonly properties: {
115
+ readonly output: {
116
+ readonly title: "Output";
117
+ readonly description: "The output of the JavaScript code";
118
+ };
119
+ };
120
+ readonly required: readonly ["output"];
121
+ readonly additionalProperties: false;
122
+ };
123
+ inputSchema(): true | {
124
+ readonly type: "object";
125
+ readonly properties: {
126
+ readonly javascript_code: {
127
+ readonly type: "string";
128
+ readonly title: "Code";
129
+ readonly minLength: 1;
130
+ readonly description: "JavaScript code to execute";
131
+ readonly format: "code:javascript";
132
+ };
133
+ };
134
+ readonly required: readonly ["javascript_code"];
135
+ readonly additionalProperties: true;
136
+ } | import("@workglow/util/schema").DataPortSchemaObject<import("@workglow/util/schema").JsonSchemaCustomProps>;
137
+ execute(input: JavaScriptTaskInput): Promise<{
138
+ output: unknown;
139
+ }>;
140
+ executePreview(input: JavaScriptTaskInput): Promise<{
141
+ output: unknown;
142
+ }>;
143
+ }
144
+ export declare const javaScript: (input: JavaScriptTaskInput, config?: TaskConfig) => Promise<{
145
+ output: unknown;
146
+ }>;
147
+ declare module "@workglow/task-graph" {
148
+ interface Workflow {
149
+ javaScript: CreateWorkflow<JavaScriptTaskInput, JavaScriptTaskOutput, TaskConfig>;
150
+ }
151
+ }
152
+ export {};
153
+ //# sourceMappingURL=JavaScriptTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JavaScriptTask.d.ts","sourceRoot":"","sources":["../../src/task/JavaScriptTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,cAAc,EAEd,IAAI,EACJ,UAAU,EAIX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA8CnE,QAAA,MAAM,WAAW;mBACT,QAAQ;;iBAEZ,eAAe;qBACb,IAAI,EAAE,QAAQ;qBACd,KAAK,EAAE,MAAM;qBACb,SAAS,EAAE,CAAC;qBACZ,WAAW,EAAE,4BAA4B;qBACzC,MAAM,EAAE,iBAAiB;;;;;CAKI,CAAC;AAEpC,QAAA,MAAM,YAAY;mBACV,QAAQ;;iBAEZ,MAAM;qBACJ,KAAK,EAAE,QAAQ;qBACf,WAAW,EAAE,mCAAmC;;;;;CAKnB,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACnE,MAAM,MAAM,oBAAoB,G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;AAEF,OAAO,QAAQ,sBAAsB,CAAC,CAAC;IACrC,UAAU,QAAQ;QAChB,UAAU,EAAE,cAAc,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC;KACnF;CACF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2012 Marijn Haverbeke
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ declare var version: string;
7
+ /**
8
+ * @param {string} inpt
9
+ * @param {Object=} opts
10
+ * @returns
11
+ */
12
+ declare var parse: (inpt: string, opts?: Object | undefined) => node_t;
13
+ export { version, parse };
14
+ //# sourceMappingURL=acorn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorn.d.ts","sourceRoot":"","sources":["../../src/task/acorn.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,QAAA,IAAI,OAAO,QAAU,CAAC;AA8BtB;;;;GAIG;AACH,QAAA,IAAI,KAAK,SAJE,MAAM,SACN,MAAM,YAAC,WASjB,CAAC;AA0wEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2013 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Create a new interpreter.
8
+ * @param {string|!Object} code Raw JavaScript text or AST.
9
+ * @param {Function=} opt_initFunc Optional initialization function. Used to
10
+ * define APIs. When called it is passed the interpreter object and the
11
+ * global scope object.
12
+ * @type Class
13
+ */
14
+ declare var Interpreter: Class;
15
+ export type = Interpreter.Object | boolean | number | string | undefined | null;
16
+ export { Interpreter };
17
+ //# sourceMappingURL=interpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../src/task/interpreter.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;;;;;;GAOG;AACH,QAAA,IAAI,WAAW,EAFN,KAyDR,CAAC;AAsqHC,YACF,AADqE,GAAxD,WAAW,CAAC,MAAM,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC;AAsxCtE,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/task.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from "./task/JavaScriptTask";
7
+ //# sourceMappingURL=task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,uBAAuB,CAAC"}