bb-relay 0.0.41 → 0.0.42

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/index.d.mts CHANGED
@@ -11,7 +11,7 @@ import './Wrapper-DWhYVa7F.mjs';
11
11
  */
12
12
  declare function injectStyles(css: string): () => void;
13
13
 
14
- type Permission = "file-system" | "storage" | "project" | "url" | "selection" | "git" | "token";
14
+ type Permission = "file-system" | "project" | "git" | "dialog";
15
15
  type Manifest = {
16
16
  id: string;
17
17
  name: string;
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import './Wrapper-DWhYVa7F.js';
11
11
  */
12
12
  declare function injectStyles(css: string): () => void;
13
13
 
14
- type Permission = "file-system" | "storage" | "project" | "url" | "selection" | "git" | "token";
14
+ type Permission = "file-system" | "project" | "git" | "dialog";
15
15
  type Manifest = {
16
16
  id: string;
17
17
  name: string;
package/dist/plugin.d.mts CHANGED
@@ -220,6 +220,31 @@ type EditorAPI = {
220
220
  copyFile: (filePath: string, destination: string) => Promise<Result<string>>;
221
221
  listFiles: (glob?: string) => Promise<Result<string[]>>;
222
222
  };
223
+ git?: {
224
+ commit: (arg: {
225
+ files: string[];
226
+ message: string;
227
+ email?: string;
228
+ }) => Promise<Result>;
229
+ };
230
+ dialog?: {
231
+ selectFile: () => Promise<Result<string[]>>;
232
+ selectFolder: () => Promise<Result<string[]>>;
233
+ };
234
+ project?: {
235
+ /**
236
+ * To create a new project
237
+ * @param dir This should be derived from `dialog.selectFolder`
238
+ * @param project The project config that you want to create
239
+ */
240
+ createProject: (dir: string, project: Project["insert"]) => Promise<Result>;
241
+ /**
242
+ * Use this to update current project information
243
+ * @param project
244
+ * @returns
245
+ */
246
+ updateProject: (project: Project["update"]) => Promise<Result>;
247
+ };
223
248
  };
224
249
  type EventMap = {
225
250
  project: {
package/dist/plugin.d.ts CHANGED
@@ -220,6 +220,31 @@ type EditorAPI = {
220
220
  copyFile: (filePath: string, destination: string) => Promise<Result<string>>;
221
221
  listFiles: (glob?: string) => Promise<Result<string[]>>;
222
222
  };
223
+ git?: {
224
+ commit: (arg: {
225
+ files: string[];
226
+ message: string;
227
+ email?: string;
228
+ }) => Promise<Result>;
229
+ };
230
+ dialog?: {
231
+ selectFile: () => Promise<Result<string[]>>;
232
+ selectFolder: () => Promise<Result<string[]>>;
233
+ };
234
+ project?: {
235
+ /**
236
+ * To create a new project
237
+ * @param dir This should be derived from `dialog.selectFolder`
238
+ * @param project The project config that you want to create
239
+ */
240
+ createProject: (dir: string, project: Project["insert"]) => Promise<Result>;
241
+ /**
242
+ * Use this to update current project information
243
+ * @param project
244
+ * @returns
245
+ */
246
+ updateProject: (project: Project["update"]) => Promise<Result>;
247
+ };
223
248
  };
224
249
  type EventMap = {
225
250
  project: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-relay",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "For managing bb-editor extension",
5
5
  "license": "ISC",
6
6
  "author": "Ade Adeola",
@@ -43,10 +43,31 @@ export type EditorAPI = {
43
43
  ) => Promise<Result<string>>;
44
44
  listFiles: (glob?: string) => Promise<Result<string[]>>;
45
45
  };
46
- // project: getProjectInfo, workingDirectory
47
- // dialog: selectFolder, selectFile
48
- // net (should be able to use "fetch api"): download, stream
49
- // git
46
+ git?: {
47
+ commit: (arg: {
48
+ files: string[];
49
+ message: string;
50
+ email?: string;
51
+ }) => Promise<Result>;
52
+ };
53
+ dialog?: {
54
+ selectFile: () => Promise<Result<string[]>>;
55
+ selectFolder: () => Promise<Result<string[]>>;
56
+ };
57
+ project?: {
58
+ /**
59
+ * To create a new project
60
+ * @param dir This should be derived from `dialog.selectFolder`
61
+ * @param project The project config that you want to create
62
+ */
63
+ createProject: (dir: string, project: Project["insert"]) => Promise<Result>;
64
+ /**
65
+ * Use this to update current project information
66
+ * @param project
67
+ * @returns
68
+ */
69
+ updateProject: (project: Project["update"]) => Promise<Result>;
70
+ };
50
71
  };
51
72
 
52
73
  export type EventMap = {
@@ -1,13 +1,6 @@
1
1
  import { FileContent } from "@/editor";
2
2
 
3
- type Permission =
4
- | "file-system"
5
- | "storage"
6
- | "project"
7
- | "url"
8
- | "selection"
9
- | "git"
10
- | "token";
3
+ type Permission = "file-system" | "project" | "git" | "dialog";
11
4
 
12
5
  export type Manifest = {
13
6
  id: string;