bb-relay 0.0.16 → 0.0.17
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/Locale-COVVY7nx.d.mts +119 -0
- package/dist/Locale-COVVY7nx.d.ts +119 -0
- package/dist/Project-By7ak4sM.d.mts +14 -0
- package/dist/Project-By7ak4sM.d.ts +14 -0
- package/dist/{chunk-UJCSKKID.mjs → chunk-NBMM2TZK.js} +8 -5
- package/dist/constant.d.mts +14 -0
- package/dist/constant.d.ts +14 -0
- package/dist/constant.js +27 -0
- package/dist/constant.mjs +27 -0
- package/dist/database.d.mts +83 -0
- package/dist/database.d.ts +83 -0
- package/dist/database.js +1 -0
- package/dist/database.mjs +0 -0
- package/dist/dev.js +185 -222
- package/dist/editor.d.mts +89 -0
- package/dist/editor.d.ts +89 -0
- package/dist/editor.js +1 -0
- package/dist/editor.mjs +0 -0
- package/dist/index.d.mts +6 -312
- package/dist/index.d.ts +6 -312
- package/dist/index.js +8 -292
- package/dist/index.mjs +2 -253
- package/dist/locale.d.mts +8 -0
- package/dist/locale.d.ts +8 -0
- package/dist/locale.js +237 -0
- package/dist/locale.mjs +237 -0
- package/package.json +8 -11
- package/src/constant.ts +6 -0
- package/src/constants/PLUGIN_URL.ts +3 -0
- package/src/database.ts +6 -0
- package/src/editor.ts +35 -0
- package/src/index.ts +12 -62
- package/src/lib/validate-manifest.ts +2 -5
- package/src/load-virtual-editor/events/handle-dir-update.ts +1 -1
- package/src/load-virtual-editor/events/handle-file-update.ts +1 -1
- package/src/load-virtual-editor/events/handle-load.ts +1 -1
- package/src/load-virtual-editor/events/handle-selected.ts +1 -1
- package/src/load-virtual-editor/index.ts +2 -2
- package/src/load-virtual-editor/node/writeFile.ts +1 -1
- package/src/load-virtual-editor/postResponse.ts +4 -4
- package/src/load-virtual-editor/request/requestFS.ts +3 -3
- package/src/load-virtual-editor/request/requestSelected.ts +3 -3
- package/src/locale.ts +7 -0
- package/src/locales/en-GB.ts +14 -8
- package/src/locales/fr-FR.ts +1 -0
- package/src/relay/index.ts +4 -4
- package/src/relay/registerEvent.ts +1 -1
- package/src/relay/registerRequest.ts +1 -1
- package/src/relay/storage-bridge.ts +1 -1
- package/src/types/{BBEvent.ts → api/BBEvent.ts} +2 -2
- package/src/types/api/BBRequest.ts +8 -0
- package/src/types/{dir/index.ts → api/DirRequests.ts} +8 -1
- package/src/types/{editor → api}/EventParam.ts +1 -1
- package/src/types/{editor → api}/EventReturn.ts +1 -1
- package/src/types/{plugins → database}/Plugin.ts +2 -5
- package/src/types/{plugins → database}/Rating.ts +4 -5
- package/src/types/{plugins → database}/Release.ts +3 -5
- package/src/types/{editor → database}/User.ts +5 -1
- package/src/types/database/Wrapper.ts +15 -0
- package/src/types/editor/Manifest.ts +4 -0
- package/tsup.config.ts +4 -4
- package/src/types/BBRequest.ts +0 -8
- package/src/types/dir/DirInfo.ts +0 -10
- package/src/types/editor/database.types.ts +0 -266
- /package/src/types/{project/index.ts → api/ProjectRequest.ts} +0 -0
- /package/src/types/{RequestParam.ts → api/RequestParam.ts} +0 -0
- /package/src/types/{RequestReturn.ts → api/RequestReturn.ts} +0 -0
- /package/src/types/{project → editor}/Project.ts +0 -0
- /package/src/types/{Zip.ts → editor/Zip.ts} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare const enGB: {
|
|
2
|
+
"language.british_english": string;
|
|
3
|
+
"language.french": string;
|
|
4
|
+
"file.new": string;
|
|
5
|
+
"file.new.placeholder": string;
|
|
6
|
+
"file.open": string;
|
|
7
|
+
"file.duplicate": string;
|
|
8
|
+
"file.delete": string;
|
|
9
|
+
"file.rename": string;
|
|
10
|
+
"file.close": string;
|
|
11
|
+
"file.cut": string;
|
|
12
|
+
"file.copy": string;
|
|
13
|
+
"file.export_html": string;
|
|
14
|
+
"file.export_pdf": string;
|
|
15
|
+
"file.print": string;
|
|
16
|
+
"file.location.open": string;
|
|
17
|
+
file: string;
|
|
18
|
+
edit: string;
|
|
19
|
+
view: string;
|
|
20
|
+
help: string;
|
|
21
|
+
welcome: string;
|
|
22
|
+
"welcome.message": string;
|
|
23
|
+
"version.current": string;
|
|
24
|
+
"version.latest": string;
|
|
25
|
+
"version.out_of_date": string;
|
|
26
|
+
"version.up_to_date": string;
|
|
27
|
+
"update.check": string;
|
|
28
|
+
"update.download": string;
|
|
29
|
+
"update.release_notes": string;
|
|
30
|
+
install_and_restart: string;
|
|
31
|
+
"install.version": string;
|
|
32
|
+
later: string;
|
|
33
|
+
close: string;
|
|
34
|
+
about: string;
|
|
35
|
+
change_log: string;
|
|
36
|
+
documentation: string;
|
|
37
|
+
"report.issue": string;
|
|
38
|
+
"folder.new": string;
|
|
39
|
+
"folder.new.placeholder": string;
|
|
40
|
+
"folder.open": string;
|
|
41
|
+
"folder.open.message": string;
|
|
42
|
+
"folder.open.description": string;
|
|
43
|
+
"project.download": string;
|
|
44
|
+
"project.download.title": string;
|
|
45
|
+
"project.download.description": string;
|
|
46
|
+
"project.select": string;
|
|
47
|
+
"project.select.title": string;
|
|
48
|
+
"project.select.description": string;
|
|
49
|
+
"project.new": string;
|
|
50
|
+
tags: string;
|
|
51
|
+
"tag.input.placeholder": string;
|
|
52
|
+
category: string;
|
|
53
|
+
"category.select": string;
|
|
54
|
+
"project.title": string;
|
|
55
|
+
"project.title.placeholder": string;
|
|
56
|
+
"project.description": string;
|
|
57
|
+
"project.description.placeholder": string;
|
|
58
|
+
email: string;
|
|
59
|
+
"email.placeholder": string;
|
|
60
|
+
password: string;
|
|
61
|
+
"password.placeholder": string;
|
|
62
|
+
username: string;
|
|
63
|
+
"username.placeholder": string;
|
|
64
|
+
"workspace.select": string;
|
|
65
|
+
"workspace.select.description": string;
|
|
66
|
+
"file.explorer": string;
|
|
67
|
+
"no_workspace.message": string;
|
|
68
|
+
"folder.select.placeholder": string;
|
|
69
|
+
"folder.select": string;
|
|
70
|
+
"folder.rename": string;
|
|
71
|
+
"folder.duplicate": string;
|
|
72
|
+
"folder.paste": string;
|
|
73
|
+
"folder.cut": string;
|
|
74
|
+
"folder.copy": string;
|
|
75
|
+
"folder.delete": string;
|
|
76
|
+
folder: string;
|
|
77
|
+
"folder.location.open": string;
|
|
78
|
+
"checkpoint.list.header": string;
|
|
79
|
+
"checkpoint.placeholder": string;
|
|
80
|
+
"checkpoint.button": string;
|
|
81
|
+
"git.stage.all": string;
|
|
82
|
+
"git.discard.all": string;
|
|
83
|
+
"git.stage": string;
|
|
84
|
+
"git.discard": string;
|
|
85
|
+
"git.discard.message": string;
|
|
86
|
+
"git.unstage.all": string;
|
|
87
|
+
"git.unstage": string;
|
|
88
|
+
changes: string;
|
|
89
|
+
history: string;
|
|
90
|
+
home: string;
|
|
91
|
+
cancel: string;
|
|
92
|
+
confirm: string;
|
|
93
|
+
"plugin.install": string;
|
|
94
|
+
"project.create": string;
|
|
95
|
+
"checkpoint.save": string;
|
|
96
|
+
"file.delete.warning": string;
|
|
97
|
+
"folder.delete.warning": string;
|
|
98
|
+
delete: string;
|
|
99
|
+
"placeholder.text": string;
|
|
100
|
+
"placeholder.click": string;
|
|
101
|
+
"placeholder.label": string;
|
|
102
|
+
find: string;
|
|
103
|
+
replace: string;
|
|
104
|
+
"replace.all": string;
|
|
105
|
+
previous: string;
|
|
106
|
+
next: string;
|
|
107
|
+
"search.use.regex": string;
|
|
108
|
+
"search.case.sensitive": string;
|
|
109
|
+
"plugins.search": string;
|
|
110
|
+
install: string;
|
|
111
|
+
uninstall: string;
|
|
112
|
+
repository: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type Language = keyof typeof enGB;
|
|
116
|
+
|
|
117
|
+
type Locale = "en-GB" | "fr-FR";
|
|
118
|
+
|
|
119
|
+
export { type Language as L, type Locale as a, enGB as e };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare const enGB: {
|
|
2
|
+
"language.british_english": string;
|
|
3
|
+
"language.french": string;
|
|
4
|
+
"file.new": string;
|
|
5
|
+
"file.new.placeholder": string;
|
|
6
|
+
"file.open": string;
|
|
7
|
+
"file.duplicate": string;
|
|
8
|
+
"file.delete": string;
|
|
9
|
+
"file.rename": string;
|
|
10
|
+
"file.close": string;
|
|
11
|
+
"file.cut": string;
|
|
12
|
+
"file.copy": string;
|
|
13
|
+
"file.export_html": string;
|
|
14
|
+
"file.export_pdf": string;
|
|
15
|
+
"file.print": string;
|
|
16
|
+
"file.location.open": string;
|
|
17
|
+
file: string;
|
|
18
|
+
edit: string;
|
|
19
|
+
view: string;
|
|
20
|
+
help: string;
|
|
21
|
+
welcome: string;
|
|
22
|
+
"welcome.message": string;
|
|
23
|
+
"version.current": string;
|
|
24
|
+
"version.latest": string;
|
|
25
|
+
"version.out_of_date": string;
|
|
26
|
+
"version.up_to_date": string;
|
|
27
|
+
"update.check": string;
|
|
28
|
+
"update.download": string;
|
|
29
|
+
"update.release_notes": string;
|
|
30
|
+
install_and_restart: string;
|
|
31
|
+
"install.version": string;
|
|
32
|
+
later: string;
|
|
33
|
+
close: string;
|
|
34
|
+
about: string;
|
|
35
|
+
change_log: string;
|
|
36
|
+
documentation: string;
|
|
37
|
+
"report.issue": string;
|
|
38
|
+
"folder.new": string;
|
|
39
|
+
"folder.new.placeholder": string;
|
|
40
|
+
"folder.open": string;
|
|
41
|
+
"folder.open.message": string;
|
|
42
|
+
"folder.open.description": string;
|
|
43
|
+
"project.download": string;
|
|
44
|
+
"project.download.title": string;
|
|
45
|
+
"project.download.description": string;
|
|
46
|
+
"project.select": string;
|
|
47
|
+
"project.select.title": string;
|
|
48
|
+
"project.select.description": string;
|
|
49
|
+
"project.new": string;
|
|
50
|
+
tags: string;
|
|
51
|
+
"tag.input.placeholder": string;
|
|
52
|
+
category: string;
|
|
53
|
+
"category.select": string;
|
|
54
|
+
"project.title": string;
|
|
55
|
+
"project.title.placeholder": string;
|
|
56
|
+
"project.description": string;
|
|
57
|
+
"project.description.placeholder": string;
|
|
58
|
+
email: string;
|
|
59
|
+
"email.placeholder": string;
|
|
60
|
+
password: string;
|
|
61
|
+
"password.placeholder": string;
|
|
62
|
+
username: string;
|
|
63
|
+
"username.placeholder": string;
|
|
64
|
+
"workspace.select": string;
|
|
65
|
+
"workspace.select.description": string;
|
|
66
|
+
"file.explorer": string;
|
|
67
|
+
"no_workspace.message": string;
|
|
68
|
+
"folder.select.placeholder": string;
|
|
69
|
+
"folder.select": string;
|
|
70
|
+
"folder.rename": string;
|
|
71
|
+
"folder.duplicate": string;
|
|
72
|
+
"folder.paste": string;
|
|
73
|
+
"folder.cut": string;
|
|
74
|
+
"folder.copy": string;
|
|
75
|
+
"folder.delete": string;
|
|
76
|
+
folder: string;
|
|
77
|
+
"folder.location.open": string;
|
|
78
|
+
"checkpoint.list.header": string;
|
|
79
|
+
"checkpoint.placeholder": string;
|
|
80
|
+
"checkpoint.button": string;
|
|
81
|
+
"git.stage.all": string;
|
|
82
|
+
"git.discard.all": string;
|
|
83
|
+
"git.stage": string;
|
|
84
|
+
"git.discard": string;
|
|
85
|
+
"git.discard.message": string;
|
|
86
|
+
"git.unstage.all": string;
|
|
87
|
+
"git.unstage": string;
|
|
88
|
+
changes: string;
|
|
89
|
+
history: string;
|
|
90
|
+
home: string;
|
|
91
|
+
cancel: string;
|
|
92
|
+
confirm: string;
|
|
93
|
+
"plugin.install": string;
|
|
94
|
+
"project.create": string;
|
|
95
|
+
"checkpoint.save": string;
|
|
96
|
+
"file.delete.warning": string;
|
|
97
|
+
"folder.delete.warning": string;
|
|
98
|
+
delete: string;
|
|
99
|
+
"placeholder.text": string;
|
|
100
|
+
"placeholder.click": string;
|
|
101
|
+
"placeholder.label": string;
|
|
102
|
+
find: string;
|
|
103
|
+
replace: string;
|
|
104
|
+
"replace.all": string;
|
|
105
|
+
previous: string;
|
|
106
|
+
next: string;
|
|
107
|
+
"search.use.regex": string;
|
|
108
|
+
"search.case.sensitive": string;
|
|
109
|
+
"plugins.search": string;
|
|
110
|
+
install: string;
|
|
111
|
+
uninstall: string;
|
|
112
|
+
repository: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type Language = keyof typeof enGB;
|
|
116
|
+
|
|
117
|
+
type Locale = "en-GB" | "fr-FR";
|
|
118
|
+
|
|
119
|
+
export { type Language as L, type Locale as a, enGB as e };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Category = "Action" | "Adventure" | "ChickLit" | "Comedy" | "Drama" | "FanFiction" | "Fantasy" | "Horror" | "Mystery / Thriller" | "Parody" | "Poetry" | "Romance" | "SciFi" | "Thriller" | "Western" | "Historical Fiction" | "No Fiction" | "Paranormal" | "Adult" | "Short story" | "Spiritual" | "Other";
|
|
2
|
+
interface Project {
|
|
3
|
+
title: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
updatedAt: string;
|
|
6
|
+
lastAccessedAt: string;
|
|
7
|
+
remoteId?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
category?: Category;
|
|
10
|
+
description?: string;
|
|
11
|
+
genre?: string | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { Project as P };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Category = "Action" | "Adventure" | "ChickLit" | "Comedy" | "Drama" | "FanFiction" | "Fantasy" | "Horror" | "Mystery / Thriller" | "Parody" | "Poetry" | "Romance" | "SciFi" | "Thriller" | "Western" | "Historical Fiction" | "No Fiction" | "Paranormal" | "Adult" | "Short story" | "Spiritual" | "Other";
|
|
2
|
+
interface Project {
|
|
3
|
+
title: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
updatedAt: string;
|
|
6
|
+
lastAccessedAt: string;
|
|
7
|
+
remoteId?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
category?: Category;
|
|
10
|
+
description?: string;
|
|
11
|
+
genre?: string | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { Project as P };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
8
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
10
|
};
|
|
@@ -23,8 +24,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
25
|
mod
|
|
25
26
|
));
|
|
27
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__publicField = __publicField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const SENTINEL_FILE = ".release.commit";
|
|
2
|
+
|
|
3
|
+
declare const WEBSITE: {
|
|
4
|
+
main: string;
|
|
5
|
+
console: string;
|
|
6
|
+
marketplace: string;
|
|
7
|
+
docs: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare const DATA_ALIAS = "${userData}";
|
|
11
|
+
|
|
12
|
+
declare const PLUGIN_URL = "https://downloadplugin-jaxucpei2q-uc.a.run.app";
|
|
13
|
+
|
|
14
|
+
export { DATA_ALIAS, PLUGIN_URL, SENTINEL_FILE, WEBSITE };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const SENTINEL_FILE = ".release.commit";
|
|
2
|
+
|
|
3
|
+
declare const WEBSITE: {
|
|
4
|
+
main: string;
|
|
5
|
+
console: string;
|
|
6
|
+
marketplace: string;
|
|
7
|
+
docs: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare const DATA_ALIAS = "${userData}";
|
|
11
|
+
|
|
12
|
+
declare const PLUGIN_URL = "https://downloadplugin-jaxucpei2q-uc.a.run.app";
|
|
13
|
+
|
|
14
|
+
export { DATA_ALIAS, PLUGIN_URL, SENTINEL_FILE, WEBSITE };
|
package/dist/constant.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NBMM2TZK.js');
|
|
2
|
+
|
|
3
|
+
// src/constants/SENTINEL_FILE.ts
|
|
4
|
+
var SENTINEL_FILE = ".release.commit";
|
|
5
|
+
var SENTINEL_FILE_default = SENTINEL_FILE;
|
|
6
|
+
|
|
7
|
+
// src/constants/WEBSITE.ts
|
|
8
|
+
var WEBSITE = {
|
|
9
|
+
main: "http://bb-editor.adeolaade.com/",
|
|
10
|
+
console: "http://bb-console.adeolaade.com",
|
|
11
|
+
marketplace: "http://bb-marketplace.adeolaade.com",
|
|
12
|
+
docs: "http://bb-docs.adeolaade.com"
|
|
13
|
+
};
|
|
14
|
+
var WEBSITE_default = WEBSITE;
|
|
15
|
+
|
|
16
|
+
// src/constants/DATA_ALIAS.ts
|
|
17
|
+
var DATA_ALIAS = "${userData}";
|
|
18
|
+
|
|
19
|
+
// src/constants/PLUGIN_URL.ts
|
|
20
|
+
var PLUGIN_URL = "https://downloadplugin-jaxucpei2q-uc.a.run.app";
|
|
21
|
+
var PLUGIN_URL_default = PLUGIN_URL;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.DATA_ALIAS = DATA_ALIAS; exports.PLUGIN_URL = PLUGIN_URL_default; exports.SENTINEL_FILE = SENTINEL_FILE_default; exports.WEBSITE = WEBSITE_default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./chunk-S47CVTVK.mjs";
|
|
2
|
+
|
|
3
|
+
// src/constants/SENTINEL_FILE.ts
|
|
4
|
+
var SENTINEL_FILE = ".release.commit";
|
|
5
|
+
var SENTINEL_FILE_default = SENTINEL_FILE;
|
|
6
|
+
|
|
7
|
+
// src/constants/WEBSITE.ts
|
|
8
|
+
var WEBSITE = {
|
|
9
|
+
main: "http://bb-editor.adeolaade.com/",
|
|
10
|
+
console: "http://bb-console.adeolaade.com",
|
|
11
|
+
marketplace: "http://bb-marketplace.adeolaade.com",
|
|
12
|
+
docs: "http://bb-docs.adeolaade.com"
|
|
13
|
+
};
|
|
14
|
+
var WEBSITE_default = WEBSITE;
|
|
15
|
+
|
|
16
|
+
// src/constants/DATA_ALIAS.ts
|
|
17
|
+
var DATA_ALIAS = "${userData}";
|
|
18
|
+
|
|
19
|
+
// src/constants/PLUGIN_URL.ts
|
|
20
|
+
var PLUGIN_URL = "https://downloadplugin-jaxucpei2q-uc.a.run.app";
|
|
21
|
+
var PLUGIN_URL_default = PLUGIN_URL;
|
|
22
|
+
export {
|
|
23
|
+
DATA_ALIAS,
|
|
24
|
+
PLUGIN_URL_default as PLUGIN_URL,
|
|
25
|
+
SENTINEL_FILE_default as SENTINEL_FILE,
|
|
26
|
+
WEBSITE_default as WEBSITE
|
|
27
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
type BaseWithId = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Generates Insert, Update, and Doc types from a base schema.
|
|
6
|
+
*/
|
|
7
|
+
type Wrapper<T extends BaseWithId> = {
|
|
8
|
+
insert: Omit<T, "id">;
|
|
9
|
+
update: Partial<Omit<T, "id">> & {
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
};
|
|
12
|
+
doc: T;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type BaseUser = {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
username: string;
|
|
19
|
+
email: string;
|
|
20
|
+
bio: string;
|
|
21
|
+
avatar: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
};
|
|
25
|
+
type User = Wrapper<BaseUser>;
|
|
26
|
+
|
|
27
|
+
type BaseRelease = {
|
|
28
|
+
storageRef: string;
|
|
29
|
+
changes: string;
|
|
30
|
+
version: string;
|
|
31
|
+
type: "production" | "beta" | "draft";
|
|
32
|
+
slug: string;
|
|
33
|
+
metadata: {
|
|
34
|
+
uploadedAt: number;
|
|
35
|
+
totalFiles: number;
|
|
36
|
+
totalSize: number;
|
|
37
|
+
};
|
|
38
|
+
createdAt: string;
|
|
39
|
+
id: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
userId: string;
|
|
42
|
+
installs: number;
|
|
43
|
+
};
|
|
44
|
+
type Release = Wrapper<BaseRelease>;
|
|
45
|
+
|
|
46
|
+
type Status = Omit<Release["doc"], "type">;
|
|
47
|
+
/**
|
|
48
|
+
* This will be pulled from two firestore
|
|
49
|
+
* The part of name, description etc will be in the main
|
|
50
|
+
* Things like installs will be in the registry
|
|
51
|
+
*/
|
|
52
|
+
type BasePlugin = {
|
|
53
|
+
userId: string;
|
|
54
|
+
slug: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
archived?: boolean;
|
|
58
|
+
deprecated?: boolean;
|
|
59
|
+
beta: Status | null;
|
|
60
|
+
production: Status | null;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
tags: string[];
|
|
64
|
+
username: string;
|
|
65
|
+
id: string;
|
|
66
|
+
avatar?: string;
|
|
67
|
+
};
|
|
68
|
+
type Plugin = Wrapper<BasePlugin>;
|
|
69
|
+
|
|
70
|
+
type BaseRating = {
|
|
71
|
+
userId: string;
|
|
72
|
+
RatingId: string;
|
|
73
|
+
rating: number;
|
|
74
|
+
comment?: string;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt?: string;
|
|
77
|
+
username: string;
|
|
78
|
+
avatar?: string;
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
81
|
+
type Rating = Wrapper<BaseRating>;
|
|
82
|
+
|
|
83
|
+
export type { Plugin, Rating, Release, User };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
type BaseWithId = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Generates Insert, Update, and Doc types from a base schema.
|
|
6
|
+
*/
|
|
7
|
+
type Wrapper<T extends BaseWithId> = {
|
|
8
|
+
insert: Omit<T, "id">;
|
|
9
|
+
update: Partial<Omit<T, "id">> & {
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
};
|
|
12
|
+
doc: T;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type BaseUser = {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
username: string;
|
|
19
|
+
email: string;
|
|
20
|
+
bio: string;
|
|
21
|
+
avatar: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
};
|
|
25
|
+
type User = Wrapper<BaseUser>;
|
|
26
|
+
|
|
27
|
+
type BaseRelease = {
|
|
28
|
+
storageRef: string;
|
|
29
|
+
changes: string;
|
|
30
|
+
version: string;
|
|
31
|
+
type: "production" | "beta" | "draft";
|
|
32
|
+
slug: string;
|
|
33
|
+
metadata: {
|
|
34
|
+
uploadedAt: number;
|
|
35
|
+
totalFiles: number;
|
|
36
|
+
totalSize: number;
|
|
37
|
+
};
|
|
38
|
+
createdAt: string;
|
|
39
|
+
id: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
userId: string;
|
|
42
|
+
installs: number;
|
|
43
|
+
};
|
|
44
|
+
type Release = Wrapper<BaseRelease>;
|
|
45
|
+
|
|
46
|
+
type Status = Omit<Release["doc"], "type">;
|
|
47
|
+
/**
|
|
48
|
+
* This will be pulled from two firestore
|
|
49
|
+
* The part of name, description etc will be in the main
|
|
50
|
+
* Things like installs will be in the registry
|
|
51
|
+
*/
|
|
52
|
+
type BasePlugin = {
|
|
53
|
+
userId: string;
|
|
54
|
+
slug: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
archived?: boolean;
|
|
58
|
+
deprecated?: boolean;
|
|
59
|
+
beta: Status | null;
|
|
60
|
+
production: Status | null;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
tags: string[];
|
|
64
|
+
username: string;
|
|
65
|
+
id: string;
|
|
66
|
+
avatar?: string;
|
|
67
|
+
};
|
|
68
|
+
type Plugin = Wrapper<BasePlugin>;
|
|
69
|
+
|
|
70
|
+
type BaseRating = {
|
|
71
|
+
userId: string;
|
|
72
|
+
RatingId: string;
|
|
73
|
+
rating: number;
|
|
74
|
+
comment?: string;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt?: string;
|
|
77
|
+
username: string;
|
|
78
|
+
avatar?: string;
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
81
|
+
type Rating = Wrapper<BaseRating>;
|
|
82
|
+
|
|
83
|
+
export type { Plugin, Rating, Release, User };
|
package/dist/database.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|