@seedprotocol/sdk 0.2.47 → 0.2.49
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/{ArweaveClient-CoFomTCN.js → ArweaveClient-Dcqcpsq4.js} +2 -2
- package/dist/{ArweaveClient-DQrXvrNN.js.map → ArweaveClient-Dcqcpsq4.js.map} +1 -1
- package/dist/{ArweaveClient-DQrXvrNN.js → ArweaveClient-Dh7LRIqD.js} +2 -2
- package/dist/{ArweaveClient-CoFomTCN.js.map → ArweaveClient-Dh7LRIqD.js.map} +1 -1
- package/dist/{Db-Dgbci7BP.js → Db-BjoRtCFg.js} +3 -4
- package/dist/{Db-Dgbci7BP.js.map → Db-BjoRtCFg.js.map} +1 -1
- package/dist/{Db-Dv7s24Zi.js → Db-CMRjCZoY.js} +7 -7
- package/dist/Db-CMRjCZoY.js.map +1 -0
- package/dist/{EasClient-CBu9ENAi.js → EasClient-A1xC7Gm-.js} +2 -2
- package/dist/{EasClient-sCbTHcO8.js.map → EasClient-A1xC7Gm-.js.map} +1 -1
- package/dist/{EasClient-sCbTHcO8.js → EasClient-m2mXad59.js} +2 -2
- package/dist/{EasClient-CBu9ENAi.js.map → EasClient-m2mXad59.js.map} +1 -1
- package/dist/{FileManager-COOp89Mj.js → FileManager-Dv2zn1RW.js} +12 -2
- package/dist/FileManager-Dv2zn1RW.js.map +1 -0
- package/dist/{Item-DOEEhWwi.js → Item-7vg6XRhw.js} +3 -4
- package/dist/{Item-DOEEhWwi.js.map → Item-7vg6XRhw.js.map} +1 -1
- package/dist/{ItemProperty-CABHeoKm.js → ItemProperty-Bcht9WTV.js} +3 -4
- package/dist/{ItemProperty-CABHeoKm.js.map → ItemProperty-Bcht9WTV.js.map} +1 -1
- package/dist/{QueryClient-BBaE-LKI.js → QueryClient-C-hFMF2j.js} +2 -2
- package/dist/{QueryClient-BBaE-LKI.js.map → QueryClient-C-hFMF2j.js.map} +1 -1
- package/dist/{QueryClient-C-ZzUnWq.js → QueryClient-C02sPZ-K.js} +2 -2
- package/dist/{QueryClient-C-ZzUnWq.js.map → QueryClient-C02sPZ-K.js.map} +1 -1
- package/dist/bin.js +21 -21
- package/dist/bin.js.map +1 -1
- package/dist/{constants-Dgv-tSO3.js → constants-C03RQQht.js} +12 -5
- package/dist/constants-C03RQQht.js.map +1 -0
- package/dist/{index-OxV3e-OY.js → index-D3Scq_ka.js} +1095 -137
- package/dist/index-D3Scq_ka.js.map +1 -0
- package/dist/{index-CAikKppg.js → index-Dp3GcggF.js} +3 -4
- package/dist/index-Dp3GcggF.js.map +1 -0
- package/dist/main.js +2 -3
- package/dist/main.js.map +1 -1
- package/dist/{seed.schema.config-Ba_E7t1M.js → seed.schema.config-CS6BvsTl.js} +3 -4
- package/dist/seed.schema.config-CS6BvsTl.js.map +1 -0
- package/dist/src/BaseFileManager.ts +14 -2
- package/dist/src/BaseItem.ts +15 -3
- package/dist/src/BaseItemProperty.ts +1 -1
- package/dist/src/FileManager.ts +14 -1
- package/dist/src/IItem.ts +4 -1
- package/dist/src/ImageResizer.ts +3 -6
- package/dist/src/actors.ts +1 -1
- package/dist/src/client.ts +25 -0
- package/dist/src/configureFs.ts +1 -1
- package/dist/src/createNewItem.ts +5 -1
- package/dist/src/download.ts +6 -16
- package/dist/src/drizzle.ts +1 -1
- package/dist/src/files.ts +1 -1
- package/dist/src/getPublishUploads.ts +1 -1
- package/dist/src/helpers.ts +201 -84
- package/dist/src/hydrateFromDb.ts +1 -1
- package/dist/src/migrate.ts +3 -3
- package/dist/src/resolveRelatedValue.ts +1 -1
- package/dist/src/resolveRemoteStorage.ts +1 -1
- package/dist/src/saveImageSrc.ts +1 -1
- package/dist/src/saveItemStorage.ts +1 -1
- package/dist/src/ts-to-proto.ts +1 -1
- package/dist/src/validate.ts +1 -1
- package/dist/src/waitForDb.ts +9 -10
- package/dist/src/waitForFiles.ts +1 -1
- package/dist/types/src/Item/BaseItem.d.ts +4 -1
- package/dist/types/src/Item/BaseItem.d.ts.map +1 -1
- package/dist/types/src/Item/service/actors/saveDataToDb.d.ts +3 -0
- package/dist/types/src/Item/service/actors/saveDataToDb.d.ts.map +1 -0
- package/dist/types/src/browser/db/Db.d.ts +2 -2
- package/dist/types/src/browser/db/Db.d.ts.map +1 -1
- package/dist/types/src/browser/helpers/FileManager.d.ts +10 -0
- package/dist/types/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/types/src/browser/helpers/index.d.ts +1 -2
- package/dist/types/src/browser/helpers/index.d.ts.map +1 -1
- package/dist/types/src/browser/react/item.d.ts.map +1 -1
- package/dist/types/src/browser/workers/ImageResizer.d.ts.map +1 -1
- package/dist/types/src/client.d.ts +1 -0
- package/dist/types/src/client.d.ts.map +1 -1
- package/dist/types/src/db/write/createNewItem.d.ts.map +1 -1
- package/dist/types/src/events/files/download.d.ts.map +1 -1
- package/dist/types/src/helpers/FileManager/BaseFileManager.d.ts +5 -2
- package/dist/types/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/types/src/interfaces/IItem.d.ts +3 -0
- package/dist/types/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/types/src/node/helpers/FileManager.d.ts +2 -0
- package/dist/types/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/types/src/services/internal/helpers.d.ts +0 -2
- package/dist/types/src/services/internal/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/Db-Dv7s24Zi.js.map +0 -1
- package/dist/FileManager-COOp89Mj.js.map +0 -1
- package/dist/FileManager-Np-xCJ1X.js +0 -794
- package/dist/FileManager-Np-xCJ1X.js.map +0 -1
- package/dist/constants-Dgv-tSO3.js.map +0 -1
- package/dist/index-CAikKppg.js.map +0 -1
- package/dist/index-OxV3e-OY.js.map +0 -1
- package/dist/seed.schema.config-Ba_E7t1M.js.map +0 -1
package/dist/src/helpers.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs from '@zenfs/core'
|
|
2
2
|
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
|
|
21
|
+
let parentDirExists = await BaseFileManager.pathExists(parentDir)
|
|
21
22
|
if (!parentDirExists) {
|
|
22
23
|
await createDirectories(parentDir)
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
parentDirExists = await
|
|
26
|
+
parentDirExists = await BaseFileManager.pathExists(parentDir)
|
|
26
27
|
if (parentDirExists) {
|
|
27
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
54
|
-
|
|
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
|
-
|
|
54
|
+
// const regex = /(\d+)[\w_]+\.(sql|json)$/
|
|
58
55
|
|
|
59
|
-
|
|
56
|
+
// const match = filename.match(regex)
|
|
60
57
|
|
|
61
|
-
|
|
58
|
+
// let migrationNumber
|
|
62
59
|
|
|
63
|
-
|
|
60
|
+
// if (match && match.length > 1) {
|
|
61
|
+
// migrationNumber = match[1]
|
|
62
|
+
// }
|
|
64
63
|
|
|
65
|
-
|
|
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
|
-
|
|
85
|
+
// try {
|
|
68
86
|
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
continue
|
|
169
|
+
async start(): Promise<void> {
|
|
170
|
+
if (this.isDownloading) {
|
|
171
|
+
console.warn("Download process is already running.");
|
|
172
|
+
return;
|
|
78
173
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
95
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventObject, fromCallback } from 'xstate'
|
|
2
2
|
import { and, eq, or, sql } from 'drizzle-orm'
|
|
3
3
|
import debug from 'debug'
|
|
4
|
-
import
|
|
4
|
+
import fs from '@zenfs/core'
|
|
5
5
|
import { metadata } from '@/seedSchema'
|
|
6
6
|
import { BaseDb } from '@/db/Db/BaseDb'
|
|
7
7
|
import { updateMetadata } from '@/db/write/updateMetadata'
|
package/dist/src/migrate.ts
CHANGED
|
@@ -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
|
-
import
|
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventObject, fromCallback } from 'xstate'
|
|
2
2
|
import { convertTxIdToImageSrc } from '@/helpers'
|
|
3
|
-
import
|
|
3
|
+
import fs from '@zenfs/core'
|
|
4
4
|
import debug from 'debug'
|
|
5
5
|
import { FromCallbackInput } from '@/types/machines'
|
|
6
6
|
import { PropertyMachineContext } from '@/types/property'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventObject, fromCallback } from 'xstate'
|
|
2
2
|
import { FromCallbackInput } from '@/types/machines'
|
|
3
3
|
import { PropertyMachineContext } from '@/types/property'
|
|
4
|
-
import
|
|
4
|
+
import fs from '@zenfs/core'
|
|
5
5
|
|
|
6
6
|
export const resolveRemoteStorage = fromCallback<
|
|
7
7
|
EventObject,
|
package/dist/src/saveImageSrc.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { createSeed } from '@/db/write/createSeed'
|
|
9
9
|
import { getDataTypeFromString, getMimeType } from '@/helpers'
|
|
10
10
|
import { createVersion } from '@/db/write/createVersion'
|
|
11
|
-
import
|
|
11
|
+
import fs from '@zenfs/core'
|
|
12
12
|
import { createMetadata } from '@/db/write/createMetadata'
|
|
13
13
|
import { updateItemPropertyValue } from '@/db/write/updateItemPropertyValue'
|
|
14
14
|
import { getSchemaUidForSchemaDefinition } from '@/stores/eas'
|
|
@@ -11,7 +11,7 @@ import { getItemData } from '@/db/read/getItemData'
|
|
|
11
11
|
import { and, eq } from 'drizzle-orm'
|
|
12
12
|
import { metadata } from '@/seedSchema'
|
|
13
13
|
import { createMetadata } from '@/db/write/createMetadata'
|
|
14
|
-
import
|
|
14
|
+
import fs from '@zenfs/core'
|
|
15
15
|
|
|
16
16
|
export const saveItemStorage = fromCallback<
|
|
17
17
|
EventObject,
|
package/dist/src/ts-to-proto.ts
CHANGED
package/dist/src/validate.ts
CHANGED
package/dist/src/waitForDb.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EventObject, fromCallback } from 'xstate'
|
|
2
|
+
import { FromCallbackInput, PropertyMachineContext } from '@/types'
|
|
2
3
|
import { BaseDb } from '@/db/Db/BaseDb'
|
|
3
|
-
import { FromCallbackInput, ItemMachineContext } from '@/types'
|
|
4
4
|
import debug from 'debug'
|
|
5
5
|
|
|
6
|
-
const logger = debug('app:
|
|
6
|
+
const logger = debug('app:ItemProperty:service:actors:waitForDb')
|
|
7
7
|
|
|
8
8
|
export const waitForDb = fromCallback<
|
|
9
9
|
EventObject,
|
|
10
|
-
FromCallbackInput<
|
|
10
|
+
FromCallbackInput<PropertyMachineContext>
|
|
11
11
|
>(({ sendBack }) => {
|
|
12
12
|
const _waitForDb = new Promise<void>((resolve) => {
|
|
13
13
|
const interval = setInterval(() => {
|
|
@@ -16,11 +16,10 @@ export const waitForDb = fromCallback<
|
|
|
16
16
|
clearInterval(interval)
|
|
17
17
|
resolve()
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}, 100)
|
|
20
|
+
})
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
22
|
+
_waitForDb.then(() => {
|
|
23
|
+
sendBack({ type: 'waitForDbSuccess' })
|
|
24
|
+
})
|
|
25
|
+
})
|
package/dist/src/waitForFiles.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventObject, fromCallback } from 'xstate'
|
|
2
2
|
import { FromCallbackInput, InternalMachineContext } from '@/types'
|
|
3
3
|
import debug from 'debug'
|
|
4
|
-
import
|
|
4
|
+
import fs from '@zenfs/core'
|
|
5
5
|
|
|
6
6
|
const logger = debug('app:services:internal:actors:waitForFiles')
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ export declare abstract class BaseItem<T extends ModelValues<ModelSchema>> imple
|
|
|
20
20
|
static setPlatformClass(platformClass: typeof BaseItem): void;
|
|
21
21
|
static create<T extends ModelValues<ModelSchema>>(props: Partial<ItemData>): Promise<BaseItem<any>>;
|
|
22
22
|
static find({ modelName, seedLocalId, seedUid, }: ItemFindProps): Promise<IItem<any> | undefined>;
|
|
23
|
-
static all(modelName?: string, deleted?: boolean): Promise<
|
|
23
|
+
static all(modelName?: string, deleted?: boolean): Promise<BaseItem<any>[]>;
|
|
24
24
|
protected _createPropertyInstance(props: Partial<CreatePropertyInstanceProps>): void;
|
|
25
25
|
static publish(item: IItem<any>): Promise<void>;
|
|
26
26
|
subscribe: (callback: (itemProps: any) => void) => Subscription;
|
|
@@ -43,9 +43,12 @@ export declare abstract class BaseItem<T extends ModelValues<ModelSchema>> imple
|
|
|
43
43
|
get seedUid(): string | undefined;
|
|
44
44
|
get schemaUid(): string;
|
|
45
45
|
get latestVersionUid(): VersionsType;
|
|
46
|
+
get latestVersionLocalId(): string;
|
|
46
47
|
get modelName(): string;
|
|
47
48
|
get properties(): Record<string, IItemProperty<any>>;
|
|
48
49
|
get attestationCreatedAt(): number;
|
|
50
|
+
get versionsCount(): number;
|
|
51
|
+
get lastVersionPublishedAt(): number;
|
|
49
52
|
unload(): void;
|
|
50
53
|
}
|
|
51
54
|
//# sourceMappingURL=BaseItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseItem.d.ts","sourceRoot":"","sources":["../../../../src/Item/BaseItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,EACL,2BAA2B,EAC3B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,SAAS,CAAA;AAEhB,OA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IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAEnD;IAED,IAAI,oBAAoB,IAAI,MAAM,CAEjC;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,sBAAsB,IAAI,MAAM,CAEnC;IAED,MAAM,IAAI,IAAI;CAIf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saveDataToDb.d.ts","sourceRoot":"","sources":["../../../../../../src/Item/service/actors/saveDataToDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAiBlD,eAAO,MAAM,YAAY,oEA+HxB,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaseDb } from "@/db/Db/BaseDb";
|
|
2
2
|
import { IDb } from "@/interfaces/IDb";
|
|
3
|
-
export declare const dbExec: (dbId:
|
|
3
|
+
export declare const dbExec: (dbId: string, params: any[], sql: string, dbName: string, retries?: number) => Promise<{}>;
|
|
4
4
|
declare class Db extends BaseDb implements IDb {
|
|
5
5
|
constructor();
|
|
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<
|
|
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;
|
|
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,SAAgB,MAAM,UAAU,GAAG,EAAE,OAAO,MAAM,UAAU,MAAM,kCAkEpF,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;
|
|
1
|
+
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/FileManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAU,uCAAuC,CAAA;AAO3E,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,CAAC,IAAI,CAAC;WAK5D,WAAW,CAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAI,OAAO,CAAC,IAAI,CAAC;WAK5E,eAAe,CAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAI,OAAO,CAAC,IAAI,CAAC;WAK1E,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;WAkC9C,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYlE;;;;;;OAMG;WACU,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAa,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAqF/G;AAwDD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/browser/helpers/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../src/browser/react/item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAOrC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../src/browser/react/item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAOrC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAGrC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAI1C,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,IAAI;IAC7C,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IACrB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CACzD,CAAA;AAED,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;AAE3D,KAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7C,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,GAAG,CAyJhC,CAAA;AACD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AACD,KAAK,aAAa,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AACD,KAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,cAAc,CAAA;AACxD,eAAO,MAAM,QAAQ,EAAE,QAgEtB,CAAA;AAED,eAAO,MAAM,cAAc;;CA2B1B,CAAA;AACD,eAAO,MAAM,aAAa,GAAI,CAAC,aAAa,MAAM;;;CAwCjD,CAAA;AAED,KAAK,iBAAiB,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,CAAA;AAEjD,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,CACX,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,EAC3B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,GAAG,KAC1C,IAAI,CAAA;IACT,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAQD,eAAO,MAAM,cAAc,QAAO,oBA8BjC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../../../../src/browser/workers/ImageResizer.ts"],"names":[],"mappings":"
|
|
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[]) => Promise<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;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAoBhE,QAAA,MAAM,MAAM;;oBAEY,sBAAsB;8BAoDb,MAAM,EAAE;0BAwBjB,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":"createNewItem.d.ts","sourceRoot":"","sources":["../../../../../src/db/write/createNewItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"createNewItem.d.ts","sourceRoot":"","sources":["../../../../../src/db/write/createNewItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAQrC,KAAK,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,aAAa,mCAGvB,kBAAkB,KAAG,OAAO,CAAC,uBAAuB,CAuCtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../../src/events/files/download.ts"],"names":[],"mappings":"
|
|
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
|