@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.js CHANGED
@@ -3612,30 +3612,28 @@ const createPushController = handlerControllerFactory((proto) => ({
3612
3612
  return;
3613
3613
  }
3614
3614
  for (const item of payload) {
3615
- process.nextTick(async () => {
3616
- const { action: action2, assetID } = item;
3617
- if (!assetsStream) {
3618
- throw new Error("Stream not defined");
3619
- }
3620
- if (action2 === "start") {
3621
- this.assets[assetID] = { ...item.data, stream: new stream$1.PassThrough() };
3622
- writeAsync(assetsStream, this.assets[assetID]);
3623
- }
3624
- if (action2 === "stream") {
3625
- const rawBuffer = item.data;
3626
- const chunk = Buffer.from(rawBuffer.data);
3627
- await writeAsync(this.assets[assetID].stream, chunk);
3628
- }
3629
- if (action2 === "end") {
3630
- await new Promise((resolve, reject2) => {
3631
- const { stream: assetStream } = this.assets[assetID];
3632
- assetStream.on("close", () => {
3633
- delete this.assets[assetID];
3634
- resolve();
3635
- }).on("error", reject2).end();
3636
- });
3637
- }
3638
- });
3615
+ const { action: action2, assetID } = item;
3616
+ if (!assetsStream) {
3617
+ throw new Error("Stream not defined");
3618
+ }
3619
+ if (action2 === "start") {
3620
+ this.assets[assetID] = { ...item.data, stream: new stream$1.PassThrough() };
3621
+ writeAsync(assetsStream, this.assets[assetID]);
3622
+ }
3623
+ if (action2 === "stream") {
3624
+ const rawBuffer = item.data;
3625
+ const chunk = Buffer.from(rawBuffer.data);
3626
+ await writeAsync(this.assets[assetID].stream, chunk);
3627
+ }
3628
+ if (action2 === "end") {
3629
+ await new Promise((resolve, reject2) => {
3630
+ const { stream: assetStream } = this.assets[assetID];
3631
+ assetStream.on("close", () => {
3632
+ delete this.assets[assetID];
3633
+ resolve();
3634
+ }).on("error", reject2).end();
3635
+ });
3636
+ }
3639
3637
  }
3640
3638
  },
3641
3639
  onClose() {