bb-relay 0.0.41 → 0.0.43

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,25 @@
1
+ import { W as Wrapper } from './Wrapper-DWhYVa7F.js';
2
+
3
+ type BasePlugin = {
4
+ userId: string;
5
+ name: string;
6
+ description: string | null;
7
+ archived?: boolean;
8
+ deprecated?: boolean;
9
+ /**
10
+ * Points to release id of the beta
11
+ */
12
+ beta: string | null;
13
+ /**
14
+ * Points to release id of the production
15
+ */
16
+ production: string | null;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ tags: string[];
20
+ username: string;
21
+ id: string;
22
+ };
23
+ type Plugin = Wrapper<BasePlugin>;
24
+
25
+ export type { Plugin as P };
@@ -0,0 +1,25 @@
1
+ import { W as Wrapper } from './Wrapper-DWhYVa7F.mjs';
2
+
3
+ type BasePlugin = {
4
+ userId: string;
5
+ name: string;
6
+ description: string | null;
7
+ archived?: boolean;
8
+ deprecated?: boolean;
9
+ /**
10
+ * Points to release id of the beta
11
+ */
12
+ beta: string | null;
13
+ /**
14
+ * Points to release id of the production
15
+ */
16
+ production: string | null;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ tags: string[];
20
+ username: string;
21
+ id: string;
22
+ };
23
+ type Plugin = Wrapper<BasePlugin>;
24
+
25
+ export type { Plugin as P };
@@ -1,5 +1,5 @@
1
1
  import { W as Wrapper } from './Wrapper-DWhYVa7F.mjs';
2
- export { P as Plugin, R as Release } from './Plugin-Db_XUKx0.mjs';
2
+ export { P as Plugin } from './Plugin-CXXPXHGc.mjs';
3
3
  export { P as Project } from './Project-9NfYlQ36.mjs';
4
4
  import './PROJECT_CATEGORY-BivLHtB6.mjs';
5
5
  import './Commit-PdsjrKSG.mjs';
@@ -22,6 +22,26 @@ type BaseUser = {
22
22
  };
23
23
  type User = Wrapper<BaseUser>;
24
24
 
