@knime/product-features 4.0.0 → 4.1.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 (48) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/analytics.js +2385 -0
  3. package/dist/analytics.js.map +1 -0
  4. package/dist/authUtils.js +149 -0
  5. package/dist/authUtils.js.map +1 -0
  6. package/dist/embeddingSDK.js +219 -0
  7. package/dist/embeddingSDK.js.map +1 -0
  8. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  9. package/dist/src/analytics/analytics.d.ts +44 -0
  10. package/dist/src/analytics/analytics.d.ts.map +1 -0
  11. package/dist/src/analytics/index.d.ts +3 -0
  12. package/dist/src/analytics/index.d.ts.map +1 -0
  13. package/dist/src/analytics/schema/cloudhome-event-functions.d.ts +82 -0
  14. package/dist/src/analytics/schema/cloudhome-event-functions.d.ts.map +1 -0
  15. package/dist/src/analytics/schema/editor-event-functions.d.ts +151 -0
  16. package/dist/src/analytics/schema/editor-event-functions.d.ts.map +1 -0
  17. package/dist/src/analytics/types.d.ts +37 -0
  18. package/dist/src/analytics/types.d.ts.map +1 -0
  19. package/dist/src/analytics/utils/toSnakeCaseDeep.d.ts +5 -0
  20. package/dist/src/analytics/utils/toSnakeCaseDeep.d.ts.map +1 -0
  21. package/dist/src/authUtils/client.d.ts +13 -0
  22. package/dist/src/authUtils/client.d.ts.map +1 -0
  23. package/dist/src/authUtils/index.d.ts +49 -0
  24. package/dist/src/authUtils/index.d.ts.map +1 -0
  25. package/dist/src/authUtils/logger.d.ts +2 -0
  26. package/dist/src/authUtils/logger.d.ts.map +1 -0
  27. package/dist/src/authUtils/refresher.d.ts +9 -0
  28. package/dist/src/authUtils/refresher.d.ts.map +1 -0
  29. package/dist/src/authUtils/shared.d.ts +8 -0
  30. package/dist/src/authUtils/shared.d.ts.map +1 -0
  31. package/dist/src/authUtils/types.d.ts +17 -0
  32. package/dist/src/authUtils/types.d.ts.map +1 -0
  33. package/dist/src/authUtils/useAuthState.d.ts +17 -0
  34. package/dist/src/authUtils/useAuthState.d.ts.map +1 -0
  35. package/dist/src/embeddingSDK/guest.d.ts +27 -0
  36. package/dist/src/embeddingSDK/guest.d.ts.map +1 -0
  37. package/dist/src/embeddingSDK/host.d.ts +23 -0
  38. package/dist/src/embeddingSDK/host.d.ts.map +1 -0
  39. package/dist/src/embeddingSDK/index.d.ts +8 -0
  40. package/dist/src/embeddingSDK/index.d.ts.map +1 -0
  41. package/dist/src/embeddingSDK/messages.d.ts +36 -0
  42. package/dist/src/embeddingSDK/messages.d.ts.map +1 -0
  43. package/dist/src/embeddingSDK/types.d.ts +117 -0
  44. package/dist/src/embeddingSDK/types.d.ts.map +1 -0
  45. package/dist/src/embeddingSDK/util.d.ts +11 -0
  46. package/dist/src/embeddingSDK/util.d.ts.map +1 -0
  47. package/dist/toasts.js +1 -1
  48. package/package.json +20 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toSnakeCaseDeep.d.ts","sourceRoot":"","sources":["../../../../src/analytics/utils/toSnakeCaseDeep.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,4BAkBrE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Navigates to the login path. This function does not work on SSR
