@jskit-ai/console-web 0.1.1
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,103 @@
|
|
|
1
|
+
export default Object.freeze({
|
|
2
|
+
packageVersion: 1,
|
|
3
|
+
packageId: "@jskit-ai/console-web",
|
|
4
|
+
version: "0.1.1",
|
|
5
|
+
kind: "runtime",
|
|
6
|
+
description: "Authenticated console surface scaffold and surface policy wiring.",
|
|
7
|
+
dependsOn: [
|
|
8
|
+
"@jskit-ai/auth-web",
|
|
9
|
+
"@jskit-ai/shell-web",
|
|
10
|
+
"@jskit-ai/users-core"
|
|
11
|
+
],
|
|
12
|
+
capabilities: {
|
|
13
|
+
provides: [
|
|
14
|
+
"console.web"
|
|
15
|
+
],
|
|
16
|
+
requires: [
|
|
17
|
+
"users.core"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
runtime: {
|
|
21
|
+
server: {
|
|
22
|
+
providers: []
|
|
23
|
+
},
|
|
24
|
+
client: {
|
|
25
|
+
providers: []
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
metadata: {
|
|
29
|
+
apiSummary: {
|
|
30
|
+
surfaces: [
|
|
31
|
+
{
|
|
32
|
+
subpath: "./client",
|
|
33
|
+
summary: "Exports no runtime API today (reserved console surface package entrypoint)."
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
containerTokens: {
|
|
37
|
+
server: [],
|
|
38
|
+
client: []
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
mutations: {
|
|
43
|
+
dependencies: {
|
|
44
|
+
runtime: {
|
|
45
|
+
"@jskit-ai/auth-web": "0.1.35",
|
|
46
|
+
"@jskit-ai/shell-web": "0.1.33",
|
|
47
|
+
"@jskit-ai/users-core": "0.1.44"
|
|
48
|
+
},
|
|
49
|
+
dev: {}
|
|
50
|
+
},
|
|
51
|
+
packageJson: {
|
|
52
|
+
scripts: {
|
|
53
|
+
"server:console": "SERVER_SURFACE=console node ./bin/server.js",
|
|
54
|
+
"dev:console": "VITE_SURFACE=console vite",
|
|
55
|
+
"build:console": "VITE_SURFACE=console vite build"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
procfile: {},
|
|
59
|
+
files: [
|
|
60
|
+
{
|
|
61
|
+
from: "templates/src/pages/console.vue",
|
|
62
|
+
toSurface: "console",
|
|
63
|
+
toSurfaceRoot: true,
|
|
64
|
+
ownership: "app",
|
|
65
|
+
reason: "Install shell-driven console wrapper page.",
|
|
66
|
+
category: "console-web",
|
|
67
|
+
id: "console-web-page-console-wrapper"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
from: "templates/src/pages/console/index.vue",
|
|
71
|
+
toSurface: "console",
|
|
72
|
+
toSurfacePath: "index.vue",
|
|
73
|
+
ownership: "app",
|
|
74
|
+
reason: "Install shell-driven console page starter.",
|
|
75
|
+
category: "console-web",
|
|
76
|
+
id: "console-web-page-console"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
text: [
|
|
80
|
+
{
|
|
81
|
+
op: "append-text",
|
|
82
|
+
file: "config/surfaceAccessPolicies.js",
|
|
83
|
+
position: "bottom",
|
|
84
|
+
skipIfContains: "surfaceAccessPolicies.console_owner = {",
|
|
85
|
+
value: "\nsurfaceAccessPolicies.console_owner = {\n requireAuth: true,\n requireFlagsAll: [\"console_owner\"]\n};\n",
|
|
86
|
+
reason: "Register console-owner surface access policy for the console surface.",
|
|
87
|
+
category: "console-web",
|
|
88
|
+
id: "console-web-surface-access-policies-console-owner"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
op: "append-text",
|
|
92
|
+
file: "config/public.js",
|
|
93
|
+
position: "bottom",
|
|
94
|
+
skipIfContains: "config.surfaceDefinitions.console = {",
|
|
95
|
+
value:
|
|
96
|
+
"\nconfig.surfaceDefinitions.console = {\n id: \"console\",\n label: \"Console\",\n pagesRoot: \"console\",\n enabled: true,\n requiresAuth: true,\n requiresWorkspace: false,\n accessPolicyId: \"console_owner\",\n origin: \"\"\n};\n",
|
|
97
|
+
reason: "Register console surface definition once console-web is installed.",
|
|
98
|
+
category: "console-web",
|
|
99
|
+
id: "console-web-surface-config-console"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card rounded="lg" elevation="1" border>
|
|
3
|
+
<v-card-item>
|
|
4
|
+
<template #prepend>
|
|
5
|
+
<v-chip color="primary" size="small" label>Console</v-chip>
|
|
6
|
+
</template>
|
|
7
|
+
<v-card-title class="text-h5">Operations Console</v-card-title>
|
|
8
|
+
<v-card-subtitle>Operator tools, scripts, and diagnostics.</v-card-subtitle>
|
|
9
|
+
</v-card-item>
|
|
10
|
+
<v-divider />
|
|
11
|
+
<v-card-text class="d-flex flex-column ga-4">
|
|
12
|
+
<div class="d-flex flex-wrap ga-3">
|
|
13
|
+
<v-chip color="secondary" variant="tonal" label>Route: /console</v-chip>
|
|
14
|
+
<v-chip color="info" variant="tonal" label>Surface status: enabled</v-chip>
|
|
15
|
+
</div>
|
|
16
|
+
<p class="text-medium-emphasis mb-0">
|
|
17
|
+
Ideal for operator actions, scripts, and technical insights not meant for end users.
|
|
18
|
+
</p>
|
|
19
|
+
<div>
|
|
20
|
+
<v-btn color="primary" variant="flat" to="/home">Back to home</v-btn>
|
|
21
|
+
</div>
|
|
22
|
+
</v-card-text>
|
|
23
|
+
</v-card>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<route lang="json">
|
|
2
|
+
{
|
|
3
|
+
"meta": {
|
|
4
|
+
"jskit": {
|
|
5
|
+
"surface": "console"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
</route>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import ShellLayout from "@/components/ShellLayout.vue";
|
|
13
|
+
import { RouterView } from "vue-router";
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<ShellLayout title="" subtitle="">
|
|
18
|
+
<RouterView />
|
|
19
|
+
</ShellLayout>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import descriptor from "../package.descriptor.mjs";
|
|
7
|
+
|
|
8
|
+
const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const PACKAGE_DIR = path.resolve(TEST_DIRECTORY, "..");
|
|
10
|
+
|
|
11
|
+
function findFileMutation(id) {
|
|
12
|
+
const files = descriptor?.mutations?.files;
|
|
13
|
+
return Array.isArray(files)
|
|
14
|
+
? files.find((entry) => String(entry?.id || "").trim() === id) || null
|
|
15
|
+
: null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function findTextMutation(id) {
|
|
19
|
+
const text = descriptor?.mutations?.text;
|
|
20
|
+
return Array.isArray(text)
|
|
21
|
+
? text.find((entry) => String(entry?.id || "").trim() === id) || null
|
|
22
|
+
: null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
test("console-web installs console surface scripts and files", () => {
|
|
26
|
+
assert.deepEqual(descriptor?.mutations?.packageJson?.scripts, {
|
|
27
|
+
"server:console": "SERVER_SURFACE=console node ./bin/server.js",
|
|
28
|
+
"dev:console": "VITE_SURFACE=console vite",
|
|
29
|
+
"build:console": "VITE_SURFACE=console vite build"
|
|
30
|
+
});
|
|
31
|
+
assert.deepEqual(findFileMutation("console-web-page-console-wrapper"), {
|
|
32
|
+
from: "templates/src/pages/console.vue",
|
|
33
|
+
toSurface: "console",
|
|
34
|
+
toSurfaceRoot: true,
|
|
35
|
+
ownership: "app",
|
|
36
|
+
reason: "Install shell-driven console wrapper page.",
|
|
37
|
+
category: "console-web",
|
|
38
|
+
id: "console-web-page-console-wrapper"
|
|
39
|
+
});
|
|
40
|
+
assert.deepEqual(findFileMutation("console-web-page-console"), {
|
|
41
|
+
from: "templates/src/pages/console/index.vue",
|
|
42
|
+
toSurface: "console",
|
|
43
|
+
toSurfacePath: "index.vue",
|
|
44
|
+
ownership: "app",
|
|
45
|
+
reason: "Install shell-driven console page starter.",
|
|
46
|
+
category: "console-web",
|
|
47
|
+
id: "console-web-page-console"
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("console-web wires console surface policy into app config", () => {
|
|
52
|
+
assert.equal(
|
|
53
|
+
findTextMutation("console-web-surface-access-policies-console-owner")?.file,
|
|
54
|
+
"config/surfaceAccessPolicies.js"
|
|
55
|
+
);
|
|
56
|
+
assert.equal(findTextMutation("console-web-surface-config-console")?.file, "config/public.js");
|
|
57
|
+
assert.match(findTextMutation("console-web-surface-config-console")?.value || "", /accessPolicyId: "console_owner"/);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("console-web console templates stay shell-driven", async () => {
|
|
61
|
+
const wrapperSource = await readFile(path.join(PACKAGE_DIR, "templates", "src", "pages", "console.vue"), "utf8");
|
|
62
|
+
const indexSource = await readFile(path.join(PACKAGE_DIR, "templates", "src", "pages", "console", "index.vue"), "utf8");
|
|
63
|
+
|
|
64
|
+
assert.match(wrapperSource, /ShellLayout/);
|
|
65
|
+
assert.match(wrapperSource, /"surface": "console"/);
|
|
66
|
+
assert.match(indexSource, /Operations Console/);
|
|
67
|
+
});
|