@selvajs/compute 5.0.0-beta.3 → 5.0.0-beta.4

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.
@@ -367,6 +367,14 @@ type FileBaseInfo = {
367
367
  /** Optional directory path for archive organization (e.g., "extras/docs"). When omitted, file lands at archive root */
368
368
  subFolder?: string;
369
369
  };
370
+ type DownloadOptions = {
371
+ /**
372
+ * Saves each finished archive instead of the default `<a download>` click. For hosts where an
373
+ * anchor download doesn't work, such as an embedded WebView that hands saves to native code.
374
+ * Awaited when it returns a promise, so archives still save one at a time.
375
+ */
376
+ saveBlob?: (blob: Blob, fileName: string) => unknown;
377
+ };
370
378
  //#endregion
371
379
  //#region src/core/files/handle-files.d.ts
372
380
  /**
@@ -377,7 +385,7 @@ type FileBaseInfo = {
377
385
  */
378
386
  declare const extractFilesFromComputeResponse: (downloadableFiles: FileData[], additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<ProcessedFile[]>;
379
387
  /** Downloads files from a compute response as a ZIP archive. */
380
- declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<void>;
388
+ declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null, options?: DownloadOptions) => Promise<void>;
381
389
  /**
382
390
  * Download one archive per `Sub Folder` root (see {@link groupFilesByRoot}). Files with no root go
383
391
  * into `fallbackName`, so a definition that never sets `Sub Folder` downloads as one archive.
@@ -388,8 +396,9 @@ declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername:
388
396
  * @param downloadableFiles - `FileData` items from the compute response.
389
397
  * @param fallbackName - Archive name for files with no `Sub Folder` root.
390
398
  * @param additionalFiles - Extra files to package; they carry no root and join the fallback archive.
399
+ * @param options - `saveBlob` replaces the anchor download for every archive.
391
400
  */
392
- declare const downloadFileDataByRoot: (downloadableFiles: FileData[], fallbackName: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<void>;
401
+ declare const downloadFileDataByRoot: (downloadableFiles: FileData[], fallbackName: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null, options?: DownloadOptions) => Promise<void>;
393
402
  //#endregion
394
403
  //#region src/core/files/sub-folder.d.ts
395
404
  /**
@@ -423,5 +432,5 @@ declare const groupFilesByRoot: <T extends Pick<FileData, "subFolder">>(files: r
423
432
  files: T[];
424
433
  }>;
425
434
  //#endregion
426
- export { ServerTiming as A, getLogger as C, ComputeConfig as D, ComputeAuth as E, ErrorCode as M, ErrorCodes as N, RetryPolicy as O, enableDebugLogging as S, fetchCompute as T, isDefinitionRef as _, extractFilesFromComputeResponse as a, readField as b, ProcessedFile as c, classifyProbeFailure as d, DEFAULT_BLOCKED_HOST as f, SolveDefinition as g, DefinitionRef as h, downloadFileDataByRoot as i, ComputeError as j, ServerErrorCodeMap as k, ProbeFailure as l, validateServerUrl as m, subFolderSegments as n, FileBaseInfo as o, ValidateServerUrlOptions as p, downloadFileData as r, FileData as s, groupFilesByRoot as t, ProbeVerdict as u, decodeBase64ToBinary as v, setLogger as w, Logger as x, hasField as y };
427
- //# sourceMappingURL=index-CyKrrYnz.d.ts.map
435
+ export { ServerErrorCodeMap as A, enableDebugLogging as C, ComputeAuth as D, fetchCompute as E, ComputeError as M, ErrorCode as N, ComputeConfig as O, ErrorCodes as P, Logger as S, setLogger as T, SolveDefinition as _, extractFilesFromComputeResponse as a, hasField as b, FileData as c, ProbeVerdict as d, classifyProbeFailure as f, DefinitionRef as g, validateServerUrl as h, downloadFileDataByRoot as i, ServerTiming as j, RetryPolicy as k, ProcessedFile as l, ValidateServerUrlOptions as m, subFolderSegments as n, DownloadOptions as o, DEFAULT_BLOCKED_HOST as p, downloadFileData as r, FileBaseInfo as s, groupFilesByRoot as t, ProbeFailure as u, isDefinitionRef as v, getLogger as w, readField as x, decodeBase64ToBinary as y };
436
+ //# sourceMappingURL=index-cMvSohkf.d.cts.map
@@ -367,6 +367,14 @@ type FileBaseInfo = {
367
367
  /** Optional directory path for archive organization (e.g., "extras/docs"). When omitted, file lands at archive root */
368
368
  subFolder?: string;
369
369
  };