3
+ */
4
+ export declare const navigateToLogin: ({ wdywtg }?: {
5
+ wdywtg?: string;
6
+ }) => void;
7
+ /**
8
+ * Navigates to the logout path. This function does not work on SSR
9
+ */
10
+ export declare const navigateToLogout: ({ wdywtg }?: {
11
+ wdywtg?: string;
12
+ }) => void;
13
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/authUtils/client.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,aAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,SAGnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,SAGpE,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { AuthRefresher } from './types';
2
+ import * as client from "./client";
3
+ /**
4
+ * This function does two main things:
5
+ * 1. Fetch the user identity and store it via the auth composable.
6
+ * 2. Start the background refresher which will renew tokens according to the
7
+ * auth service TTL.
8
+ *
9
+ * Typical usage is from a route middleware for routes that require
10
+ * authentication. See README for a more in-depth example usage
11
+ *
12
+ * @param options AuthRefresher
13
+ * @returns a function that, when called, will load the identity (if needed)
14
+ * and start the token refresher. The returned function will throw if the
15
+ * underlying identity fetch fails.
16
+ */
17
+ declare function createAuthRefresher(options: AuthRefresher): () => Promise<void>;
18
+ export declare const authUtils: {
19
+ createAuthRefresher: typeof createAuthRefresher;
20
+ stopTokenRefresh: () => void;
21
+ useAuthState: () => {
22
+ loggedInUser: Readonly<import('vue').Ref<{
23
+ readonly id: string;
24
+ readonly name: string;
25
+ readonly realName?: string | undefined;
26
+ readonly avatarUrl?: string | undefined;
27
+ } | null, {
28
+ readonly id: string;
29
+ readonly name: string;
30
+ readonly realName?: string | undefined;
31
+ readonly avatarUrl?: string | undefined;
32
+ } | null>>;
33
+ isLoggedIn: import('vue').ComputedRef<boolean>;
34
+ };
35
+ /**
36
+ * These utilities don't work in SSR. You can leverage the `paths` helpers to redirect manually
37
+ */
38
+ client: typeof client;
39
+ paths: {
40
+ login: ({ wdywtg }?: {
41
+ wdywtg?: string;
42
+ }) => string;
43
+ logout: ({ wdywtg }?: {
44
+ wdywtg?: string;
45
+ }) => string;
46
+ };
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authUtils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAInC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;GAaG;AACH,iBAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,uBA4BlD;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;IAIpB;;OAEG;;;;kBA3C+B,CAAA;;;kBAGyB,CAAC;;;CA2C7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const logger: () => import('consola').ConsolaInstance;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/authUtils/logger.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,yCAAsC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AuthRefresher } from './types';
2
+ type Options = Pick<AuthRefresher, "onRefreshComplete">;
3
+ /**
4
+ * Start proactively refreshing the token before it expires.
5
+ */
6
+ export declare const startRefresher: (options?: Options) => void;
7
+ export declare const stopRefresher: () => void;
8
+ export {};
9
+ //# sourceMappingURL=refresher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresher.d.ts","sourceRoot":"","sources":["../../../src/authUtils/refresher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,KAAK,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;AAexD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAS,OAAY,SAkCnD,CAAC;AAEF,eAAO,MAAM,aAAa,YAKzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const AUTH_SERVICE_PATH = "/_/auth";
2
+ export declare const buildLoginPath: ({ wdywtg }?: {
3
+ wdywtg?: string;
4
+ }) => string;
5
+ export declare const buildLogoutPath: ({ wdywtg }?: {
6
+ wdywtg?: string;
7
+ }) => string;
8
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/authUtils/shared.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,eAAO,MAAM,cAAc,GAAI,aAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,WAClB,CAAC;AAElD,eAAO,MAAM,eAAe,GAAI,aAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,WAClB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type UserIdentity = {
2
+ id: string;
3
+ name: string;
4
+ realName?: string;
5
+ avatarUrl?: string;
6
+ };
7
+ export type AuthRefresher = {
8
+ /**
9
+ * Fetcher function to obtain the basic user identity information
10
+ */
11
+ getIdentity: () => Promise<UserIdentity>;
12
+ /**
13
+ * Callback that runs after each completion of an auth token refresh
14
+ */
15
+ onRefreshComplete?: () => unknown;
16
+ };
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/authUtils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC;CACnC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { UserIdentity } from './types';
2
+ export declare const setLoggedInUser: (user: UserIdentity) => void;
3
+ export declare const useAuthState: () => {
4
+ loggedInUser: Readonly<import('vue').Ref<{
5
+ readonly id: string;
6
+ readonly name: string;
7
+ readonly realName?: string | undefined;
8
+ readonly avatarUrl?: string | undefined;
9
+ } | null, {
10
+ readonly id: string;
11
+ readonly name: string;
12
+ readonly realName?: string | undefined;
13
+ readonly avatarUrl?: string | undefined;
14
+ } | null>>;
15
+ isLoggedIn: import('vue').ComputedRef<boolean>;
16
+ };
17
+ //# sourceMappingURL=useAuthState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuthState.d.ts","sourceRoot":"","sources":["../../../src/authUtils/useAuthState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,eAAO,MAAM,eAAe,GAAI,MAAM,YAAY,SAEjD,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAOxB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { EmbeddingContext, GenericEvent, UserActivityInfo } from './types';
2
+ /**
3
+ * Manually set the Embedding context. Use with caution as this should be done
4
+ * automatically out-of-the-box. It's mostly exposed to be helpful for dev setups
5
+ */
6
+ export declare const setContext: (value: EmbeddingContext) => void;
7
+ export declare const getContext: () => Readonly<EmbeddingContext> | undefined;
8
+ /**
9
+ * Only relevant for tests
10
+ */
11
+ export declare const clearContext: () => void;
12
+ type EmbeddingContextValidator = (context: EmbeddingContext) => {
13
+ valid: true;
14
+ error: null;
15
+ } | {
16
+ valid: false;
17
+ error: string;
18
+ };
19
+ /**
20
+ * Wait for host application to send a message containing the embedding context
21
+ */
22
+ export declare const waitForContext: (validator?: EmbeddingContextValidator) => Promise<EmbeddingContext>;
23
+ export declare const sendEmbeddingFailureMessage: (error: unknown) => void;
24
+ export declare const dispatchGenericEventToHost: (event: GenericEvent) => void;
25
+ export declare const notifyActivityChange: (userActivityInfo: UserActivityInfo) => void;
26
+ export {};
27
+ //# sourceMappingURL=guest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guest.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/guest.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAKjB;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,gBAAgB,SAOjD,CAAC;AAEF,eAAO,MAAM,UAAU,8CAOtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,YAOxB,CAAC;AAEF,KAAK,yBAAyB,GAAG,CAC/B,OAAO,EAAE,gBAAgB,KACtB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAQpE;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,YAAW,yBAA4C,KACtD,OAAO,CAAC,gBAAgB,CA8C1B,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,SAKzD,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,OAAO,YAAY,SAO7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAAkB,gBAAgB,SAOtE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { EmbeddingContext, GenericEvent, GenericEventHandlers, UserActivityInfo } from './types';
2
+ /**
3
+ * This function acts as a handshake to make sure the event with the
4
+ * embedding context is only sent once the embedded application is ready to
5
+ * receive it and not earlier. It also listens to possible embedding failure
6
+ * from the child application
7
+ */
8
+ export declare const init: (callbacks: {
9
+ onReady: () => void;
10
+ onError: (error: Error) => void;
11
+ }) => void;
12
+ export declare const sendEmbeddingContext: (iframe: HTMLIFrameElement, targetOrigin: string, context: EmbeddingContext) => void;
13
+ /**
14
+ * Sets up a listener to receive user activity events to detect idleness
15
+ */
16
+ export declare const listenToActivityEvents: (callbacks: {
17
+ onActivity: (event: UserActivityInfo) => void;
18
+ }) => () => void;
19
+ /**
20
+ * Sets up handlers for commands dispatched from the embedded guest application
21
+ */
22
+ export declare const setupGenericEventHandlers: <K extends GenericEvent["kind"]>(handlers: GenericEventHandlers) => () => void;
23
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/host.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAKjB;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,WAAW;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC,SA4BA,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,iBAAiB,EACzB,cAAc,MAAM,EACpB,SAAS,gBAAgB,SAiB1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,WAAW;IAChD,UAAU,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C,eAgBA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,EACtE,UAAU,oBAAoB,eAwB/B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as guest from "./guest";
2
+ import * as host from "./host";
3
+ export declare const embeddingSDK: {
4
+ host: typeof host;
5
+ guest: typeof guest;
6
+ };
7
+ export * from './types';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,eAAO,MAAM,YAAY;;;CAAkB,CAAC;AAC5C,cAAc,SAAS,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * ----------- IMPORTANT NOTES ---------------
3
+ * 1. These messages are considered API. So they **must** remain
4
+ * backwards compatible
5
+ * 2. Instead of removal of properties from the embedding context payload,
6
+ * we must use deprecation notes that list which AP version last used the
7
+ * deprecated property
8
+ * 3. The message variable name can change, but not it's value. This is because
9
+ * these values are used since AP browser embedding was first implemented, so
10
+ * they must be retained in order to preserve backwars compatibility
11
+ */
12
+ export declare const MESSAGES: {
13
+ /**
14
+ * Message used to establish a handshake and setup
15
+ * before waiting for embedding context transfer
16
+ */
17
+ readonly AWAITING_EMBEDDING_CONTEXT: "KNIME_UI__AWAITING_CONNECTION_INFO";
18
+ /**
19
+ * Message that contains the embedding context information
20
+ */
21
+ readonly EMBEDDING_CONTEXT: "KNIME_UI__CONNECTION_INFO";
22
+ /**
23
+ * Message used for when embedding failed
24
+ */
25
+ readonly EMBEDDING_FAILED: "KNIME_UI__CONNECTION_FAIL";
26
+ /**
27
+ * Message to report user activity events
28
+ */
29
+ readonly USER_ACTIVITY: "KNIME_UI__USER_ACTIVITY";
30
+ /**
31
+ * General purpose event to transfer data between host application and embedded
32
+ * application.
33
+ */
34
+ readonly GENERIC_EVENT: "KNIME_UI__GENERIC_EVENT";
35
+ };
36
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ;IACnB;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;CAEK,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { Toast } from '../toasts';
2
+ export type EmbeddingContext = {
3
+ /**
4
+ * URI of the WS used by the embedded application.
5
+ * (e.g in case of browser AP, this is the WS url provided by the ws-proxy)
6
+ */
7
+ wsConnectionUri: string;
8
+ /**
9
+ * URI of the HTTP endpoint used by the embedded application to fetch HTTP resources.
10
+ * Optional for backwards compatibility with older embedders.
11
+ */
12
+ httpResourceUri?: string;
13
+ /**
14
+ * @deprecated URI of the WS used by the embedded application.
15
+ * Last used in AP 5.8.0. From 5.9.0 and onwards `wsConnectionUri` is preferred.
16
+ * Although, the AP still references the url for compatibility with older embedders
17
+ * that don't use the new property `wsConnectionUri`
18
+ */
19
+ url?: string;
20
+ /**
21
+ * Base URL of the Hub's REST API. This will be used by the embedded application
22
+ * to make requests to the hub API. It can also be used to fetch resources
23
+ * dynamically at runtime and get assets needed to render UI extensions
24
+ * (e.g port views, node views, etc)
25
+ */
26
+ restApiBaseUrl: string;
27
+ /**
28
+ * Id of the job loaded into the executor that is providing the embedded application
29
+ */
30
+ jobId: string;
31
+ /**
32
+ * @deprecated only needed due to backwards compatibility because it's used
33
+ * by older AP versions. Last used in AP 5.4.0
34
+ */
35
+ sessionId?: string;
36
+ /**
37
+ * Time in MS after which the user is considered idle if no interactions
38
+ * are being made on the page
39
+ */
40
+ userIdleTimeout?: number;
41
+ /**
42
+ * Configuration for analytics
43
+ */
44
+ analytics?: {
45
+ /**
46
+ * Whether the embedded application can send analytic and tracking events
47
+ */
48
+ enabled: boolean;
49
+ };
50
+ /**
51
+ * A set of custom properties provided by the host, which the guest has to read and validate.
52
+ */
53
+ customProperties?: Record<string, unknown>;
54
+ };
55
+ type ShowNotificationEvent = {
56
+ kind: "showNotification";
57
+ payload: Toast;
58
+ };
59
+ type ClearNotificationEvent = {
60
+ kind: "clearNotification";
61
+ payload: {
62
+ id: string;
63
+ } | {
64
+ deduplicationKey: string;
65
+ };
66
+ };
67
+ type HostNavigationRequestEvent = {
68
+ kind: "hostNavigationRequest";
69
+ payload: {
70
+ intent: "reload";
71
+ } | {
72
+ intent: "go-to";
73
+ destination: "cloud-home";
74
+ openIn: "_blank" | "_parent";
75
+ } | {
76
+ intent: "navigate";
77
+ href: string;
78
+ openIn: "_blank" | "_parent";
79
+ };
80
+ };
81
+ type CustomPropertyUpdateEvent = {
82
+ kind: "customPropertyUpdate";
83
+ payload: {
84
+ key: string;
85
+ value: unknown;
86
+ };
87
+ };
88
+ type AnalyticsEvent = {
89
+ kind: "analytics";
90
+ payload: {
91
+ id: string;
92
+ data: unknown;
93
+ };
94
+ };
95
+ export type GenericEvent = ShowNotificationEvent | ClearNotificationEvent | HostNavigationRequestEvent | CustomPropertyUpdateEvent | AnalyticsEvent;
96
+ export type GenericEventByKind<K extends GenericEvent["kind"]> = Extract<GenericEvent, {
97
+ kind: K;
98
+ }>;
99
+ export type GenericEventHandlers = {
100
+ [K in GenericEvent["kind"]]?: (event: GenericEventByKind<K>) => void;
101
+ };
102
+ export type UserActivityInfo = {
103
+ idle: boolean;
104
+ lastActive: string;
105
+ version?: "v0";
106
+ } | {
107
+ /**
108
+ * active: *default* state, user is interacting with app but NO background task is running
109
+ * idle: user is NOT interacting and NO task is running
110
+ * background-task: whenever a background task is running, whether the user is interacting with app or not
111
+ */
112
+ state: "active" | "idle" | "background-task";
113
+ lastActive: string;
114
+ version: "v1";
115
+ };
116
+ export {};
117
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EACH;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,GACpB;QACE,MAAM,EAAE,OAAO,CAAC;QAChB,WAAW,EAAE,YAAY,CAAC;QAC1B,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;KAC9B,GACD;QAAE,MAAM,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAA;KAAE,CAAC;CACxE,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,qBAAqB,GACrB,sBAAsB,GACtB,0BAA0B,GAC1B,yBAAyB,GACzB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,IAAI,OAAO,CACtE,YAAY,EACZ;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CACZ,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI;CACrE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACD;IACE;;;;OAIG;IACH,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC;CACf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { MESSAGES } from './messages';
2
+ import { GenericEvent, GenericEventByKind } from './types';
3
+ export declare const messageValidators: {
4
+ isInitializationMessage: (event: MessageEvent) => boolean;
5
+ isUserActivityMessage: (event: MessageEvent) => boolean;
6
+ isGenericEvent: <K extends GenericEvent["kind"]>(event: MessageEvent) => event is MessageEvent<{
7
+ type: typeof MESSAGES.GENERIC_EVENT;
8
+ payload: GenericEventByKind<K>;
9
+ }>;
10
+ };
11
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/embeddingSDK/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAErE,eAAO,MAAM,iBAAiB;qCACK,YAAY;mCAKd,YAAY;qBAG1B,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,SACtC,YAAY,KAClB,KAAK,IAAI,YAAY,CAAC;QACvB,IAAI,EAAE,OAAO,QAAQ,CAAC,aAAa,CAAC;QACpC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC;CACH,CAAC"}
package/dist/toasts.js CHANGED
@@ -2,9 +2,9 @@ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-hel
2
2
  import { t as capitalize, u as truncateString_default } from "./dist-DvDWkkNg.js";
