@vivix-labs/media-tools 1.0.0-beta.22 → 1.0.0-beta.23

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/server.js CHANGED
@@ -376,6 +376,15 @@ import { mkdir, open, rename, readFile } from "fs/promises";
376
376
  import { join } from "path";
377
377
  import { fileURLToPath } from "url";
378
378
  import { randomUUID } from "crypto";
379
+ async function syncDirectory(directory, platform = process.platform) {
380
+ if (platform === "win32") return;
381
+ const parent = await open(directory, "r");
382
+ try {
383
+ await parent.sync();
384
+ } finally {
385
+ await parent.close();
386
+ }
387
+ }
379
388
  async function durableRecord(directory, name, value) {
380
389
  const path = join(directory, name), temporary = path + "." + randomUUID() + ".tmp";
381
390
  const file = await open(temporary, "wx", 384);
@@ -386,12 +395,7 @@ async function durableRecord(directory, name, value) {
386
395
  await file.close();
387
396
  }
388
397
  await rename(temporary, path);
389
- const parent = await open(directory, "r");
390
- try {
391
- await parent.sync();
392
- } finally {
393
- await parent.close();
394
- }
398
+ await syncDirectory(directory);
395
399
  }
396
400
  async function commandClosed(directory, expected, requireProof = true) {
397
401
  let identity;
package/dist/shared.d.ts CHANGED
@@ -747,9 +747,9 @@ declare const exportSettings: z.ZodObject<{
747
747
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
748
748
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
749
749
  quality: z.ZodEnum<{
750
+ small: "small";
750
751
  high: "high";
751
752
  standard: "standard";
752
- small: "small";
753
753
  }>;
754
754
  audio: z.ZodBoolean;
755
755
  }, z.core.$strict>;
@@ -817,9 +817,9 @@ declare const processSequence: z.ZodObject<{
817
817
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
818
818
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
819
819
  quality: z.ZodEnum<{
820
+ small: "small";
820
821
  high: "high";
821
822
  standard: "standard";
822
- small: "small";
823
823
  }>;
824
824
  audio: z.ZodBoolean;
825
825
  }, z.core.$strict>>;
@@ -970,9 +970,9 @@ declare const mediaRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
970
970
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
971
971
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
972
972
  quality: z.ZodEnum<{
973
+ small: "small";
973
974
  high: "high";
974
975
  standard: "standard";
975
- small: "small";
976
976
  }>;
977
977
  audio: z.ZodBoolean;
978
978
  }, z.core.$strict>>;
@@ -1141,9 +1141,9 @@ declare const jobsQuery: z.ZodObject<{
1141
1141
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
1142
1142
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
1143
1143
  quality: z.ZodEnum<{
1144
+ small: "small";
1144
1145
  high: "high";
1145
1146
  standard: "standard";
1146
- small: "small";
1147
1147
  }>;
1148
1148
  audio: z.ZodBoolean;
1149
1149
  }, z.core.$strict>>;
package/dist/worker.js CHANGED
@@ -12,6 +12,15 @@ var deadline;
12
12
  var send = (value) => {
13
13
  if (process.connected) process.send?.(value);
14
14
  };
15
+ async function syncDirectory(directory, platform = process.platform) {
16
+ if (platform === "win32") return;
17
+ const handle = await open(directory, "r");
18
+ try {
19
+ await handle.sync();
20
+ } finally {
21
+ await handle.close();
22
+ }
23
+ }
15
24
  async function record(name, value) {
16
25
  if (!active) return;
17
26
  const path = join(active.directory, name);
@@ -24,12 +33,7 @@ async function record(name, value) {
24
33
  await file.close();
25
34
  }
26
35
  await rename(temporary, path);
27
- const directory = await open(active.directory, "r");
28
- try {
29
- await directory.sync();
30
- } finally {
31
- await directory.close();
32
- }
36
+ await syncDirectory(active.directory);
33
37
  }
34
38
  function stop(code) {
35
39
  reason ??= code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/media-tools",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.23",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",