@strapi/data-transfer 4.15.0 → 4.15.1

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/dist/index.js CHANGED
@@ -3533,30 +3533,28 @@ const createPushController = handlerControllerFactory((proto) => ({
3533
3533
  return;
3534
3534
  }
3535
3535
  for (const item of payload) {
3536
- process.nextTick(async () => {
3537
- const { action: action2, assetID } = item;
3538
- if (!assetsStream) {
3539
- throw new Error("Stream not defined");
3540
- }
3541
- if (action2 === "start") {
3542
- this.assets[assetID] = { ...item.data, stream: new stream$1.PassThrough() };
3543
- writeAsync(assetsStream, this.assets[assetID]);
3544
- }
3545
- if (action2 === "stream") {
3546
- const rawBuffer = item.data;
3547
- const chunk = Buffer.from(rawBuffer.data);
3548
- await writeAsync(this.assets[assetID].stream, chunk);
3549
- }
3550
- if (action2 === "end") {
3551
- await new Promise((resolve, reject2) => {
3552
- const { stream: assetStream } = this.assets[assetID];
3553
- assetStream.on("close", () => {
3554
- delete this.assets[assetID];
3555
- resolve();
3556
- }).on("error", reject2).end();
3557
- });
3558
- }
3559
- });
3536
+ const { action: action2, assetID } = item;
3537
+ if (!assetsStream) {
3538
+ throw new Error("Stream not defined");
3539
+ }
3540
+ if (action2 === "start") {
3541
+ this.assets[assetID] = { ...item.data, stream: new stream$1.PassThrough() };
3542
+ writeAsync(assetsStream, this.assets[assetID]);
3543
+ }
3544
+ if (action2 === "stream") {
3545
+ const rawBuffer = item.data;
3546
+ const chunk = Buffer.from(rawBuffer.data);
3547
+ await writeAsync(this.assets[assetID].stream, chunk);
3548
+ }
3549
+ if (action2 === "end") {
3550
+ await new Promise((resolve, reject2) => {
3551
+ const { stream: assetStream } = this.assets[assetID];
3552
+ assetStream.on("close", () => {
3553
+ delete this.assets[assetID];
3554
+ resolve();
3555
+ }).on("error", reject2).end();
3556
+ });
3557
+ }
3560
3558
  }
3561
3559
  },
3562
3560
  onClose() {