bb-relay 0.0.25 → 0.0.26

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.
@@ -0,0 +1,288 @@
1
+ import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, c as FolderStat, G as GitFileStatus, d as FetchRequest } from './fetch-BFabLq7k.mjs';
2
+ import { P as Project } from './Project-B7IjpqOJ.mjs';
3
+ import { C as Commit } from './Commit-PdsjrKSG.mjs';
4
+
5
+ type Load = {
6
+ styles: string;
7
+ theme: "light" | "dark";
8
+ languages: string[];
9
+ };
10
+
11
+ type LanguageChange = {
12
+ type: "language";
13
+ languages: string[];
14
+ };
15
+ type ThemeChange = {
16
+ type: "theme";
17
+ theme: "dark" | "light";
18
+ };
19
+ type IconChange = {
20
+ type: "icon";
21
+ };
22
+ type ProjectUpdate = {
23
+ type: "project-update";
24
+ project: Partial<Project["doc"]>;
25
+ };
26
+ type ProjectChange = {
27
+ type: "project-change";
28
+ project: Partial<Project["doc"]>;
29
+ };
30
+ type ProjectEmpty = {
31
+ type: "project-empty";
32
+ };
33
+ type BBEvent = {
34
+ app: {
35
+ response: LanguageChange | ThemeChange | IconChange;
36
+ };
37
+ load: {
38
+ response: Load;
39
+ };
40
+ project: {
41
+ response: ProjectUpdate | ProjectChange | ProjectEmpty;
42
+ };
43
+ selection: {
44
+ response: {
45
+ type: "file" | "folder";
46
+ path: string;
47
+ };
48
+ };
49
+ token: {
50
+ response: string;
51
+ };
52
+ file: {
53
+ response: string;
54
+ };
55
+ folder: {
56
+ response: string;
57
+ };
58
+ editor: {
59
+ response: FileContent | null;
60
+ };
61
+ };
62
+
63
+ type FileRequests = {
64
+ "file:read": {
65
+ arg: {
66
+ path: string;
67
+ type?: FileContent["type"];
68
+ };
69
+ response: FileContent;
70
+ };
71
+ "file:delete": {
72
+ arg: {
73
+ path: string;
74
+ };
75
+ response: null;
76
+ };
77
+ "file:write": {
78
+ arg: FileContent;
79
+ response: null;
80
+ };
81
+ "file:list": {
82
+ /**
83
+ * Without path, it will return all the files in the project
84
+ */
85
+ arg: {
86
+ glob?: string;
87
+ path?: string;
88
+ } | null;
89
+ response: string[];
90
+ };
91
+ "file:stat": {
92
+ arg: {
93
+ path: string;
94
+ };
95
+ response: FileStat;
96
+ };
97
+ "file:copy": {
98
+ arg: CopyArg;
99
+ response: null;
100
+ };
101
+ "file:select": {
102
+ arg: {
103
+ path: string;
104
+ };
105
+ response: null;
106
+ };
107
+ };
108
+
109
+ type FolderRequest = {
110
+ "folder:read": {
111
+ arg: {
112
+ path: string;
113
+ };
114
+ response: FolderContent;
115
+ };
116
+ "folder:create": {
117
+ arg: {
118
+ path: string;
119
+ };
120
+ response: null;
121
+ };
122
+ "folder:delete": {
123
+ arg: {
124
+ path: string;
125
+ };
126
+ response: null;
127
+ };
128
+ "folder:stat": {
129
+ arg: {
130
+ path: string;
131
+ };
132
+ response: FolderStat;
133
+ };
134
+ "folder:copy": {
135
+ arg: CopyArg;
136
+ response: null;
137
+ };
138
+ "folder:select": {
139
+ arg: {
140
+ path: string;
141
+ };
142
+ response: null;
143
+ };
144
+ };
145
+
146
+ type ProjectRequest = {
147
+ "project:update": {
148
+ arg: Project["update"];
149
+ response: null;
150
+ };
151
+ "project:read": {
152
+ arg: null;
153
+ response: Project["doc"];
154
+ };
155
+ };
156
+
157
+ type AppRequest = {
158
+ "app:ping": {
159
+ arg: {
160
+ message: string;
161
+ params: unknown;
162
+ };
163
+ response: unknown;
164
+ };
165
+ /**
166
+ * To get the supported version of the app (plugin) e.g. if it's in version 2
167
+ */
168
+ "app:version": {
169
+ arg: null;
170
+ response: string;
171
+ };
172
+ "app:language": {
173
+ arg: null;
174
+ response: string[];
175
+ };
176
+ "app:icon": {
177
+ arg: {
178
+ extensionId: string;
179
+ isFolder?: boolean;
180
+ };
181
+ response: string;
182
+ };
183
+ "app:styles": {
184
+ arg: null;
185
+ response: string;
186
+ };
187
+ "app:theme": {
188
+ arg: null;
189
+ response: "light" | "dark";
190
+ };
191
+ };
192
+
193
+ type GitRequests = {
194
+ "git:init": {
195
+ arg: null;
196
+ response: null;
197
+ };
198
+ "git:stage": {
199
+ arg: {
200
+ path: string;
201
+ };
202
+ response: null;
203
+ };
204
+ "git:unstage": {
205
+ arg: {
206
+ path: string;
207
+ };
208
+ response: null;
209
+ };
210
+ "git:stage-all": {
211
+ arg: null;
212
+ response: null;
213
+ };
214
+ "git:unstage-all": {
215
+ arg: null;
216
+ response: null;
217
+ };
218
+ "git:commit": {
219
+ arg: {
220
+ message: string;
221
+ };
222
+ response: null;
223
+ };
224
+ "git:checkout": {
225
+ arg: {
226
+ ref: string;
227
+ };
228
+ response: null;
229
+ };
230
+ "git:discard": {
231
+ arg: {
232
+ path: string;
233
+ };
234
+ response: null;
235
+ };
236
+ "git:discard-all": {
237
+ arg: null;
238
+ response: null;
239
+ };
240
+ "git:log": {
241
+ arg: null;
242
+ response: Commit[];
243
+ };
244
+ "git:diff": {
245
+ arg: {
246
+ path: string;
247
+ };
248
+ response: null;
249
+ };
250
+ "git:push": {
251
+ arg: null;
252
+ response: null;
253
+ };
254
+ "git:pull": {
255
+ arg: null;
256
+ response: null;
257
+ };
258
+ "git:status": {
259
+ arg: {
260
+ path: string;
261
+ };
262
+ response: GitFileStatus;
263
+ };
264
+ "git:status-list": {
265
+ arg: null;
266
+ response: GitFileStatus[];
267
+ };
268
+ };
269
+
270
+ type BBRequest = FileRequests & FolderRequest & ProjectRequest & AppRequest & GitRequests & FetchRequest;
271
+
272
+ interface EventReturn<K extends keyof BBEvent> {
273
+ type: K;
274
+ response: BBEvent[K]["response"];
275
+ responseId: string;
276
+ source: "event";
277
+ }
278
+
279
+ interface RequestReturn<K extends keyof BBRequest> {
280
+ id: string;
281
+ type: K;
282
+ response: BBRequest[K]["response"] | null;
283
+ responseId: string;
284
+ source: "request";
285
+ error: string | null;
286
+ }
287
+
288
+ export type { BBEvent as B, EventReturn as E, RequestReturn as R, BBRequest as a };
@@ -0,0 +1,288 @@
1
+ import { a as FileContent, b as FileStat, C as CopyArg, F as FolderContent, c as FolderStat, G as GitFileStatus, d as FetchRequest } from './fetch-BFabLq7k.js';
2
+ import { P as Project } from './Project-B_Vppjgw.js';
3
+ import { C as Commit } from './Commit-PdsjrKSG.js';
4
+
5
+ type Load = {
6
+ styles: string;
7
+ theme: "light" | "dark";
8
+ languages: string[];
9
+ };
10
+
11
+ type LanguageChange = {
12
+ type: "language";
13
+ languages: string[];
14
+ };
15
+ type ThemeChange = {
16
+ type: "theme";
17
+ theme: "dark" | "light";
18
+ };
19
+ type IconChange = {
20
+ type: "icon";
21
+ };
22
+ type ProjectUpdate = {
23
+ type: "project-update";
24
+ project: Partial<Project["doc"]>;
25
+ };
26
+ type ProjectChange = {
27
+ type: "project-change";
28
+ project: Partial<Project["doc"]>;
29
+ };
30
+ type ProjectEmpty = {
31
+ type: "project-empty";
32
+ };
33
+ type BBEvent = {
34
+ app: {
35
+ response: LanguageChange | ThemeChange | IconChange;
36
+ };
37
+ load: {
38
+ response: Load;
39
+ };
40
+ project: {
41
+ response: ProjectUpdate | ProjectChange | ProjectEmpty;
42
+ };
43
+ selection: {
44
+ response: {
45
+ type: "file" | "folder";
46
+ path: string;
47
+ };
48
+ };
49
+ token: {
50
+ response: string;
51
+ };
52
+ file: {
53
+ response: string;
54
+ };
55
+ folder: {
56
+ response: string;
57
+ };
58
+ editor: {
59
+ response: FileContent | null;
60
+ };
61
+ };
62
+
63
+ type FileRequests = {
64
+ "file:read": {
65
+ arg: {
66
+ path: string;
67
+ type?: FileContent["type"];
68
+ };
69
+ response: FileContent;
70
+ };
71
+ "file:delete": {
72
+ arg: {
73
+ path: string;
74
+ };
75
+ response: null;
76
+ };
77
+ "file:write": {
78
+ arg: FileContent;
79
+ response: null;
80
+ };
81
+ "file:list": {
82
+ /**
83
+ * Without path, it will return all the files in the project
84
+ */
85
+ arg: {
86
+ glob?: string;
87
+ path?: string;
88
+ } | null;
89
+ response: string[];
90
+ };
91
+ "file:stat": {
92
+ arg: {
93
+ path: string;
94
+ };
95
+ response: FileStat;
96
+ };
97
+ "file:copy": {
98
+ arg: CopyArg;
99
+ response: null;
100
+ };
101
+ "file:select": {
102
+ arg: {
103
+ path: string;
104
+ };
105
+ response: null;
106
+ };
107
+ };
108
+
109
+ type FolderRequest = {
110
+ "folder:read": {
111
+ arg: {
112
+ path: string;
113
+ };
114
+ response: FolderContent;
115
+ };
116
+ "folder:create": {
117
+ arg: {
118
+ path: string;
119
+ };
120
+ response: null;
121
+ };
122
+ "folder:delete": {
123
+ arg: {
124
+ path: string;
125
+ };
126
+ response: null;
127
+ };
128
+ "folder:stat": {
129
+ arg: {
130
+ path: string;
131
+ };
132
+ response: FolderStat;
133
+ };
134
+ "folder:copy": {
135
+ arg: CopyArg;
136
+ response: null;
137
+ };
138
+ "folder:select": {
139
+ arg: {
140
+ path: string;
141
+ };
142
+ response: null;
143
+ };
144
+ };
145
+
146
+ type ProjectRequest = {
147
+ "project:update": {
148
+ arg: Project["update"];
149
+ response: null;
150
+ };
151
+ "project:read": {
152
+ arg: null;
153
+ response: Project["doc"];
154
+ };
155
+ };
156
+
157
+ type AppRequest = {
158
+ "app:ping": {
159
+ arg: {
160
+ message: string;
161
+ params: unknown;
162
+ };
163
+ response: unknown;
164
+ };
165
+ /**
166
+ * To get the supported version of the app (plugin) e.g. if it's in version 2
167
+ */
168
+ "app:version": {
169
+ arg: null;
170
+ response: string;
171
+ };
172
+ "app:language": {
173
+ arg: null;
174
+ response: string[];
175
+ };
176
+ "app:icon": {
177
+ arg: {
178
+ extensionId: string;
179
+ isFolder?: boolean;
180
+ };
181
+ response: string;
182
+ };
183
+ "app:styles": {
184
+ arg: null;
185
+ response: string;
186
+ };
187
+ "app:theme": {
188
+ arg: null;
189
+ response: "light" | "dark";
190
+ };
191
+ };
192
+
193
+ type GitRequests = {
194
+ "git:init": {
195
+ arg: null;
196
+ response: null;
197
+ };
198
+ "git:stage": {
199
+ arg: {
200
+ path: string;
201
+ };
202
+ response: null;
203
+ };
204
+ "git:unstage": {
205
+ arg: {
206
+ path: string;
207
+ };
208
+ response: null;
209
+ };
210
+ "git:stage-all": {
211
+ arg: null;
212
+ response: null;
213
+ };
214
+ "git:unstage-all": {
215
+ arg: null;
216
+ response: null;
217
+ };
218
+ "git:commit": {
219
+ arg: {
220
+ message: string;
221
+ };
222
+ response: null;
223
+ };
224
+ "git:checkout": {
225
+ arg: {
226
+ ref: string;
227
+ };
228
+ response: null;
229
+ };
230
+ "git:discard": {
231
+ arg: {
232
+ path: string;
233
+ };
234
+ response: null;
235
+ };
236
+ "git:discard-all": {
237
+ arg: null;
238
+ response: null;
239
+ };
240
+ "git:log": {
241
+ arg: null;
242
+ response: Commit[];
243
+ };
244
+ "git:diff": {
245
+ arg: {
246
+ path: string;
247
+ };
248
+ response: null;
249
+ };
250
+ "git:push": {
251
+ arg: null;
252
+ response: null;
253
+ };
254
+ "git:pull": {
255
+ arg: null;
256
+ response: null;
257
+ };
258
+ "git:status": {
259
+ arg: {
260
+ path: string;
261
+ };
262
+ response: GitFileStatus;
263
+ };
264
+ "git:status-list": {
265
+ arg: null;
266
+ response: GitFileStatus[];
267
+ };
268
+ };
269
+
270
+ type BBRequest = FileRequests & FolderRequest & ProjectRequest & AppRequest & GitRequests & FetchRequest;
271
+
272
+ interface EventReturn<K extends keyof BBEvent> {
273
+ type: K;
274
+ response: BBEvent[K]["response"];
275
+ responseId: string;
276
+ source: "event";
277
+ }
278
+
279
+ interface RequestReturn<K extends keyof BBRequest> {
280
+ id: string;
281
+ type: K;
282
+ response: BBRequest[K]["response"] | null;
283
+ responseId: string;
284
+ source: "request";
285
+ error: string | null;
286
+ }
287
+
288
+ export type { BBEvent as B, EventReturn as E, RequestReturn as R, BBRequest as a };