@knime/hub-features 1.18.1 → 1.19.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @knime/hub-features
2
2
 
3
+ ## 1.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ea3b7e1: - Introduce file upload limit
8
+ - Fix date-time format for RFC toasts
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [ea3b7e1]
13
+ - @knime/utils@1.10.0
14
+ - @knime/components@1.45.5
15
+
16
+ ## 1.18.2
17
+
18
+ ### Patch Changes
19
+
20
+ - 628f341: Fix sending entire embedding context to avoid missing properties
21
+
3
22
  ## 1.18.1
4
23
 
5
24
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/hub-features",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "Vue components & composables for shared hub features",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,9 +36,9 @@
36
36
  "lodash-es": "4.17.23",
37
37
  "ofetch": "^1.4.1",
38
38
  "typescript": "^5.8.3",
39
- "@knime/components": "1.45.4",
39
+ "@knime/components": "1.45.5",
40
40
  "@knime/styles": "1.15.0",
41
- "@knime/utils": "1.9.2"
41
+ "@knime/utils": "1.10.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "consola": "3.x",
@@ -116,6 +116,8 @@ export const sendEmbeddingFailureMessage = (error: unknown) => {
116
116
  };
117
117
 
118
118
  export const dispatchGenericEventToHost = (event: GenericEvent) => {
119
+ logger().info("Sending GenericEvent", { event });
120
+
119
121
  window.parent.postMessage(
120
122
  { type: MESSAGES.GENERIC_EVENT, payload: event },
121
123
  PARENT_ORIGIN,
@@ -62,12 +62,8 @@ export const sendEmbeddingContext = (
62
62
  // AP uses `url` instead of `wsConnectionUri` in older versions, so it needs
63
63
  // to be present to preserve backwards compatibility
64
64
  url: context.wsConnectionUri,
65
- wsConnectionUri: context.wsConnectionUri,
66
65
 
67
- restApiBaseUrl: context.restApiBaseUrl,
68
- userIdleTimeout: context.userIdleTimeout,
69
- sessionId: context.sessionId,
70
- jobId: context.jobId,
66
+ ...context,
71
67
  } satisfies EmbeddingContext,
72
68
  },
73
69
  targetOrigin,
@@ -5,6 +5,7 @@ import { useClipboard } from "@vueuse/core";
5
5
  import { Button } from "@knime/components";
6
6
  import CheckIcon from "@knime/styles/img/icons/check.svg";
7
7
  import CopyIcon from "@knime/styles/img/icons/copy.svg";
8
+ import { formatDateTimeString } from "@knime/utils";
8
9
 
9
10
  import type { RFCErrorData } from "./types";
10
11
 
@@ -29,19 +30,8 @@ const { copy, copied } = useClipboard({
29
30
 
30
31
  const showDetails = ref(false);
31
32
 
32
- const dateFormatOptions = {
33
- year: "numeric",
34
- month: "short",
35
- day: "numeric",
36
- hour: "numeric",
37
- minute: "numeric",
38
- second: "numeric",
39
- hour12: true,
40
- } as const;
41
-
42
33
  const formattedDate = computed(() => {
43
- const formatter = new Intl.DateTimeFormat(undefined, dateFormatOptions); // use default locale
44
- return formatter.format(props.date);
34
+ return props.date ? formatDateTimeString(props.date.getTime()) : "";
45
35
  });
46
36
 
47
37
  const errorForClipboard = computed(() => {
@@ -2,15 +2,26 @@ import { computed, reactive, readonly, ref } from "vue";
2
2
  import { FetchError, type FetchOptions } from "ofetch";
3
3
 
4
4
  import { useUploadManager } from "@knime/components";
5
- import { getFileMimeType, knimeFileFormats, promise } from "@knime/utils";
5
+ import {
6
+ formatFileSize,
7
+ getFileMimeType,
8
+ knimeFileFormats,
9
+ promise,
10
+ } from "@knime/utils";
6
11
 
7
12
  import { getFetchClient } from "../common/ofetchClient";
8
13
  import { rfcErrors } from "../rfcErrors";
9
14
 
10
15
  const DEFAULT_MAX_UPLOAD_QUEUE_SIZE = 10;
16
+ const DEFAULT_UPLOAD_SIZE_LIMIT_BYTES = 5 * 1024 * 1024 * 1024;
11
17
 
12
18
  const DEFAULT_RETRY_DELAY_MS = 50;
13
19
 
20
+ // Catalog & artifacts services currently have a limit for 5 GiB for
21
+ // upload and copy/move operations but it is not communicated to clients.
22
+ // Repeat the constant here to be able to still make a pre-check. See NXT-4510.
23
+ const getUploadSizeLimitBytes = () => DEFAULT_UPLOAD_SIZE_LIMIT_BYTES;
24
+
14
25
  type UseFileUploadOptions = {
15
26
  /**
16
27
  * Max number of concurrent uploads allowed in the upload queue.
@@ -265,6 +276,22 @@ export const useFileUpload = (options: UseFileUploadOptions = {}) => {
265
276
 
266
277
  start: async (parentId: string, files: File[]) => {
267
278
  const enqueableFiles = getEnqueueableFiles(files);
279
+ const uploadSizeLimitBytes = getUploadSizeLimitBytes();
280
+ const oversizedFiles = enqueableFiles.filter(
281
+ (file) => file.size > uploadSizeLimitBytes,
282
+ );
283
+
284
+ if (oversizedFiles.length > 0) {
285
+ throw new rfcErrors.RFCError({
286
+ title: "Upload size limit exceeded",
287
+ status: 413,
288
+ details: oversizedFiles.map(
289
+ (file) =>
290
+ `${file.name} (${formatFileSize(file.size)}) exceeds the upload limit of ${formatFileSize(uploadSizeLimitBytes)}.`,
291
+ ),
292
+ });
293
+ }
294
+
268
295
  try {
269
296
  if (enqueableFiles.length === 0) {
270
297
  return;