bb-relay 0.0.21 → 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/api.d.mts CHANGED
@@ -1,5 +1,337 @@
1
- export { a as BBEvent, B as BBRequest, E as EventReturn, R as RequestReturn } from './api-D-t6UimA.mjs';
2
- import './FileStat-CmS6lR3e.mjs';
3
- import './Project-B7IjpqOJ.mjs';
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
4
  import './PROJECT_CATEGORY-BivLHtB6.mjs';
5
- import './Commit-PdsjrKSG.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 };
package/dist/api.d.ts CHANGED
@@ -1,5 +1,337 @@
1
- export { a as BBEvent, B as BBRequest, E as EventReturn, R as RequestReturn } from './api-D7yHosgq.js';
2
- import './FileStat-CmS6lR3e.js';
3
- import './Project-B_Vppjgw.js';
1
+ import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, G as GitFileStatus } from './FileStat-CmS6lR3e.js';
2
+ import { P as Project } from './Project-B_Vppjgw.js';
3
+ import { C as Commit } from './Commit-PdsjrKSG.js';
4
4
  import './PROJECT_CATEGORY-BivLHtB6.js';
5
- import './Commit-PdsjrKSG.js';
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 };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import { B as BBRequest, R as RequestReturn, a as BBEvent, E as EventReturn } from './api-D-t6UimA.mjs';
2
- export { b as Result } from './api-D-t6UimA.mjs';
1
+ import { BBRequest, RequestReturn, BBEvent, EventReturn } from './api.mjs';
3
2
  import './FileStat-CmS6lR3e.mjs';
4
3
  import './Project-B7IjpqOJ.mjs';
5
4
  import './PROJECT_CATEGORY-BivLHtB6.mjs';
@@ -63,4 +62,11 @@ interface Zip {
63
62
  totalSize: number;
64
63
  }
65
64
 
66
- export { type FileNode, type Manifest, type Zip, BBRelay as default, injectStyles, registerEvent, registerRequest, validateManifest };
65
+ type Result<T = null> = {
66
+ data: T | null;
67
+ error: string | null;
68
+ };
69
+
70
+ declare function extractStyles(): string;
71
+
72
+ export { type FileNode, type Manifest, type Result, type Zip, BBRelay as default, extractStyles, injectStyles, registerEvent, registerRequest, validateManifest };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { B as BBRequest, R as RequestReturn, a as BBEvent, E as EventReturn } from './api-D7yHosgq.js';
2
- export { b as Result } from './api-D7yHosgq.js';
1
+ import { BBRequest, RequestReturn, BBEvent, EventReturn } from './api.js';
3
2
  import './FileStat-CmS6lR3e.js';
4
3
  import './Project-B_Vppjgw.js';
5
4
  import './PROJECT_CATEGORY-BivLHtB6.js';
@@ -63,4 +62,11 @@ interface Zip {
63
62
  totalSize: number;
64
63
  }
65
64
 
66
- export { type FileNode, type Manifest, type Zip, BBRelay as default, injectStyles, registerEvent, registerRequest, validateManifest };
65
+ type Result<T = null> = {
66
+ data: T | null;
67
+ error: string | null;
68
+ };
69
+
70
+ declare function extractStyles(): string;
71
+
72
+ export { type FileNode, type Manifest, type Result, type Zip, BBRelay as default, extractStyles, injectStyles, registerEvent, registerRequest, validateManifest };