anbaric-cloud-hosting 1.14.2 → 1.15.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-cloud-hosting",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Anbaric Cloud hosting service: Postgres-backed job persistence and queuing exposed over an HTTP API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chris@anbaric.ai",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"@aws-sdk/client-s3": "^3.1110.0",
|
|
19
19
|
"@aws-sdk/client-secrets-manager": "^3.700.0",
|
|
20
20
|
"@aws-sdk/client-servicediscovery": "^3.1110.0",
|
|
21
|
-
"anbaric-data-store": "^1.
|
|
22
|
-
"anbaric-plugins": "^1.
|
|
23
|
-
"anbaric-tsapi": "^1.
|
|
21
|
+
"anbaric-data-store": "^1.15.0",
|
|
22
|
+
"anbaric-plugins": "^1.15.0",
|
|
23
|
+
"anbaric-tsapi": "^1.15.0",
|
|
24
24
|
"esbuild": "^0.28.2",
|
|
25
25
|
"pg": "^8.16.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^26.2.0",
|
|
29
29
|
"@types/pg": "^8.15.0",
|
|
30
|
-
"anbaric-impl-cloud": "^1.
|
|
31
|
-
"anbaric-state-machine": "^1.
|
|
30
|
+
"anbaric-impl-cloud": "^1.15.0",
|
|
31
|
+
"anbaric-state-machine": "^1.15.0",
|
|
32
32
|
"tsx": "^4.20.0",
|
|
33
33
|
"typescript": "^7.0.2"
|
|
34
34
|
},
|
|
@@ -4,7 +4,7 @@ import {AuditFilter, AuditRecordStore} from "../auditing/AuditRecordStore";
|
|
|
4
4
|
|
|
5
5
|
/* The writes worth keeping in the durable trail; reads (READ, LIST, QUERY) are
|
|
6
6
|
dropped by default. Interactions are plain strings chosen by each store. */
|
|
7
|
-
const DEFAULT_WRITE_MASK : Array<string> = ["CREATE", "SAVE", "UPDATE_PROPERTIES", "CHANGE_STATE", "DELETE", "EXECUTE", "KILL"];
|
|
7
|
+
const DEFAULT_WRITE_MASK : Array<string> = ["INITIALIZE", "CREATE", "SAVE", "UPDATE_PROPERTIES", "CHANGE_STATE", "DELETE", "EXECUTE", "KILL"];
|
|
8
8
|
|
|
9
9
|
/* Persists audit records, subject to a write mask: only the interactions in
|
|
10
10
|
the mask are stored, so high-volume reads can be audited at the call site
|
|
@@ -3,7 +3,9 @@ import {build, Plugin as EsbuildPlugin} from "esbuild";
|
|
|
3
3
|
|
|
4
4
|
/* Compiles a plugin module twice: a browser ESM bundle whose react,
|
|
5
5
|
react-dom and design-system imports are aliased to the dashboard's
|
|
6
|
-
window.AnbaricPluginRuntime global
|
|
6
|
+
window.AnbaricPluginRuntime global (and whose server-only imports — pg and
|
|
7
|
+
node builtins used by widget data functions — are stubbed inert, since data
|
|
8
|
+
functions only ever run on the server), and a node bundle whose UI imports
|
|
7
9
|
are replaced with inert stubs so the module can be imported server-side
|
|
8
10
|
(for page metadata and widget data functions) without a DOM or CSS
|
|
9
11
|
loader. */
|
|
@@ -14,7 +16,7 @@ class PluginBundler {
|
|
|
14
16
|
async bundleForBrowser(moduleName : string) : Promise<string> {
|
|
15
17
|
return this.bundle(moduleName, {
|
|
16
18
|
platform: "browser",
|
|
17
|
-
plugins: [this.replacementPlugin(browserReplacement)],
|
|
19
|
+
plugins: [this.replacementPlugin(browserReplacement, /^react(-dom)?(\/|$)|^@anbaric\/design-system(\/|$)|^pg(\/|$)|^node:/)],
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -22,7 +24,7 @@ class PluginBundler {
|
|
|
22
24
|
return this.bundle(moduleName, {
|
|
23
25
|
platform: "node",
|
|
24
26
|
packages: "external",
|
|
25
|
-
plugins: [this.replacementPlugin(serverReplacement)],
|
|
27
|
+
plugins: [this.replacementPlugin(serverReplacement, /^react(-dom)?(\/|$)|^@anbaric\/design-system(\/|$)/)],
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -39,11 +41,11 @@ class PluginBundler {
|
|
|
39
41
|
return result.outputFiles[0].text;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
private replacementPlugin(replacement : (path : string) => string) : EsbuildPlugin {
|
|
44
|
+
private replacementPlugin(replacement : (path : string) => string, moduleFilter : RegExp) : EsbuildPlugin {
|
|
43
45
|
return {
|
|
44
46
|
name: "anbaric-plugin-runtime",
|
|
45
47
|
setup(pluginBuild) {
|
|
46
|
-
pluginBuild.onResolve({ filter:
|
|
48
|
+
pluginBuild.onResolve({ filter: moduleFilter }, resolving =>
|
|
47
49
|
({ path: resolving.path, namespace: "anbaric-runtime" }));
|
|
48
50
|
pluginBuild.onResolve({ filter: /\.css$/ }, resolving =>
|
|
49
51
|
({ path: resolving.path, namespace: "anbaric-runtime" }));
|
|
@@ -57,6 +59,7 @@ class PluginBundler {
|
|
|
57
59
|
|
|
58
60
|
const browserReplacement = (path : string) : string => {
|
|
59
61
|
if (path.endsWith(".css")) return "";
|
|
62
|
+
if (path === "pg" || path.startsWith("pg/") || path.startsWith("node:")) return "module.exports = {};";
|
|
60
63
|
if (path === "react/jsx-runtime" || path === "react/jsx-dev-runtime") {
|
|
61
64
|
return "module.exports = window.AnbaricPluginRuntime.jsxRuntime;";
|
|
62
65
|
}
|