@knime/scripting-editor 0.0.51 → 0.0.53
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function o(e) {
|
|
2
2
|
return new Promise((n) => setTimeout(n, e));
|
|
3
3
|
}
|
|
4
|
-
const
|
|
4
|
+
const l = 100, c = 2e3, t = (e, ...n) => {
|
|
5
5
|
typeof consola > "u" ? console.log(e, ...n) : consola.log(e, ...n);
|
|
6
|
-
},
|
|
6
|
+
}, a = (e, ...n) => {
|
|
7
7
|
typeof consola > "u" ? console.error(e, ...n) : consola.error(e, ...n);
|
|
8
|
-
},
|
|
8
|
+
}, u = [
|
|
9
9
|
{
|
|
10
10
|
name: "Input Table 1",
|
|
11
11
|
subItems: [
|
|
@@ -23,11 +23,11 @@ const c = 100, a = 2e3, s = (e, ...n) => {
|
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
|
-
],
|
|
26
|
+
], g = [
|
|
27
27
|
{
|
|
28
28
|
name: "Output Table 1"
|
|
29
29
|
}
|
|
30
|
-
],
|
|
30
|
+
], S = {
|
|
31
31
|
name: "Flow Variables",
|
|
32
32
|
subItems: [
|
|
33
33
|
{
|
|
@@ -43,12 +43,12 @@ const c = 100, a = 2e3, s = (e, ...n) => {
|
|
|
43
43
|
type: "String"
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
|
-
},
|
|
46
|
+
}, d = (e) => {
|
|
47
47
|
const n = /* @__PURE__ */ new Map(), i = {
|
|
48
48
|
getHubId: () => Promise.resolve("My Mocked KNIME Hub"),
|
|
49
49
|
isLoggedIn: () => Promise.resolve(!0),
|
|
50
50
|
suggestCode: async () => {
|
|
51
|
-
await o(
|
|
51
|
+
await o(c);
|
|
52
52
|
const r = n.get("codeSuggestion");
|
|
53
53
|
return typeof r < "u" && r({
|
|
54
54
|
status: "SUCCESS",
|
|
@@ -58,52 +58,56 @@ const c = 100, a = 2e3, s = (e, ...n) => {
|
|
|
58
58
|
abortSuggestCodeRequest: () => Promise.resolve()
|
|
59
59
|
};
|
|
60
60
|
return {
|
|
61
|
-
async sendToService(r,
|
|
62
|
-
return
|
|
61
|
+
async sendToService(r, s) {
|
|
62
|
+
return t(`Called scriptingService.sendToService("${r}")`, s), await o(l), e.sendToServiceMockResponses && r in e.sendToServiceMockResponses ? e.sendToServiceMockResponses[r](s) : r in i ? i[r](s) : (a(
|
|
63
63
|
`${r} not implemented in sendToServiceMockResponses.
|
|
64
64
|
Returning undefined.`
|
|
65
65
|
), Promise.resolve());
|
|
66
66
|
},
|
|
67
67
|
// Settings and dialog window
|
|
68
68
|
getInitialSettings() {
|
|
69
|
-
return
|
|
69
|
+
return t("Called scriptingService.getInitialSettings"), Promise.resolve(e.initialSettings ?? { script: "Hello world" });
|
|
70
|
+
},
|
|
71
|
+
registerSettingsGetterForApply() {
|
|
72
|
+
return t("Called scriptingService.registerSettingsGetterForApply"), Promise.resolve();
|
|
70
73
|
},
|
|
71
74
|
// Input and output objects
|
|
72
75
|
inputsAvailable() {
|
|
73
|
-
return
|
|
76
|
+
return t("Called scriptingService.inputsAvailable"), Promise.resolve(e.inputsAvailable ?? !0);
|
|
74
77
|
},
|
|
75
78
|
getInputObjects() {
|
|
76
|
-
return
|
|
79
|
+
return t("Called scriptingService.getInputObjects"), Promise.resolve(e.inputObjects ?? u);
|
|
77
80
|
},
|
|
78
81
|
getOutputObjects() {
|
|
79
|
-
return
|
|
82
|
+
return t("Called scriptingService.getOutputObjects"), Promise.resolve(e.outputObjects ?? g);
|
|
80
83
|
},
|
|
81
84
|
getFlowVariableInputs() {
|
|
82
|
-
return
|
|
83
|
-
e.flowVariableInputs ??
|
|
85
|
+
return t("Called scriptingService.getFlowVariableInputs"), Promise.resolve(
|
|
86
|
+
e.flowVariableInputs ?? S
|
|
84
87
|
);
|
|
85
88
|
},
|
|
86
89
|
// Code assistant
|
|
87
90
|
isCodeAssistantInstalled() {
|
|
88
|
-
return
|
|
91
|
+
return t("Called scriptingService.isCodeAssistantInstalled"), Promise.resolve(!0);
|
|
89
92
|
},
|
|
90
93
|
isCodeAssistantEnabled() {
|
|
91
|
-
return
|
|
94
|
+
return t("Called scriptingService.isCodeAssistantEnabled"), Promise.resolve(!0);
|
|
92
95
|
},
|
|
93
96
|
// Event handler
|
|
94
|
-
registerEventHandler(r,
|
|
95
|
-
|
|
97
|
+
registerEventHandler(r, s) {
|
|
98
|
+
t("Called scriptingService.registerEventHandler", r), n.set(r, s);
|
|
96
99
|
},
|
|
97
100
|
// Language server
|
|
98
|
-
connectToLanguageServer
|
|
99
|
-
|
|
101
|
+
connectToLanguageServer() {
|
|
102
|
+
return t("Called scriptingService.connectToLanguageServer"), Promise.reject(new Error("No language server in mock"));
|
|
103
|
+
},
|
|
100
104
|
// Console handling
|
|
101
105
|
eventHandlers: n
|
|
102
106
|
};
|
|
103
107
|
};
|
|
104
108
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
S as DEFAULT_FLOW_VARIABLE_INPUTS,
|
|
110
|
+
u as DEFAULT_INPUT_OBJECTS,
|
|
111
|
+
g as DEFAULT_OUTPUT_OBJECTS,
|
|
112
|
+
d as createScriptingServiceMock
|
|
109
113
|
};
|
|
@@ -9,6 +9,7 @@ interface Props {
|
|
|
9
9
|
menuItems?: MenuItem[];
|
|
10
10
|
showControlBar?: boolean;
|
|
11
11
|
initialPaneSizes?: PaneSizes;
|
|
12
|
+
rightPaneMinimumWidthInPixel?: number;
|
|
12
13
|
toSettings?: (settings: NodeSettings) => NodeSettings;
|
|
13
14
|
}
|
|
14
15
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
@@ -20,6 +21,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
20
21
|
right: number;
|
|
21
22
|
bottom: number;
|
|
22
23
|
};
|
|
24
|
+
rightPaneMinimumWidthInPixel: () => 0;
|
|
23
25
|
toSettings: (settings: NodeSettings) => NodeSettings;
|
|
24
26
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
27
|
"menu-item-clicked": (...args: any[]) => void;
|
|
@@ -32,6 +34,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
32
34
|
right: number;
|
|
33
35
|
bottom: number;
|
|
34
36
|
};
|
|
37
|
+
rightPaneMinimumWidthInPixel: () => 0;
|
|
35
38
|
toSettings: (settings: NodeSettings) => NodeSettings;
|
|
36
39
|
}>>> & {
|
|
37
40
|
"onMenu-item-clicked"?: ((...args: any[]) => any) | undefined;
|
|
@@ -41,6 +44,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
41
44
|
showControlBar: boolean;
|
|
42
45
|
rightPaneLayout: "fixed" | "relative";
|
|
43
46
|
initialPaneSizes: PaneSizes;
|
|
47
|
+
rightPaneMinimumWidthInPixel: number;
|
|
44
48
|
}, {}>, {
|
|
45
49
|
"settings-title"?(_: {}): any;
|
|
46
50
|
"settings-content"?(_: {}): any;
|
|
@@ -25,6 +25,18 @@ export type ScriptingServiceMockOptions = {
|
|
|
25
25
|
outputObjects?: InputOutputModel[];
|
|
26
26
|
flowVariableInputs?: InputOutputModel;
|
|
27
27
|
};
|
|
28
|
-
export declare const createScriptingServiceMock: (opt: ScriptingServiceMockOptions) =>
|
|
28
|
+
export declare const createScriptingServiceMock: (opt: ScriptingServiceMockOptions) => {
|
|
29
|
+
sendToService(methodName: string, options?: any[] | undefined): Promise<any>;
|
|
30
|
+
registerEventHandler(type: string, handler: (args: any) => void): void;
|
|
31
|
+
connectToLanguageServer(): Promise<import("./lsp/connection").MonacoLSPConnection>;
|
|
32
|
+
isCodeAssistantEnabled(): Promise<boolean>;
|
|
33
|
+
isCodeAssistantInstalled(): Promise<boolean>;
|
|
34
|
+
inputsAvailable(): Promise<boolean>;
|
|
35
|
+
getFlowVariableInputs(): Promise<InputOutputModel>;
|
|
36
|
+
getInputObjects(): Promise<InputOutputModel[]>;
|
|
37
|
+
getOutputObjects(): Promise<InputOutputModel[]>;
|
|
38
|
+
getInitialSettings: () => Promise<NodeSettings>;
|
|
39
|
+
registerSettingsGetterForApply: (settingsGetter: () => NodeSettings) => Promise<void>;
|
|
40
|
+
} & {
|
|
29
41
|
eventHandlers: Map<string, (args: any) => void>;
|
|
30
42
|
};
|
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
import type { InputOutputModel } from "./components/InputOutputItem.vue";
|
|
2
|
+
import { MonacoLSPConnection } from "./lsp/connection";
|
|
2
3
|
export type NodeSettings = {
|
|
3
4
|
script: string;
|
|
4
5
|
scriptUsedFlowVariable?: string;
|
|
5
6
|
};
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
private _eventHandlers;
|
|
9
|
-
private _runEventPoller;
|
|
10
|
-
private _monacoLSPConnection;
|
|
11
|
-
constructor();
|
|
12
|
-
private eventPoller;
|
|
13
|
-
private stopEventPoller;
|
|
14
|
-
sendToService(methodName: string, options?: any[]): Promise<any>;
|
|
15
|
-
getInitialSettings(): Promise<NodeSettings>;
|
|
7
|
+
declare const scriptingService: {
|
|
8
|
+
sendToService(methodName: string, options?: any[] | undefined): Promise<any>;
|
|
16
9
|
registerEventHandler(type: string, handler: (args: any) => void): void;
|
|
17
|
-
connectToLanguageServer(): Promise<
|
|
18
|
-
configureLanguageServer(settings: any): Promise<void>;
|
|
10
|
+
connectToLanguageServer(): Promise<MonacoLSPConnection>;
|
|
19
11
|
isCodeAssistantEnabled(): Promise<boolean>;
|
|
20
12
|
isCodeAssistantInstalled(): Promise<boolean>;
|
|
21
13
|
inputsAvailable(): Promise<boolean>;
|
|
22
14
|
getFlowVariableInputs(): Promise<InputOutputModel>;
|
|
23
15
|
getInputObjects(): Promise<InputOutputModel[]>;
|
|
24
16
|
getOutputObjects(): Promise<InputOutputModel[]>;
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
getInitialSettings: () => Promise<NodeSettings>;
|
|
18
|
+
registerSettingsGetterForApply: (settingsGetter: () => NodeSettings) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export type ScriptingServiceType = typeof scriptingService;
|
|
27
21
|
/**
|
|
28
22
|
* Get the singleton instance of the scripting service. The scripting service
|
|
29
23
|
* provides access to the backend KNIME instance.
|
|
@@ -54,5 +48,4 @@ export type ScriptingServiceType = Pick<ScriptingService, keyof ScriptingService
|
|
|
54
48
|
*/
|
|
55
49
|
export declare const getScriptingService: () => ScriptingServiceType;
|
|
56
50
|
export declare const initConsoleEventHandler: () => void;
|
|
57
|
-
export declare const registerSettingsGetterForApply: (settingsGetter: () => NodeSettings) => Promise<void>;
|
|
58
51
|
export {};
|
package/package.json
CHANGED