@seedprotocol/sdk 0.2.46 → 0.2.48

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.
Files changed (66) hide show
  1. package/dist/{ArweaveClient-CoFomTCN.js → ArweaveClient-Dcqcpsq4.js} +2 -2
  2. package/dist/{ArweaveClient-DQrXvrNN.js.map → ArweaveClient-Dcqcpsq4.js.map} +1 -1
  3. package/dist/{ArweaveClient-DQrXvrNN.js → ArweaveClient-Dh7LRIqD.js} +2 -2
  4. package/dist/{ArweaveClient-CoFomTCN.js.map → ArweaveClient-Dh7LRIqD.js.map} +1 -1
  5. package/dist/{Db-5C5VqRWb.js → Db-BhLWMUOe.js} +7 -7
  6. package/dist/Db-BhLWMUOe.js.map +1 -0
  7. package/dist/{Db-Dv890NJZ.js → Db-DrcygP77.js} +3 -4
  8. package/dist/{Db-Dv890NJZ.js.map → Db-DrcygP77.js.map} +1 -1
  9. package/dist/{EasClient-CBu9ENAi.js → EasClient-A1xC7Gm-.js} +2 -2
  10. package/dist/{EasClient-sCbTHcO8.js.map → EasClient-A1xC7Gm-.js.map} +1 -1
  11. package/dist/{EasClient-sCbTHcO8.js → EasClient-m2mXad59.js} +2 -2
  12. package/dist/{EasClient-CBu9ENAi.js.map → EasClient-m2mXad59.js.map} +1 -1
  13. package/dist/{FileManager-COOp89Mj.js → FileManager-Dv2zn1RW.js} +12 -2
  14. package/dist/FileManager-Dv2zn1RW.js.map +1 -0
  15. package/dist/{Item-BmPvgaG4.js → Item-D0rGmrZg.js} +3 -4
  16. package/dist/{Item-BmPvgaG4.js.map → Item-D0rGmrZg.js.map} +1 -1
  17. package/dist/{ItemProperty-BW4k1h0o.js → ItemProperty-D0tkeKx1.js} +3 -4
  18. package/dist/{ItemProperty-BW4k1h0o.js.map → ItemProperty-D0tkeKx1.js.map} +1 -1
  19. package/dist/{QueryClient-BBaE-LKI.js → QueryClient-C-hFMF2j.js} +2 -2
  20. package/dist/{QueryClient-BBaE-LKI.js.map → QueryClient-C-hFMF2j.js.map} +1 -1
  21. package/dist/{QueryClient-C-ZzUnWq.js → QueryClient-C02sPZ-K.js} +2 -2
  22. package/dist/{QueryClient-C-ZzUnWq.js.map → QueryClient-C02sPZ-K.js.map} +1 -1
  23. package/dist/bin.js +5 -5
  24. package/dist/{constants-Dgv-tSO3.js → constants-C03RQQht.js} +12 -5
  25. package/dist/constants-C03RQQht.js.map +1 -0
  26. package/dist/{index-CGeSKilQ.js → index-B6FQruEq.js} +1069 -134
  27. package/dist/index-B6FQruEq.js.map +1 -0
  28. package/dist/{index-CPxn1SR4.js → index-C93o7-zP.js} +3 -4
  29. package/dist/index-C93o7-zP.js.map +1 -0
  30. package/dist/main.js +2 -3
  31. package/dist/main.js.map +1 -1
  32. package/dist/{seed.schema.config-BXWvwsZQ.js → seed.schema.config-ClOsMOKS.js} +3 -4
  33. package/dist/seed.schema.config-ClOsMOKS.js.map +1 -0
  34. package/dist/src/BaseFileManager.ts +14 -2
  35. package/dist/src/FileManager.ts +14 -1
  36. package/dist/src/ImageResizer.ts +2 -5
  37. package/dist/src/actors.ts +34 -272
  38. package/dist/src/client.ts +19 -0
  39. package/dist/src/download.ts +5 -15
  40. package/dist/src/helpers.ts +200 -83
  41. package/dist/src/migrate.ts +2 -2
  42. package/dist/types/src/browser/db/Db.d.ts +1 -1
  43. package/dist/types/src/browser/db/Db.d.ts.map +1 -1
  44. package/dist/types/src/browser/helpers/FileManager.d.ts +10 -0
  45. package/dist/types/src/browser/helpers/FileManager.d.ts.map +1 -1
  46. package/dist/types/src/browser/helpers/index.d.ts +1 -2
  47. package/dist/types/src/browser/helpers/index.d.ts.map +1 -1
  48. package/dist/types/src/browser/workers/ImageResizer.d.ts.map +1 -1
  49. package/dist/types/src/client.d.ts +1 -0
  50. package/dist/types/src/client.d.ts.map +1 -1
  51. package/dist/types/src/events/files/download.d.ts.map +1 -1
  52. package/dist/types/src/helpers/FileManager/BaseFileManager.d.ts +5 -2
  53. package/dist/types/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  54. package/dist/types/src/node/helpers/FileManager.d.ts +2 -0
  55. package/dist/types/src/node/helpers/FileManager.d.ts.map +1 -1
  56. package/dist/types/src/services/internal/helpers.d.ts +0 -2
  57. package/dist/types/src/services/internal/helpers.d.ts.map +1 -1
  58. package/package.json +3 -3
  59. package/dist/Db-5C5VqRWb.js.map +0 -1
  60. package/dist/FileManager-AhAsy_F_.js +0 -794
  61. package/dist/FileManager-AhAsy_F_.js.map +0 -1
  62. package/dist/FileManager-COOp89Mj.js.map +0 -1
  63. package/dist/constants-Dgv-tSO3.js.map +0 -1
  64. package/dist/index-CGeSKilQ.js.map +0 -1
  65. package/dist/index-CPxn1SR4.js.map +0 -1
  66. package/dist/seed.schema.config-BXWvwsZQ.js.map +0 -1
@@ -3,6 +3,7 @@ import path from 'path'
3
3
  import { Endpoints } from '@/types'