25
+ type BaseRelease = {
26
+ changes: string;
27
+ version: string;
28
+ type: "production" | "beta" | "draft";
29
+ metadata: {
30
+ uploadedAt: number;
31
+ totalFiles: number;
32
+ totalSize: number;
33
+ };
34
+ createdAt: string;
35
+ /**
36
+ * Based on plugin-id and version e.g. bb-plugin@1.2.3
37
+ */
38
+ id: string;
39
+ updatedAt: string;
40
+ userId: string;
41
+ installs: number;
42
+ };
43
+ type Release = Wrapper<BaseRelease>;
44
+
25
45
  type BaseRating = {
26
46
  userId: string;
27
47
  RatingId: string;
@@ -35,4 +55,4 @@ type BaseRating = {
35
55
  };
36
56
  type Rating = Wrapper<BaseRating>;
37
57
 
38
- export type { Rating, User };
58
+ export type { Rating, Release, User };
@@ -1,5 +1,5 @@
1
1
  import { W as Wrapper } from './Wrapper-DWhYVa7F.js';
2
- export { P as Plugin, R as Release } from './Plugin-t8StCIag.js';
2
+ export { P as Plugin } from './Plugin-CP-5My91.js';
3
3
  export { P as Project } from './Project-DOzeI4xi.js';
4
4
  import './PROJECT_CATEGORY-BivLHtB6.js';
5
5
  import './Commit-PdsjrKSG.js';
@@ -22,6 +22,26 @@ type BaseUser = {
22
22
  };
23
23
  type User = Wrapper<BaseUser>;
24
24
 
25
+ type BaseRelease = {
26
+ changes: string;
27
+ version: string;
28
+ type: "production" | "beta" | "draft";
29
+ metadata: {
30
+ uploadedAt: number;
31
+ totalFiles: number;
32
+ totalSize: number;
33
+ };
34
+ createdAt: string;
35
+ /**
36
+ * Based on plugin-id and version e.g. bb-plugin@1.2.3
37
+ */
38
+ id: string;
39
+ updatedAt: string;
40
+ userId: string;
41
+ installs: number;
42
+ };
43
+ type Release = Wrapper<BaseRelease>;
44
+
25
45
  type BaseRating = {
26
46
  userId: string;
27
47
  RatingId: string;
@@ -35,4 +55,4 @@ type BaseRating = {
35
55
  };
36
56
  type Rating = Wrapper<BaseRating>;
37
57
 
38
- export type { Rating, User };
58
+ export type { Rating, Release, User };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { F as FileContent } from './FileContent-CXlulSZq.mjs';
2
2
  export { R as Result } from './Result-BLbZLEgX.mjs';
3
- import { P as Plugin } from './Plugin-Db_XUKx0.mjs';
3
+ import { P as Plugin } from './Plugin-CXXPXHGc.mjs';
4
4
  import { R as RelayEvent, E as EventReturn, a as RelayRequest, b as RequestReturn } from './RequestReturn-Dahl-hde.mjs';
5
5
  import './Wrapper-DWhYVa7F.mjs';
6
6
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  import { F as FileContent } from './FileContent-CXlulSZq.js';
2
2
  export { R as Result } from './Result-BLbZLEgX.js';
3
- import { P as Plugin } from './Plugin-t8StCIag.js';
3
+ import { P as Plugin } from './Plugin-CP-5My91.js';
4
4
  import { R as RelayEvent, E as EventReturn, a as RelayRequest, b as RequestReturn } from './RequestReturn-Clb_WcNj.js';
5
5
  import './Wrapper-DWhYVa7F.js';
6
6
 
@@ -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.43",
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,27 +1,24 @@
1
- import { Release } from "./Release";
2
1
  import { Wrapper } from "./Wrapper";
3
2
 
4
- type Status = Omit<Release["doc"], "type">;
5
- /**
6
- * This will be pulled from two firestore
7
- * The part of name, description etc will be in the main
8
- * Things like installs will be in the registry
9
- */
10
3
  type BasePlugin = {
11
4
  userId: string;
12
- slug: string;
13
5
  name: string;
14
6
  description: string | null;
15
7
  archived?: boolean;
16
8
  deprecated?: boolean;
17
- beta: Status | null;
18
- production: Status | null;
9
+ /**
10
+ * Points to release id of the beta
11
+ */
12
+ beta: string | null;
13
+ /**
14
+ * Points to release id of the production
15
+ */
16
+ production: string | null;
19
17
  createdAt: string;
20
18
  updatedAt: string;
21
19
  tags: string[];
22
20
  username: string;
23
21
  id: string;
24
- avatar?: string;
25
22
  };
26
23
 
27
24
  export type Plugin = Wrapper<BasePlugin>;
@@ -1,17 +1,18 @@
1
1
  import { Wrapper } from "./Wrapper";
2
2
 
3
3
  type BaseRelease = {
4
- storageRef: string;
5
4
  changes: string;
6
5
  version: string;
7
6
  type: "production" | "beta" | "draft";
8
- slug: string;
9
7
  metadata: {
10
8
  uploadedAt: number;
11
9
  totalFiles: number;
12
10
  totalSize: number;
13
11
  };
14
12
  createdAt: string;
13
+ /**
14
+ * Based on plugin-id and version e.g. bb-plugin@1.2.3
15
+ */
15
16
  id: string;
16
17
  updatedAt: string;
17
18
  userId: string;
@@ -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;
@@ -1,46 +0,0 @@
1
- import { W as Wrapper } from './Wrapper-DWhYVa7F.mjs';
2
-
3
- type BaseRelease = {
4
- storageRef: string;
5
- changes: string;
6
- version: string;
7
- type: "production" | "beta" | "draft";
8
- slug: string;
9
- metadata: {
10
- uploadedAt: number;
11
- totalFiles: number;
12
- totalSize: number;
13
- };
14
- createdAt: string;
15
- id: string;
16
- updatedAt: string;
17
- userId: string;
18
- installs: number;
19
- };
20
- type Release = Wrapper<BaseRelease>;
21
-
22
- type Status = Omit<Release["doc"], "type">;
23
- /**
24
- * This will be pulled from two firestore
25
- * The part of name, description etc will be in the main
26
- * Things like installs will be in the registry
27
- */
28
- type BasePlugin = {
29
- userId: string;
30
- slug: string;
31
- name: string;
32
- description: string | null;
33
- archived?: boolean;
34
- deprecated?: boolean;
35
- beta: Status | null;
36
- production: Status | null;
37
- createdAt: string;
38
- updatedAt: string;
39
- tags: string[];
40
- username: string;
41
- id: string;
42
- avatar?: string;
43
- };
44
- type Plugin = Wrapper<BasePlugin>;
45
-
46
- export type { Plugin as P, Release as R };
@@ -1,46 +0,0 @@
1
- import { W as Wrapper } from './Wrapper-DWhYVa7F.js';
2
-
3
- type BaseRelease = {
4
- storageRef: string;
5
- changes: string;
6
- version: string;
7
- type: "production" | "beta" | "draft";
8
- slug: string;
9
- metadata: {
10
- uploadedAt: number;
11
- totalFiles: number;
12
- totalSize: number;
13
- };
14
- createdAt: string;
15
- id: string;
16
- updatedAt: string;
17
- userId: string;
18
- installs: number;
19
- };
20
- type Release = Wrapper<BaseRelease>;
21
-
22
- type Status = Omit<Release["doc"], "type">;
23
- /**
24
- * This will be pulled from two firestore
25
- * The part of name, description etc will be in the main
26
- * Things like installs will be in the registry
27
- */
28
- type BasePlugin = {
29
- userId: string;
30
- slug: string;
31
- name: string;
32
- description: string | null;
33
- archived?: boolean;
34
- deprecated?: boolean;
35
- beta: Status | null;
36
- production: Status | null;
37
- createdAt: string;
38
- updatedAt: string;
39
- tags: string[];
40
- username: string;
41
- id: string;
42
- avatar?: string;
43
- };
44
- type Plugin = Wrapper<BasePlugin>;
45
-
46
- export type { Plugin as P, Release as R };