@strapi/data-transfer 4.14.5 → 4.14.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.
package/dist/index.mjs CHANGED
@@ -3579,30 +3579,28 @@ const createPushController = handlerControllerFactory((proto) => ({
3579
3579
  return;
3580
3580
  }
3581
3581
  for (const item of payload) {
3582
- process.nextTick(async () => {
3583
- const { action: action2, assetID } = item;
3584
- if (!assetsStream) {
3585
- throw new Error("Stream not defined");
3586
- }
3587
- if (action2 === "start") {
3588
- this.assets[assetID] = { ...item.data, stream: new PassThrough() };
3589
- writeAsync(assetsStream, this.assets[assetID]);
3590
- }
3591
- if (action2 === "stream") {
3592
- const rawBuffer = item.data;
3593
- const chunk = Buffer.from(rawBuffer.data);
3594
- await writeAsync(this.assets[assetID].stream, chunk);
3595
- }
3596
- if (action2 === "end") {
3597
- await new Promise((resolve, reject2) => {
3598
- const { stream: assetStream } = this.assets[assetID];
3599
- assetStream.on("close", () => {
3600
- delete this.assets[assetID];
3601
- resolve();
3602
- }).on("error", reject2).end();
3603
- });
3604
- }
3605
- });
3582
+ const { action: action2, assetID } = item;
3583
+ if (!assetsStream) {
3584
+ throw new Error("Stream not defined");
3585
+ }
3586
+ if (action2 === "start") {
3587
+ this.assets[assetID] = { ...item.data, stream: new PassThrough() };
3588
+ writeAsync(assetsStream, this.assets[assetID]);
3589
+ }
3590
+ if (action2 === "stream") {
3591
+ const rawBuffer = item.data;
3592
+ const chunk = Buffer.from(rawBuffer.data);
3593
+ await writeAsync(this.assets[assetID].stream, chunk);
3594
+ }
3595
+ if (action2 === "end") {
3596
+ await new Promise((resolve, reject2) => {
3597
+ const { stream: assetStream } = this.assets[assetID];
3598
+ assetStream.on("close", () => {
3599
+ delete this.assets[assetID];
3600
+ resolve();
3601
+ }).on("error", reject2).end();
3602
+ });
3603
+ }
3606
3604
  }
3607
3605
  },
3608
3606
  onClose() {