4
4
  import { BROWSER_FS_TOP_DIR } from '@/services/internal/constants'
5
5
  import debug from 'debug'
6
+ import { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'
6
7
 
7
8
  const logger = debug('app:services:internal:helpers')
8
9
 
@@ -17,125 +18,238 @@ export const createDirectories = async (dirPath: string) => {
17
18
  }
18
19
 
19
20
  const parentDir = path.dirname(dirPath)
20
- let parentDirExists = await fs.promises.exists(parentDir)
21
+ let parentDirExists = await BaseFileManager.pathExists(parentDir)
21
22
  if (!parentDirExists) {
22
23
  await createDirectories(parentDir)
23
24
  }
24
25
 
25
- parentDirExists = await fs.promises.exists(parentDir)
26
+ parentDirExists = await BaseFileManager.pathExists(parentDir)
26
27
  if (parentDirExists) {
27
- try {
28
- await fs.promises.mkdir(dirPath)
29
- } catch (error) {
30
- logger(`[Error] Failed to create directories for ${dirPath}:`, error)
31
- }
32
- }
33
-
34
- if (!parentDirExists) {
35
- console.log(fs)
28
+ await BaseFileManager.createDirIfNotExists(dirPath)
36
29
  }
37
30
  }
38
31
 
39
- let busy = false
40
-
41
- export const downloadFile = async (url: string, localFilePath: string) => {
42
- try {
43
- const response = await fetch(url)
44
- const fileData = await response.text().catch((error) => {
45
- console.error(`Failed to parse text from ${url}:`, error)
46
- })
47
- if (!fileData) {
48
- console.error(`No file data from ${url}`)
49
- return
50
- }
51
- const localDirPath = path.dirname(localFilePath)
32
+ // export const downloadFile = async (url: string, localFilePath: string) => {
33
+ // try {
34
+ // const response = await fetch(url)
35
+ // const fileData = await response.text().catch((error) => {
36
+ // console.error(`Failed to parse text from ${url}:`, error)
37
+ // })
38
+ // if (!fileData) {
39
+ // console.error(`No file data from ${url}`)
40
+ // return
41
+ // }
42
+ // const localDirPath = path.dirname(localFilePath)
52
43
 
53
- if (busy) {
54
- return
55
- }
44
+ // if (busy) {
45
+ // return
46
+ // }
47
+
48
+ // busy = true
49
+
50
+ // await createDirectories(localDirPath)
51
+
52
+ // const filename = path.basename(localFilePath)
56
53
 
57
- busy = true
54
+ // const regex = /(\d+)[\w_]+\.(sql|json)$/
58
55
 
59
- await createDirectories(localDirPath)
56
+ // const match = filename.match(regex)
60
57
 
61
- const filename = path.basename(localFilePath)
58
+ // let migrationNumber
62
59
 
63
- const regex = /(\d+)[\w_]+\.(sql|json)$/
60
+ // if (match && match.length > 1) {
61
+ // migrationNumber = match[1]
62
+ // }
64
63
 
65
- const match = filename.match(regex)
64
+ // if (migrationNumber) {
65
+ // const filesInDir = await fs.promises.readdir(localDirPath)
66
+ // for (const file of filesInDir) {
67
+ // if (file === filename) {
68
+ // continue
69
+ // }
70
+ // const innerMatch = file.match(regex)
71
+ // let existingFileMigrationNumber
72
+ // if (innerMatch && innerMatch.length > 1) {
73
+ // existingFileMigrationNumber = innerMatch[1]
74
+ // }
75
+ // if (
76
+ // migrationNumber &&
77
+ // existingFileMigrationNumber &&
78
+ // existingFileMigrationNumber === migrationNumber
79
+ // ) {
80
+ // await fs.promises.unlink(path.join(localDirPath, file))
81
+ // }
82
+ // }
83
+ // }
66
84
 
67
- let migrationNumber
85
+ // try {
68
86
 
69
- if (match && match.length > 1) {
70
- migrationNumber = match[1]
87
+ // await fs.promises.writeFile(localFilePath, fileData)
88
+ // logger(`[downloadFile] Wrote file async to ${localFilePath}`)
89
+ // } catch (error) {
90
+ // fs.writeFileSync(localFilePath, fileData)
91
+ // logger(`[downloadFile] Wrote file sync to ${localFilePath}`)
92
+ // }
93
+ // } catch (error) {
94
+ // logger(`[Error] Failed to download file from ${url}:`, error)
95
+ // }
96
+
97
+ // busy = false
98
+ // }
99
+
100
+ type DownloadFunction = (fileUrl: string) => Promise<void>;
101
+
102
+ class FileDownloadManager {
103
+ private filesToDownload: Map<string, number>;
104
+ private maxRetries: number;
105
+ private isDownloading: boolean = false;
106
+
107
+ constructor(fileUrls: string[], maxRetries: number) {
108
+ this.filesToDownload = new Map(fileUrls.map(url => [url, 0]));
109
+ this.maxRetries = maxRetries;
110
+ }
111
+
112
+ async downloadFile(url: string, localFilePath: string): Promise<void> {
113
+ const response = await fetch(url)
114
+ const fileData = await response.text().catch((error) => {
115
+ console.error(`Failed to parse text from ${url}:`, error)
116
+ })
117
+ if (!fileData) {
118
+ console.error(`No file data from ${url}`)
119
+ return
120
+ }
121
+ const localDirPath = path.dirname(localFilePath)
122
+
123
+ await createDirectories(localDirPath)
124
+
125
+ const filename = path.basename(localFilePath)
126
+
127
+ const regex = /(\d+)[\w_]+\.(sql|json)$/
128
+
129
+ const match = filename.match(regex)
130
+
131
+ let migrationNumber
132
+
133
+ if (match && match.length > 1) {
134
+ migrationNumber = match[1]
135
+ }
136
+
137
+ if (migrationNumber) {
138
+ const filesInDir = await fs.promises.readdir(localDirPath)
139
+ for (const file of filesInDir) {
140
+ if (file === filename) {
141
+ continue
142
+ }
143
+ const innerMatch = file.match(regex)
144
+ let existingFileMigrationNumber
145
+ if (innerMatch && innerMatch.length > 1) {
146
+ existingFileMigrationNumber = innerMatch[1]
147
+ }
148
+ if (
149
+ migrationNumber &&
150
+ existingFileMigrationNumber &&
151
+ existingFileMigrationNumber === migrationNumber
152
+ ) {
153
+ await fs.promises.unlink(path.join(localDirPath, file))
154
+ }
155
+ }
156
+ }
157
+
158
+ try {
159
+
160
+ await fs.promises.writeFile(localFilePath, fileData)
161
+ logger(`[downloadFile] Wrote file async to ${localFilePath}`)
162
+ } catch (error) {
163
+ fs.writeFileSync(localFilePath, fileData)
164
+ logger(`[downloadFile] Wrote file sync to ${localFilePath}`)
165
+ }
166
+
71
167
  }
72
168
 
73
- if (migrationNumber) {
74
- const filesInDir = await fs.promises.readdir(localDirPath)
75
- for (const file of filesInDir) {
76
- if (file === filename) {
77
- continue
169
+ async start(): Promise<void> {
170
+ if (this.isDownloading) {
171
+ console.warn("Download process is already running.");
172
+ return;
78
173
  }
79
- const innerMatch = file.match(regex)
80
- let existingFileMigrationNumber
81
- if (innerMatch && innerMatch.length > 1) {
82
- existingFileMigrationNumber = innerMatch[1]
174
+
175
+ this.isDownloading = true;
176
+
177
+ for (const [fileUrl, attempts] of this.filesToDownload.entries()) {
178
+ let success = false;
179
+
180
+ while (attempts < this.maxRetries) {
181
+ try {
182
+ console.log(`Starting download: ${fileUrl}`);
183
+ await this.downloadFile(fileUrl, fileUrl);
184
+ console.log(`Download successful: ${fileUrl}`);
185
+ this.filesToDownload.delete(fileUrl);
186
+ success = true;
187
+ break; // Move to next file
188
+ } catch (error) {
189
+ console.error(`Error downloading ${fileUrl}:`, error);
190
+ this.filesToDownload.set(fileUrl, attempts + 1);
191
+ }
192
+ }
193
+
194
+ if (!success) {
195
+ console.error(`Failed to download after ${this.maxRetries} attempts: ${fileUrl}`);
196
+ }
83
197
  }
84
- if (
85
- migrationNumber &&
86
- existingFileMigrationNumber &&
87
- existingFileMigrationNumber === migrationNumber
88
- ) {
89
- await fs.promises.unlink(path.join(localDirPath, file))
198
+
199
+ this.isDownloading = false;
200
+ console.log("All downloads completed.");
201
+ }
202
+
203
+ addFile(fileUrl: string): void {
204
+ if (!this.filesToDownload.has(fileUrl)) {
205
+ this.filesToDownload.set(fileUrl, 0);
206
+ console.log(`Added file to download queue: ${fileUrl}`);
207
+ } else {
208
+ console.warn(`File already in queue: ${fileUrl}`);
90
209
  }
91
- }
92
210
  }
93
211
 
94
- try {
95
- await fs.promises.writeFile(localFilePath, fileData)
96
- logger(`[downloadFile] Wrote file async to ${localFilePath}`)
97
- } catch (error) {
98
- fs.writeFileSync(localFilePath, fileData)
99
- logger(`[downloadFile] Wrote file sync to ${localFilePath}`)
212
+ getPendingFiles(): string[] {
213
+ return Array.from(this.filesToDownload.keys());
100
214
  }
101
- } catch (error) {
102
- logger(`[Error] Failed to download file from ${url}:`, error)
103
- }
104
215
 
105
- busy = false
216
+ clear(): void {
217
+ this.filesToDownload.clear();
218
+ console.log("Cleared all files from the download queue.");
219
+ }
106
220
  }
107
221
 
222
+
108
223
  export const fetchDirectory = async (url: string) => {
109
224
  const response = await fetch(url)
110
225
  return response.json()
111
226
  }
112
227
 
113
- export const fetchFilesRecursively = async (
114
- url: string,
115
- localPath: string,
116
- fileList: string[],
117
- ) => {
118
- for (const file of fileList) {
119
- try {
120
- const fileUrl = `${url}/${file}`
121
- const fileLocalPath = path.join(localPath, file)
122
-
123
- // logger(`[fetchFilesRecursively] fileUrl: ${fileUrl}`)
124
- // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)
125
-
126
- await downloadFile(fileUrl, fileLocalPath)
127
- } catch (error) {
128
- console.error(`Failed to fetch files from ${url}:`, error)
129
- }
130
- }
131
- }
228
+ // export const fetchFilesRecursively = async (
229
+ // url: string,
230
+ // localPath: string,
231
+ // fileList: string[],
232
+ // ) => {
233
+ // for (const file of fileList) {
234
+ // try {
235
+ // const fileUrl = `${url}/${file}`
236
+ // const fileLocalPath = path.join(localPath, file)
237
+
238
+ // // logger(`[fetchFilesRecursively] fileUrl: ${fileUrl}`)
239
+ // // logger(`[fetchFilesRecursively] fileLocalPath: ${fileLocalPath}`)
240
+
241
+ // await downloadFile(fileUrl, fileLocalPath)
242
+ // } catch (error) {
243
+ // console.error(`Failed to fetch files from ${url}:`, error)
244
+ // }
245
+ // }
246
+ // }
132
247
 
133
248
  export const confirmFilesExist = async (filePaths: string[]) => {
134
249
  let everythingDownloaded = false
135
250
 
136
251
  for (const filePath of filePaths) {
137
- const fullPath = path.join(BROWSER_FS_TOP_DIR, filePath)
138
- everythingDownloaded = await fs.promises.exists(fullPath)
252
+ everythingDownloaded = await fs.promises.exists(filePath)
139
253
  }
140
254
 
141
255
  if (!everythingDownloaded) {
@@ -150,7 +264,10 @@ const filesToExclude = ['.DS_Store']
150
264
  export const syncDbFiles = async ({ filePaths, files }: Endpoints) => {
151
265
  let fileList = await fetchDirectory(filePaths)
152
266
  fileList = fileList.filter((file: string) => !filesToExclude.includes(file))
153
- await fetchFilesRecursively(files, BROWSER_FS_TOP_DIR, fileList)
267
+ fileList = fileList.map((file: string) => `${files}/${file}`)
268
+ const downloadManager = new FileDownloadManager(fileList, 5)
269
+ await downloadManager.start()
270
+ // await fetchFilesRecursively(files, BROWSER_FS_TOP_DIR, fileList)
154
271
  await confirmFilesExist(fileList)
155
272
  logger('[syncDbFiles] Files synced!')
156
273
  }
@@ -5,9 +5,9 @@ import {
5
5
  DB_MIGRATING_SUCCESS,
6
6
  } from '@/services/internal/constants'
7
7
  import debug from 'debug'
8
- import { waitForFile } from '@/helpers/files'
9
8
  import { BaseDb } from '@/db/Db/BaseDb'
10
9
  import fs from '@zenfs/core'
10
+ import { FileManager } from '@/browser/helpers/FileManager'
11
11
 
12
12
  const logger = debug('app:services:db:actors:migrate')
13
13
 
@@ -31,7 +31,7 @@ export const migrate = fromCallback<
31
31
 
32
32
 
33
33
  if (!journalExists) {
34
- await waitForFile(journalPath, 500, 60000)
34
+ await FileManager.waitForFile(journalPath, 500, 60000)
35
35
  }
36
36
  }
37
37
 
@@ -6,7 +6,7 @@ declare class Db extends BaseDb implements IDb {
6
6
  static getAppDb(): import("drizzle-orm/sqlite-proxy").SqliteRemoteDatabase<Record<string, unknown>>;
7
7
  static isAppDbReady(): boolean;
8
8
  static prepareDb(filesDir: string): Promise<unknown>;
9
- static connectToDb(pathToDir: string, dbName: string): Promise<unknown>;
9
+ static connectToDb(pathToDir: string, dbName: string): Promise<string>;
10
10
  static migrate(pathToDbDir: string, dbName: string, dbId: string): Promise<void>;
11
11
  }
12
12
  export { Db };
@@ -1 +1 @@
1
- {"version":3,"file":"Db.d.ts","sourceRoot":"","sources":["../../../../../src/browser/db/Db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAavC,eAAO,MAAM,MAAM,kFAkElB,CAAA;AAED,cAAM,EAAG,SAAQ,MAAO,YAAW,GAAG;;IAKpC,MAAM,CAAC,QAAQ;IAIf,MAAM,CAAC,YAAY;IAInB,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM;IAmBjC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;WAyCvC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA6KvF;AAID,OAAO,EAAE,EAAE,EAAE,CAAA"}
1
+ {"version":3,"file":"Db.d.ts","sourceRoot":"","sources":["../../../../../src/browser/db/Db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAYvC,eAAO,MAAM,MAAM,kFAkElB,CAAA;AAED,cAAM,EAAG,SAAQ,MAAO,YAAW,GAAG;;IAKpC,MAAM,CAAC,QAAQ;IAIf,MAAM,CAAC,YAAY;IAInB,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM;WAmBpB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WAyC/D,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA+KvF;AAID,OAAO,EAAE,EAAE,EAAE,CAAA"}
@@ -6,6 +6,16 @@ declare class FileManager extends BaseFileManager {
6
6
  static downloadAllFiles({ transactionIds, arweaveHost, excludedTransactions, }: DownloadAllFilesParams): Promise<void>;
7
7
  static resizeImage({ filePath, width, height }: ResizeImageParams): Promise<void>;
8
8
  static resizeAllImages({ width, height }: ResizeAllImagesParams): Promise<void>;
9
+ static pathExists(filePath: string): Promise<boolean>;
10
+ static createDirIfNotExists(filePath: string): Promise<void>;
11
+ /**
12
+ * Waits for a file to exist at the specified path.
13
+ * @param {string} filePath - The path of the file to check.
14
+ * @param {number} interval - The interval in milliseconds between checks (default: 500ms).
15
+ * @param {number} timeout - The timeout in milliseconds to wait for the file to exist (default: 10s).
16
+ * @returns {Promise<boolean>} - Resolves to true if the file exists within the timeout period, otherwise false.
17
+ */
18
+ static waitForFile(filePath: string, interval?: number, timeout?: number): Promise<boolean>;
9
19
  }
10
20
  export { FileManager };
11
21
  //# sourceMappingURL=FileManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/FileManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAU,uCAAuC,CAAA;AAI3E,cAAM,WAAY,SAAQ,eAAe;WAC1B,gBAAgB,CAAE,QAAQ,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC;WAMrD,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;WAgBlE,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;WAsBrC,gBAAgB,CAAE,EACE,cAAc,EACd,WAAW,EACX,oBAAoB,GACrB,EAAE,sBAAsB,GAAI,OAAO,C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AAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,3 +1,2 @@
1
- export declare const getSaveStateKey: (serviceId: any, modelName: any) => string;
2
- export declare const getContentUrlFromPath: (path: string) => Promise<string | undefined>;
1
+ export {};
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/index.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,eAAe,4CAE3B,CAAA;AAED,eAAO,MAAM,qBAAqB,SAC1B,MAAM,KACX,OAAO,CAAC,MAAM,GAAG,SAAS,CAQ5B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/index.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../../../../src/browser/workers/ImageResizer.ts"],"names":[],"mappings":"AAKA,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,aAAa,CAAQ;;IAUd,MAAM,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC,EAAE,iBAAiB;IAqCrD,SAAS,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,EAAE,qBAAqB;CA4B9D"}
1
+ {"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../../../../src/browser/workers/ImageResizer.ts"],"names":[],"mappings":"AAMA,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,aAAa,CAAQ;;IAUd,MAAM,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC,EAAE,iBAAiB;IAqCrD,SAAS,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,EAAE,qBAAqB;CAwB9D"}
@@ -2,6 +2,7 @@ import { ModelClassType, SeedConstructorOptions } from '@/types';
2
2
  declare const client: {
3
3
  isInitialized: boolean;
4
4
  init: (options: SeedConstructorOptions) => Promise<void>;
5
+ setAddresses: (addresses: string[]) => void;
5
6
  subscribe: (callback: any) => {
6
7
  unsubscribe: () => void;
7
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAmBhE,QAAA,MAAM,MAAM;;oBAEY,sBAAsB;0BAoDtB,GAAG;;;qBAYR,MAAM,YAAY,GAAG;;;;0BAqBhB,MAAM;qBAGb,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;yBAG1B,MAAM,EAAE;CAG5B,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAqBhE,QAAA,MAAM,MAAM;;oBAEY,sBAAsB;8BAoDlB,MAAM,EAAE;0BAiBZ,GAAG;;;qBAYR,MAAM,YAAY,GAAG;;;;0BAqBhB,MAAM;qBAGb,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;yBAG1B,MAAM,EAAE;CAG5B,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../../src/events/files/download.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,8BAA8B;;;mBAQ1C,CAAA;AAED,eAAO,MAAM,oCAAoC,oCAgLhD,CAAA"}
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../../src/events/files/download.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,8BAA8B;;;mBAQ1C,CAAA;AAED,eAAO,MAAM,oCAAoC,oCAqKhD,CAAA"}
@@ -1,6 +1,6 @@
1
1
  export declare abstract class BaseFileManager {
2
- private fileSystemInitialized;
3
- private initializing;
2
+ private static fileSystemInitialized;
3
+ private static initializing;
4
4
  static PlatformClass: typeof BaseFileManager;
5
5
  static setPlatformClass(platformClass: typeof BaseFileManager): void;
6
6
  static initializeFileSystem(): Promise<void>;
@@ -8,5 +8,8 @@ export declare abstract class BaseFileManager {
8
8
  static downloadAllFiles({ transactionIds, arweaveHost, excludedTransactions, }: DownloadAllFilesParams): Promise<void>;
9
9
  static resizeImage({ filePath, width, height }: ResizeImageParams): Promise<void>;
10
10
  static resizeAllImages({ width, height }: ResizeAllImagesParams): Promise<void>;
11
+ static pathExists(filePath: string): Promise<boolean>;
12
+ static createDirIfNotExists(filePath: string): Promise<void>;
13
+ static waitForFile(filePath: string): Promise<boolean>;
11
14
  }
12
15
  //# sourceMappingURL=BaseFileManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseFileManager.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/FileManager/BaseFileManager.ts"],"names":[],"mappings":"AAAA,8BAAsB,eAAe;IACnC,OAAO,CAAC,qBAAqB,CAAQ;IACrC,OAAO,CAAC,YAAY,CAAQ;IAE5B,MAAM,CAAC,aAAa,EAAE,OAAO,eAAe,CAAA;IAE5C,MAAM,CAAC,gBAAgB,CAAE,aAAa,EAAE,OAAO,eAAe;WAIjD,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUlD,MAAM,CAAC,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIzE,MAAM,CAAC,gBAAgB,CAAE,EACE,cAAc,EACd,WAAW,EACX,oBAAoB,GACrB,EAAE,sBAAsB,GAAI,OAAO,CAAC,IAAI,CAAC;IAInE,MAAM,CAAC,WAAW,CAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAI,OAAO,CAAC,IAAI,CAAC;IAInF,MAAM,CAAC,eAAe,CAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAI,OAAO,CAAC,IAAI,CAAC;CAGlF"}
1
+ {"version":3,"file":"BaseFileManager.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/FileManager/BaseFileManager.ts"],"names":[],"mappings":"AAAA,8BAAsB,eAAe;IACnC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAQ;IAC5C,OAAO,CAAC,MAAM,CAAC,YAAY,CAAQ;IAEnC,MAAM,CAAC,aAAa,EAAE,OAAO,eAAe,CAAA;IAE5C,MAAM,CAAC,gBAAgB,CAAE,aAAa,EAAE,OAAO,eAAe;WAIjD,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUlD,MAAM,CAAC,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIzE,MAAM,CAAC,gBAAgB,CAAE,EACE,cAAc,EACd,WAAW,EACX,oBAAoB,GACrB,EAAE,sBAAsB,GAAI,OAAO,CAAC,IAAI,CAAC;IAInE,MAAM,CAAC,WAAW,CAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAI,OAAO,CAAC,IAAI,CAAC;IAInF,MAAM,CAAC,eAAe,CAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAI,OAAO,CAAC,IAAI,CAAC;IAIjF,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrD,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAI/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG7D"}
@@ -6,6 +6,8 @@ declare class FileManager extends BaseFileManager {
6
6
  static downloadAllFiles(): Promise<void>;
7
7
  static resizeImage(): Promise<void>;
8
8
  static resizeAllImages(): Promise<void>;
9
+ static pathExists(filePath: string): Promise<boolean>;
10
+ static createDirIfNotExists(filePath: string): Promise<void>;
9
11
  }
10
12
  export { FileManager };
11
13
  //# sourceMappingURL=FileManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/node/helpers/FileManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAEvE,cAAM,WAAY,SAAQ,eAAe;WAE1B,gBAAgB,CAAE,QAAQ,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC;WAIrD,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;WAMlE,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;WAMrC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;WAMjC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;WAM5B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAM9C;AAID,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/node/helpers/FileManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAEvE,cAAM,WAAY,SAAQ,eAAe;WAE1B,gBAAgB,CAAE,QAAQ,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC;WAIrD,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;WAMlE,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;WAMrC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;WAMjC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;WAM5B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;WAMhC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;WAM9C,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMnE;AAID,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -4,9 +4,7 @@ import { Endpoints } from '@/types';
4
4
  * @param {string} dirPath - The directory path to create.
5
5
  */
6
6
  export declare const createDirectories: (dirPath: string) => Promise<void>;
7
- export declare const downloadFile: (url: string, localFilePath: string) => Promise<void>;
8
7
  export declare const fetchDirectory: (url: string) => Promise<any>;
9
- export declare const fetchFilesRecursively: (url: string, localPath: string, fileList: string[]) => Promise<void>;
10
8
  export declare const confirmFilesExist: (filePaths: string[]) => Promise<void>;
11
9
  export declare const syncDbFiles: ({ filePaths, files }: Endpoints) => Promise<void>;
12
10
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/services/internal/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAMnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAmB,MAAM,kBAwBtD,CAAA;AAID,eAAO,MAAM,YAAY,QAAe,MAAM,iBAAiB,MAAM,kBAiEpE,CAAA;AAED,eAAO,MAAM,cAAc,QAAe,MAAM,iBAG/C,CAAA;AAED,eAAO,MAAM,qBAAqB,QAC3B,MAAM,aACA,MAAM,YACP,MAAM,EAAE,kBAenB,CAAA;AAED,eAAO,MAAM,iBAAiB,cAAqB,MAAM,EAAE,kBAa1D,CAAA;AAID,eAAO,MAAM,WAAW,yBAAgC,SAAS,kBAMhE,CAAA"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/services/internal/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAOnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAmB,MAAM,kBAgBtD,CAAA;AAiMD,eAAO,MAAM,cAAc,QAAe,MAAM,iBAG/C,CAAA;AAsBD,eAAO,MAAM,iBAAiB,cAAqB,MAAM,EAAE,kBAY1D,CAAA;AAID,eAAO,MAAM,WAAW,yBAAgC,SAAS,kBAShE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/sdk",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "description": "The SDK for Seed Protocol",
5
5
  "type": "module",
6
6
  "engines": {
@@ -54,8 +54,8 @@
54
54
  "@tanstack/react-virtual": "^3.11.2",
55
55
  "@vitejs/plugin-legacy": "^6.0.0",
56
56
  "@xstate/react": "^5.0.0",
57
- "@zenfs/core": "1.8.8",
58
- "@zenfs/dom": "^1.1.3",
57
+ "@zenfs/core": "^1.6.12",
58
+ "@zenfs/dom": "1.1.0",
59
59
  "arweave": "^1.15.5",
60
60
  "crypto-browserify": "^3.12.1",
61
61
  "debug": "^4.4.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"Db-5C5VqRWb.js","sources":["../../src/browser/db/sqlWasmClient.ts","../../src/services/db/connectionManager.ts","../../src/browser/db/Db.ts"],"sourcesContent":["import { SqliteConnectionManager } from '@/services/db'\nimport {\n SqliteRemoteDatabase,\n SqliteRemoteResult,\n} from 'drizzle-orm/sqlite-proxy'\nimport { sql } from 'drizzle-orm'\n\nlet sqlite3InitModule: any\nlet sqliteWasmClient: any\nlet manager: SqliteConnectionManager | undefined\nlet isPreparing = false\n\nexport const setSqliteWasmClient = (client: any) => {\n sqliteWasmClient = client\n}\n\nexport const getSqliteWasmClient = async () => {\n if (sqliteWasmClient) {\n return sqliteWasmClient\n }\n if (typeof window === 'undefined') {\n throw new Error('validateInput called from non-browser context')\n }\n\n if (isPreparing) {\n return\n }\n\n isPreparing = true\n\n if (!sqlite3InitModule) {\n sqlite3InitModule = await import('@sqlite.org/sqlite-wasm')\n }\n\n if (!window.sqlite3Worker1Promiser) {\n await sqlite3InitModule()\n }\n\n if (!window.sqlite3Worker1Promiser) {\n console.error('window.sqlite3Worker1Promiser not found')\n isPreparing = false\n return\n }\n\n try {\n sqliteWasmClient = await window.sqlite3Worker1Promiser.v2().catch((err) => {\n console.error('Error initializing sqliteWasmClient:', err)\n isPreparing = false\n })\n } catch (err) {\n console.error('Error initializing sqliteWasmClient:', err)\n isPreparing = false\n }\n return sqliteWasmClient\n}\n\nexport const getManager = () => {\n return manager\n}\n\nexport const setManager = (m: any) => {\n manager = m\n}\nlet appDb: SqliteRemoteDatabase<Record<string, unknown>> | undefined\nexport const setAppDb = (db: SqliteRemoteDatabase<Record<string, unknown>>) => {\n appDb = db\n}\nexport const getAppDb = () => {\n if (!appDb) {\n throw new Error('getAppDb: appDb is undefined')\n }\n\n return appDb\n}\nexport const isAppDbReady = () => {\n return !!appDb\n}\ntype RunQueryForStatement = (\n statement: string,\n) => Promise<SqliteRemoteResult<unknown>>\n\nexport const runQueryForStatement: RunQueryForStatement = async (\n statement: string,\n) => {\n const appDb = getAppDb()\n\n return appDb.run(sql.raw(statement))\n}\n","type SqliteDatabase = {\n open: (filename: string) => Promise<void>\n exec: (sql: string, params?: any[]) => any\n close: () => void\n}\n\nclass SqliteConnectionManager {\n private sqliteModule: SqliteDatabase\n private idleTimeout: number\n private databases: { [key: string]: SqliteDatabase }\n private idleTimers: { [key: string]: NodeJS.Timeout }\n\n constructor(sqliteModule: SqliteDatabase, idleTimeout: number = 300000) {\n // Default idle timeout: 5 minutes\n this.sqliteModule = sqliteModule\n this.idleTimeout = idleTimeout\n this.databases = {}\n this.idleTimers = {}\n }\n\n private resetIdleTimer(dbName: string): void {\n if (this.idleTimers[dbName]) {\n clearTimeout(this.idleTimers[dbName])\n }\n\n this.idleTimers[dbName] = setTimeout(() => {\n this.closeConnection(dbName)\n }, this.idleTimeout)\n }\n\n private async getConnection(dbName: string): Promise<SqliteDatabase> {\n if (this.databases[dbName]) {\n this.resetIdleTimer(dbName)\n return this.databases[dbName]\n }\n\n const db = new this.sqliteModule()\n await db.open(dbName)\n this.databases[dbName] = db\n this.resetIdleTimer(dbName)\n return db\n }\n\n public async execute(\n dbName: string,\n sql: string,\n params: any[] = [],\n ): Promise<any> {\n const db = await this.getConnection(dbName)\n const result = db.exec(sql, params)\n this.resetIdleTimer(dbName)\n return result\n }\n\n public closeConnection(dbName: string): void {\n if (this.databases[dbName]) {\n this.databases[dbName].close()\n delete this.databases[dbName]\n if (this.idleTimers[dbName]) {\n clearTimeout(this.idleTimers[dbName])\n delete this.idleTimers[dbName]\n }\n }\n }\n}\n\nexport { SqliteConnectionManager }\n","import { BaseDb } from \"@/db/Db/BaseDb\";\nimport { IDb } from \"@/interfaces/IDb\";\nimport { getAppDb, getSqliteWasmClient, isAppDbReady, setAppDb } from \"./sqlWasmClient\";\nimport { SqliteConnectionManager } from \"@/services/db\";\nimport debug from \"debug\";\nimport { waitForFile } from \"@/helpers/files\";\nimport fs from \"@zenfs/core\";\nimport { sql } from \"drizzle-orm\";\nimport { readMigrationFiles } from \"drizzle-orm/migrator\";\nimport { drizzle } from \"drizzle-orm/sqlite-proxy\";\nimport { migrate as drizzleMigrate } from \"drizzle-orm/sqlite-proxy/migrator\";\nimport { BROWSER_FS_TOP_DIR } from \"@/services/internal/constants\";\nconst logger = debug('app:browser:db:Db')\n\nexport const dbExec = async (dbId, params, sql, dbName, retries = 2) => {\n const rowsToReturnRaw: SqliteWasmResult[] = []\n const rowsValues: string[][] = []\n\n const sqliteWasmClient = await getSqliteWasmClient()\n\n // For a single exec command, the callback potentially gets called several times -- once for each row.\n // So we need to collect all rows into a final array to return (execResult).\n const rowsToReturn = await new Promise((resolve, reject) => {\n sqliteWasmClient('exec', {\n dbId,\n sql,\n bind: params,\n callback: (result) => {\n // Checks if this is the final callback of the query\n if (!result || !result.row || !result.rowNumber) {\n const returnResult = []\n // Before returning the array, we process it to match the expected output format\n // const rowsToReturnProcessed = rowsToReturnRaw.reduce((acc, curr) => {\n // if (\n // Array.isArray(curr.row) &&\n // curr.row?.length > 0 &&\n // curr.columnNames.length > 0\n // ) {\n // const returnObj: ReturnObj = {\n // database: dbName,\n // }\n //\n // const values = []\n //\n // curr.columnNames.forEach((colName, index: number) => {\n // if (curr.row && curr.row[index]) {\n // returnObj[colName] = curr.row[index]\n // values.push(curr.row[index])\n // }\n // })\n // // rowsValueStrings.push(`(${values.join(', ')})`)\n // acc.push(returnObj)\n // }\n // return acc\n // }, [] as string[])\n for (const currRow of rowsToReturnRaw) {\n // const values: string[] = []\n // currRow.columnNames.forEach((colName, index: number) => {\n // if (currRow.row) {\n // values.push(currRow.row[index])\n // }\n // })\n // logger(`[db/actors] [dbExec] currRow`, currRow)\n returnResult.push(currRow.row)\n }\n resolve(returnResult)\n } else {\n // If not the final response, add this row to the return array\n rowsToReturnRaw.push(result)\n }\n },\n }).catch(async (error) => {\n reject(error)\n })\n })\n\n // logger(`[db/actors] [dbExec] rowsToReturn`, rowsToReturn)\n // logger(`[db/actors] [dbExec] rowsValues`, rowsValues)\n\n return rowsToReturn || []\n}\n\nclass Db extends BaseDb implements IDb {\n constructor() {\n super()\n }\n\n static getAppDb() {\n return getAppDb()\n }\n\n static isAppDbReady() {\n return isAppDbReady()\n }\n\n static prepareDb(filesDir: string) {\n\n return new Promise((resolve, reject) => {\n let sqliteWasmClient\n const interval = setInterval(() => {\n // TODO: Add a timeout\n // TODO: Add a cancel token to the promise so we can prevent more loops starting while we're checking the successful outcome\n getSqliteWasmClient().then((sqliteWasmClient) => {\n if (sqliteWasmClient) {\n clearInterval(interval)\n const manager = new SqliteConnectionManager(sqliteWasmClient)\n resolve(manager)\n }\n })\n\n }, 200)\n })\n }\n\n static connectToDb(pathToDir: string, dbName: string) {\n\n return new Promise((resolve, reject) => {\n const interval = setInterval(() => {\n\n // TODO: Add a timeout\n // TODO: Add a cancel token to the promise so we can prevent more loops starting while we're checking the successful outcome\n getSqliteWasmClient().then((sqliteWasmClient) => {\n\n if (!sqliteWasmClient) {\n return\n }\n\n //@ts-ignore\n sqliteWasmClient('config-get', {}).then((response) => {\n logger(response)\n logger('Running SQLite3 version', response.result.version.libVersion)\n\n //@ts-ignore\n sqliteWasmClient('open', {\n filename: `file:${pathToDir}/db/${dbName}.sqlite3?vfs=opfs`,\n }).then((response: { dbId: string, result: { filename: string } }) => {\n\n logger(response)\n const dbId = response.dbId\n logger(\n 'OPFS is available, created persisted database at',\n response.result.filename.replace(/^file:(.*?)\\?vfs=opfs$/, '$1'),\n )\n\n if (dbId) {\n clearInterval(interval)\n resolve(dbId)\n }\n })\n })\n })\n }, 500)\n })\n }\n\n static async migrate(pathToDbDir: string, dbName: string, dbId: string): Promise<void> {\n\n const schemaGlobString = `${BROWSER_FS_TOP_DIR}/schema/*`\n\n const drizzleDb = drizzle(\n async (sql, params, method) => {\n try {\n // logger(\n // `executing sql on ${dbName} with id: ${dbId} and method: ${method}`,\n // sql,\n // )\n\n const finalResult = await dbExec(dbId, params, sql, dbName)\n\n // logger(`finalResult with method: ${method}`, finalResult)\n // Drizzle always waits for {rows: string[][]} or {rows: string[]} for the return value.\n\n // When the method is get, you should return a value as {rows: string[]}.\n // Otherwise, you should return {rows: string[][]}.\n\n return { rows: finalResult }\n } catch (e: any) {\n console.error('Error from sqlite proxy server: ', JSON.stringify(e))\n return { rows: [] }\n }\n },\n {\n schema: schemaGlobString,\n // logger: true,\n },\n )\n\n try {\n\n const filesInRoot = await fs.promises.readdir('/')\n logger('filesInRoot', filesInRoot)\n const migrations = readMigrationFiles({\n migrationsFolder: pathToDbDir,\n })\n\n if (migrations.length > 0) {\n const incomingMigrationHashes = migrations.map(\n (migration) => migration.hash,\n )\n\n let existingMigrationHashes\n let rows = []\n\n try {\n\n const queryMigrationsTable = await drizzleDb.run(\n sql.raw(\n `SELECT name \n FROM sqlite_master \n WHERE type='table' \n AND name='__drizzle_migrations';`,\n ),\n )\n\n logger('queryMigrationsTable', queryMigrationsTable)\n\n if (queryMigrationsTable && queryMigrationsTable.rows && queryMigrationsTable.rows.length > 0) {\n const query = await drizzleDb.run(\n sql.raw(\n `SELECT hash, created_at\n FROM main.__drizzle_migrations;`,\n ),\n )\n \n rows = query.rows\n }\n\n } catch (e) {\n rows = []\n }\n\n if (rows && rows.length > 0) {\n existingMigrationHashes = rows.map((row) => row[0])\n }\n\n if (existingMigrationHashes) {\n let shouldRebuildDb = false\n for (const existingHash of existingMigrationHashes) {\n if (!incomingMigrationHashes.includes(existingHash)) {\n shouldRebuildDb = true\n break\n }\n }\n if (shouldRebuildDb) {\n await fs.promises.unlink(`${pathToDbDir}/${dbName}.sqlite3`)\n }\n }\n }\n\n await drizzleMigrate(\n drizzleDb,\n async (queriesToRun) => {\n // logger('queriesToRun', queriesToRun)\n for (const query of queriesToRun) {\n // logger('query', query)\n await drizzleDb.run(sql.raw(query))\n }\n },\n {\n migrationsFolder: pathToDbDir,\n },\n )\n } catch (error) {\n\n await waitForFile(`${pathToDbDir}/meta/_journal.json`)\n\n await this.migrate(pathToDbDir, dbName)\n\n }\n\n setAppDb(drizzleDb)\n // const createTempTableQuery = await appDb.run(\n // sql.raw(\n // `CREATE TEMP TABLE IF NOT EXISTS temp_last_inserted_id (id INTEGER, table TEXT);`,\n // ),\n // )\n //\n // logger(\n // '[db/actors] [migrate] createTempTableQuery',\n // createTempTableQuery,\n // )\n\n // const triggersQuery = await appDb.run(\n // sql.raw(\n // `SELECT name\n // FROM main.sqlite_master\n // WHERE type = 'trigger';`,\n // ),\n // )\n //\n // logger('[db/actors] [migrate] triggersQuery', triggersQuery)\n //\n // const triggers = triggersQuery.rows.map((row) => row[0])\n //\n // const tablesQuery = await appDb.run(\n // sql.raw(\n // `SELECT name\n // FROM main.sqlite_master\n // WHERE type = 'table';`,\n // ),\n // )\n //\n // logger('[db/actors] [migrate] tablesQuery', tablesQuery)\n //\n // const tableNames = tablesQuery.rows.map((row) => row[0])\n // logger('[db/actors] [migrate] tableNames', tableNames)\n // for (const tableName of tableNames) {\n // const triggerName = `after_insert_${tableName}`\n // if (triggers.includes(triggerName)) {\n // continue\n // }\n // const createTriggerQuery = await appDb.run(\n // sql.raw(\n // `CREATE TRIGGER after_insert_${tableName}\n // AFTER INSERT ON ${tableName}\n // BEGIN\n // DELETE FROM temp_last_inserted_id;\n // INSERT INTO temp_last_inserted_id (id) VALUES (new.id);\n // END;`,\n // ),\n // )\n //\n // logger(\n // '[db/actors] [migrate] createTriggerQuery',\n // createTriggerQuery,\n // )\n // }\n }\n}\n\nBaseDb.setPlatformClass(Db)\n\nexport { Db }"],"names":["drizzleMigrate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAI,iBAAsB;AAC1B,IAAI,gBAAqB;AAEzB,IAAI,WAAW,GAAG,KAAK;AAMhB,MAAM,mBAAmB,GAAG,YAAW;IAC5C,IAAI,gBAAgB,EAAE;AACpB,QAAA,OAAO,gBAAgB;;AAEzB,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC;;IAGlE,IAAI,WAAW,EAAE;QACf;;IAGF,WAAW,GAAG,IAAI;IAElB,IAAI,CAAC,iBAAiB,EAAE;AACtB,QAAA,iBAAiB,GAAG,MAAM,OAAO,yBAAyB,CAAC;;AAG7D,IAAA,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE;QAClC,MAAM,iBAAiB,EAAE;;AAG3B,IAAA,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE;AAClC,QAAA,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC;QACxD,WAAW,GAAG,KAAK;QACnB;;AAGF,IAAA,IAAI;AACF,QAAA,gBAAgB,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;AACxE,YAAA,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC;YAC1D,WAAW,GAAG,KA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