bb-relay 0.0.23 → 0.0.24
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/{FileStat-CmS6lR3e.d.mts → FolderStat-CC_Sg9M2.d.mts} +10 -5
- package/dist/{FileStat-CmS6lR3e.d.ts → FolderStat-CC_Sg9M2.d.ts} +10 -5
- package/dist/api.d.mts +58 -59
- package/dist/api.d.ts +58 -59
- package/dist/editor.d.mts +1 -1
- package/dist/editor.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/editor.ts +2 -0
- package/src/relay/index.ts +3 -3
- package/src/types/api/RequestParam.ts +1 -1
- package/src/types/api/RequestReturn.ts +0 -1
- package/src/types/requests/app/index.ts +10 -7
- package/src/types/requests/file/FileStat.ts +1 -4
- package/src/types/requests/file/index.ts +10 -7
- package/src/types/requests/folder/FolderStat.ts +0 -2
- package/src/types/requests/folder/index.ts +6 -6
- package/src/types/requests/git.ts +15 -15
- package/src/types/requests/project.ts +2 -2
- package/src/types/requests/storage.ts +8 -8
|
@@ -22,14 +22,19 @@ interface GitFileStatus {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
type FileStat = {
|
|
25
|
-
name: string;
|
|
26
|
-
fullPath: string;
|
|
27
25
|
createdAt: string;
|
|
28
26
|
modifiedAt: string;
|
|
27
|
+
accessedAt: string;
|
|
29
28
|
ext: string;
|
|
30
29
|
size: number;
|
|
31
|
-
wordCount: number;
|
|
32
|
-
summary: string;
|
|
33
30
|
};
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
type FolderStat = {
|
|
33
|
+
createdAt: string;
|
|
34
|
+
modifiedAt: string;
|
|
35
|
+
size: number;
|
|
36
|
+
fileCount: number;
|
|
37
|
+
folderCount: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type { CopyArg as C, FolderContent as F, GitFileStatus as G, FileContent as a, FileStat as b, FolderStat as c };
|
|
@@ -22,14 +22,19 @@ interface GitFileStatus {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
type FileStat = {
|
|
25
|
-
name: string;
|
|
26
|
-
fullPath: string;
|
|
27
25
|
createdAt: string;
|
|
28
26
|
modifiedAt: string;
|
|
27
|
+
accessedAt: string;
|
|
29
28
|
ext: string;
|
|
30
29
|
size: number;
|
|
31
|
-
wordCount: number;
|
|
32
|
-
summary: string;
|
|
33
30
|
};
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
type FolderStat = {
|
|
33
|
+
createdAt: string;
|
|
34
|
+
modifiedAt: string;
|
|
35
|
+
size: number;
|
|
36
|
+
fileCount: number;
|
|
37
|
+
folderCount: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type { CopyArg as C, FolderContent as F, GitFileStatus as G, FileContent as a, FileStat as b, FolderStat as c };
|
package/dist/api.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, G as GitFileStatus } from './
|
|
1
|
+
import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, c as FolderStat, G as GitFileStatus } from './FolderStat-CC_Sg9M2.mjs';
|
|
2
2
|
import { P as Project } from './Project-B7IjpqOJ.mjs';
|
|
3
3
|
import { C as Commit } from './Commit-PdsjrKSG.mjs';
|
|
4
4
|
import './PROJECT_CATEGORY-BivLHtB6.mjs';
|
|
@@ -63,87 +63,81 @@ type BBEvent = {
|
|
|
63
63
|
|
|
64
64
|
type FileRequests = {
|
|
65
65
|
"file:read": {
|
|
66
|
-
|
|
66
|
+
arg: {
|
|
67
67
|
path: string;
|
|
68
68
|
type?: FileContent["type"];
|
|
69
69
|
};
|
|
70
70
|
response: FileContent;
|
|
71
71
|
};
|
|
72
72
|
"file:delete": {
|
|
73
|
-
|
|
73
|
+
arg: {
|
|
74
74
|
path: string;
|
|
75
75
|
};
|
|
76
76
|
response: null;
|
|
77
77
|
};
|
|
78
78
|
"file:write": {
|
|
79
|
-
|
|
79
|
+
arg: FileContent;
|
|
80
80
|
response: null;
|
|
81
81
|
};
|
|
82
82
|
"file:list": {
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Without path, it will return all the files in the project
|
|
85
|
+
*/
|
|
86
|
+
arg: {
|
|
84
87
|
glob?: string;
|
|
85
|
-
|
|
88
|
+
path?: string;
|
|
89
|
+
};
|
|
86
90
|
response: string[];
|
|
87
91
|
};
|
|
88
92
|
"file:stat": {
|
|
89
|
-
|
|
93
|
+
arg: {
|
|
90
94
|
path: string;
|
|
91
95
|
};
|
|
92
96
|
response: FileStat;
|
|
93
97
|
};
|
|
94
98
|
"file:copy": {
|
|
95
|
-
|
|
99
|
+
arg: CopyArg;
|
|
96
100
|
response: null;
|
|
97
101
|
};
|
|
98
102
|
"file:select": {
|
|
99
|
-
|
|
103
|
+
arg: {
|
|
100
104
|
path: string;
|
|
101
105
|
};
|
|
102
106
|
response: null;
|
|
103
107
|
};
|
|
104
108
|
};
|
|
105
109
|
|
|
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
110
|
type FolderRequest = {
|
|
117
111
|
"folder:read": {
|
|
118
|
-
|
|
112
|
+
arg: {
|
|
119
113
|
path: string;
|
|
120
114
|
};
|
|
121
115
|
response: FolderContent;
|
|
122
116
|
};
|
|
123
117
|
"folder:create": {
|
|
124
|
-
|
|
118
|
+
arg: {
|
|
125
119
|
path: string;
|
|
126
120
|
};
|
|
127
121
|
response: null;
|
|
128
122
|
};
|
|
129
123
|
"folder:delete": {
|
|
130
|
-
|
|
124
|
+
arg: {
|
|
131
125
|
path: string;
|
|
132
126
|
};
|
|
133
127
|
response: null;
|
|
134
128
|
};
|
|
135
129
|
"folder:stat": {
|
|
136
|
-
|
|
130
|
+
arg: {
|
|
137
131
|
path: string;
|
|
138
132
|
};
|
|
139
133
|
response: FolderStat;
|
|
140
134
|
};
|
|
141
135
|
"folder:copy": {
|
|
142
|
-
|
|
136
|
+
arg: CopyArg;
|
|
143
137
|
response: null;
|
|
144
138
|
};
|
|
145
139
|
"folder:select": {
|
|
146
|
-
|
|
140
|
+
arg: {
|
|
147
141
|
path: string;
|
|
148
142
|
};
|
|
149
143
|
response: null;
|
|
@@ -152,40 +146,40 @@ type FolderRequest = {
|
|
|
152
146
|
|
|
153
147
|
type StorageRequests = {
|
|
154
148
|
"storage:set-item": {
|
|
155
|
-
|
|
149
|
+
arg: {
|
|
156
150
|
key: string;
|
|
157
151
|
value: string;
|
|
158
152
|
};
|
|
159
153
|
response: null;
|
|
160
154
|
};
|
|
161
155
|
"storage:get-item": {
|
|
162
|
-
|
|
156
|
+
arg: {
|
|
163
157
|
key: string;
|
|
164
158
|
};
|
|
165
159
|
response: string;
|
|
166
160
|
};
|
|
167
161
|
"storage:remove-item": {
|
|
168
|
-
|
|
162
|
+
arg: {
|
|
169
163
|
key: string;
|
|
170
164
|
};
|
|
171
165
|
response: null;
|
|
172
166
|
};
|
|
173
167
|
"storage:clear": {
|
|
174
|
-
|
|
168
|
+
arg: null;
|
|
175
169
|
response: null;
|
|
176
170
|
};
|
|
177
171
|
"storage:key": {
|
|
178
|
-
|
|
172
|
+
arg: {
|
|
179
173
|
index: number;
|
|
180
174
|
};
|
|
181
175
|
response: string[];
|
|
182
176
|
};
|
|
183
177
|
"storage:length": {
|
|
184
|
-
|
|
178
|
+
arg: null;
|
|
185
179
|
response: string[];
|
|
186
180
|
};
|
|
187
181
|
"storage:sync": {
|
|
188
|
-
|
|
182
|
+
arg: {
|
|
189
183
|
[key: string]: string;
|
|
190
184
|
};
|
|
191
185
|
response: {
|
|
@@ -193,7 +187,7 @@ type StorageRequests = {
|
|
|
193
187
|
};
|
|
194
188
|
};
|
|
195
189
|
"storage:load": {
|
|
196
|
-
|
|
190
|
+
arg: null;
|
|
197
191
|
response: {
|
|
198
192
|
[key: string]: string;
|
|
199
193
|
};
|
|
@@ -202,118 +196,124 @@ type StorageRequests = {
|
|
|
202
196
|
|
|
203
197
|
type ProjectRequest = {
|
|
204
198
|
"project:update": {
|
|
205
|
-
|
|
199
|
+
arg: Project["update"];
|
|
206
200
|
response: null;
|
|
207
201
|
};
|
|
208
202
|
"project:read": {
|
|
209
|
-
|
|
203
|
+
arg: null;
|
|
210
204
|
response: Project["doc"];
|
|
211
205
|
};
|
|
212
206
|
};
|
|
213
207
|
|
|
214
208
|
type AppRequest = {
|
|
215
209
|
"app:ping": {
|
|
216
|
-
|
|
217
|
-
|
|
210
|
+
arg: {
|
|
211
|
+
message: string;
|
|
212
|
+
params: unknown;
|
|
213
|
+
};
|
|
214
|
+
response: unknown;
|
|
218
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* To get the supported version of the app (plugin) e.g. if it's in version 2
|
|
218
|
+
*/
|
|
219
219
|
"app:version": {
|
|
220
|
-
|
|
220
|
+
arg: null;
|
|
221
221
|
response: string;
|
|
222
222
|
};
|
|
223
223
|
"app:language": {
|
|
224
|
-
|
|
224
|
+
arg: null;
|
|
225
225
|
response: string[];
|
|
226
226
|
};
|
|
227
227
|
"app:icon": {
|
|
228
|
-
|
|
228
|
+
arg: {
|
|
229
229
|
extensionId: string;
|
|
230
230
|
isFolder?: boolean;
|
|
231
231
|
};
|
|
232
232
|
response: string;
|
|
233
233
|
};
|
|
234
234
|
"app:styles": {
|
|
235
|
-
|
|
235
|
+
arg: null;
|
|
236
236
|
response: string;
|
|
237
237
|
};
|
|
238
238
|
"app:theme": {
|
|
239
|
-
|
|
239
|
+
arg: null;
|
|
240
240
|
response: "light" | "dark";
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
type GitRequests = {
|
|
245
245
|
"git:init": {
|
|
246
|
-
|
|
246
|
+
arg: null;
|
|
247
247
|
response: null;
|
|
248
248
|
};
|
|
249
249
|
"git:stage": {
|
|
250
|
-
|
|
250
|
+
arg: {
|
|
251
251
|
path: string;
|
|
252
252
|
};
|
|
253
253
|
response: null;
|
|
254
254
|
};
|
|
255
255
|
"git:unstage": {
|
|
256
|
-
|
|
256
|
+
arg: {
|
|
257
257
|
path: string;
|
|
258
258
|
};
|
|
259
259
|
response: null;
|
|
260
260
|
};
|
|
261
261
|
"git:stage-all": {
|
|
262
|
-
|
|
262
|
+
arg: null;
|
|
263
263
|
response: null;
|
|
264
264
|
};
|
|
265
265
|
"git:unstage-all": {
|
|
266
|
-
|
|
266
|
+
arg: null;
|
|
267
267
|
response: null;
|
|
268
268
|
};
|
|
269
269
|
"git:commit": {
|
|
270
|
-
|
|
270
|
+
arg: {
|
|
271
271
|
message: string;
|
|
272
272
|
};
|
|
273
273
|
response: null;
|
|
274
274
|
};
|
|
275
275
|
"git:checkout": {
|
|
276
|
-
|
|
276
|
+
arg: {
|
|
277
277
|
ref: string;
|
|
278
278
|
};
|
|
279
279
|
response: null;
|
|
280
280
|
};
|
|
281
281
|
"git:discard": {
|
|
282
|
-
|
|
282
|
+
arg: {
|
|
283
283
|
path: string;
|
|
284
284
|
};
|
|
285
285
|
response: null;
|
|
286
286
|
};
|
|
287
287
|
"git:discard-all": {
|
|
288
|
-
|
|
288
|
+
arg: null;
|
|
289
289
|
response: null;
|
|
290
290
|
};
|
|
291
291
|
"git:log": {
|
|
292
|
-
|
|
292
|
+
arg: null;
|
|
293
293
|
response: Commit[];
|
|
294
294
|
};
|
|
295
295
|
"git:diff": {
|
|
296
|
-
|
|
296
|
+
arg: {
|
|
297
297
|
path: string;
|
|
298
298
|
};
|
|
299
299
|
response: null;
|
|
300
300
|
};
|
|
301
301
|
"git:push": {
|
|
302
|
-
|
|
302
|
+
arg: null;
|
|
303
303
|
response: null;
|
|
304
304
|
};
|
|
305
305
|
"git:pull": {
|
|
306
|
-
|
|
306
|
+
arg: null;
|
|
307
307
|
response: null;
|
|
308
308
|
};
|
|
309
309
|
"git:status": {
|
|
310
|
-
|
|
310
|
+
arg: {
|
|
311
311
|
path: string;
|
|
312
312
|
};
|
|
313
313
|
response: GitFileStatus;
|
|
314
314
|
};
|
|
315
315
|
"git:status-list": {
|
|
316
|
-
|
|
316
|
+
arg: null;
|
|
317
317
|
response: GitFileStatus[];
|
|
318
318
|
};
|
|
319
319
|
};
|
|
@@ -336,7 +336,7 @@ interface EventReturn<K extends keyof BBEvent> {
|
|
|
336
336
|
type RequestParam<K extends keyof BBRequest> = {
|
|
337
337
|
id: string;
|
|
338
338
|
type: K;
|
|
339
|
-
arg: BBRequest[K]["
|
|
339
|
+
arg: BBRequest[K]["arg"];
|
|
340
340
|
source: "request";
|
|
341
341
|
};
|
|
342
342
|
|
|
@@ -344,7 +344,6 @@ interface RequestReturn<K extends keyof BBRequest> {
|
|
|
344
344
|
id: string;
|
|
345
345
|
type: K;
|
|
346
346
|
response: BBRequest[K]["response"] | null;
|
|
347
|
-
error: null | string;
|
|
348
347
|
responseId: string;
|
|
349
348
|
}
|
|
350
349
|
|
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, G as GitFileStatus } from './
|
|
1
|
+
import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, c as FolderStat, G as GitFileStatus } from './FolderStat-CC_Sg9M2.js';
|
|
2
2
|
import { P as Project } from './Project-B_Vppjgw.js';
|
|
3
3
|
import { C as Commit } from './Commit-PdsjrKSG.js';
|
|
4
4
|
import './PROJECT_CATEGORY-BivLHtB6.js';
|
|
@@ -63,87 +63,81 @@ type BBEvent = {
|
|
|
63
63
|
|
|
64
64
|
type FileRequests = {
|
|
65
65
|
"file:read": {
|
|
66
|
-
|
|
66
|
+
arg: {
|
|
67
67
|
path: string;
|
|
68
68
|
type?: FileContent["type"];
|
|
69
69
|
};
|
|
70
70
|
response: FileContent;
|
|
71
71
|
};
|
|
72
72
|
"file:delete": {
|
|
73
|
-
|
|
73
|
+
arg: {
|
|
74
74
|
path: string;
|
|
75
75
|
};
|
|
76
76
|
response: null;
|
|
77
77
|
};
|
|
78
78
|
"file:write": {
|
|
79
|
-
|
|
79
|
+
arg: FileContent;
|
|
80
80
|
response: null;
|
|
81
81
|
};
|
|
82
82
|
"file:list": {
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Without path, it will return all the files in the project
|
|
85
|
+
*/
|
|
86
|
+
arg: {
|
|
84
87
|
glob?: string;
|
|
85
|
-
|
|
88
|
+
path?: string;
|
|
89
|
+
};
|
|
86
90
|
response: string[];
|
|
87
91
|
};
|
|
88
92
|
"file:stat": {
|
|
89
|
-
|
|
93
|
+
arg: {
|
|
90
94
|
path: string;
|
|
91
95
|
};
|
|
92
96
|
response: FileStat;
|
|
93
97
|
};
|
|
94
98
|
"file:copy": {
|
|
95
|
-
|
|
99
|
+
arg: CopyArg;
|
|
96
100
|
response: null;
|
|
97
101
|
};
|
|
98
102
|
"file:select": {
|
|
99
|
-
|
|
103
|
+
arg: {
|
|
100
104
|
path: string;
|
|
101
105
|
};
|
|
102
106
|
response: null;
|
|
103
107
|
};
|
|
104
108
|
};
|
|
105
109
|
|
|
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
110
|
type FolderRequest = {
|
|
117
111
|
"folder:read": {
|
|
118
|
-
|
|
112
|
+
arg: {
|
|
119
113
|
path: string;
|
|
120
114
|
};
|
|
121
115
|
response: FolderContent;
|
|
122
116
|
};
|
|
123
117
|
"folder:create": {
|
|
124
|
-
|
|
118
|
+
arg: {
|
|
125
119
|
path: string;
|
|
126
120
|
};
|
|
127
121
|
response: null;
|
|
128
122
|
};
|
|
129
123
|
"folder:delete": {
|
|
130
|
-
|
|
124
|
+
arg: {
|
|
131
125
|
path: string;
|
|
132
126
|
};
|
|
133
127
|
response: null;
|
|
134
128
|
};
|
|
135
129
|
"folder:stat": {
|
|
136
|
-
|
|
130
|
+
arg: {
|
|
137
131
|
path: string;
|
|
138
132
|
};
|
|
139
133
|
response: FolderStat;
|
|
140
134
|
};
|
|
141
135
|
"folder:copy": {
|
|
142
|
-
|
|
136
|
+
arg: CopyArg;
|
|
143
137
|
response: null;
|
|
144
138
|
};
|
|
145
139
|
"folder:select": {
|
|
146
|
-
|
|
140
|
+
arg: {
|
|
147
141
|
path: string;
|
|
148
142
|
};
|
|
149
143
|
response: null;
|
|
@@ -152,40 +146,40 @@ type FolderRequest = {
|
|
|
152
146
|
|
|
153
147
|
type StorageRequests = {
|
|
154
148
|
"storage:set-item": {
|
|
155
|
-
|
|
149
|
+
arg: {
|
|
156
150
|
key: string;
|
|
157
151
|
value: string;
|
|
158
152
|
};
|
|
159
153
|
response: null;
|
|
160
154
|
};
|
|
161
155
|
"storage:get-item": {
|
|
162
|
-
|
|
156
|
+
arg: {
|
|
163
157
|
key: string;
|
|
164
158
|
};
|
|
165
159
|
response: string;
|
|
166
160
|
};
|
|
167
161
|
"storage:remove-item": {
|
|
168
|
-
|
|
162
|
+
arg: {
|
|
169
163
|
key: string;
|
|
170
164
|
};
|
|
171
165
|
response: null;
|
|
172
166
|
};
|
|
173
167
|
"storage:clear": {
|
|
174
|
-
|
|
168
|
+
arg: null;
|
|
175
169
|
response: null;
|
|
176
170
|
};
|
|
177
171
|
"storage:key": {
|
|
178
|
-
|
|
172
|
+
arg: {
|
|
179
173
|
index: number;
|
|
180
174
|
};
|
|
181
175
|
response: string[];
|
|
182
176
|
};
|
|
183
177
|
"storage:length": {
|
|
184
|
-
|
|
178
|
+
arg: null;
|
|
185
179
|
response: string[];
|
|
186
180
|
};
|
|
187
181
|
"storage:sync": {
|
|
188
|
-
|
|
182
|
+
arg: {
|
|
189
183
|
[key: string]: string;
|
|
190
184
|
};
|
|
191
185
|
response: {
|
|
@@ -193,7 +187,7 @@ type StorageRequests = {
|
|
|
193
187
|
};
|
|
194
188
|
};
|
|
195
189
|
"storage:load": {
|
|
196
|
-
|
|
190
|
+
arg: null;
|
|
197
191
|
response: {
|
|
198
192
|
[key: string]: string;
|
|
199
193
|
};
|
|
@@ -202,118 +196,124 @@ type StorageRequests = {
|
|
|
202
196
|
|
|
203
197
|
type ProjectRequest = {
|
|
204
198
|
"project:update": {
|
|
205
|
-
|
|
199
|
+
arg: Project["update"];
|
|
206
200
|
response: null;
|
|
207
201
|
};
|
|
208
202
|
"project:read": {
|
|
209
|
-
|
|
203
|
+
arg: null;
|
|
210
204
|
response: Project["doc"];
|
|
211
205
|
};
|
|
212
206
|
};
|
|
213
207
|
|
|
214
208
|
type AppRequest = {
|
|
215
209
|
"app:ping": {
|
|
216
|
-
|
|
217
|
-
|
|
210
|
+
arg: {
|
|
211
|
+
message: string;
|
|
212
|
+
params: unknown;
|
|
213
|
+
};
|
|
214
|
+
response: unknown;
|
|
218
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* To get the supported version of the app (plugin) e.g. if it's in version 2
|
|
218
|
+
*/
|
|
219
219
|
"app:version": {
|
|
220
|
-
|
|
220
|
+
arg: null;
|
|
221
221
|
response: string;
|
|
222
222
|
};
|
|
223
223
|
"app:language": {
|
|
224
|
-
|
|
224
|
+
arg: null;
|
|
225
225
|
response: string[];
|
|
226
226
|
};
|
|
227
227
|
"app:icon": {
|
|
228
|
-
|
|
228
|
+
arg: {
|
|
229
229
|
extensionId: string;
|
|
230
230
|
isFolder?: boolean;
|
|
231
231
|
};
|
|
232
232
|
response: string;
|
|
233
233
|
};
|
|
234
234
|
"app:styles": {
|
|
235
|
-
|
|
235
|
+
arg: null;
|
|
236
236
|
response: string;
|
|
237
237
|
};
|
|
238
238
|
"app:theme": {
|
|
239
|
-
|
|
239
|
+
arg: null;
|
|
240
240
|
response: "light" | "dark";
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
type GitRequests = {
|
|
245
245
|
"git:init": {
|
|
246
|
-
|
|
246
|
+
arg: null;
|
|
247
247
|
response: null;
|
|
248
248
|
};
|
|
249
249
|
"git:stage": {
|
|
250
|
-
|
|
250
|
+
arg: {
|
|
251
251
|
path: string;
|
|
252
252
|
};
|
|
253
253
|
response: null;
|
|
254
254
|
};
|
|
255
255
|
"git:unstage": {
|
|
256
|
-
|
|
256
|
+
arg: {
|
|
257
257
|
path: string;
|
|
258
258
|
};
|
|
259
259
|
response: null;
|
|
260
260
|
};
|
|
261
261
|
"git:stage-all": {
|
|
262
|
-
|
|
262
|
+
arg: null;
|
|
263
263
|
response: null;
|
|
264
264
|
};
|
|
265
265
|
"git:unstage-all": {
|
|
266
|
-
|
|
266
|
+
arg: null;
|
|
267
267
|
response: null;
|
|
268
268
|
};
|
|
269
269
|
"git:commit": {
|
|
270
|
-
|
|
270
|
+
arg: {
|
|
271
271
|
message: string;
|
|
272
272
|
};
|
|
273
273
|
response: null;
|
|
274
274
|
};
|
|
275
275
|
"git:checkout": {
|
|
276
|
-
|
|
276
|
+
arg: {
|
|
277
277
|
ref: string;
|
|
278
278
|
};
|
|
279
279
|
response: null;
|
|
280
280
|
};
|
|
281
281
|
"git:discard": {
|
|
282
|
-
|
|
282
|
+
arg: {
|
|
283
283
|
path: string;
|
|
284
284
|
};
|
|
285
285
|
response: null;
|
|
286
286
|
};
|
|
287
287
|
"git:discard-all": {
|
|
288
|
-
|
|
288
|
+
arg: null;
|
|
289
289
|
response: null;
|
|
290
290
|
};
|
|
291
291
|
"git:log": {
|
|
292
|
-
|
|
292
|
+
arg: null;
|
|
293
293
|
response: Commit[];
|
|
294
294
|
};
|
|
295
295
|
"git:diff": {
|
|
296
|
-
|
|
296
|
+
arg: {
|
|
297
297
|
path: string;
|
|
298
298
|
};
|
|
299
299
|
response: null;
|
|
300
300
|
};
|
|
301
301
|
"git:push": {
|
|
302
|
-
|
|
302
|
+
arg: null;
|
|
303
303
|
response: null;
|
|
304
304
|
};
|
|
305
305
|
"git:pull": {
|
|
306
|
-
|
|
306
|
+
arg: null;
|
|
307
307
|
response: null;
|
|
308
308
|
};
|
|
309
309
|
"git:status": {
|
|
310
|
-
|
|
310
|
+
arg: {
|
|
311
311
|
path: string;
|
|
312
312
|
};
|
|
313
313
|
response: GitFileStatus;
|
|
314
314
|
};
|
|
315
315
|
"git:status-list": {
|
|
316
|
-
|
|
316
|
+
arg: null;
|
|
317
317
|
response: GitFileStatus[];
|
|
318
318
|
};
|
|
319
319
|
};
|
|
@@ -336,7 +336,7 @@ interface EventReturn<K extends keyof BBEvent> {
|
|
|
336
336
|
type RequestParam<K extends keyof BBRequest> = {
|
|
337
337
|
id: string;
|
|
338
338
|
type: K;
|
|
339
|
-
arg: BBRequest[K]["
|
|
339
|
+
arg: BBRequest[K]["arg"];
|
|
340
340
|
source: "request";
|
|
341
341
|
};
|
|
342
342
|
|
|
@@ -344,7 +344,6 @@ interface RequestReturn<K extends keyof BBRequest> {
|
|
|
344
344
|
id: string;
|
|
345
345
|
type: K;
|
|
346
346
|
response: BBRequest[K]["response"] | null;
|
|
347
|
-
error: null | string;
|
|
348
347
|
responseId: string;
|
|
349
348
|
}
|
|
350
349
|
|
package/dist/editor.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as Commit } from './Commit-PdsjrKSG.mjs';
|
|
2
|
-
export { C as CopyArg, a as FileContent, b as FileStat, F as FolderContent, G as GitFileStatus } from './
|
|
2
|
+
export { C as CopyArg, a as FileContent, b as FileStat, F as FolderContent, c as FolderStat, G as GitFileStatus } from './FolderStat-CC_Sg9M2.mjs';
|
|
3
3
|
import { L as Language, a as Locale } from './Locale-WvQQn-Rm.mjs';
|
|
4
4
|
export { R as Result } from './Result-BLbZLEgX.mjs';
|
|
5
5
|
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as Commit } from './Commit-PdsjrKSG.js';
|
|
2
|
-
export { C as CopyArg, a as FileContent, b as FileStat, F as FolderContent, G as GitFileStatus } from './
|
|
2
|
+
export { C as CopyArg, a as FileContent, b as FileStat, F as FolderContent, c as FolderStat, G as GitFileStatus } from './FolderStat-CC_Sg9M2.js';
|
|
3
3
|
import { L as Language, a as Locale } from './Locale-WvQQn-Rm.js';
|
|
4
4
|
export { R as Result } from './Result-BLbZLEgX.js';
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BBRequest, RequestReturn, BBEvent, EventReturn, EventParam, RequestParam } from './api.mjs';
|
|
2
|
-
import { a as FileContent } from './
|
|
2
|
+
import { a as FileContent } from './FolderStat-CC_Sg9M2.mjs';
|
|
3
3
|
export { R as Result } from './Result-BLbZLEgX.mjs';
|
|
4
4
|
import { P as Plugin } from './Plugin-BMoQ48uq.mjs';
|
|
5
5
|
import './Project-B7IjpqOJ.mjs';
|
|
@@ -11,7 +11,7 @@ declare class BBRelay {
|
|
|
11
11
|
private eventCallbacks;
|
|
12
12
|
private responseIds;
|
|
13
13
|
constructor();
|
|
14
|
-
request<K extends keyof BBRequest>(type: K, arg: BBRequest[K]["
|
|
14
|
+
request<K extends keyof BBRequest>(type: K, arg: BBRequest[K]["arg"], callback?: (result: RequestReturn<K>) => void): void;
|
|
15
15
|
subscribe<K extends keyof BBEvent>(type: K, callback: (result: EventReturn<K>) => void): () => void;
|
|
16
16
|
}
|
|
17
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BBRequest, RequestReturn, BBEvent, EventReturn, EventParam, RequestParam } from './api.js';
|
|
2
|
-
import { a as FileContent } from './
|
|
2
|
+
import { a as FileContent } from './FolderStat-CC_Sg9M2.js';
|
|
3
3
|
export { R as Result } from './Result-BLbZLEgX.js';
|
|
4
4
|
import { P as Plugin } from './Plugin-BojCB5ZJ.js';
|
|
5
5
|
import './Project-B_Vppjgw.js';
|
|
@@ -11,7 +11,7 @@ declare class BBRelay {
|
|
|
11
11
|
private eventCallbacks;
|
|
12
12
|
private responseIds;
|
|
13
13
|
constructor();
|
|
14
|
-
request<K extends keyof BBRequest>(type: K, arg: BBRequest[K]["
|
|
14
|
+
request<K extends keyof BBRequest>(type: K, arg: BBRequest[K]["arg"], callback?: (result: RequestReturn<K>) => void): void;
|
|
15
15
|
subscribe<K extends keyof BBEvent>(type: K, callback: (result: EventReturn<K>) => void): () => void;
|
|
16
16
|
}
|
|
17
17
|
|
package/dist/index.js
CHANGED
|
@@ -92,8 +92,8 @@ var BBRelay = class {
|
|
|
92
92
|
}
|
|
93
93
|
const callback = this.requestCallbacks.get(data.id);
|
|
94
94
|
if (callback) {
|
|
95
|
-
const { response
|
|
96
|
-
callback.callback({ response, error });
|
|
95
|
+
const { response } = data;
|
|
96
|
+
callback.callback({ response, error: null });
|
|
97
97
|
this.requestCallbacks.delete(data.id);
|
|
98
98
|
return;
|
|
99
99
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -92,8 +92,8 @@ var BBRelay = class {
|
|
|
92
92
|
}
|
|
93
93
|
const callback = this.requestCallbacks.get(data.id);
|
|
94
94
|
if (callback) {
|
|
95
|
-
const { response
|
|
96
|
-
callback.callback({ response, error });
|
|
95
|
+
const { response } = data;
|
|
96
|
+
callback.callback({ response, error: null });
|
|
97
97
|
this.requestCallbacks.delete(data.id);
|
|
98
98
|
return;
|
|
99
99
|
}
|
package/package.json
CHANGED
package/src/editor.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { TutorialHeader } from "./types/editor/TutorialHeader";
|
|
|
12
12
|
import { WatchFSEvent } from "./types/editor/WatchFSEvent";
|
|
13
13
|
import FileStat from "./types/requests/file/FileStat";
|
|
14
14
|
import Result from "./types/editor/Result";
|
|
15
|
+
import { FolderStat } from "./types/requests/folder/FolderStat";
|
|
15
16
|
|
|
16
17
|
export type {
|
|
17
18
|
Commit,
|
|
@@ -27,5 +28,6 @@ export type {
|
|
|
27
28
|
TutorialHeader,
|
|
28
29
|
WatchFSEvent,
|
|
29
30
|
FileStat,
|
|
31
|
+
FolderStat,
|
|
30
32
|
Result,
|
|
31
33
|
};
|
package/src/relay/index.ts
CHANGED
|
@@ -49,8 +49,8 @@ export default class BBRelay {
|
|
|
49
49
|
|
|
50
50
|
const callback = this.requestCallbacks.get(data.id);
|
|
51
51
|
if (callback) {
|
|
52
|
-
const { response
|
|
53
|
-
callback.callback({ response, error });
|
|
52
|
+
const { response } = data as RequestReturn<typeof data.type>;
|
|
53
|
+
callback.callback({ response, error: null });
|
|
54
54
|
this.requestCallbacks.delete(data.id);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -59,7 +59,7 @@ export default class BBRelay {
|
|
|
59
59
|
|
|
60
60
|
request<K extends keyof BBRequest>(
|
|
61
61
|
type: K,
|
|
62
|
-
arg: BBRequest[K]["
|
|
62
|
+
arg: BBRequest[K]["arg"],
|
|
63
63
|
callback?: (result: RequestReturn<K>) => void
|
|
64
64
|
) {
|
|
65
65
|
const id = crypto.randomUUID();
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
export type AppRequest = {
|
|
2
2
|
"app:ping": {
|
|
3
|
-
|
|
4
|
-
response:
|
|
3
|
+
arg: { message: string; params: unknown };
|
|
4
|
+
response: unknown;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* To get the supported version of the app (plugin) e.g. if it's in version 2
|
|
8
|
+
*/
|
|
6
9
|
"app:version": {
|
|
7
|
-
|
|
10
|
+
arg: null;
|
|
8
11
|
response: string;
|
|
9
12
|
};
|
|
10
13
|
"app:language": {
|
|
11
|
-
|
|
14
|
+
arg: null;
|
|
12
15
|
response: string[];
|
|
13
16
|
};
|
|
14
17
|
"app:icon": {
|
|
15
|
-
|
|
18
|
+
arg: { extensionId: string; isFolder?: boolean };
|
|
16
19
|
response: string;
|
|
17
20
|
};
|
|
18
21
|
"app:styles": {
|
|
19
|
-
|
|
22
|
+
arg: null;
|
|
20
23
|
response: string;
|
|
21
24
|
};
|
|
22
25
|
"app:theme": {
|
|
23
|
-
|
|
26
|
+
arg: null;
|
|
24
27
|
response: "light" | "dark";
|
|
25
28
|
};
|
|
26
29
|
};
|
|
@@ -4,31 +4,34 @@ import FileContent from "./FileContent";
|
|
|
4
4
|
|
|
5
5
|
export type FileRequests = {
|
|
6
6
|
"file:read": {
|
|
7
|
-
|
|
7
|
+
arg: { path: string; type?: FileContent["type"] };
|
|
8
8
|
response: FileContent;
|
|
9
9
|
};
|
|
10
10
|
"file:delete": {
|
|
11
|
-
|
|
11
|
+
arg: { path: string };
|
|
12
12
|
response: null;
|
|
13
13
|
};
|
|
14
14
|
"file:write": {
|
|
15
|
-
|
|
15
|
+
arg: FileContent;
|
|
16
16
|
response: null;
|
|
17
17
|
};
|
|
18
18
|
"file:list": {
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Without path, it will return all the files in the project
|
|
21
|
+
*/
|
|
22
|
+
arg: { glob?: string; path?: string };
|
|
20
23
|
response: string[];
|
|
21
24
|
};
|
|
22
25
|
"file:stat": {
|
|
23
|
-
|
|
26
|
+
arg: { path: string };
|
|
24
27
|
response: FileStat;
|
|
25
28
|
};
|
|
26
29
|
"file:copy": {
|
|
27
|
-
|
|
30
|
+
arg: CopyArg;
|
|
28
31
|
response: null;
|
|
29
32
|
};
|
|
30
33
|
"file:select": {
|
|
31
|
-
|
|
34
|
+
arg: { path: string };
|
|
32
35
|
response: null;
|
|
33
36
|
};
|
|
34
37
|
};
|
|
@@ -4,29 +4,29 @@ import FolderContent from "./FolderContent";
|
|
|
4
4
|
|
|
5
5
|
export type FolderRequest = {
|
|
6
6
|
"folder:read": {
|
|
7
|
-
|
|
7
|
+
arg: { path: string };
|
|
8
8
|
response: FolderContent;
|
|
9
9
|
};
|
|
10
10
|
"folder:create": {
|
|
11
|
-
|
|
11
|
+
arg: {
|
|
12
12
|
path: string;
|
|
13
13
|
};
|
|
14
14
|
response: null;
|
|
15
15
|
};
|
|
16
16
|
"folder:delete": {
|
|
17
|
-
|
|
17
|
+
arg: { path: string };
|
|
18
18
|
response: null;
|
|
19
19
|
};
|
|
20
20
|
"folder:stat": {
|
|
21
|
-
|
|
21
|
+
arg: { path: string };
|
|
22
22
|
response: FolderStat;
|
|
23
23
|
};
|
|
24
24
|
"folder:copy": {
|
|
25
|
-
|
|
25
|
+
arg: CopyArg;
|
|
26
26
|
response: null;
|
|
27
27
|
};
|
|
28
28
|
"folder:select": {
|
|
29
|
-
|
|
29
|
+
arg: { path: string };
|
|
30
30
|
response: null;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -2,63 +2,63 @@ import { Commit, GitFileStatus } from "@/editor";
|
|
|
2
2
|
|
|
3
3
|
export type GitRequests = {
|
|
4
4
|
"git:init": {
|
|
5
|
-
|
|
5
|
+
arg: null;
|
|
6
6
|
response: null;
|
|
7
7
|
};
|
|
8
8
|
"git:stage": {
|
|
9
|
-
|
|
9
|
+
arg: { path: string };
|
|
10
10
|
response: null;
|
|
11
11
|
};
|
|
12
12
|
"git:unstage": {
|
|
13
|
-
|
|
13
|
+
arg: { path: string };
|
|
14
14
|
response: null;
|
|
15
15
|
};
|
|
16
16
|
"git:stage-all": {
|
|
17
|
-
|
|
17
|
+
arg: null;
|
|
18
18
|
response: null;
|
|
19
19
|
};
|
|
20
20
|
"git:unstage-all": {
|
|
21
|
-
|
|
21
|
+
arg: null;
|
|
22
22
|
response: null;
|
|
23
23
|
};
|
|
24
24
|
"git:commit": {
|
|
25
|
-
|
|
25
|
+
arg: { message: string };
|
|
26
26
|
response: null;
|
|
27
27
|
};
|
|
28
28
|
"git:checkout": {
|
|
29
|
-
|
|
29
|
+
arg: { ref: string };
|
|
30
30
|
response: null;
|
|
31
31
|
};
|
|
32
32
|
"git:discard": {
|
|
33
|
-
|
|
33
|
+
arg: { path: string };
|
|
34
34
|
response: null;
|
|
35
35
|
};
|
|
36
36
|
"git:discard-all": {
|
|
37
|
-
|
|
37
|
+
arg: null;
|
|
38
38
|
response: null;
|
|
39
39
|
};
|
|
40
40
|
"git:log": {
|
|
41
|
-
|
|
41
|
+
arg: null;
|
|
42
42
|
response: Commit[];
|
|
43
43
|
};
|
|
44
44
|
"git:diff": {
|
|
45
|
-
|
|
45
|
+
arg: { path: string };
|
|
46
46
|
response: null;
|
|
47
47
|
};
|
|
48
48
|
"git:push": {
|
|
49
|
-
|
|
49
|
+
arg: null;
|
|
50
50
|
response: null;
|
|
51
51
|
};
|
|
52
52
|
"git:pull": {
|
|
53
|
-
|
|
53
|
+
arg: null;
|
|
54
54
|
response: null;
|
|
55
55
|
};
|
|
56
56
|
"git:status": {
|
|
57
|
-
|
|
57
|
+
arg: { path: string };
|
|
58
58
|
response: GitFileStatus;
|
|
59
59
|
};
|
|
60
60
|
"git:status-list": {
|
|
61
|
-
|
|
61
|
+
arg: null;
|
|
62
62
|
response: GitFileStatus[];
|
|
63
63
|
};
|
|
64
64
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
export type StorageRequests = {
|
|
2
2
|
"storage:set-item": {
|
|
3
|
-
|
|
3
|
+
arg: { key: string; value: string };
|
|
4
4
|
response: null;
|
|
5
5
|
};
|
|
6
6
|
"storage:get-item": {
|
|
7
|
-
|
|
7
|
+
arg: { key: string };
|
|
8
8
|
response: string;
|
|
9
9
|
};
|
|
10
10
|
"storage:remove-item": {
|
|
11
|
-
|
|
11
|
+
arg: { key: string };
|
|
12
12
|
response: null;
|
|
13
13
|
};
|
|
14
14
|
"storage:clear": {
|
|
15
|
-
|
|
15
|
+
arg: null;
|
|
16
16
|
response: null;
|
|
17
17
|
};
|
|
18
18
|
"storage:key": {
|
|
19
|
-
|
|
19
|
+
arg: { index: number };
|
|
20
20
|
response: string[];
|
|
21
21
|
};
|
|
22
22
|
"storage:length": {
|
|
23
|
-
|
|
23
|
+
arg: null;
|
|
24
24
|
response: string[];
|
|
25
25
|
};
|
|
26
26
|
"storage:sync": {
|
|
27
|
-
|
|
27
|
+
arg: { [key: string]: string };
|
|
28
28
|
response: { [key: string]: string };
|
|
29
29
|
};
|
|
30
30
|
"storage:load": {
|
|
31
|
-
|
|
31
|
+
arg: null;
|
|
32
32
|
response: { [key: string]: string };
|
|
33
33
|
};
|
|
34
34
|
};
|