@knime/scripting-editor 0.0.114 → 0.0.115
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,15 +1,15 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
function c(
|
|
3
|
-
return new Promise((n) => setTimeout(n,
|
|
1
|
+
import { l as r } from "./log-BmIREpQ5.js";
|
|
2
|
+
function c(i) {
|
|
3
|
+
return new Promise((n) => setTimeout(n, i));
|
|
4
4
|
}
|
|
5
|
-
const l = 100, a = 2e3, g = (
|
|
6
|
-
typeof consola > "u" ? console.error(
|
|
7
|
-
}, u = (
|
|
5
|
+
const l = 100, a = 2e3, g = (i, ...n) => {
|
|
6
|
+
typeof consola > "u" ? console.error(i, ...n) : consola.error(i, ...n);
|
|
7
|
+
}, u = (i) => {
|
|
8
8
|
let n = 498;
|
|
9
|
-
const
|
|
9
|
+
const t = /* @__PURE__ */ new Map(), o = {
|
|
10
10
|
suggestCode: async () => {
|
|
11
11
|
await c(a);
|
|
12
|
-
const e =
|
|
12
|
+
const e = t.get("codeSuggestion");
|
|
13
13
|
return typeof e < "u" && e({
|
|
14
14
|
status: "SUCCESS",
|
|
15
15
|
code: JSON.stringify({
|
|
@@ -26,7 +26,7 @@ const l = 100, a = 2e3, g = (r, ...n) => {
|
|
|
26
26
|
};
|
|
27
27
|
return {
|
|
28
28
|
async sendToService(e, s) {
|
|
29
|
-
return
|
|
29
|
+
return r(`Called scriptingService.sendToService("${e}")`, s), await c(l), i.sendToServiceMockResponses && e in i.sendToServiceMockResponses ? i.sendToServiceMockResponses[e](...s ?? []) : e in o ? o[e](...s ?? []) : (g(
|
|
30
30
|
`${e} not implemented in sendToServiceMockResponses.
|
|
31
31
|
Returning undefined.`
|
|
32
32
|
), Promise.resolve());
|
|
@@ -36,35 +36,38 @@ const l = 100, a = 2e3, g = (r, ...n) => {
|
|
|
36
36
|
},
|
|
37
37
|
// Settings and dialog window
|
|
38
38
|
isCallKnimeUiApiAvailable() {
|
|
39
|
-
return
|
|
39
|
+
return r("Called scriptingService.isCallKnimeUiApiAvailable"), Promise.resolve(!1);
|
|
40
40
|
},
|
|
41
41
|
isKaiEnabled() {
|
|
42
|
-
return
|
|
42
|
+
return r("Called scriptingService.isKaiEnabled"), Promise.resolve(!0);
|
|
43
43
|
},
|
|
44
44
|
isLoggedIntoHub() {
|
|
45
|
-
return
|
|
45
|
+
return r("Called scriptingService.isLoggedIntoHub"), Promise.resolve(!0);
|
|
46
46
|
},
|
|
47
47
|
// Event handler
|
|
48
48
|
registerEventHandler(e, s) {
|
|
49
|
-
|
|
49
|
+
r("Called scriptingService.registerEventHandler", e), t.set(e, s);
|
|
50
50
|
},
|
|
51
51
|
// Language server
|
|
52
52
|
connectToLanguageServer() {
|
|
53
|
-
return
|
|
53
|
+
return r("Called scriptingService.connectToLanguageServer"), Promise.reject(new Error("No language server in mock"));
|
|
54
54
|
},
|
|
55
55
|
getAiDisclaimer() {
|
|
56
|
-
return
|
|
56
|
+
return r("Called scriptingService.getAiDisclaimer"), Promise.resolve(
|
|
57
57
|
"This is a fake AI disclaimer. Enjoy the AI. It does nothing!"
|
|
58
58
|
);
|
|
59
59
|
},
|
|
60
60
|
getAiUsage() {
|
|
61
|
-
return
|
|
61
|
+
return r("Called scriptingService.getAiUsage"), Promise.resolve({
|
|
62
62
|
limit: 500,
|
|
63
63
|
used: n
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
|
+
sendAlert(e) {
|
|
67
|
+
r("Called scriptingService.sendAlert", e);
|
|
68
|
+
},
|
|
66
69
|
// Console handling
|
|
67
|
-
eventHandlers:
|
|
70
|
+
eventHandlers: t
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScriptingServiceType } from './scripting-service';
|
|
2
2
|
export type ScriptingServiceMockOptions = {
|
|
3
|
-
sendToServiceMockResponses?: Record<string, (options
|
|
3
|
+
sendToServiceMockResponses?: Record<string, (...options: any) => Promise<any>>;
|
|
4
4
|
};
|
|
5
5
|
export declare const createScriptingServiceMock: (opt: ScriptingServiceMockOptions) => ScriptingServiceType & {
|
|
6
6
|
eventHandlers: Map<string, (args: any) => void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonDataService } from '@knime/ui-extension-service';
|
|
1
|
+
import { AlertParams, AlertingService, JsonDataService } from '@knime/ui-extension-service';
|
|
2
2
|
import { PortConfig } from './initial-data-service';
|
|
3
3
|
import { MonacoLSPConnection } from './lsp/connection';
|
|
4
4
|
import { PublicAPI } from './types/public-api';
|
|
@@ -8,6 +8,7 @@ export type UsageData = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare class ScriptingService {
|
|
10
10
|
private readonly jsonDataService;
|
|
11
|
+
private readonly alertingService;
|
|
11
12
|
private readonly eventPoller;
|
|
12
13
|
/**
|
|
13
14
|
* Internal constructor — use `getScriptingService()` from `init.ts` instead.
|
|
@@ -20,8 +21,9 @@ export declare class ScriptingService {
|
|
|
20
21
|
*
|
|
21
22
|
* @internal
|
|
22
23
|
* @param jsonDataService The JSON data service used for communication with the backend.
|
|
24
|
+
* @param alertingService The alerting service used to send alerts.
|
|
23
25
|
*/
|
|
24
|
-
constructor(jsonDataService: JsonDataService);
|
|
26
|
+
constructor(jsonDataService: JsonDataService, alertingService: AlertingService);
|
|
25
27
|
sendToService(methodName: string, options?: any[] | undefined): Promise<any>;
|
|
26
28
|
getOutputPreviewTableInitialData(): Promise<string | undefined>;
|
|
27
29
|
registerEventHandler(type: string, handler: (args: any) => void): void;
|
|
@@ -31,6 +33,7 @@ export declare class ScriptingService {
|
|
|
31
33
|
isLoggedIntoHub(): Promise<boolean>;
|
|
32
34
|
getAiDisclaimer(): Promise<string>;
|
|
33
35
|
getAiUsage(): Promise<UsageData | null>;
|
|
36
|
+
sendAlert(alert: AlertParams): void;
|
|
34
37
|
}
|
|
35
38
|
/** Type representing the public API of ScriptingService */
|
|
36
39
|
export type ScriptingServiceType = PublicAPI<ScriptingService>;
|
package/package.json
CHANGED