370
+ type DownloadOptions = {
371
+ /**
372
+ * Saves each finished archive instead of the default `<a download>` click. For hosts where an
373
+ * anchor download doesn't work, such as an embedded WebView that hands saves to native code.
374
+ * Awaited when it returns a promise, so archives still save one at a time.
375
+ */
376
+ saveBlob?: (blob: Blob, fileName: string) => unknown;
377
+ };
370
378
  //#endregion
371
379
  //#region src/core/files/handle-files.d.ts
372
380
  /**
@@ -377,7 +385,7 @@ type FileBaseInfo = {
377
385
  */
378
386
  declare const extractFilesFromComputeResponse: (downloadableFiles: FileData[], additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<ProcessedFile[]>;
379
387
  /** Downloads files from a compute response as a ZIP archive. */
380
- declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<void>;
388
+ declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null, options?: DownloadOptions) => Promise<void>;
381
389
  /**
382
390
  * Download one archive per `Sub Folder` root (see {@link groupFilesByRoot}). Files with no root go
383
391
  * into `fallbackName`, so a definition that never sets `Sub Folder` downloads as one archive.
@@ -388,8 +396,9 @@ declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername:
388
396
  * @param downloadableFiles - `FileData` items from the compute response.
389
397
  * @param fallbackName - Archive name for files with no `Sub Folder` root.
390
398
  * @param additionalFiles - Extra files to package; they carry no root and join the fallback archive.
399
+ * @param options - `saveBlob` replaces the anchor download for every archive.
391
400
  */
392
- declare const downloadFileDataByRoot: (downloadableFiles: FileData[], fallbackName: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<void>;
401
+ declare const downloadFileDataByRoot: (downloadableFiles: FileData[], fallbackName: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null, options?: DownloadOptions) => Promise<void>;
393
402
  //#endregion
394
403
  //#region src/core/files/sub-folder.d.ts
395
404
  /**
@@ -423,5 +432,5 @@ declare const groupFilesByRoot: <T extends Pick<FileData, "subFolder">>(files: r
423
432
  files: T[];
424
433
  }>;
425
434
  //#endregion
426
- export { ServerTiming as A, getLogger as C, ComputeConfig as D, ComputeAuth as E, ErrorCode as M, ErrorCodes as N, RetryPolicy as O, enableDebugLogging as S, fetchCompute as T, isDefinitionRef as _, extractFilesFromComputeResponse as a, readField as b, ProcessedFile as c, classifyProbeFailure as d, DEFAULT_BLOCKED_HOST as f, SolveDefinition as g, DefinitionRef as h, downloadFileDataByRoot as i, ComputeError as j, ServerErrorCodeMap as k, ProbeFailure as l, validateServerUrl as m, subFolderSegments as n, FileBaseInfo as o, ValidateServerUrlOptions as p, downloadFileData as r, FileData as s, groupFilesByRoot as t, ProbeVerdict as u, decodeBase64ToBinary as v, setLogger as w, Logger as x, hasField as y };
427
- //# sourceMappingURL=index-CyKrrYnz.d.cts.map
435
+ export { ServerErrorCodeMap as A, enableDebugLogging as C, ComputeAuth as D, fetchCompute as E, ComputeError as M, ErrorCode as N, ComputeConfig as O, ErrorCodes as P, Logger as S, setLogger as T, SolveDefinition as _, extractFilesFromComputeResponse as a, hasField as b, FileData as c, ProbeVerdict as d, classifyProbeFailure as f, DefinitionRef as g, validateServerUrl as h, downloadFileDataByRoot as i, ServerTiming as j, RetryPolicy as k, ProcessedFile as l, ValidateServerUrlOptions as m, subFolderSegments as n, DownloadOptions as o, DEFAULT_BLOCKED_HOST as p, downloadFileData as r, FileBaseInfo as s, groupFilesByRoot as t, ProbeFailure as u, isDefinitionRef as v, getLogger as w, readField as x, decodeBase64ToBinary as y };
436
+ //# sourceMappingURL=index-cMvSohkf.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/compute",
3
- "version": "5.0.0-beta.3",
3
+ "version": "5.0.0-beta.4",
4
4
  "description": "TypeScript library for Rhino Compute Server - Grasshopper and RhinoCommon",
5
5
  "author": "VektorNode",
6
6
  "license": "MIT",