bb-relay 0.0.20 → 0.0.22
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/{Checkpoint-BDzkE4x-.d.mts → Commit-PdsjrKSG.d.mts} +2 -2
- package/dist/{Checkpoint-BDzkE4x-.d.ts → Commit-PdsjrKSG.d.ts} +2 -2
- package/dist/FileStat-CmS6lR3e.d.mts +35 -0
- package/dist/FileStat-CmS6lR3e.d.ts +35 -0
- package/dist/{Project-CaBJDjOU.d.mts → Project-B7IjpqOJ.d.mts} +2 -2
- package/dist/{Project-CSkTbftG.d.ts → Project-B_Vppjgw.d.ts} +2 -2
- package/dist/api.d.mts +337 -0
- package/dist/api.d.ts +337 -0
- package/dist/api.js +1 -0
- package/dist/api.mjs +0 -0
- package/dist/constant.js +1 -3
- package/dist/constant.mjs +0 -2
- package/dist/database.d.mts +3 -3
- package/dist/database.d.ts +3 -3
- package/dist/editor.d.mts +4 -41
- package/dist/editor.d.ts +4 -41
- package/dist/index.d.mts +12 -236
- package/dist/index.d.ts +12 -236
- package/dist/index.js +30 -16
- package/dist/index.mjs +28 -14
- package/dist/locale.js +1 -3
- package/dist/locale.mjs +0 -2
- package/package.json +2 -9
- package/src/api.ts +6 -0
- package/src/editor.ts +7 -11
- package/src/index.ts +4 -18
- package/src/relay/index.ts +11 -9
- package/src/relay/storage-bridge.ts +5 -7
- package/src/types/api/BBEvent.ts +44 -32
- package/src/types/api/BBRequest.ts +12 -5
- package/src/types/database/Project.ts +2 -2
- package/src/types/editor/Commit.ts +11 -0
- package/src/types/editor/CopyArg.ts +2 -5
- package/src/types/editor/Nav.ts +8 -2
- package/src/types/requests/app/Load.ts +7 -0
- package/src/types/requests/app/index.ts +26 -0
- package/src/types/{files/FileInfo.ts → requests/file/FileStat.ts} +2 -2
- package/src/types/requests/file/index.ts +34 -0
- package/src/types/requests/folder/FolderContent.ts +4 -0
- package/src/types/requests/folder/FolderEntry.ts +5 -0
- package/src/types/requests/folder/FolderStat.ts +9 -0
- package/src/types/requests/folder/index.ts +32 -0
- package/src/types/requests/git.ts +64 -0
- package/src/types/requests/project.ts +14 -0
- package/src/types/requests/storage.ts +34 -0
- package/src/utils/extract-styles.ts +22 -0
- package/dist/chunk-NBMM2TZK.js +0 -33
- package/dist/chunk-S47CVTVK.mjs +0 -33
- package/dist/dev.d.mts +0 -11
- package/dist/dev.d.ts +0 -11
- package/dist/dev.js +0 -4991
- package/dist/dev.mjs +0 -4991
- package/src/dev.ts +0 -4
- package/src/load-virtual-editor/app/StatusState.ts +0 -6
- package/src/load-virtual-editor/app/css.ts +0 -154
- package/src/load-virtual-editor/app/store.ts +0 -25
- package/src/load-virtual-editor/events/handle-dir-update.ts +0 -23
- package/src/load-virtual-editor/events/handle-file-update.ts +0 -23
- package/src/load-virtual-editor/events/handle-load.ts +0 -39
- package/src/load-virtual-editor/events/handle-selected.ts +0 -30
- package/src/load-virtual-editor/index.ts +0 -52
- package/src/load-virtual-editor/lib/indexedStorage.ts +0 -28
- package/src/load-virtual-editor/mocks/generate-files.ts +0 -25
- package/src/load-virtual-editor/node/NodeState.ts +0 -23
- package/src/load-virtual-editor/node/copyDir.ts +0 -14
- package/src/load-virtual-editor/node/copyFile.ts +0 -14
- package/src/load-virtual-editor/node/createDir.ts +0 -10
- package/src/load-virtual-editor/node/createFile.ts +0 -13
- package/src/load-virtual-editor/node/deleteDir.ts +0 -10
- package/src/load-virtual-editor/node/deleteFile.ts +0 -13
- package/src/load-virtual-editor/node/formatPath.ts +0 -13
- package/src/load-virtual-editor/node/formatText.ts +0 -19
- package/src/load-virtual-editor/node/generateDirs.ts +0 -13
- package/src/load-virtual-editor/node/getDescendantLevel.ts +0 -9
- package/src/load-virtual-editor/node/getDirInfo.ts +0 -33
- package/src/load-virtual-editor/node/getFileInfo.ts +0 -31
- package/src/load-virtual-editor/node/getFiles.ts +0 -17
- package/src/load-virtual-editor/node/getParent.ts +0 -11
- package/src/load-virtual-editor/node/readDir.ts +0 -41
- package/src/load-virtual-editor/node/readFile.ts +0 -46
- package/src/load-virtual-editor/node/store.ts +0 -206
- package/src/load-virtual-editor/node/watch.ts +0 -9
- package/src/load-virtual-editor/node/writeFile.ts +0 -21
- package/src/load-virtual-editor/postResponse.ts +0 -21
- package/src/load-virtual-editor/request/requestFS.ts +0 -199
- package/src/load-virtual-editor/request/requestSelected.ts +0 -45
- package/src/load-virtual-editor/selected/SelectedState.ts +0 -7
- package/src/load-virtual-editor/selected/selectDir.ts +0 -13
- package/src/load-virtual-editor/selected/selectFile.ts +0 -13
- package/src/load-virtual-editor/selected/store.ts +0 -27
- package/src/load-virtual-editor/selected/watch.ts +0 -9
- package/src/types/api/DirRequests.ts +0 -39
- package/src/types/api/ProjectRequest.ts +0 -11
- package/src/types/editor/Checkpoint.ts +0 -11
- package/src/types/editor/DirectoryContents.ts +0 -4
- package/src/types/editor/DirectoryStats.ts +0 -4
- package/src/types/editor/RenameType.ts +0 -4
- package/src/types/files/FileTypes.ts +0 -13
- package/src/types/files/ReadFile.ts +0 -17
- package/src/types/files/index.ts +0 -31
- package/src/types/status/Load.ts +0 -16
- package/src/types/storage/index.ts +0 -11
- /package/src/types/{editor → requests/file}/FileContent.ts +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type CopyArg = {
|
|
2
|
+
source: string;
|
|
3
|
+
destination: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
interface FolderContent {
|
|
7
|
+
files: string[];
|
|
8
|
+
folders: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type FileEncoding = Extract<BufferEncoding, "utf8" | "hex" | "base64" | "base64url">;
|
|
12
|
+
type FileContent = {
|
|
13
|
+
path: string;
|
|
14
|
+
content: string;
|
|
15
|
+
type: FileEncoding;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface GitFileStatus {
|
|
19
|
+
filePath: string;
|
|
20
|
+
staged: boolean;
|
|
21
|
+
status: "new" | "modified" | "deleted";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type FileStat = {
|
|
25
|
+
name: string;
|
|
26
|
+
fullPath: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
modifiedAt: string;
|
|
29
|
+
ext: string;
|
|
30
|
+
size: number;
|
|
31
|
+
wordCount: number;
|
|
32
|
+
summary: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type { CopyArg as C, FolderContent as F, GitFileStatus as G, FileContent as a, FileStat as b };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type CopyArg = {
|
|
2
|
+
source: string;
|
|
3
|
+
destination: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
interface FolderContent {
|
|
7
|
+
files: string[];
|
|
8
|
+
folders: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type FileEncoding = Extract<BufferEncoding, "utf8" | "hex" | "base64" | "base64url">;
|
|
12
|
+
type FileContent = {
|
|
13
|
+
path: string;
|
|
14
|
+
content: string;
|
|
15
|
+
type: FileEncoding;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface GitFileStatus {
|
|
19
|
+
filePath: string;
|
|
20
|
+
staged: boolean;
|
|
21
|
+
status: "new" | "modified" | "deleted";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type FileStat = {
|
|
25
|
+
name: string;
|
|
26
|
+
fullPath: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
modifiedAt: string;
|
|
29
|
+
ext: string;
|
|
30
|
+
size: number;
|
|
31
|
+
wordCount: number;
|
|
32
|
+
summary: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type { CopyArg as C, FolderContent as F, GitFileStatus as G, FileContent as a, FileStat as b };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as PROJECT_CATEGORY } from './PROJECT_CATEGORY-BivLHtB6.mjs';
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as Commit } from './Commit-PdsjrKSG.mjs';
|
|
3
3
|
|
|
4
4
|
type BaseWithId = {
|
|
5
5
|
id: string | number;
|
|
@@ -24,7 +24,7 @@ interface BaseProject {
|
|
|
24
24
|
tags?: string[];
|
|
25
25
|
description?: string;
|
|
26
26
|
category?: Category;
|
|
27
|
-
history?:
|
|
27
|
+
history?: Commit[];
|
|
28
28
|
userId: string;
|
|
29
29
|
}
|
|
30
30
|
type Project = Wrapper<BaseProject>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as PROJECT_CATEGORY } from './PROJECT_CATEGORY-BivLHtB6.js';
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as Commit } from './Commit-PdsjrKSG.js';
|
|
3
3
|
|
|
4
4
|
type BaseWithId = {
|
|
5
5
|
id: string | number;
|
|
@@ -24,7 +24,7 @@ interface BaseProject {
|
|
|
24
24
|
tags?: string[];
|
|
25
25
|
description?: string;
|
|
26
26
|
category?: Category;
|
|
27
|
-
history?:
|
|
27
|
+
history?: Commit[];
|
|
28
28
|
userId: string;
|
|
29
29
|
}
|
|
30
30
|
type Project = Wrapper<BaseProject>;
|
package/dist/api.d.mts
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, G as GitFileStatus } from './FileStat-CmS6lR3e.mjs';
|
|
2
|
+
import { P as Project } from './Project-B7IjpqOJ.mjs';
|
|
3
|
+
import { C as Commit } from './Commit-PdsjrKSG.mjs';
|
|
4
|
+
import './PROJECT_CATEGORY-BivLHtB6.mjs';
|
|
5
|
+
|
|
6
|
+
type Load = {
|
|
7
|
+
styles: string;
|
|
8
|
+
theme: "light" | "dark";
|
|
9
|
+
languages: string[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type LanguageChange = {
|
|
13
|
+
type: "language";
|
|
14
|
+
languages: string[];
|
|
15
|
+
};
|
|
16
|
+
type ThemeChange = {
|
|
17
|
+
type: "theme";
|
|
18
|
+
theme: "dark" | "light";
|
|
19
|
+
};
|
|
20
|
+
type IconChange = {
|
|
21
|
+
type: "icon";
|
|
22
|
+
};
|
|
23
|
+
type ProjectUpdate = {
|
|
24
|
+
type: "project-update";
|
|
25
|
+
project: Partial<Project["doc"]>;
|
|
26
|
+
};
|
|
27
|
+
type ProjectChange = {
|
|
28
|
+
type: "project-change";
|
|
29
|
+
project: Partial<Project["doc"]>;
|
|
30
|
+
};
|
|
31
|
+
type ProjectEmpty = {
|
|
32
|
+
type: "project-empty";
|
|
33
|
+
};
|
|
34
|
+
type BBEvent = {
|
|
35
|
+
app: {
|
|
36
|
+
response: LanguageChange | ThemeChange | IconChange;
|
|
37
|
+
};
|
|
38
|
+
load: {
|
|
39
|
+
response: Load;
|
|
40
|
+
};
|
|
41
|
+
project: {
|
|
42
|
+
response: ProjectUpdate | ProjectChange | ProjectEmpty;
|
|
43
|
+
};
|
|
44
|
+
selection: {
|
|
45
|
+
response: {
|
|
46
|
+
type: "file" | "folder";
|
|
47
|
+
path: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
token: {
|
|
51
|
+
response: string;
|
|
52
|
+
};
|
|
53
|
+
file: {
|
|
54
|
+
response: string;
|
|
55
|
+
};
|
|
56
|
+
folder: {
|
|
57
|
+
response: string;
|
|
58
|
+
};
|
|
59
|
+
editor: {
|
|
60
|
+
response: FileContent | null;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type FileRequests = {
|
|
65
|
+
"file:read": {
|
|
66
|
+
args: {
|
|
67
|
+
path: string;
|
|
68
|
+
type?: FileContent["type"];
|
|
69
|
+
};
|
|
70
|
+
response: FileContent;
|
|
71
|
+
};
|
|
72
|
+
"file:delete": {
|
|
73
|
+
args: {
|
|
74
|
+
path: string;
|
|
75
|
+
};
|
|
76
|
+
response: null;
|
|
77
|
+
};
|
|
78
|
+
"file:write": {
|
|
79
|
+
args: FileContent;
|
|
80
|
+
response: null;
|
|
81
|
+
};
|
|
82
|
+
"file:list": {
|
|
83
|
+
args: {
|
|
84
|
+
glob?: string;
|
|
85
|
+
} | null;
|
|
86
|
+
response: string[];
|
|
87
|
+
};
|
|
88
|
+
"file:stat": {
|
|
89
|
+
args: {
|
|
90
|
+
path: string;
|
|
91
|
+
};
|
|
92
|
+
response: FileStat;
|
|
93
|
+
};
|
|
94
|
+
"file:copy": {
|
|
95
|
+
args: CopyArg;
|
|
96
|
+
response: null;
|
|
97
|
+
};
|
|
98
|
+
"file:select": {
|
|
99
|
+
args: {
|
|
100
|
+
path: string;
|
|
101
|
+
};
|
|
102
|
+
response: null;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type FolderStat = {
|
|
107
|
+
name: string;
|
|
108
|
+
fullPath: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
modifiedAt: string;
|
|
111
|
+
size: number;
|
|
112
|
+
fileCount: number;
|
|
113
|
+
folderCount: number;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type FolderRequest = {
|
|
117
|
+
"folder:read": {
|
|
118
|
+
args: {
|
|
119
|
+
path: string;
|
|
120
|
+
};
|
|
121
|
+
response: FolderContent;
|
|
122
|
+
};
|
|
123
|
+
"folder:create": {
|
|
124
|
+
args: {
|
|
125
|
+
path: string;
|
|
126
|
+
};
|
|
127
|
+
response: null;
|
|
128
|
+
};
|
|
129
|
+
"folder:delete": {
|
|
130
|
+
args: {
|
|
131
|
+
path: string;
|
|
132
|
+
};
|
|
133
|
+
response: null;
|
|
134
|
+
};
|
|
135
|
+
"folder:stat": {
|
|
136
|
+
args: {
|
|
137
|
+
path: string;
|
|
138
|
+
};
|
|
139
|
+
response: FolderStat;
|
|
140
|
+
};
|
|
141
|
+
"folder:copy": {
|
|
142
|
+
args: CopyArg;
|
|
143
|
+
response: null;
|
|
144
|
+
};
|
|
145
|
+
"folder:select": {
|
|
146
|
+
args: {
|
|
147
|
+
path: string;
|
|
148
|
+
};
|
|
149
|
+
response: null;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
type StorageRequests = {
|
|
154
|
+
"storage:set-item": {
|
|
155
|
+
args: {
|
|
156
|
+
key: string;
|
|
157
|
+
value: string;
|
|
158
|
+
};
|
|
159
|
+
response: null;
|
|
160
|
+
};
|
|
161
|
+
"storage:get-item": {
|
|
162
|
+
args: {
|
|
163
|
+
key: string;
|
|
164
|
+
};
|
|
165
|
+
response: string;
|
|
166
|
+
};
|
|
167
|
+
"storage:remove-item": {
|
|
168
|
+
args: {
|
|
169
|
+
key: string;
|
|
170
|
+
};
|
|
171
|
+
response: null;
|
|
172
|
+
};
|
|
173
|
+
"storage:clear": {
|
|
174
|
+
args: null;
|
|
175
|
+
response: null;
|
|
176
|
+
};
|
|
177
|
+
"storage:key": {
|
|
178
|
+
args: {
|
|
179
|
+
index: number;
|
|
180
|
+
};
|
|
181
|
+
response: string[];
|
|
182
|
+
};
|
|
183
|
+
"storage:length": {
|
|
184
|
+
args: null;
|
|
185
|
+
response: string[];
|
|
186
|
+
};
|
|
187
|
+
"storage:sync": {
|
|
188
|
+
args: {
|
|
189
|
+
[key: string]: string;
|
|
190
|
+
};
|
|
191
|
+
response: {
|
|
192
|
+
[key: string]: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
"storage:load": {
|
|
196
|
+
args: null;
|
|
197
|
+
response: {
|
|
198
|
+
[key: string]: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
type ProjectRequest = {
|
|
204
|
+
"project:update": {
|
|
205
|
+
args: Project["update"];
|
|
206
|
+
response: null;
|
|
207
|
+
};
|
|
208
|
+
"project:read": {
|
|
209
|
+
args: null;
|
|
210
|
+
response: Project["doc"];
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
type AppRequest = {
|
|
215
|
+
"app:ping": {
|
|
216
|
+
args: null;
|
|
217
|
+
response: "pong";
|
|
218
|
+
};
|
|
219
|
+
"app:version": {
|
|
220
|
+
args: null;
|
|
221
|
+
response: string;
|
|
222
|
+
};
|
|
223
|
+
"app:language": {
|
|
224
|
+
args: null;
|
|
225
|
+
response: string[];
|
|
226
|
+
};
|
|
227
|
+
"app:icon": {
|
|
228
|
+
args: {
|
|
229
|
+
extensionId: string;
|
|
230
|
+
isFolder?: boolean;
|
|
231
|
+
};
|
|
232
|
+
response: string;
|
|
233
|
+
};
|
|
234
|
+
"app:styles": {
|
|
235
|
+
args: null;
|
|
236
|
+
response: string;
|
|
237
|
+
};
|
|
238
|
+
"app:theme": {
|
|
239
|
+
args: null;
|
|
240
|
+
response: "light" | "dark";
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
type GitRequests = {
|
|
245
|
+
"git:init": {
|
|
246
|
+
args: null;
|
|
247
|
+
response: null;
|
|
248
|
+
};
|
|
249
|
+
"git:stage": {
|
|
250
|
+
args: {
|
|
251
|
+
path: string;
|
|
252
|
+
};
|
|
253
|
+
response: null;
|
|
254
|
+
};
|
|
255
|
+
"git:unstage": {
|
|
256
|
+
args: {
|
|
257
|
+
path: string;
|
|
258
|
+
};
|
|
259
|
+
response: null;
|
|
260
|
+
};
|
|
261
|
+
"git:stage-all": {
|
|
262
|
+
args: null;
|
|
263
|
+
response: null;
|
|
264
|
+
};
|
|
265
|
+
"git:unstage-all": {
|
|
266
|
+
args: null;
|
|
267
|
+
response: null;
|
|
268
|
+
};
|
|
269
|
+
"git:commit": {
|
|
270
|
+
args: {
|
|
271
|
+
message: string;
|
|
272
|
+
};
|
|
273
|
+
response: null;
|
|
274
|
+
};
|
|
275
|
+
"git:checkout": {
|
|
276
|
+
args: {
|
|
277
|
+
ref: string;
|
|
278
|
+
};
|
|
279
|
+
response: null;
|
|
280
|
+
};
|
|
281
|
+
"git:discard": {
|
|
282
|
+
args: {
|
|
283
|
+
path: string;
|
|
284
|
+
};
|
|
285
|
+
response: null;
|
|
286
|
+
};
|
|
287
|
+
"git:discard-all": {
|
|
288
|
+
args: null;
|
|
289
|
+
response: null;
|
|
290
|
+
};
|
|
291
|
+
"git:log": {
|
|
292
|
+
args: null;
|
|
293
|
+
response: Commit[];
|
|
294
|
+
};
|
|
295
|
+
"git:diff": {
|
|
296
|
+
args: {
|
|
297
|
+
path: string;
|
|
298
|
+
};
|
|
299
|
+
response: null;
|
|
300
|
+
};
|
|
301
|
+
"git:push": {
|
|
302
|
+
args: null;
|
|
303
|
+
response: null;
|
|
304
|
+
};
|
|
305
|
+
"git:pull": {
|
|
306
|
+
args: null;
|
|
307
|
+
response: null;
|
|
308
|
+
};
|
|
309
|
+
"git:status": {
|
|
310
|
+
args: {
|
|
311
|
+
path: string;
|
|
312
|
+
};
|
|
313
|
+
response: GitFileStatus;
|
|
314
|
+
};
|
|
315
|
+
"git:status-list": {
|
|
316
|
+
args: null;
|
|
317
|
+
response: GitFileStatus[];
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
type BBRequest = FileRequests & FolderRequest & StorageRequests & ProjectRequest & AppRequest & GitRequests;
|
|
322
|
+
|
|
323
|
+
interface EventReturn<K extends keyof BBEvent> {
|
|
324
|
+
type: K;
|
|
325
|
+
response: BBEvent[K]["response"];
|
|
326
|
+
responseId: string;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
interface RequestReturn<K extends keyof BBRequest> {
|
|
330
|
+
id: string;
|
|
331
|
+
type: K;
|
|
332
|
+
response: BBRequest[K]["response"] | null;
|
|
333
|
+
error: null | string;
|
|
334
|
+
responseId: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export type { BBEvent, BBRequest, EventReturn, RequestReturn };
|