3
3
  import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, normalizeClass, onMounted, openBlock, provide, ref, renderList, resolveDynamicComponent, toDisplayString, unref, useCssVars, vShow, watch, withCtx, withDirectives } from "vue";
4
4
  import { KdsButton, KdsIcon, KdsLinkButton, KdsProgressBar } from "@knime/kds-components";
5
+ import { cloneDeep } from "es-toolkit";
5
6
  import { useEventBus, useMouseInElement, useRafFn, useWindowFocus } from "@vueuse/core";
6
7
  import { border, color } from "@knime/kds-styles/tokens";
7
- import { cloneDeep } from "es-toolkit";
8
8
  import { uniqueId } from "es-toolkit/compat";
9
9
  import './toasts.css';//#region src/toasts/Toast/enums.ts
10
10
  var toastType = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/product-features",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Package containing composition patterns of KDS Components and KNIME business logic",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,6 +21,14 @@
21
21
  "types": "./dist/src/ai/index.d.ts",
22
22
  "import": "./dist/ai.js"
23
23
  },
24
+ "./analytics": {
25
+ "types": "./dist/src/analytics/index.d.ts",
26
+ "import": "./dist/analytics.js"
27
+ },
28
+ "./auth-utils": {
29
+ "types": "./dist/src/authUtils/index.d.ts",
30
+ "import": "./dist/authUtils.js"
31
+ },
24
32
  "./data-transfer": {
25
33
  "types": "./dist/src/dataTransfer/index.d.ts",
26
34
  "import": "./dist/dataTransfer.js"
@@ -29,6 +37,10 @@
29
37
  "types": "./dist/src/dataTransfer/core.d.ts",
30
38
  "import": "./dist/dataTransfer/core.js"
31
39
  },
