bb-relay 0.0.1
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/.husky/pre-commit +1 -0
- package/README.md +47 -0
- package/dist/chunk-S47CVTVK.mjs +33 -0
- package/dist/chunk-UJCSKKID.mjs +30 -0
- package/dist/dev.d.mts +11 -0
- package/dist/dev.d.ts +11 -0
- package/dist/dev.js +5028 -0
- package/dist/dev.mjs +4991 -0
- package/dist/index.d.mts +666 -0
- package/dist/index.d.ts +666 -0
- package/dist/index.js +405 -0
- package/dist/index.mjs +376 -0
- package/eslint.config.mts +19 -0
- package/jest.config.js +11 -0
- package/package.json +60 -0
- package/src/dev.ts +4 -0
- package/src/index.ts +72 -0
- package/src/load-virtual-editor/app/StatusState.ts +6 -0
- package/src/load-virtual-editor/app/css.ts +154 -0
- package/src/load-virtual-editor/app/store.ts +25 -0
- package/src/load-virtual-editor/events/handle-dir-update.ts +23 -0
- package/src/load-virtual-editor/events/handle-file-update.ts +23 -0
- package/src/load-virtual-editor/events/handle-load.ts +39 -0
- package/src/load-virtual-editor/events/handle-selected.ts +30 -0
- package/src/load-virtual-editor/index.ts +52 -0
- package/src/load-virtual-editor/lib/indexedStorage.ts +28 -0
- package/src/load-virtual-editor/mocks/generate-files.ts +25 -0
- package/src/load-virtual-editor/node/NodeState.ts +23 -0
- package/src/load-virtual-editor/node/copyDir.ts +14 -0
- package/src/load-virtual-editor/node/copyFile.ts +14 -0
- package/src/load-virtual-editor/node/createDir.ts +10 -0
- package/src/load-virtual-editor/node/createFile.ts +13 -0
- package/src/load-virtual-editor/node/deleteDir.ts +10 -0
- package/src/load-virtual-editor/node/deleteFile.ts +13 -0
- package/src/load-virtual-editor/node/formatPath.ts +13 -0
- package/src/load-virtual-editor/node/formatText.ts +19 -0
- package/src/load-virtual-editor/node/generateDirs.ts +13 -0
- package/src/load-virtual-editor/node/getDescendantLevel.ts +9 -0
- package/src/load-virtual-editor/node/getDirInfo.ts +33 -0
- package/src/load-virtual-editor/node/getFileInfo.ts +31 -0
- package/src/load-virtual-editor/node/getFiles.ts +17 -0
- package/src/load-virtual-editor/node/getParent.ts +11 -0
- package/src/load-virtual-editor/node/readDir.ts +41 -0
- package/src/load-virtual-editor/node/readFile.ts +46 -0
- package/src/load-virtual-editor/node/store.ts +206 -0
- package/src/load-virtual-editor/node/watch.ts +9 -0
- package/src/load-virtual-editor/node/writeFile.ts +21 -0
- package/src/load-virtual-editor/postResponse.ts +21 -0
- package/src/load-virtual-editor/request/requestFS.ts +199 -0
- package/src/load-virtual-editor/request/requestSelected.ts +45 -0
- package/src/load-virtual-editor/selected/SelectedState.ts +7 -0
- package/src/load-virtual-editor/selected/selectDir.ts +13 -0
- package/src/load-virtual-editor/selected/selectFile.ts +13 -0
- package/src/load-virtual-editor/selected/store.ts +27 -0
- package/src/load-virtual-editor/selected/watch.ts +9 -0
- package/src/locales/en-GB.ts +117 -0
- package/src/locales/fr-FR.ts +125 -0
- package/src/relay/index.ts +89 -0
- package/src/relay/registerEvent.ts +16 -0
- package/src/relay/registerRequest.ts +16 -0
- package/src/relay/storage-bridge.ts +71 -0
- package/src/types/BBEvent.ts +51 -0
- package/src/types/BBRequest.ts +8 -0
- package/src/types/Checkpoint.ts +11 -0
- package/src/types/CopyArg.ts +6 -0
- package/src/types/DirectoryContents.ts +4 -0
- package/src/types/DirectoryStats.ts +4 -0
- package/src/types/EventParam.ts +8 -0
- package/src/types/EventReturn.ts +9 -0
- package/src/types/FileContent.ts +9 -0
- package/src/types/GitFileStatus.ts +5 -0
- package/src/types/IconArg.ts +6 -0
- package/src/types/Language.ts +5 -0
- package/src/types/Locale.ts +3 -0
- package/src/types/MenuContent.ts +10 -0
- package/src/types/Nav.ts +3 -0
- package/src/types/PluginItem.ts +14 -0
- package/src/types/RenameType.ts +4 -0
- package/src/types/RequestParam.ts +9 -0
- package/src/types/RequestReturn.ts +11 -0
- package/src/types/Result.ts +6 -0
- package/src/types/Route.ts +1 -0
- package/src/types/Settings.ts +7 -0
- package/src/types/TutorialHeader.ts +10 -0
- package/src/types/User.ts +9 -0
- package/src/types/WatchFSEvent.ts +1 -0
- package/src/types/database.types.ts +266 -0
- package/src/types/dir/DirInfo.ts +10 -0
- package/src/types/dir/index.ts +32 -0
- package/src/types/files/FileInfo.ts +12 -0
- package/src/types/files/FileTypes.ts +13 -0
- package/src/types/files/ReadFile.ts +17 -0
- package/src/types/files/index.ts +31 -0
- package/src/types/project/Project.ts +35 -0
- package/src/types/project/index.ts +11 -0
- package/src/types/status/Load.ts +16 -0
- package/src/types/storage/index.ts +11 -0
- package/src/utils/inject-styles.ts +13 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +16 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
type BinaryFile = {
|
|
2
|
+
path: string;
|
|
3
|
+
type: "binary";
|
|
4
|
+
content: Uint8Array;
|
|
5
|
+
};
|
|
6
|
+
type TextFile = {
|
|
7
|
+
path: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
content: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ReadFile = {
|
|
13
|
+
args: {
|
|
14
|
+
path: string;
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
response: TextFile;
|
|
18
|
+
} | {
|
|
19
|
+
args: {
|
|
20
|
+
path: string;
|
|
21
|
+
type: "binary";
|
|
22
|
+
};
|
|
23
|
+
response: BinaryFile;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type FileRequests = {
|
|
27
|
+
"create-file": {
|
|
28
|
+
args: {
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
31
|
+
response: null;
|
|
32
|
+
};
|
|
33
|
+
"copy-file": {
|
|
34
|
+
args: {
|
|
35
|
+
source: string;
|
|
36
|
+
destination: string;
|
|
37
|
+
};
|
|
38
|
+
response: null;
|
|
39
|
+
};
|
|
40
|
+
"read-file": ReadFile;
|
|
41
|
+
stat: {
|
|
42
|
+
args: {
|
|
43
|
+
path: string;
|
|
44
|
+
};
|
|
45
|
+
response: FileInfo;
|
|
46
|
+
};
|
|
47
|
+
"write-file": {
|
|
48
|
+
args: TextFile | BinaryFile;
|
|
49
|
+
response: null;
|
|
50
|
+
};
|
|
51
|
+
"delete-file": {
|
|
52
|
+
args: {
|
|
53
|
+
path: string;
|
|
54
|
+
};
|
|
55
|
+
response: null;
|
|
56
|
+
};
|
|
57
|
+
"select-file": {
|
|
58
|
+
args: {
|
|
59
|
+
path: string;
|
|
60
|
+
};
|
|
61
|
+
response: null;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type DirInfo = {
|
|
66
|
+
name: string;
|
|
67
|
+
fullPath: string;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
modifiedAt: string;
|
|
70
|
+
fsCount: number;
|
|
71
|
+
size: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type DirRequests = {
|
|
75
|
+
"create-dir": {
|
|
76
|
+
args: {
|
|
77
|
+
path: string;
|
|
78
|
+
};
|
|
79
|
+
response: null;
|
|
80
|
+
};
|
|
81
|
+
"read-dir": {
|
|
82
|
+
args: {
|
|
83
|
+
path: string;
|
|
84
|
+
};
|
|
85
|
+
response: {
|
|
86
|
+
path: string;
|
|
87
|
+
type: "file" | "dir";
|
|
88
|
+
}[];
|
|
89
|
+
};
|
|
90
|
+
"get-files": {
|
|
91
|
+
args: {
|
|
92
|
+
path: string;
|
|
93
|
+
};
|
|
94
|
+
response: string[];
|
|
95
|
+
};
|
|
96
|
+
"get-dir-info": {
|
|
97
|
+
args: {
|
|
98
|
+
path: string;
|
|
99
|
+
};
|
|
100
|
+
response: DirInfo;
|
|
101
|
+
};
|
|
102
|
+
"copy-dir": {
|
|
103
|
+
args: {
|
|
104
|
+
source: string;
|
|
105
|
+
destination: string;
|
|
106
|
+
};
|
|
107
|
+
response: null;
|
|
108
|
+
};
|
|
109
|
+
"delete-dir": {
|
|
110
|
+
args: {
|
|
111
|
+
path: string;
|
|
112
|
+
};
|
|
113
|
+
response: null;
|
|
114
|
+
};
|
|
115
|
+
"select-dir": {
|
|
116
|
+
args: {
|
|
117
|
+
path: string;
|
|
118
|
+
};
|
|
119
|
+
response: null;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
type StorageRequests = {
|
|
124
|
+
"sync-storage": {
|
|
125
|
+
args: {
|
|
126
|
+
data: Record<string, string>;
|
|
127
|
+
};
|
|
128
|
+
response: null;
|
|
129
|
+
};
|
|
130
|
+
"load-storage": {
|
|
131
|
+
args: null;
|
|
132
|
+
response: Record<string, string>;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
type ProjectRequest = {
|
|
137
|
+
"update-project": {
|
|
138
|
+
args: {
|
|
139
|
+
name: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
response: null;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
type BBRequest = FileRequests & DirRequests & StorageRequests & ProjectRequest;
|
|
147
|
+
|
|
148
|
+
interface RequestReturn<K extends keyof BBRequest> {
|
|
149
|
+
id: string;
|
|
150
|
+
type: K;
|
|
151
|
+
response: BBRequest[K]["response"] | null;
|
|
152
|
+
error: null | string;
|
|
153
|
+
responseId: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type Load = {
|
|
157
|
+
/**
|
|
158
|
+
* Whether the app is in dark mode or not
|
|
159
|
+
*/
|
|
160
|
+
mode: "dark" | "light";
|
|
161
|
+
/**
|
|
162
|
+
* The CSS to be applied to the app
|
|
163
|
+
*/
|
|
164
|
+
css: string;
|
|
165
|
+
/**
|
|
166
|
+
* The language of the app e.g. en, en-gb
|
|
167
|
+
*/
|
|
168
|
+
language: string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
type Category = "Action" | "Adventure" | "ChickLit" | "Comedy" | "Drama" | "FanFiction" | "Fantasy" | "Horror" | "Mystery / Thriller" | "Parody" | "Poetry" | "Romance" | "SciFi" | "Thriller" | "Western" | "Historical Fiction" | "No Fiction" | "Paranormal" | "Adult" | "Short story" | "Spiritual" | "Other";
|
|
172
|
+
interface Project {
|
|
173
|
+
title: string;
|
|
174
|
+
createdAt: string;
|
|
175
|
+
updatedAt: string;
|
|
176
|
+
lastAccessedAt: string;
|
|
177
|
+
remoteId?: string;
|
|
178
|
+
tags?: string[];
|
|
179
|
+
category?: Category;
|
|
180
|
+
description?: string;
|
|
181
|
+
genre?: string | null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
type BBEvent = {
|
|
185
|
+
/**
|
|
186
|
+
* When sidebar loads to ensure that the theme matches the app
|
|
187
|
+
*/
|
|
188
|
+
load: {
|
|
189
|
+
response: Load;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Show what has been selected
|
|
193
|
+
*/
|
|
194
|
+
selected: {
|
|
195
|
+
response: {
|
|
196
|
+
path: string;
|
|
197
|
+
type: "file" | "dir";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Access tokens
|
|
202
|
+
*/
|
|
203
|
+
tokens: {
|
|
204
|
+
response: string;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* File event
|
|
208
|
+
*/
|
|
209
|
+
"file-updated": {
|
|
210
|
+
response: string;
|
|
211
|
+
};
|
|
212
|
+
"dir-updated": {
|
|
213
|
+
response: string;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* When the current project details is updated e.g. the title
|
|
217
|
+
*/
|
|
218
|
+
"project-updated": {
|
|
219
|
+
response: Project;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* When a new project is selected. Unlike updated, the workspaces and files
|
|
223
|
+
* will be totally different
|
|
224
|
+
* Hence if user is using file systems, they might want to reload the files
|
|
225
|
+
*/
|
|
226
|
+
"project-changed": {
|
|
227
|
+
response: Project | null;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
interface EventReturn<K extends keyof BBEvent> {
|
|
232
|
+
type: K;
|
|
233
|
+
response: BBEvent[K]["response"];
|
|
234
|
+
responseId: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
declare class BBRelay {
|
|
238
|
+
private requestCallbacks;
|
|
239
|
+
private eventCallbacks;
|
|
240
|
+
private responseIds;
|
|
241
|
+
constructor();
|
|
242
|
+
request<K extends keyof BBRequest>(type: K, arg: BBRequest[K]["args"], callback?: (result: RequestReturn<K>) => void): void;
|
|
243
|
+
subscribe<K extends keyof BBEvent>(type: K, callback: (result: EventReturn<K>) => void): () => void;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
type FileInfo = {
|
|
247
|
+
name: string;
|
|
248
|
+
fullPath: string;
|
|
249
|
+
createdAt: string;
|
|
250
|
+
modifiedAt: string;
|
|
251
|
+
ext: string;
|
|
252
|
+
size: number;
|
|
253
|
+
wordCount: number;
|
|
254
|
+
summary: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Window = iframe
|
|
259
|
+
* This will be used to send message (request) from the iframe to editor
|
|
260
|
+
* It will let the app know which event to listen to and update the iframe
|
|
261
|
+
* @param event the params that will be sent to the editor
|
|
262
|
+
*/
|
|
263
|
+
declare function registerEvent<K extends keyof BBEvent>(event: {
|
|
264
|
+
type: K;
|
|
265
|
+
}): void;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* This will be used to send message (request) from the iframe to editor
|
|
269
|
+
* @param request the params that will be sent to the editor
|
|
270
|
+
*/
|
|
271
|
+
declare function registerRequest<K extends keyof BBRequest>(request: {
|
|
272
|
+
id: string;
|
|
273
|
+
type: K;
|
|
274
|
+
arg: BBRequest[K]["args"];
|
|
275
|
+
}): void;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* This is the function to inject styles to the iframe from the parent window
|
|
279
|
+
* @param css the css styles from parent window
|
|
280
|
+
* @returns function to remove the injected styles
|
|
281
|
+
*/
|
|
282
|
+
declare function injectStyles(css: string): () => void;
|
|
283
|
+
|
|
284
|
+
type Checkpoint = {
|
|
285
|
+
sha: string;
|
|
286
|
+
message: string;
|
|
287
|
+
timestamp: number;
|
|
288
|
+
author: {
|
|
289
|
+
name: string;
|
|
290
|
+
email: string;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type CopyArg = {
|
|
295
|
+
path: string;
|
|
296
|
+
targetFolder: string;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
type WatchFSEvent = "updated" | "deleted";
|
|
300
|
+
|
|
301
|
+
type User = {
|
|
302
|
+
id: string;
|
|
303
|
+
name: string;
|
|
304
|
+
email: string;
|
|
305
|
+
bio: string;
|
|
306
|
+
avatar: string;
|
|
307
|
+
createdAt: string;
|
|
308
|
+
updatedAt: string;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
interface DirectoryContents {
|
|
312
|
+
files: string[];
|
|
313
|
+
directories: string[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
type DirectoryStats = {
|
|
317
|
+
files: number;
|
|
318
|
+
directories: number;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
type FileEncoding = Extract<BufferEncoding, "utf8" | "hex" | "base64" | "base64url">;
|
|
322
|
+
type FileContent = {
|
|
323
|
+
path: string;
|
|
324
|
+
content: string;
|
|
325
|
+
type: FileEncoding;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
interface GitFileStatus {
|
|
329
|
+
filePath: string;
|
|
330
|
+
staged: boolean;
|
|
331
|
+
status: "new" | "modified" | "deleted";
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
type IconArg = {
|
|
335
|
+
pluginId?: string;
|
|
336
|
+
extension: string;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
declare const enGB: {
|
|
340
|
+
"language.british_english": string;
|
|
341
|
+
"language.french": string;
|
|
342
|
+
"file.new": string;
|
|
343
|
+
"file.new.placeholder": string;
|
|
344
|
+
"file.open": string;
|
|
345
|
+
"file.duplicate": string;
|
|
346
|
+
"file.delete": string;
|
|
347
|
+
"file.rename": string;
|
|
348
|
+
"file.close": string;
|
|
349
|
+
"file.cut": string;
|
|
350
|
+
"file.copy": string;
|
|
351
|
+
"file.export_html": string;
|
|
352
|
+
"file.export_pdf": string;
|
|
353
|
+
"file.print": string;
|
|
354
|
+
"file.location.open": string;
|
|
355
|
+
file: string;
|
|
356
|
+
edit: string;
|
|
357
|
+
view: string;
|
|
358
|
+
help: string;
|
|
359
|
+
welcome: string;
|
|
360
|
+
"welcome.message": string;
|
|
361
|
+
"version.current": string;
|
|
362
|
+
"version.latest": string;
|
|
363
|
+
"version.out_of_date": string;
|
|
364
|
+
"version.up_to_date": string;
|
|
365
|
+
"update.check": string;
|
|
366
|
+
"update.download": string;
|
|
367
|
+
"update.release_notes": string;
|
|
368
|
+
install_and_restart: string;
|
|
369
|
+
later: string;
|
|
370
|
+
close: string;
|
|
371
|
+
about: string;
|
|
372
|
+
change_log: string;
|
|
373
|
+
documentation: string;
|
|
374
|
+
"report.issue": string;
|
|
375
|
+
"folder.new": string;
|
|
376
|
+
"folder.new.placeholder": string;
|
|
377
|
+
"folder.open": string;
|
|
378
|
+
"folder.open.message": string;
|
|
379
|
+
"folder.open.description": string;
|
|
380
|
+
"project.download": string;
|
|
381
|
+
"project.download.title": string;
|
|
382
|
+
"project.download.description": string;
|
|
383
|
+
"project.select": string;
|
|
384
|
+
"project.select.title": string;
|
|
385
|
+
"project.select.description": string;
|
|
386
|
+
"project.new": string;
|
|
387
|
+
tags: string;
|
|
388
|
+
"tag.input.placeholder": string;
|
|
389
|
+
category: string;
|
|
390
|
+
"category.select": string;
|
|
391
|
+
"project.title": string;
|
|
392
|
+
"project.title.placeholder": string;
|
|
393
|
+
"project.description": string;
|
|
394
|
+
"project.description.placeholder": string;
|
|
395
|
+
email: string;
|
|
396
|
+
"email.placeholder": string;
|
|
397
|
+
password: string;
|
|
398
|
+
"password.placeholder": string;
|
|
399
|
+
username: string;
|
|
400
|
+
"username.placeholder": string;
|
|
401
|
+
"workspace.select": string;
|
|
402
|
+
"workspace.select.description": string;
|
|
403
|
+
"file.explorer": string;
|
|
404
|
+
"no_workspace.message": string;
|
|
405
|
+
"folder.select.placeholder": string;
|
|
406
|
+
"folder.select": string;
|
|
407
|
+
"folder.rename": string;
|
|
408
|
+
"folder.duplicate": string;
|
|
409
|
+
"folder.paste": string;
|
|
410
|
+
"folder.cut": string;
|
|
411
|
+
"folder.copy": string;
|
|
412
|
+
"folder.delete": string;
|
|
413
|
+
folder: string;
|
|
414
|
+
"folder.location.open": string;
|
|
415
|
+
"checkpoint.list.header": string;
|
|
416
|
+
"checkpoint.placeholder": string;
|
|
417
|
+
"checkpoint.button": string;
|
|
418
|
+
"git.stage.all": string;
|
|
419
|
+
"git.discard.all": string;
|
|
420
|
+
"git.stage": string;
|
|
421
|
+
"git.discard": string;
|
|
422
|
+
"git.discard.message": string;
|
|
423
|
+
"git.unstage.all": string;
|
|
424
|
+
"git.unstage": string;
|
|
425
|
+
changes: string;
|
|
426
|
+
history: string;
|
|
427
|
+
home: string;
|
|
428
|
+
cancel: string;
|
|
429
|
+
confirm: string;
|
|
430
|
+
"plugin.install": string;
|
|
431
|
+
"project.create": string;
|
|
432
|
+
"checkpoint.save": string;
|
|
433
|
+
"file.delete.warning": string;
|
|
434
|
+
"folder.delete.warning": string;
|
|
435
|
+
delete: string;
|
|
436
|
+
"placeholder.text": string;
|
|
437
|
+
"placeholder.click": string;
|
|
438
|
+
"placeholder.label": string;
|
|
439
|
+
find: string;
|
|
440
|
+
replace: string;
|
|
441
|
+
"replace.all": string;
|
|
442
|
+
previous: string;
|
|
443
|
+
next: string;
|
|
444
|
+
"search.use.regex": string;
|
|
445
|
+
"search.case.sensitive": string;
|
|
446
|
+
"plugins.search": string;
|
|
447
|
+
install: string;
|
|
448
|
+
uninstall: string;
|
|
449
|
+
repository: string;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
type Language = keyof typeof enGB;
|
|
453
|
+
|
|
454
|
+
type Locale = "en-GB" | "fr-FR";
|
|
455
|
+
|
|
456
|
+
interface MenuContent {
|
|
457
|
+
header: Language;
|
|
458
|
+
shortcut?: string;
|
|
459
|
+
disabled?: boolean;
|
|
460
|
+
sub?: MenuContent[];
|
|
461
|
+
separator?: boolean;
|
|
462
|
+
onClick?: () => void;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote";
|
|
466
|
+
|
|
467
|
+
type Database = {
|
|
468
|
+
__InternalSupabase: {
|
|
469
|
+
PostgrestVersion: "13.0.4";
|
|
470
|
+
};
|
|
471
|
+
public: {
|
|
472
|
+
Tables: {
|
|
473
|
+
plugin_versions: {
|
|
474
|
+
Row: {
|
|
475
|
+
archived: boolean;
|
|
476
|
+
created_at: string;
|
|
477
|
+
id: number;
|
|
478
|
+
plugin_id: number;
|
|
479
|
+
release_note: string;
|
|
480
|
+
size: number;
|
|
481
|
+
stage: Database["public"]["Enums"]["version_stage"];
|
|
482
|
+
updated_at: string;
|
|
483
|
+
version: string;
|
|
484
|
+
};
|
|
485
|
+
Insert: {
|
|
486
|
+
archived?: boolean;
|
|
487
|
+
created_at?: string;
|
|
488
|
+
id?: number;
|
|
489
|
+
plugin_id: number;
|
|
490
|
+
release_note: string;
|
|
491
|
+
size?: number;
|
|
492
|
+
stage?: Database["public"]["Enums"]["version_stage"];
|
|
493
|
+
updated_at?: string;
|
|
494
|
+
version: string;
|
|
495
|
+
};
|
|
496
|
+
Update: {
|
|
497
|
+
archived?: boolean;
|
|
498
|
+
created_at?: string;
|
|
499
|
+
id?: number;
|
|
500
|
+
plugin_id?: number;
|
|
501
|
+
release_note?: string;
|
|
502
|
+
size?: number;
|
|
503
|
+
stage?: Database["public"]["Enums"]["version_stage"];
|
|
504
|
+
updated_at?: string;
|
|
505
|
+
version?: string;
|
|
506
|
+
};
|
|
507
|
+
Relationships: [
|
|
508
|
+
{
|
|
509
|
+
foreignKeyName: "plugin_versions_plugin_id_fkey";
|
|
510
|
+
columns: ["plugin_id"];
|
|
511
|
+
isOneToOne: false;
|
|
512
|
+
referencedRelation: "plugins";
|
|
513
|
+
referencedColumns: ["id"];
|
|
514
|
+
}
|
|
515
|
+
];
|
|
516
|
+
};
|
|
517
|
+
plugins: {
|
|
518
|
+
Row: {
|
|
519
|
+
author_id: string;
|
|
520
|
+
categories: string[] | null;
|
|
521
|
+
created_at: string;
|
|
522
|
+
description: string | null;
|
|
523
|
+
homepage: string | null;
|
|
524
|
+
id: number;
|
|
525
|
+
key: string;
|
|
526
|
+
name: string | null;
|
|
527
|
+
npm_package: string | null;
|
|
528
|
+
updated_at: string;
|
|
529
|
+
};
|
|
530
|
+
Insert: {
|
|
531
|
+
author_id?: string;
|
|
532
|
+
categories?: string[] | null;
|
|
533
|
+
created_at?: string;
|
|
534
|
+
description?: string | null;
|
|
535
|
+
homepage?: string | null;
|
|
536
|
+
id?: number;
|
|
537
|
+
key?: string;
|
|
538
|
+
name?: string | null;
|
|
539
|
+
npm_package?: string | null;
|
|
540
|
+
updated_at?: string;
|
|
541
|
+
};
|
|
542
|
+
Update: {
|
|
543
|
+
author_id?: string;
|
|
544
|
+
categories?: string[] | null;
|
|
545
|
+
created_at?: string;
|
|
546
|
+
description?: string | null;
|
|
547
|
+
homepage?: string | null;
|
|
548
|
+
id?: number;
|
|
549
|
+
key?: string;
|
|
550
|
+
name?: string | null;
|
|
551
|
+
npm_package?: string | null;
|
|
552
|
+
updated_at?: string;
|
|
553
|
+
};
|
|
554
|
+
Relationships: [
|
|
555
|
+
{
|
|
556
|
+
foreignKeyName: "plugins_author_id_fkey";
|
|
557
|
+
columns: ["author_id"];
|
|
558
|
+
isOneToOne: false;
|
|
559
|
+
referencedRelation: "profiles";
|
|
560
|
+
referencedColumns: ["id"];
|
|
561
|
+
}
|
|
562
|
+
];
|
|
563
|
+
};
|
|
564
|
+
profiles: {
|
|
565
|
+
Row: {
|
|
566
|
+
avatar_url: string | null;
|
|
567
|
+
full_name: string | null;
|
|
568
|
+
id: string;
|
|
569
|
+
updated_at: string | null;
|
|
570
|
+
username: string | null;
|
|
571
|
+
website: string | null;
|
|
572
|
+
};
|
|
573
|
+
Insert: {
|
|
574
|
+
avatar_url?: string | null;
|
|
575
|
+
full_name?: string | null;
|
|
576
|
+
id: string;
|
|
577
|
+
updated_at?: string | null;
|
|
578
|
+
username?: string | null;
|
|
579
|
+
website?: string | null;
|
|
580
|
+
};
|
|
581
|
+
Update: {
|
|
582
|
+
avatar_url?: string | null;
|
|
583
|
+
full_name?: string | null;
|
|
584
|
+
id?: string;
|
|
585
|
+
updated_at?: string | null;
|
|
586
|
+
username?: string | null;
|
|
587
|
+
website?: string | null;
|
|
588
|
+
};
|
|
589
|
+
Relationships: [];
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
Views: {
|
|
593
|
+
[_ in never]: never;
|
|
594
|
+
};
|
|
595
|
+
Functions: {
|
|
596
|
+
[_ in never]: never;
|
|
597
|
+
};
|
|
598
|
+
Enums: {
|
|
599
|
+
version_stage: "DRAFT" | "ALPHA" | "BETA" | "PROD";
|
|
600
|
+
};
|
|
601
|
+
CompositeTypes: {
|
|
602
|
+
[_ in never]: never;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
|
|
607
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
|
|
608
|
+
type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
|
|
609
|
+
schema: keyof DatabaseWithoutInternals;
|
|
610
|
+
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
611
|
+
schema: keyof DatabaseWithoutInternals;
|
|
612
|
+
} ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
|
|
613
|
+
schema: keyof DatabaseWithoutInternals;
|
|
614
|
+
} ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
615
|
+
Row: infer R;
|
|
616
|
+
} ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
|
|
617
|
+
Row: infer R;
|
|
618
|
+
} ? R : never : never;
|
|
619
|
+
|
|
620
|
+
type PluginItem = Tables<"plugins"> & {
|
|
621
|
+
production_version: {
|
|
622
|
+
id: number;
|
|
623
|
+
version: string;
|
|
624
|
+
release_note: string;
|
|
625
|
+
size: number;
|
|
626
|
+
updated_at: string;
|
|
627
|
+
} | null;
|
|
628
|
+
profile: {
|
|
629
|
+
username: string | null;
|
|
630
|
+
} | null;
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
interface RenameType {
|
|
634
|
+
path: string;
|
|
635
|
+
newPath: string;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
type Result<T = null> = {
|
|
639
|
+
data: T | null;
|
|
640
|
+
error: string | null;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
type Route = "welcome" | "project" | "new-project" | "settings" | "updates";
|
|
644
|
+
|
|
645
|
+
type Settings = {
|
|
646
|
+
theme: "light" | "dark" | "system";
|
|
647
|
+
language?: Locale;
|
|
648
|
+
sidebarWidth: number;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
interface TutorialHeader {
|
|
652
|
+
slug: string;
|
|
653
|
+
title: string;
|
|
654
|
+
tags: string[];
|
|
655
|
+
order: number | null;
|
|
656
|
+
date: string | null;
|
|
657
|
+
excerpt: string;
|
|
658
|
+
filePath: string;
|
|
659
|
+
body: string;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
declare const frFR: {
|
|
663
|
+
[key in Language]: ;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
export { type BBEvent, type BBRequest, type Checkpoint, type CopyArg, type DirInfo, type DirectoryContents, type DirectoryStats, type EventReturn, type FileContent, type FileInfo, type GitFileStatus, type IconArg, type Language, type Load, type Locale, type MenuContent, type Nav, type PluginItem, type Project, type RenameType, type RequestReturn, type Result, type Route, type Settings, type TutorialHeader, type User, type WatchFSEvent, BBRelay as default, enGB, frFR, injectStyles, registerEvent, registerRequest };
|