@flowscripter/pluggable-io-framework 1.2.5 → 1.2.6

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 +1 @@
1
- {"version":3,"file":"copyMove.d.ts","sourceRoot":"","sources":["../../src/copyMove.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEnB,KAAK,UAAU,EAIf,KAAK,cAAc,EACpB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,6FAA6F;IAC7F,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACjD,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B;AA+WD;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CACxB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,CACxB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAOf"}
1
+ {"version":3,"file":"copyMove.d.ts","sourceRoot":"","sources":["../../src/copyMove.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEnB,KAAK,UAAU,EAIf,KAAK,cAAc,EACpB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,6FAA6F;IAC7F,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACjD,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmXD;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CACxB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,CACxB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -183,15 +183,18 @@ async function resolveRecursiveDestRoot(sourcePath, sink, destPath) {
183
183
  return joinPath(destPath, baseName);
184
184
  }
185
185
  async function recursiveTransfer(source, sourcePath, sink, destPath, options, mode) {
186
+ const resolvedDestRoot = await resolveRecursiveDestRoot(sourcePath, sink, destPath);
186
187
  if (source.canDirectTransfer?.(sink) && source.supportsRecursiveDirectTransfer) {
187
- const directFn = mode === "copy" ? source.directCopy : source.directMove;
188
- if (directFn) {
189
- const operationId = crypto.randomUUID();
190
- await directFn(sourcePath, destPath, { operationId, hooks: options.telemetry ?? {} });
188
+ const telemetry = { operationId: crypto.randomUUID(), hooks: options.telemetry ?? {} };
189
+ if (mode === "copy" && source.directCopy) {
190
+ await source.directCopy(sourcePath, resolvedDestRoot, telemetry);
191
+ return;
192
+ }
193
+ if (mode === "move" && source.directMove) {
194
+ await source.directMove(sourcePath, resolvedDestRoot, telemetry);
191
195
  return;
192
196
  }
193
197
  }
194
- const resolvedDestRoot = await resolveRecursiveDestRoot(sourcePath, sink, destPath);
195
198
  const recursiveOperationId = crypto.randomUUID();
196
199
  const limiter = options.concurrencyLimiter ?? defaultConcurrencyLimiter;
197
200
  let discovered = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/pluggable-io-framework",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "A pluggable source/sink IO framework using https://github.com/flowscripter/dynamic-plugin-framework",
5
5
  "keywords": [
6
6
  "bun",
package/src/copyMove.ts CHANGED
@@ -324,16 +324,20 @@ async function recursiveTransfer(
324
324
  options: TransferOptions,
325
325
  mode: "copy" | "move",
326
326
  ): Promise<void> {
327
+ const resolvedDestRoot = await resolveRecursiveDestRoot(sourcePath, sink, destPath);
328
+
327
329
  if (source.canDirectTransfer?.(sink) && source.supportsRecursiveDirectTransfer) {
328
- const directFn = mode === "copy" ? source.directCopy : source.directMove;
329
- if (directFn) {
330
- const operationId = crypto.randomUUID();
331
- await directFn(sourcePath, destPath, { operationId, hooks: options.telemetry ?? {} });
330
+ const telemetry = { operationId: crypto.randomUUID(), hooks: options.telemetry ?? {} };
331
+ if (mode === "copy" && source.directCopy) {
332
+ await source.directCopy(sourcePath, resolvedDestRoot, telemetry);
333
+ return;
334
+ }
335
+ if (mode === "move" && source.directMove) {
336
+ await source.directMove(sourcePath, resolvedDestRoot, telemetry);
332
337
  return;
333
338
  }
334
339
  }
335
340
 
336
- const resolvedDestRoot = await resolveRecursiveDestRoot(sourcePath, sink, destPath);
337
341
  const recursiveOperationId = crypto.randomUUID();
338
342
  const limiter = options.concurrencyLimiter ?? defaultConcurrencyLimiter;
339
343