@vandenberghinc/volt 1.1.4 → 1.1.6
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/backend/dist/cjs/database.d.ts +41 -68
- package/backend/dist/cjs/database.js +136 -78
- package/backend/dist/cjs/endpoint.d.ts +23 -9
- package/backend/dist/cjs/endpoint.js +98 -21
- package/backend/dist/cjs/file_watcher.js +2 -2
- package/backend/dist/cjs/frontend.d.ts +0 -2
- package/backend/dist/cjs/frontend.js +9 -9
- package/backend/dist/cjs/image_endpoint.d.ts +3 -1
- package/backend/dist/cjs/image_endpoint.js +2 -1
- package/backend/dist/cjs/payments/paddle.js +10 -2
- package/backend/dist/cjs/plugins/css.d.ts +6 -5
- package/backend/dist/cjs/plugins/css.js +32 -7
- package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
- package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/cjs/server.d.ts +7 -13
- package/backend/dist/cjs/server.js +184 -303
- package/backend/dist/cjs/status.d.ts +1 -0
- package/backend/dist/cjs/status.js +2 -1
- package/backend/dist/cjs/stream.d.ts +5 -3
- package/backend/dist/cjs/stream.js +13 -4
- package/backend/dist/cjs/users.d.ts +1 -1
- package/backend/dist/cjs/users.js +87 -72
- package/backend/dist/cjs/utils.d.ts +17 -9
- package/backend/dist/cjs/utils.js +22 -64
- package/backend/dist/cjs/view.d.ts +2 -2
- package/backend/dist/cjs/view.js +38 -40
- package/backend/dist/cjs/volt.d.ts +3 -2
- package/backend/dist/cjs/volt.js +2 -2
- package/backend/dist/css/volt.css +5 -0
- package/backend/dist/esm/database.d.ts +41 -68
- package/backend/dist/esm/database.js +137 -79
- package/backend/dist/esm/endpoint.d.ts +23 -9
- package/backend/dist/esm/endpoint.js +99 -22
- package/backend/dist/esm/file_watcher.js +2 -2
- package/backend/dist/esm/frontend.d.ts +0 -2
- package/backend/dist/esm/frontend.js +9 -9
- package/backend/dist/esm/image_endpoint.d.ts +3 -1
- package/backend/dist/esm/image_endpoint.js +2 -1
- package/backend/dist/esm/payments/paddle.js +11 -3
- package/backend/dist/esm/plugins/css.d.ts +6 -5
- package/backend/dist/esm/plugins/css.js +32 -6
- package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm/plugins/ts/compiler.js +26 -2
- package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/esm/server.d.ts +7 -13
- package/backend/dist/esm/server.js +182 -301
- package/backend/dist/esm/status.d.ts +1 -0
- package/backend/dist/esm/status.js +1 -0
- package/backend/dist/esm/stream.d.ts +5 -3
- package/backend/dist/esm/stream.js +13 -4
- package/backend/dist/esm/users.d.ts +1 -1
- package/backend/dist/esm/users.js +87 -72
- package/backend/dist/esm/utils.d.ts +17 -9
- package/backend/dist/esm/utils.js +21 -62
- package/backend/dist/esm/view.d.ts +2 -2
- package/backend/dist/esm/view.js +38 -40
- package/backend/dist/esm/volt.d.ts +3 -2
- package/backend/dist/esm/volt.js +2 -1
- package/backend/dist/esm-dev/blacklist.js +1 -1
- package/backend/dist/esm-dev/cli.js +2 -2
- package/backend/dist/esm-dev/database.d.ts +41 -68
- package/backend/dist/esm-dev/database.js +138 -80
- package/backend/dist/esm-dev/endpoint.d.ts +23 -9
- package/backend/dist/esm-dev/endpoint.js +100 -23
- package/backend/dist/esm-dev/file_watcher.js +3 -3
- package/backend/dist/esm-dev/frontend.d.ts +0 -2
- package/backend/dist/esm-dev/frontend.js +9 -9
- package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
- package/backend/dist/esm-dev/image_endpoint.js +2 -1
- package/backend/dist/esm-dev/logger.js +1 -1
- package/backend/dist/esm-dev/payments/paddle.js +12 -4
- package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
- package/backend/dist/esm-dev/plugins/css.js +33 -7
- package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
- package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
- package/backend/dist/esm-dev/rate_limit.js +1 -1
- package/backend/dist/esm-dev/server.d.ts +7 -13
- package/backend/dist/esm-dev/server.js +184 -303
- package/backend/dist/esm-dev/status.d.ts +1 -0
- package/backend/dist/esm-dev/status.js +1 -0
- package/backend/dist/esm-dev/stream.d.ts +5 -3
- package/backend/dist/esm-dev/stream.js +13 -4
- package/backend/dist/esm-dev/users.d.ts +1 -1
- package/backend/dist/esm-dev/users.js +88 -73
- package/backend/dist/esm-dev/utils.d.ts +17 -9
- package/backend/dist/esm-dev/utils.js +22 -63
- package/backend/dist/esm-dev/view.d.ts +2 -2
- package/backend/dist/esm-dev/view.js +39 -41
- package/backend/dist/esm-dev/volt.d.ts +3 -2
- package/backend/dist/esm-dev/volt.js +2 -1
- package/backend/src/database.ts +173 -155
- package/backend/src/endpoint.ts +123 -31
- package/backend/src/file_watcher.ts +2 -2
- package/backend/src/frontend.ts +9 -8
- package/backend/src/image_endpoint.ts +4 -0
- package/backend/src/payments/paddle.ts +11 -3
- package/backend/src/plugins/css.ts +36 -8
- package/backend/src/plugins/ts/compiler.ts +37 -1
- package/backend/src/plugins/ts/preprocessing.ts +5 -3
- package/backend/src/server.ts +167 -306
- package/backend/src/status.ts +1 -0
- package/backend/src/stream.ts +28 -8
- package/backend/src/users.ts +87 -72
- package/backend/src/utils.ts +58 -25
- package/backend/src/view.ts +30 -28
- package/backend/src/{volt.js → volt.ts} +2 -1
- package/backend/tsconfig.cjs.json +3 -3
- package/backend/tsconfig.esm.json +3 -3
- package/frontend/dist/elements/base.d.ts +414 -432
- package/frontend/dist/elements/base.js +566 -329
- package/frontend/dist/elements/module.d.ts +26 -12
- package/frontend/dist/elements/module.js +69 -32
- package/frontend/dist/elements/register_element.d.ts +3 -0
- package/frontend/dist/elements/register_element.js +22 -0
- package/frontend/dist/modules/auth.d.ts +1 -0
- package/frontend/dist/modules/auth.js +6 -5
- package/frontend/dist/modules/color.d.ts +159 -0
- package/frontend/dist/modules/color.js +315 -0
- package/frontend/dist/modules/colors.d.ts +1 -26
- package/frontend/dist/modules/colors.js +417 -340
- package/frontend/dist/modules/cookies.d.ts +1 -0
- package/frontend/dist/modules/cookies.js +1 -0
- package/frontend/dist/modules/events.d.ts +1 -0
- package/frontend/dist/modules/events.js +1 -0
- package/frontend/dist/modules/google.d.ts +1 -0
- package/frontend/dist/modules/google.js +1 -0
- package/frontend/dist/modules/meta.d.ts +1 -0
- package/frontend/dist/modules/meta.js +1 -0
- package/frontend/dist/modules/mutex.d.ts +1 -2
- package/frontend/dist/modules/mutex.js +3 -4
- package/frontend/dist/modules/paddle.d.ts +1 -0
- package/frontend/dist/modules/paddle.js +14 -13
- package/frontend/dist/modules/scheme.d.ts +1 -0
- package/frontend/dist/modules/scheme.js +5 -3
- package/frontend/dist/modules/statics.d.ts +1 -0
- package/frontend/dist/modules/statics.js +1 -0
- package/frontend/dist/modules/support.d.ts +1 -0
- package/frontend/dist/modules/support.js +3 -2
- package/frontend/dist/modules/theme.d.ts +56 -0
- package/frontend/dist/{ui → modules}/theme.js +186 -75
- package/frontend/dist/modules/themes.d.ts +1 -1
- package/frontend/dist/modules/themes.js +1 -0
- package/frontend/dist/modules/user.d.ts +1 -0
- package/frontend/dist/modules/user.js +11 -10
- package/frontend/dist/modules/utils.d.ts +23 -2
- package/frontend/dist/modules/utils.js +93 -1
- package/frontend/dist/types/gradient.js +4 -0
- package/frontend/dist/ui/border_button.d.ts +0 -25
- package/frontend/dist/ui/border_button.js +50 -51
- package/frontend/dist/ui/button.d.ts +0 -21
- package/frontend/dist/ui/button.js +41 -46
- package/frontend/dist/ui/canvas.js +15 -15
- package/frontend/dist/ui/checkbox.d.ts +3 -17
- package/frontend/dist/ui/checkbox.js +36 -30
- package/frontend/dist/ui/code.d.ts +15 -82
- package/frontend/dist/ui/code.js +150 -125
- package/frontend/dist/ui/color.d.ts +0 -1
- package/frontend/dist/ui/color.js +1 -1
- package/frontend/dist/ui/context_menu.d.ts +4 -2
- package/frontend/dist/ui/context_menu.js +16 -17
- package/frontend/dist/ui/css.js +2 -0
- package/frontend/dist/ui/divider.d.ts +0 -7
- package/frontend/dist/ui/divider.js +21 -25
- package/frontend/dist/ui/dropdown.d.ts +13 -7
- package/frontend/dist/ui/dropdown.js +65 -30
- package/frontend/dist/ui/for_each.d.ts +0 -5
- package/frontend/dist/ui/for_each.js +17 -22
- package/frontend/dist/ui/form.d.ts +17 -12
- package/frontend/dist/ui/form.js +21 -18
- package/frontend/dist/ui/frame_modes.d.ts +9 -12
- package/frontend/dist/ui/frame_modes.js +8 -10
- package/frontend/dist/ui/google_map.d.ts +0 -11
- package/frontend/dist/ui/google_map.js +23 -28
- package/frontend/dist/ui/gradient.d.ts +0 -5
- package/frontend/dist/ui/gradient.js +17 -22
- package/frontend/dist/ui/image.d.ts +27 -58
- package/frontend/dist/ui/image.js +99 -93
- package/frontend/dist/ui/input.d.ts +20 -97
- package/frontend/dist/ui/input.js +192 -170
- package/frontend/dist/ui/link.d.ts +0 -18
- package/frontend/dist/ui/link.js +42 -48
- package/frontend/dist/ui/list.js +36 -37
- package/frontend/dist/ui/loader_button.d.ts +4 -19
- package/frontend/dist/ui/loader_button.js +35 -37
- package/frontend/dist/ui/loaders.d.ts +0 -8
- package/frontend/dist/ui/loaders.js +20 -25
- package/frontend/dist/ui/popup.d.ts +11 -8
- package/frontend/dist/ui/popup.js +183 -24
- package/frontend/dist/ui/pseudo.d.ts +3 -3
- package/frontend/dist/ui/pseudo.js +14 -17
- package/frontend/dist/ui/scroller.d.ts +10 -48
- package/frontend/dist/ui/scroller.js +306 -300
- package/frontend/dist/ui/slider.d.ts +9 -3
- package/frontend/dist/ui/slider.js +31 -17
- package/frontend/dist/ui/spacer.d.ts +0 -9
- package/frontend/dist/ui/spacer.js +21 -26
- package/frontend/dist/ui/span.js +13 -15
- package/frontend/dist/ui/stack.d.ts +14 -75
- package/frontend/dist/ui/stack.js +166 -169
- package/frontend/dist/ui/steps.d.ts +10 -23
- package/frontend/dist/ui/steps.js +47 -34
- package/frontend/dist/ui/style.d.ts +4 -3
- package/frontend/dist/ui/style.js +13 -18
- package/frontend/dist/ui/switch.d.ts +10 -4
- package/frontend/dist/ui/switch.js +24 -16
- package/frontend/dist/ui/table.d.ts +0 -23
- package/frontend/dist/ui/table.js +113 -119
- package/frontend/dist/ui/tabs.d.ts +3 -19
- package/frontend/dist/ui/tabs.js +35 -29
- package/frontend/dist/ui/text.d.ts +0 -8
- package/frontend/dist/ui/text.js +20 -25
- package/frontend/dist/ui/title.d.ts +0 -15
- package/frontend/dist/ui/title.js +39 -45
- package/frontend/dist/ui/ui.d.ts +0 -2
- package/frontend/dist/ui/ui.js +0 -2
- package/frontend/dist/ui/view.d.ts +3 -17
- package/frontend/dist/ui/view.js +27 -32
- package/frontend/dist/volt.d.ts +2 -1
- package/frontend/dist/volt.js +3 -1
- package/frontend/examples/dashboard/dashboard.ts +774 -0
- package/frontend/examples/theme/theme.ts +58 -0
- package/frontend/src/css/volt.css +5 -0
- package/frontend/src/elements/base.ts +767 -545
- package/frontend/src/elements/module.ts +90 -29
- package/frontend/src/elements/register_element.ts +24 -0
- package/frontend/src/modules/auth.ts +7 -6
- package/frontend/src/modules/color.ts +348 -0
- package/frontend/src/modules/colors.ts +468 -449
- package/frontend/src/modules/cookies.ts +1 -0
- package/frontend/src/modules/events.ts +1 -0
- package/frontend/src/modules/google.ts +1 -0
- package/frontend/src/modules/meta.ts +2 -1
- package/frontend/src/modules/mutex.ts +2 -4
- package/frontend/src/modules/paddle.ts +21 -20
- package/frontend/src/modules/scheme.ts +5 -4
- package/frontend/src/modules/statics.ts +2 -1
- package/frontend/src/modules/support.ts +3 -2
- package/frontend/src/modules/theme.ts +413 -0
- package/frontend/src/modules/themes.ts +2 -1
- package/frontend/src/modules/user.ts +12 -11
- package/frontend/src/modules/utils.ts +125 -2
- package/frontend/src/ui/border_button.ts +41 -37
- package/frontend/src/ui/button.ts +33 -32
- package/frontend/src/ui/canvas.ts +5 -2
- package/frontend/src/ui/checkbox.ts +21 -22
- package/frontend/src/ui/code.ts +92 -86
- package/frontend/src/ui/context_menu.ts +7 -5
- package/frontend/src/ui/css.ts +1 -1
- package/frontend/src/ui/divider.ts +15 -10
- package/frontend/src/ui/dropdown.ts +38 -21
- package/frontend/src/ui/for_each.ts +9 -8
- package/frontend/src/ui/form.ts +26 -21
- package/frontend/src/ui/frame_modes.ts +13 -17
- package/frontend/src/ui/google_map.ts +15 -13
- package/frontend/src/ui/gradient.ts +9 -8
- package/frontend/src/ui/image.ts +108 -86
- package/frontend/src/ui/input.ts +145 -144
- package/frontend/src/ui/link.ts +25 -23
- package/frontend/src/ui/list.ts +12 -6
- package/frontend/src/ui/loader_button.ts +26 -25
- package/frontend/src/ui/loaders.ts +12 -11
- package/frontend/src/ui/popup.ts +168 -14
- package/frontend/src/ui/pseudo.ts +5 -3
- package/frontend/src/ui/scroller.ts +303 -294
- package/frontend/src/ui/slider.ts +15 -10
- package/frontend/src/ui/spacer.ts +14 -11
- package/frontend/src/ui/span.ts +6 -2
- package/frontend/src/ui/stack.ts +196 -183
- package/frontend/src/ui/steps.ts +38 -22
- package/frontend/src/ui/style.ts +7 -4
- package/frontend/src/ui/switch.ts +16 -11
- package/frontend/src/ui/table.ts +42 -34
- package/frontend/src/ui/tabs.ts +20 -19
- package/frontend/src/ui/text.ts +12 -11
- package/frontend/src/ui/title.ts +22 -20
- package/frontend/src/ui/ui.ts +0 -2
- package/frontend/src/ui/view.ts +20 -19
- package/frontend/src/volt.ts +3 -1
- package/frontend/{compile.js → tools/compile.old.js} +2 -2
- package/frontend/tools/embed_scripts.js +69 -0
- package/frontend/tsconfig.json +26 -0
- package/package.json +7 -6
- package/frontend/dist/ui/theme.d.ts +0 -25
- package/frontend/exports.json +0 -1340
- package/frontend/src/modules/date.js +0 -535
- package/frontend/src/ui/color.ts +0 -117
- package/frontend/src/ui/theme.ts +0 -279
- /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
package/backend/dist/cjs/view.js
CHANGED
|
@@ -159,7 +159,7 @@ class View {
|
|
|
159
159
|
is_js_ts_view;
|
|
160
160
|
html;
|
|
161
161
|
raw_html;
|
|
162
|
-
|
|
162
|
+
_bundle;
|
|
163
163
|
payments;
|
|
164
164
|
// vhighlight?: string | undefined;
|
|
165
165
|
min_device_width;
|
|
@@ -203,7 +203,7 @@ class View {
|
|
|
203
203
|
this.includes = this.includes.drop_duplicates();
|
|
204
204
|
// Attributes.
|
|
205
205
|
this.html = undefined;
|
|
206
|
-
this.
|
|
206
|
+
this._bundle = undefined;
|
|
207
207
|
}
|
|
208
208
|
// Initialize.
|
|
209
209
|
_initialize(server, endpoint) {
|
|
@@ -216,51 +216,45 @@ class View {
|
|
|
216
216
|
this._server = server;
|
|
217
217
|
this._endpoint = endpoint;
|
|
218
218
|
}
|
|
219
|
-
// Bundle the compiled typescript / javascript
|
|
220
|
-
async
|
|
219
|
+
// Bundle the compiled typescript / javascript dynamically on demand to optimize server startup for development purposes.
|
|
220
|
+
async _dynamic_bundle() {
|
|
221
221
|
// Server & endpoint.
|
|
222
222
|
if (this._server === undefined || this._endpoint === undefined) {
|
|
223
223
|
throw Error("View has not been initialized with \"View._initialize()\" yet.");
|
|
224
224
|
}
|
|
225
225
|
// Bundle.
|
|
226
|
-
const had_bundle = this.bundle !== undefined;
|
|
227
|
-
if (bundle != null) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
this.
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
226
|
+
// const had_bundle = this.bundle !== undefined;
|
|
227
|
+
// if (bundle != null) {
|
|
228
|
+
// // also accept already bundled for server.js in case multiple endpoint paths serve the same bundle.
|
|
229
|
+
// this.bundle = bundle;
|
|
230
|
+
// } else {
|
|
231
|
+
logger_js_1.default.log(2, log_source, `Bundling entry path "${this.source_path?.str()}".`);
|
|
232
|
+
this._bundle = await compiler_js_1.default.bundle({
|
|
233
|
+
entry_paths: [this.source_path?.str() ?? ""],
|
|
234
|
+
minify: false, //this._server.production,
|
|
235
|
+
platform: "browser",
|
|
236
|
+
// format: "esm",
|
|
237
|
+
format: "iife",
|
|
238
|
+
target: "es2021",
|
|
239
|
+
// target: "esnext",
|
|
240
|
+
// sourcemap: this._server.production ? false : "inline",
|
|
241
|
+
extract_inputs: true, // since bundle.inputs is used by server.js.
|
|
242
|
+
tree_shaking: false,
|
|
243
|
+
});
|
|
244
|
+
if (this._bundle.errors.length > 0) {
|
|
245
|
+
logger_js_1.default.log(0, log_source, `Encountered an error while bundling "${this.source}".`);
|
|
246
|
+
this._bundle.debug();
|
|
247
|
+
return;
|
|
250
248
|
}
|
|
249
|
+
// }
|
|
251
250
|
// Set options based on inputs.
|
|
252
|
-
this.payments = this.
|
|
251
|
+
this.payments = this._bundle.inputs.find((path) => path.endsWith("/modules/paddle.js"));
|
|
253
252
|
// this.vhighlight = this.bundle.inputs.find((path: string) => path.endsWith("/vhighlight.js"));
|
|
254
253
|
// Rebuild html.
|
|
255
254
|
await this._build_html();
|
|
256
|
-
|
|
257
|
-
logger_js_1.default.log(0, log_source, `Refreshing endpoint ${this._endpoint.method}:${this._endpoint.endpoint}.`);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
logger_js_1.default.log(1, log_source, `Refreshing endpoint ${this._endpoint.method}:${this._endpoint.endpoint}.`);
|
|
261
|
-
}
|
|
255
|
+
logger_js_1.default.log(0, log_source, `Bundling javascript endpoint ${this._endpoint.method}:${this._endpoint.endpoint}.`);
|
|
262
256
|
// Response.
|
|
263
|
-
return this.bundle;
|
|
257
|
+
// return this.bundle;
|
|
264
258
|
}
|
|
265
259
|
// Build html.
|
|
266
260
|
async _build_html() {
|
|
@@ -268,9 +262,13 @@ class View {
|
|
|
268
262
|
if (this._server === undefined || this._endpoint === undefined) {
|
|
269
263
|
throw Error("View has not been initialized with \"View._initialize()\" yet.");
|
|
270
264
|
}
|
|
265
|
+
// Bundle js files automatically.
|
|
266
|
+
if (this.is_js_ts_view && !this._bundle) {
|
|
267
|
+
await this._dynamic_bundle();
|
|
268
|
+
}
|
|
271
269
|
// Vars.
|
|
272
|
-
const line_break = this._server.production ? "" : "\n";
|
|
273
|
-
const has_bundle = this.
|
|
270
|
+
const line_break = this._server.production ? "\n" : "\n";
|
|
271
|
+
const has_bundle = this._bundle != null && typeof this._bundle === "object";
|
|
274
272
|
// Initialize html.
|
|
275
273
|
this.html = "";
|
|
276
274
|
// Doctype.
|
|
@@ -512,8 +510,8 @@ class View {
|
|
|
512
510
|
}
|
|
513
511
|
});
|
|
514
512
|
// Add direct source code.
|
|
515
|
-
if (has_bundle && typeof this.
|
|
516
|
-
this.html += `<script type='module'>${line_break}${this.
|
|
513
|
+
if (has_bundle && typeof this._bundle.code === "string") {
|
|
514
|
+
this.html += `<script type='module'>${line_break}${this._bundle.code}${line_break}</script>${line_break}`;
|
|
517
515
|
}
|
|
518
516
|
// Include the source.
|
|
519
517
|
else if (typeof this.source === "string") {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { APIError } from "./utils.js";
|
|
1
2
|
export * from "./status.js";
|
|
2
3
|
export * from "./meta.js";
|
|
3
4
|
export * from "./splash_screen.js";
|
|
@@ -9,7 +10,7 @@ export * from "./database.js";
|
|
|
9
10
|
export * from "./rate_limit.js";
|
|
10
11
|
export * from "./logger.js";
|
|
11
12
|
export * from "./file_watcher.js";
|
|
12
|
-
export * from "./frontend.js";
|
|
13
13
|
export * as Mail from "./plugins/mail.js";
|
|
14
14
|
export * as TypeScript from "./plugins/ts/compiler.js";
|
|
15
|
-
export
|
|
15
|
+
export * from "./plugins/css.js";
|
|
16
|
+
export * from "./frontend.js";
|
package/backend/dist/cjs/volt.js
CHANGED
|
@@ -40,12 +40,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
};
|
|
41
41
|
})();
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.TypeScript = exports.Mail = exports.APIError =
|
|
43
|
+
exports.TypeScript = exports.Mail = exports.APIError = void 0;
|
|
44
44
|
// ---------------------------------------------------------
|
|
45
45
|
// Exports.
|
|
46
46
|
// Create volt lib.
|
|
47
47
|
var utils_js_1 = require("./utils.js");
|
|
48
|
-
Object.defineProperty(exports, "FrontendError", { enumerable: true, get: function () { return utils_js_1.FrontendError; } });
|
|
49
48
|
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return utils_js_1.APIError; } });
|
|
50
49
|
__exportStar(require("./status.js"), exports);
|
|
51
50
|
__exportStar(require("./meta.js"), exports);
|
|
@@ -61,4 +60,5 @@ __exportStar(require("./file_watcher.js"), exports);
|
|
|
61
60
|
exports.Mail = __importStar(require("./plugins/mail.js"));
|
|
62
61
|
// export * as PDF from "./plugins/pdf.js"
|
|
63
62
|
exports.TypeScript = __importStar(require("./plugins/ts/compiler.js"));
|
|
63
|
+
__exportStar(require("./plugins/css.js"), exports);
|
|
64
64
|
__exportStar(require("./frontend.js"), exports);
|
|
@@ -20,6 +20,11 @@ Copyright: © 2022 Daan van den Bergh.
|
|
|
20
20
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/*kill the transitions on any descendant elements of .notransition*/
|
|
24
|
+
.notransition * {
|
|
25
|
+
transition: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
/* Hide the scrollbar */
|
|
24
29
|
.hide_scrollbar {
|
|
25
30
|
-ms-overflow-style: none; /* IE and Edge */
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { ChildProcess } from "child_process";
|
|
2
2
|
import { MongoClient, Collection as MongoCollection } from 'mongodb';
|
|
3
|
+
import { vlib } from "./vinc.js";
|
|
4
|
+
interface BaseOptions {
|
|
5
|
+
options?: Record<string, any>;
|
|
6
|
+
commit_quorum?: any;
|
|
7
|
+
forced?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type IndexOptions = (BaseOptions & {
|
|
10
|
+
key: string;
|
|
11
|
+
keys?: never;
|
|
12
|
+
}) | (BaseOptions & {
|
|
13
|
+
key?: never;
|
|
14
|
+
keys: string[];
|
|
15
|
+
});
|
|
3
16
|
declare class Collection {
|
|
4
17
|
static chunk_size: number;
|
|
5
18
|
static constructor_scheme: {
|
|
@@ -47,21 +60,13 @@ declare class Collection {
|
|
|
47
60
|
uid_based: boolean;
|
|
48
61
|
ttl: number | null;
|
|
49
62
|
ttl_enabled: boolean;
|
|
50
|
-
constructor(name: string, collection: MongoCollection, ttl?: number | null,
|
|
51
|
-
|
|
52
|
-
options?: Record<string, any>;
|
|
53
|
-
commit_quorum?: any;
|
|
54
|
-
forced?: boolean;
|
|
55
|
-
}>, uid_based?: boolean);
|
|
63
|
+
constructor(name: string, collection: MongoCollection, ttl?: number | null, // ttl in msec
|
|
64
|
+
indexes?: IndexOptions[], uid_based?: boolean);
|
|
56
65
|
private _process_doc;
|
|
57
66
|
private _load_chunked;
|
|
58
67
|
private _save_chunked;
|
|
59
|
-
create_index({
|
|
60
|
-
|
|
61
|
-
options?: Record<string, any> | null;
|
|
62
|
-
commit_quorum?: any;
|
|
63
|
-
forced?: boolean;
|
|
64
|
-
}): Promise<string>;
|
|
68
|
+
create_index({ key, keys, // following the IndexOptions "key" or "keys" must be defined in typescript but not in raw js.
|
|
69
|
+
options, commit_quorum, forced }: IndexOptions): Promise<string>;
|
|
65
70
|
find(query: Record<string, any>): Promise<any>;
|
|
66
71
|
exists(path: string | Record<string, any>): Promise<boolean>;
|
|
67
72
|
load(path: string | Record<string, any>, opts?: {
|
|
@@ -101,16 +106,8 @@ declare class Collection {
|
|
|
101
106
|
declare class UIDCollection {
|
|
102
107
|
private _col;
|
|
103
108
|
col: MongoCollection;
|
|
104
|
-
constructor(name: string, collection: MongoCollection, indexes?:
|
|
105
|
-
|
|
106
|
-
options?: Record<string, any>;
|
|
107
|
-
commit_quorum?: any;
|
|
108
|
-
}>, ttl?: number | null);
|
|
109
|
-
create_index({ keys, options, commit_quorum }: {
|
|
110
|
-
keys: string[] | string | Record<string, any>;
|
|
111
|
-
options?: Record<string, any> | null;
|
|
112
|
-
commit_quorum?: any;
|
|
113
|
-
}): Promise<string>;
|
|
109
|
+
constructor(name: string, collection: MongoCollection, indexes?: IndexOptions[], ttl?: number | null);
|
|
110
|
+
create_index(args: IndexOptions): Promise<string>;
|
|
114
111
|
find(uid?: string | null, query?: Record<string, any>): Promise<any>;
|
|
115
112
|
exists(uid: string, path: string | Record<string, any>): Promise<boolean>;
|
|
116
113
|
load(uid: string, path: string | Record<string, any>, opts?: {
|
|
@@ -275,90 +272,66 @@ declare class Database {
|
|
|
275
272
|
type: string[];
|
|
276
273
|
default: {};
|
|
277
274
|
};
|
|
278
|
-
_server:
|
|
275
|
+
_server: {
|
|
276
|
+
type: string[];
|
|
277
|
+
};
|
|
279
278
|
};
|
|
280
279
|
uri: string | null;
|
|
281
|
-
preview: boolean;
|
|
282
|
-
preview_ip_whitelist: string[];
|
|
283
280
|
client_opts: Record<string, any> | null;
|
|
284
281
|
config: Record<string, any>;
|
|
285
|
-
source:
|
|
282
|
+
source: vlib.Path | undefined;
|
|
286
283
|
start_args: string[];
|
|
287
|
-
_collections:
|
|
284
|
+
_collections: {
|
|
288
285
|
name: string;
|
|
289
286
|
ttl?: number | null;
|
|
290
|
-
indexes?:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
commit_quorum?: any;
|
|
294
|
-
}>;
|
|
295
|
-
}>;
|
|
296
|
-
_uid_collections: Array<{
|
|
287
|
+
indexes?: string[] | IndexOptions[];
|
|
288
|
+
}[];
|
|
289
|
+
_uid_collections: {
|
|
297
290
|
name: string;
|
|
298
291
|
ttl?: number | null;
|
|
299
|
-
indexes?:
|
|
300
|
-
|
|
301
|
-
options?: Record<string, any>;
|
|
302
|
-
commit_quorum?: any;
|
|
303
|
-
}>;
|
|
304
|
-
}>;
|
|
292
|
+
indexes?: string[] | IndexOptions[];
|
|
293
|
+
}[];
|
|
305
294
|
server: any;
|
|
306
295
|
client: MongoClient | null;
|
|
307
296
|
collections: Record<string, Collection | UIDCollection>;
|
|
308
297
|
proc?: ChildProcess;
|
|
309
298
|
daemon?: any;
|
|
310
299
|
db?: any;
|
|
311
|
-
|
|
300
|
+
_listed_cols: any;
|
|
301
|
+
constructor({ uri, source, config, start_args, client, collections, uid_collections, daemon, _server, }: {
|
|
312
302
|
uri?: string | null;
|
|
313
303
|
source?: string | null;
|
|
314
304
|
config?: Record<string, any> | null;
|
|
315
305
|
start_args?: string[];
|
|
316
306
|
client?: Record<string, any> | null;
|
|
317
|
-
collections?:
|
|
307
|
+
collections?: {
|
|
318
308
|
name: string;
|
|
319
309
|
ttl?: number | null;
|
|
320
|
-
indexes?:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
commit_quorum?: any;
|
|
324
|
-
}>;
|
|
325
|
-
}>;
|
|
326
|
-
uid_collections?: Array<{
|
|
310
|
+
indexes?: string[] | IndexOptions[];
|
|
311
|
+
}[];
|
|
312
|
+
uid_collections?: {
|
|
327
313
|
name: string;
|
|
328
314
|
ttl?: number | null;
|
|
329
|
-
indexes?:
|
|
330
|
-
|
|
331
|
-
options?: Record<string, any>;
|
|
332
|
-
commit_quorum?: any;
|
|
333
|
-
}>;
|
|
334
|
-
}>;
|
|
315
|
+
indexes?: string[] | IndexOptions[];
|
|
316
|
+
}[];
|
|
335
317
|
preview?: boolean;
|
|
336
318
|
preview_ip_whitelist?: string[];
|
|
337
319
|
daemon?: Record<string, any> | boolean;
|
|
338
320
|
_server: any;
|
|
339
321
|
});
|
|
340
|
-
_initialize_db_preview(): void;
|
|
341
322
|
connect(): Promise<void>;
|
|
342
323
|
initialize(): Promise<void>;
|
|
343
324
|
close(): Promise<void>;
|
|
344
325
|
create_collection(info: {
|
|
345
326
|
name: string;
|
|
346
|
-
indexes?:
|
|
347
|
-
keys: string[] | string | Record<string, any>;
|
|
348
|
-
options?: Record<string, any>;
|
|
349
|
-
commit_quorum?: any;
|
|
350
|
-
}>;
|
|
327
|
+
indexes?: IndexOptions[];
|
|
351
328
|
ttl?: number | null;
|
|
352
|
-
} | string): Collection
|
|
329
|
+
} | string): Promise<Collection>;
|
|
353
330
|
create_uid_collection(info: {
|
|
354
331
|
name: string;
|
|
355
|
-
indexes?:
|
|
356
|
-
keys: string[] | string | Record<string, any>;
|
|
357
|
-
options?: Record<string, any>;
|
|
358
|
-
commit_quorum?: any;
|
|
359
|
-
}>;
|
|
332
|
+
indexes?: IndexOptions[];
|
|
360
333
|
ttl?: number | null;
|
|
361
|
-
} | string): UIDCollection
|
|
334
|
+
} | string): Promise<UIDCollection>;
|
|
362
335
|
get_collections(): Promise<string[]>;
|
|
363
336
|
}
|
|
364
337
|
export { Collection, UIDCollection, Database };
|