@orangelogic/design-system 4.61.0 → 4.62.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "4.61.0",
4
+ "version": "4.62.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -32,6 +32,16 @@ export declare class ChunkDownloader extends BackgroundJob {
32
32
  private locker;
33
33
  static readonly type: string;
34
34
  private static readonly _roundRobinMapPerFile;
35
+ private static readonly _inFlightChunksPerFile;
36
+ private static readonly _lastActiveAtPerFile;
37
+ /**
38
+ * Files with a chunk in flight, or whose last chunk ended within `graceMs`.
39
+ * The grace window covers the gap between one chunk finishing and the next being picked up.
40
+ */
41
+ static getActiveFileIDs(graceMs: number, now?: number): string[];
42
+ static resetActiveFiles(): void;
43
+ private static markChunkStarted;
44
+ private static markChunkEnded;
35
45
  constructor(chunksRepo: IDownloadChunksRepository, filesRepo: IDownloadFilesRepository, apiClient: IDownloadApiClient, storage: IStorage, eventHub: IEventHub, retrier: IRetrier, locker: ILocker, logger: ILogger, context: DownloadContext);
36
46
  static logsProvider: {
37
47
  error: {
@@ -2,14 +2,19 @@ import { DownloadContext } from '../context';
2
2
  import { Event, IEventHub } from '../events';
3
3
  import { ILogger } from '../utilities';
4
4
  import { BackgroundJob } from './BackgroundJob';
5
+ /** How long a file stays "active" after its last chunk ends, to avoid Downloading/Queued flicker between chunks. */
6
+ export declare const ACTIVE_FILE_GRACE_MS = 5000;
5
7
  export declare class DownloadSpeedUpdatedEvent extends Event {
6
8
  readonly speed: number;
9
+ readonly activeFileIDs?: string[] | undefined;
7
10
  static readonly type: string;
8
11
  /**
9
12
  *
10
13
  * @param speed bytes per second
14
+ * @param activeFileIDs files currently transferring data; other Downloading files are waiting for a slot.
15
+ * An array, not a Set, because events are cloned across tabs.
11
16
  */
12
- constructor(speed: number);
17
+ constructor(speed: number, activeFileIDs?: string[] | undefined);
13
18
  }
14
19
  export declare class DownloadSpeedMonitor extends BackgroundJob {
15
20
  private eventHub;
@@ -86,6 +86,7 @@ export declare enum DownloadFileState {
86
86
  WaitingServerProcessing = "WaitingServerProcessing"
87
87
  }
88
88
  export declare enum DownloadFileStateDetails {
89
+ AssemblingErrorMessage = "AssemblingErrorMessage",
89
90
  MissingFileErrorMessage = "MissingFileErrorMessage",
90
91
  NetworkErrorMessage = "NetworkErrorMessage",
91
92
  NotEnoughStorageErrorMessage = "NotEnoughStorageErrorMessage"
@@ -52,6 +52,7 @@ export type DependenciesAnalyzer<T extends CoreContext<any, any>> = {
52
52
  };
53
53
  type ConfigurationData = {
54
54
  allowForcedDownloadLocation: boolean;
55
+ assemblingErrorMessage?: string;
55
56
  autoUnlockAfterMinutes: number;
56
57
  backgroundJobDefaultInterval: number;
57
58
  chunkSize: number;
@@ -7,6 +7,7 @@ export declare const storageKey: {
7
7
  };
8
8
  export declare const STATUS_COLORS: {
9
9
  downloading: string;
10
+ queued: string;
10
11
  assembling: string;
11
12
  waitingServerProcessing: string;
12
13
  paused: string;
@@ -16,6 +17,7 @@ export declare const STATUS_COLORS: {
16
17
  };
17
18
  export declare const ICON_COLORS: {
18
19
  downloading: string;
20
+ queued: string;
19
21
  assembling: string;
20
22
  waitingServerProcessing: string;
21
23
  paused: string;
@@ -25,6 +27,7 @@ export declare const ICON_COLORS: {
25
27
  };
26
28
  export declare const STATUS_VARIANTS_MAP: {
27
29
  downloading: string;
30
+ queued: string;
28
31
  assembling: string;
29
32
  waitingServerProcessing: string;
30
33
  paused: string;
@@ -128,6 +128,8 @@ export default class CxDownloader extends CortexElement {
128
128
  private totalSize;
129
129
  updateTotalSize(): Promise<void>;
130
130
  private countByStatus;
131
+ /** Files the worker is transferring right now; null until the worker reports. */
132
+ private activeFileIDs;
131
133
  updateCountByStatus(): Promise<void>;
132
134
  private isAllDownloadingFilesCompleted;
133
135
  updateIsAllDownloadingFilesCompleted(): Promise<void>;
@@ -1,6 +1,15 @@
1
- import { DownloadItem } from '../../../types/src/downloader';
1
+ import { DownloadItem, STATUS } from '../../../types/src/downloader';
2
2
  import { DownloadItem as CoreDownloadItem } from './data/core/worker/app/queries/DownloadItem';
3
3
  export declare const getMissingProperties: (obj1: Record<string, any>, obj2: Record<string, any>) => string[];
4
4
  export declare const isDownloadingFile: (file: DownloadItem) => boolean;
5
5
  export declare function getFileSizeKB(file: DownloadItem): number;
6
- export declare function mapDownloadFile(item: CoreDownloadItem): DownloadItem;
6
+ /**
7
+ * Downloading vs Queued for a file the worker has started: a file holding no download slot is waiting, not stuck.
8
+ * `activeFileIDs` null means not reported yet, so keep Downloading.
9
+ */
10
+ export declare function getActiveStatus(id: string, activeFileIDs: ReadonlySet<string> | null): STATUS.Downloading | STATUS.Queued;
11
+ /** A stored Queued status is stale once the worker restarts; show Downloading until it reports again. */
12
+ export declare const resetQueuedStatus: (file: DownloadItem) => DownloadItem;
13
+ /** Re-derive Downloading/Queued for already-mapped items; returns the same object when nothing changed. */
14
+ export declare function applyActiveFiles(files: Record<string, DownloadItem>, activeFileIDs: ReadonlySet<string> | null): Record<string, DownloadItem>;
15
+ export declare function mapDownloadFile(item: CoreDownloadItem, activeFileIDs?: ReadonlySet<string> | null): DownloadItem;
@@ -5,6 +5,7 @@ export declare enum STATUS {
5
5
  Downloading = "downloading",
6
6
  Failed = "failed",
7
7
  Paused = "paused",
8
+ Queued = "queued",
8
9
  WaitingServerProcessing = "waitingServerProcessing"
9
10
  }
10
11
  export declare const STATUS_LABELS_MAP: {
@@ -14,6 +15,7 @@ export declare const STATUS_LABELS_MAP: {
14
15
  downloading: string;
15
16
  failed: string;
16
17
  paused: string;
18
+ queued: string;
17
19
  waitingServerProcessing: string;
18
20
  };
19
21
  export declare enum UNIT {
@@ -34,6 +36,7 @@ export interface DownloadItem {
34
36
  unit: UNIT;
35
37
  }
36
38
  export declare enum DownloadFileStateDetails {
39
+ AssemblingErrorMessage = "AssemblingErrorMessage",
37
40
  MissingFileErrorMessage = "MissingFileErrorMessage",
38
41
  NetworkErrorMessage = "NetworkErrorMessage",
39
42
  NotEnoughStorageErrorMessage = "NotEnoughStorageErrorMessage"
@@ -73,7 +73,7 @@
73
73
  export type CxDownloaderRaw = { "value": string; };
74
74
  export type CxDownloaderEvent = any;
75
75
  export type CxDownloaderAction = { "doNothing": boolean; };
76
- export type CxDownloaderConfigurationData = { "allowForcedDownloadLocation": boolean; "autoUnlockAfterMinutes": number; "backgroundJobDefaultInterval": number; "chunkSize": number; "dateFormat": string; "defaultMode": "normal" | "rocket"; "downloadChunkMaxRetries": number; "downloadChunkRetryMaxWait": number; "downloadChunkRetryMinWait": number; "downloadDirectlyFromCloudIfPossible": boolean; "downloadSpeedMonitorDuration": number; "instructionsPopupHeight": number; "instructionsPopupWidth": number; "massActionBatchSize": number; "maxChunkSize": number; "maxRetryPerChunk": number; "minChunkSize": number; "missingFileErrorMessage": string; "networkErrorMessage": string; "normalMode": { "backgroundJobInstancesCount": dictionary; "backgroundJobInterval": dictionary; "maxInProgressChunksPerFile": number; }; "notEnoughStorageErrorMessage": string; "popupId": string; "rocketMode": { "backgroundJobInstancesCount": dictionary; "backgroundJobInterval": dictionary; "maxInProgressChunksPerFile": number; }; "roundRobinCloudURLs": boolean; "shouldHandlePathLimit": boolean; "verbose": boolean; };
76
+ export type CxDownloaderConfigurationData = { "allowForcedDownloadLocation": boolean; "assemblingErrorMessage": string; "autoUnlockAfterMinutes": number; "backgroundJobDefaultInterval": number; "chunkSize": number; "dateFormat": string; "defaultMode": "normal" | "rocket"; "downloadChunkMaxRetries": number; "downloadChunkRetryMaxWait": number; "downloadChunkRetryMinWait": number; "downloadDirectlyFromCloudIfPossible": boolean; "downloadSpeedMonitorDuration": number; "instructionsPopupHeight": number; "instructionsPopupWidth": number; "massActionBatchSize": number; "maxChunkSize": number; "maxRetryPerChunk": number; "minChunkSize": number; "missingFileErrorMessage": string; "networkErrorMessage": string; "normalMode": { "backgroundJobInstancesCount": dictionary; "backgroundJobInterval": dictionary; "maxInProgressChunksPerFile": number; }; "notEnoughStorageErrorMessage": string; "popupId": string; "rocketMode": { "backgroundJobInstancesCount": dictionary; "backgroundJobInterval": dictionary; "maxInProgressChunksPerFile": number; }; "roundRobinCloudURLs": boolean; "shouldHandlePathLimit": boolean; "verbose": boolean; };
77
77
  export type CxFileOnDemandAssetsProp = { "assets": CxFileOnDemandAsset[]; "hasMore": boolean; };
78
78
  export type CxFileOnDemandAsset = { "assetsCount": number; "childrenCount": number; "docType": string; "fileName": string; "isInFavorite": boolean; "isPaused": boolean; "isPinned": boolean; "isUploadCompleted": boolean; "key": string; "parentRecordId": string; "recordId": string; "remainingSize": number; "remainingTime": number; "size": number; "thumbnail": string; "uploadErrorMessage": string; "uploadId": string; "uploadStatus": "CANCELED" | "FAILED" | "INPROGRESS" | "PENDINGCOMPLETE" | "SUCCESS"; "uploadTimestamp": number; "uploaded": number; };
79
79
  export type CxFileOnDemandSettings = { "cacheLocation": string; "cacheSize": number; "cacheUsage": number; "config": { "latestVersion": string; "monitoringActivated": boolean; "mountPoint": string; "mountProxy": boolean; "proxyTypes": "Image" | "Video" | "Audio" | "All"[]; "rootIDs": string[]; "siteUrl": string; "version": string; }; };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "4.61.0",
4
+ "version": "4.62.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {