zkcloudworker 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/lib/ts/src/cloud/config.d.ts +1 -0
  2. package/lib/ts/src/cloud/config.js +2 -1
  3. package/lib/{web/src/cloud/utils/hash.d.ts → ts/src/cloud/utils/base64.d.ts} +0 -1
  4. package/lib/ts/src/cloud/utils/{hash.js → base64.js} +1 -11
  5. package/lib/ts/src/cloud/utils/index.d.ts +1 -2
  6. package/lib/ts/src/cloud/utils/index.js +1 -2
  7. package/lib/ts/src/mina/local/local.js +16 -11
  8. package/lib/ts/src/mina/utils/base64.js +5 -5
  9. package/lib/ts/tsconfig.tsbuildinfo +1 -1
  10. package/lib/web/src/cloud/config.d.ts +1 -0
  11. package/lib/web/src/cloud/config.js +2 -1
  12. package/lib/web/src/cloud/config.js.map +1 -1
  13. package/lib/{ts/src/cloud/utils/hash.d.ts → web/src/cloud/utils/base64.d.ts} +0 -1
  14. package/lib/web/src/cloud/utils/{hash.js → base64.js} +1 -7
  15. package/lib/web/src/cloud/utils/base64.js.map +1 -0
  16. package/lib/web/src/cloud/utils/index.d.ts +1 -2
  17. package/lib/web/src/cloud/utils/index.js +1 -2
  18. package/lib/web/src/cloud/utils/index.js.map +1 -1
  19. package/lib/web/src/mina/local/local.js +15 -10
  20. package/lib/web/src/mina/local/local.js.map +1 -1
  21. package/lib/web/src/mina/utils/base64.js +1 -1
  22. package/lib/web/src/mina/utils/base64.js.map +1 -1
  23. package/lib/web/tsconfig.web.tsbuildinfo +1 -1
  24. package/package.json +4 -4
  25. package/lib/ts/src/cloud/utils/files.d.ts +0 -11
  26. package/lib/ts/src/cloud/utils/files.js +0 -74
  27. package/lib/web/src/cloud/utils/files.d.ts +0 -11
  28. package/lib/web/src/cloud/utils/files.js +0 -65
  29. package/lib/web/src/cloud/utils/files.js.map +0 -1
  30. package/lib/web/src/cloud/utils/hash.js.map +0 -1
@@ -1,65 +0,0 @@
1
- import fs from "fs/promises";
2
- export async function saveFile(params) {
3
- const { data, filename } = params;
4
- const folder = "./data/";
5
- const name = folder + filename + ".json";
6
- try {
7
- await fs.access("./data");
8
- }
9
- catch (e) {
10
- // if not, create it
11
- await fs.mkdir("./data");
12
- }
13
- try {
14
- await fs.writeFile(name, JSON.stringify(data, null, 2));
15
- return name;
16
- }
17
- catch (e) {
18
- console.error(`Error writing file ${name}`);
19
- return undefined;
20
- }
21
- }
22
- export async function loadFile(filename) {
23
- const name = "./data/" + filename + ".json";
24
- try {
25
- const filedata = await fs.readFile(name, "utf8");
26
- const data = JSON.parse(filedata);
27
- return data;
28
- }
29
- catch (e) {
30
- console.error(`File ${name} does not exist or has wrong format`);
31
- return undefined;
32
- }
33
- }
34
- export async function saveBinaryFile(params) {
35
- const { data, filename } = params;
36
- const folder = "./data/";
37
- const name = folder + filename + ".bin";
38
- try {
39
- await fs.access("./data");
40
- }
41
- catch (e) {
42
- // if not, create it
43
- await fs.mkdir("./data");
44
- }
45
- try {
46
- await fs.writeFile(name, data);
47
- return name;
48
- }
49
- catch (e) {
50
- console.error(`Error writing file ${name}`);
51
- return undefined;
52
- }
53
- }
54
- export async function loadBinaryFile(filename) {
55
- const name = "./data/" + filename + ".bin";
56
- try {
57
- const data = await fs.readFile(name);
58
- return data;
59
- }
60
- catch (e) {
61
- console.error(`File ${name} does not exist or has wrong format`);
62
- return undefined;
63
- }
64
- }
65
- //# sourceMappingURL=files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../../../src/cloud/utils/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAI9B;IACC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAClC,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzC,IAAI,CAAC;QACH,MAA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