40
+ "./embedding-sdk": {
41
+ "types": "./dist/src/embeddingSDK/index.d.ts",
42
+ "import": "./dist/embeddingSDK.js"
43
+ },
32
44
  "./nodes": {
33
45
  "types": "./dist/src/nodes/index.d.ts",
34
46
  "import": "./dist/nodes.js"
@@ -63,8 +75,8 @@
63
75
  "consola": "^3.4.2"
64
76
  },
65
77
  "devDependencies": {
66
- "@knime/kds-components": "^9.0.0",
67
- "@knime/kds-styles": "^9.0.0",
78
+ "@knime/kds-components": "^9.1.0",
79
+ "@knime/kds-styles": "^9.1.0",
68
80
  "@storybook/addon-docs": "^10.4.6",
69
81
  "@storybook/vue3-vite": "^10.4.6",
70
82
  "@vitejs/plugin-vue": "^6.0.8",
@@ -73,6 +85,7 @@
73
85
  "@vueuse/core": "~14.4.0",
74
86
  "es-toolkit": "^1.49.0",
75
87
  "flush-promises": "^1.0.2",
88
+ "json-schema-to-typescript": "^15.0.4",
76
89
  "mock-xmlhttprequest": "^8.4.1",
77
90
  "ofetch": "^1.5.1",
78
91
  "prettier": "3.9.6",
@@ -94,6 +107,9 @@
94
107
  ],
95
108
  "scripts": {
96
109
  "build": "vite build",
97
- "type-check": "vue-tsc --build"
110
+ "type-check": "vue-tsc --build",
111
+ "generate-analytics-events": "pnpm generate-event-types && pnpm generate-event-functions",
112
+ "generate-event-types": "json2ts ./src/analytics/schema/schema.json > ./src/analytics/schema/schema.d.ts",
113
+ "generate-event-functions": "node ./src/analytics/schema/code-generator.js"
98
114
  }
99
115
  }