@antelopejs/dms 0.19.0 → 0.19.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.
- package/CHANGELOG.md +26 -0
- package/bin/control/commands-stack.mjs +5 -5
- package/bin/control/commands-verify.mjs +2 -2
- package/bin/control/consumer-install.test.mjs +14 -1
- package/bin/control/namespaces.test.mjs +33 -0
- package/bin/control/run-state.mjs +27 -11
- package/bin/control/stack.mjs +8 -8
- package/bin/control/verify/formal.mjs +1 -1
- package/bin/control/verify/map.test.mjs +2 -6
- package/bin/control/verify/verdict.mjs +4 -4
- package/dist/attachments/save.js +2 -1
- package/dist/attachments/save.js.map +1 -1
- package/frontend-vue/layers/dms-ui/app/components/kpi/KpiCard.vue +3 -0
- package/frontend-vue/layers/dms-ui/app/composables/chart/types.ts +2 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.19.1
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.19.0...v0.19.1)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **dms-ui:** Show a KPI payload's caption as the card's footnote ([#844](https://github.com/AntelopeJS/dms/pull/844))
|
|
10
|
+
|
|
11
|
+
### 🩹 Fixes
|
|
12
|
+
|
|
13
|
+
- **docs:** Open the sign-in capture signed out so later scenes keep the session ([#836](https://github.com/AntelopeJS/dms/pull/836))
|
|
14
|
+
- **dms-control:** Let read-only commands read a run from another PID namespace ([#843](https://github.com/AntelopeJS/dms/pull/843))
|
|
15
|
+
- **agents:** Type-check the probes' JSDoc with checkJs ([#842](https://github.com/AntelopeJS/dms/pull/842))
|
|
16
|
+
|
|
17
|
+
### 📖 Documentation
|
|
18
|
+
|
|
19
|
+
- **readme:** Tell the one-run story from the X article ([#841](https://github.com/AntelopeJS/dms/pull/841))
|
|
20
|
+
|
|
21
|
+
### 📦 Build
|
|
22
|
+
|
|
23
|
+
- **deps:** Take tooling-configs 0.5.0 ([#840](https://github.com/AntelopeJS/dms/pull/840))
|
|
24
|
+
|
|
25
|
+
### ❤️ Contributors
|
|
26
|
+
|
|
27
|
+
- Antony Rizzitelli ([@Upd4ting](http://github.com/Upd4ting))
|
|
28
|
+
|
|
3
29
|
## v0.19.0
|
|
4
30
|
|
|
5
31
|
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.18.2...v0.19.0)
|
|
@@ -5,7 +5,7 @@ import { ACTION_NAMES, describeTarget, serveBrowser } from "./browser.mjs";
|
|
|
5
5
|
import { doctor } from "./doctor.mjs";
|
|
6
6
|
import { setUpFrontendWorkspace } from "./frontend-workspace.mjs";
|
|
7
7
|
import { capturedMail, serveMail } from "./mail.mjs";
|
|
8
|
-
import { loadRun } from "./run-state.mjs";
|
|
8
|
+
import { loadRun, readRun } from "./run-state.mjs";
|
|
9
9
|
import { apiRequest, isOk, onboard } from "./session.mjs";
|
|
10
10
|
import { resolutionFolders } from "./launch.mjs";
|
|
11
11
|
import { down, up } from "./stack.mjs";
|
|
@@ -108,7 +108,7 @@ async function commandDoctor(dir, values) {
|
|
|
108
108
|
* @returns {Promise<number>}
|
|
109
109
|
*/
|
|
110
110
|
async function commandOnboard(dir, values) {
|
|
111
|
-
const state =
|
|
111
|
+
const state = readRun(dir);
|
|
112
112
|
const answer = await onboard(state, {
|
|
113
113
|
platformName: values["platform-name"],
|
|
114
114
|
});
|
|
@@ -187,7 +187,7 @@ async function commandBrowser(dir, action, values) {
|
|
|
187
187
|
* @returns {Promise<number>}
|
|
188
188
|
*/
|
|
189
189
|
async function commandApi(dir, method, path, values) {
|
|
190
|
-
const state =
|
|
190
|
+
const state = readRun(dir);
|
|
191
191
|
/** @type {unknown} */
|
|
192
192
|
const body = values.body === undefined ? undefined : JSON.parse(values.body);
|
|
193
193
|
const answer = await apiRequest(state, {
|
|
@@ -239,12 +239,12 @@ export async function runStackCommand(command, rest, values) {
|
|
|
239
239
|
case "api":
|
|
240
240
|
return commandApi(rest[0], rest[1], rest[2], values);
|
|
241
241
|
case "mail":
|
|
242
|
-
print(JSON.stringify(capturedMail(
|
|
242
|
+
print(JSON.stringify(capturedMail(readRun(rest[0]).mail), null, 2));
|
|
243
243
|
return 0;
|
|
244
244
|
case "down":
|
|
245
245
|
return commandDown(rest[0]);
|
|
246
246
|
case "timings":
|
|
247
|
-
print(formatTimings(summarize(readTimings(
|
|
247
|
+
print(formatTimings(summarize(readTimings(readRun(rest[0]).evidence))));
|
|
248
248
|
return 0;
|
|
249
249
|
case "reset": {
|
|
250
250
|
const state = loadRun(rest[0]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { print } from "./commands-stack.mjs";
|
|
3
3
|
import { runJourneyFile } from "./journey.mjs";
|
|
4
|
-
import { loadRun } from "./run-state.mjs";
|
|
4
|
+
import { loadRun, readRun } from "./run-state.mjs";
|
|
5
5
|
import { timed } from "./timing.mjs";
|
|
6
6
|
import { doorLine, flaggedDoors, patchFiles } from "./verify/doors.mjs";
|
|
7
7
|
import {
|
|
@@ -150,7 +150,7 @@ async function commandVerdict(dir, values) {
|
|
|
150
150
|
print("verdict needs --pr <number>");
|
|
151
151
|
return 2;
|
|
152
152
|
}
|
|
153
|
-
const state =
|
|
153
|
+
const state = readRun(dir);
|
|
154
154
|
const skill = await skillOf(values, state);
|
|
155
155
|
const verdict = await renderVerdict(
|
|
156
156
|
skill,
|
|
@@ -8,6 +8,19 @@ import { pathToFileURL } from "node:url";
|
|
|
8
8
|
import manifest from "../../package.json" with { type: "json" };
|
|
9
9
|
import { PACKAGE_ROOT } from "./launch.mjs";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* The environment of a consumer's shell: this process's, without the
|
|
13
|
+
* `NODE_PATH` a package manager's bin shim exports, which would resolve
|
|
14
|
+
* packages the consumer never installed.
|
|
15
|
+
*
|
|
16
|
+
* @returns {NodeJS.ProcessEnv} The environment
|
|
17
|
+
*/
|
|
18
|
+
function consumerEnv() {
|
|
19
|
+
return Object.fromEntries(
|
|
20
|
+
Object.entries(process.env).filter(([name]) => name !== "NODE_PATH"),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
25
|
* A module repository that depends on `@antelopejs/dms` and declares nothing
|
|
13
26
|
* else: the installed copy gets the `bin` folder it publishes and, beside it,
|
|
@@ -44,7 +57,7 @@ try {
|
|
|
44
57
|
process.stdout.write(error.message);
|
|
45
58
|
}`,
|
|
46
59
|
],
|
|
47
|
-
{ cwd: moduleRoot, encoding: "utf8" },
|
|
60
|
+
{ cwd: moduleRoot, encoding: "utf8", env: consumerEnv() },
|
|
48
61
|
);
|
|
49
62
|
return run.stdout;
|
|
50
63
|
}
|
|
@@ -209,3 +209,36 @@ await test("a run that recorded no namespaces, as an earlier dms-control wrote i
|
|
|
209
209
|
assert.equal(down.status, 0, down.stderr);
|
|
210
210
|
assert.equal(isRunning(pid), false);
|
|
211
211
|
});
|
|
212
|
+
|
|
213
|
+
await test("mail, timings and api read a run started in another PID namespace; down on that run still refuses and leaves run.json as it was; a version that checks the namespace for every command fails mail, timings and api", async (t) => {
|
|
214
|
+
const state = await newRun(t);
|
|
215
|
+
state.namespaces = { ...currentNamespaces(), pid: "pid:[1]" };
|
|
216
|
+
saveRun(state);
|
|
217
|
+
const recorded = storedRun(state.dir);
|
|
218
|
+
/** @param {string[]} command */
|
|
219
|
+
const run = (...command) =>
|
|
220
|
+
spawnSync(
|
|
221
|
+
process.execPath,
|
|
222
|
+
[CONTROL_BIN, command[0], state.dir, ...command.slice(1)],
|
|
223
|
+
{
|
|
224
|
+
encoding: "utf8",
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
const mail = run("mail");
|
|
229
|
+
assert.equal(mail.status, 0, mail.stderr);
|
|
230
|
+
assert.deepEqual(JSON.parse(mail.stdout), []);
|
|
231
|
+
const timings = run("timings");
|
|
232
|
+
assert.equal(timings.status, 0, timings.stderr);
|
|
233
|
+
const api = run("api", "GET", "/api/onboarding/informations", "--as", "anon");
|
|
234
|
+
assert.doesNotMatch(api.stderr, /another PID namespace/);
|
|
235
|
+
assert.match(api.stdout, /ECONNREFUSED/, api.stderr);
|
|
236
|
+
|
|
237
|
+
const down = run("down");
|
|
238
|
+
assert.equal(down.status, 1, down.stderr);
|
|
239
|
+
assert.match(
|
|
240
|
+
down.stderr,
|
|
241
|
+
/this run was started in another PID namespace \(run: pid:\[1\]; here: pid:\[\d+\]\); run this command there/,
|
|
242
|
+
);
|
|
243
|
+
assert.equal(storedRun(state.dir), recorded);
|
|
244
|
+
});
|
|
@@ -111,7 +111,7 @@ export function createRunFolders(dir) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* @typedef {Omit<RunState, "browser" | "accounts"> & { browser?: string | ServerRecord, accounts: Record<string, Omit<Account, "password"> & { password?: string }
|
|
114
|
+
* @typedef {Omit<RunState, "browser" | "accounts"> & { browser?: string | ServerRecord, accounts: Record<string, Omit<Account, "password"> & { password?: string }>, stoppedAt?: string }} StoredRunState The state as a file may hold it. A run saved by an earlier release holds the browser's folder in `browser` until the browser starts, and `down` leaves an account without its `password` and records when it stopped in `stoppedAt`.
|
|
115
115
|
*/
|
|
116
116
|
|
|
117
117
|
const isStrings = recordOf(isString);
|
|
@@ -205,19 +205,19 @@ const isStoredRun = objectOf(
|
|
|
205
205
|
);
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
|
-
* Reads the state `up` recorded for a run
|
|
209
|
-
* in `browser` is dropped, since nothing
|
|
210
|
-
* account that `down` left without its
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
208
|
+
* Reads the state `up` recorded for a run, from any PID or time namespace.
|
|
209
|
+
* A folder an earlier release stored in `browser` is dropped, since nothing
|
|
210
|
+
* creates or reads that folder. An account that `down` left without its
|
|
211
|
+
* `password` reads with an empty one. Only a command that never reads,
|
|
212
|
+
* starts, signals or forgets a process the run recorded opens its run here:
|
|
213
|
+
* `mail`, `timings`, `api`, `onboard` and `verdict`. Every other command
|
|
214
|
+
* opens it with {@link loadRun}.
|
|
214
215
|
*
|
|
215
216
|
* @param {string} dir The run root, as `up` printed it
|
|
216
217
|
* @returns {RunState} The run state
|
|
217
218
|
* @throws When the folder holds no run.json
|
|
218
|
-
* @throws When the run was started in another PID or time namespace
|
|
219
219
|
*/
|
|
220
|
-
export function
|
|
220
|
+
export function readRun(dir) {
|
|
221
221
|
const file = join(resolve(dir), RUN_FILE);
|
|
222
222
|
if (!existsSync(file)) {
|
|
223
223
|
throw new Error(
|
|
@@ -227,7 +227,6 @@ export function loadRun(dir) {
|
|
|
227
227
|
/** @type {unknown} */
|
|
228
228
|
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
229
229
|
const stored = decode(isStoredRun, parsed, file, "a run state");
|
|
230
|
-
assertSameNamespaces(stored.namespaces);
|
|
231
230
|
const { browser, accounts, ...rest } = stored;
|
|
232
231
|
const run = {
|
|
233
232
|
...rest,
|
|
@@ -241,11 +240,28 @@ export function loadRun(dir) {
|
|
|
241
240
|
return browser === undefined || isString(browser) ? run : { ...run, browser };
|
|
242
241
|
}
|
|
243
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Reads the state `up` recorded for a run, as {@link readRun} does, for
|
|
245
|
+
* every command that {@link readRun} does not name. Run outside the PID or
|
|
246
|
+
* time namespace `up` ran in, it refuses before the command reads a process
|
|
247
|
+
* or changes anything.
|
|
248
|
+
*
|
|
249
|
+
* @param {string} dir The run root, as `up` printed it
|
|
250
|
+
* @returns {RunState} The run state
|
|
251
|
+
* @throws When the folder holds no run.json
|
|
252
|
+
* @throws When the run was started in another PID or time namespace
|
|
253
|
+
*/
|
|
254
|
+
export function loadRun(dir) {
|
|
255
|
+
const run = readRun(dir);
|
|
256
|
+
assertSameNamespaces(run.namespaces);
|
|
257
|
+
return run;
|
|
258
|
+
}
|
|
259
|
+
|
|
244
260
|
/**
|
|
245
261
|
* Writes the run state, readable by its owner only since it holds the run's
|
|
246
262
|
* secrets and the admin password.
|
|
247
263
|
*
|
|
248
|
-
* @param {
|
|
264
|
+
* @param {StoredRunState} state The run state
|
|
249
265
|
*/
|
|
250
266
|
export function saveRun(state) {
|
|
251
267
|
writeFileSync(
|
package/bin/control/stack.mjs
CHANGED
|
@@ -494,21 +494,21 @@ export async function down(state) {
|
|
|
494
494
|
lines.push(`removed ${folder}`);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
497
|
+
state.processes = [];
|
|
498
|
+
state.browser = undefined;
|
|
499
|
+
state.secrets = {};
|
|
500
|
+
state.adminPassword = "";
|
|
501
|
+
state.tokens = {};
|
|
502
|
+
state.ready = false;
|
|
503
|
+
saveRun({
|
|
504
|
+
...state,
|
|
503
505
|
accounts: Object.fromEntries(
|
|
504
506
|
Object.entries(state.accounts ?? {}).map(([name, account]) => [
|
|
505
507
|
name,
|
|
506
508
|
{ email: account.email },
|
|
507
509
|
]),
|
|
508
510
|
),
|
|
509
|
-
ready: false,
|
|
510
511
|
stoppedAt: new Date().toISOString(),
|
|
511
512
|
});
|
|
512
|
-
saveRun(state);
|
|
513
513
|
return [...new Set(lines)];
|
|
514
514
|
}
|
|
@@ -260,7 +260,7 @@ export function formalGate(result) {
|
|
|
260
260
|
/**
|
|
261
261
|
* The recorded result of a formal check in a run, if it ran.
|
|
262
262
|
*
|
|
263
|
-
* @param {import("../run-state.mjs").RunState} state The run
|
|
263
|
+
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
264
264
|
* @param {string} name The check
|
|
265
265
|
* @returns {import("./types.mjs").FormalResult | undefined} The result
|
|
266
266
|
*/
|
|
@@ -228,9 +228,7 @@ await test("the verdict fails a run that skipped features the shared-file plan r
|
|
|
228
228
|
const { skill, base, head } = fixture(t, { "pnpm-lock.yaml": "lock: 2\n" });
|
|
229
229
|
const evidence = mkdtempSync(join(tmpdir(), "dms-control-evidence-test-"));
|
|
230
230
|
t.after(() => rmSync(evidence, { recursive: true, force: true }));
|
|
231
|
-
const state =
|
|
232
|
-
/** @type {unknown} */ ({ baseRef: base, headSha: head, evidence })
|
|
233
|
-
);
|
|
231
|
+
const state = { baseRef: base, headSha: head, evidence };
|
|
234
232
|
recordPassing(evidence, ["smoke"]);
|
|
235
233
|
const skipped = await renderVerdict(skill, state, 1, JUDGEMENT);
|
|
236
234
|
assert.equal(skipped.result, "FAIL");
|
|
@@ -251,9 +249,7 @@ await test("the verdict of a covered-only diff needs the other features only whe
|
|
|
251
249
|
});
|
|
252
250
|
const evidence = mkdtempSync(join(tmpdir(), "dms-control-evidence-test-"));
|
|
253
251
|
t.after(() => rmSync(evidence, { recursive: true, force: true }));
|
|
254
|
-
const state =
|
|
255
|
-
/** @type {unknown} */ ({ baseRef: base, headSha: head, evidence })
|
|
256
|
-
);
|
|
252
|
+
const state = { baseRef: base, headSha: head, evidence };
|
|
257
253
|
recordPassing(evidence, ["smoke", "a"]);
|
|
258
254
|
assert.equal(
|
|
259
255
|
(await renderVerdict(skill, state, 1, JUDGEMENT)).result,
|
|
@@ -36,7 +36,7 @@ function bullets(entries, empty) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* @param {import("../run-state.mjs").RunState} state The run
|
|
39
|
+
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
40
40
|
* @param {string} feature The feature
|
|
41
41
|
* @returns {import("./types.mjs").FeatureResult[]} The journey results the run recorded
|
|
42
42
|
*/
|
|
@@ -46,7 +46,7 @@ function readResults(state, feature) {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* @param {import("./skill.mjs").Skill} skill The skill
|
|
49
|
-
* @param {import("../run-state.mjs").RunState} state The run
|
|
49
|
+
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
50
50
|
* @param {import("./types.mjs").Plan} plan The plan
|
|
51
51
|
* @returns {Promise<{ rows: string[], reasons: string[] }>} The table rows and why the verdict fails
|
|
52
52
|
*/
|
|
@@ -135,7 +135,7 @@ function doorsSection(judgement) {
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* @param {import("./skill.mjs").Skill} skill The skill
|
|
138
|
-
* @param {import("../run-state.mjs").RunState} state The run
|
|
138
|
+
* @param {Pick<import("../run-state.mjs").RunState, "evidence">} state The run
|
|
139
139
|
* @param {import("./types.mjs").Plan} plan The plan
|
|
140
140
|
* @returns {{ reasons: string[], lines: string[] }} Why the formal checks fail the verdict, and their lines
|
|
141
141
|
*/
|
|
@@ -273,7 +273,7 @@ function markdown(skill, verdict, parts) {
|
|
|
273
273
|
* verdict.md, verdict.json and plan.json into the evidence folder.
|
|
274
274
|
*
|
|
275
275
|
* @param {import("./skill.mjs").Skill} skill The skill
|
|
276
|
-
* @param {import("../run-state.mjs").RunState} state The run
|
|
276
|
+
* @param {Pick<import("../run-state.mjs").RunState, "baseRef" | "headSha" | "evidence">} state The run
|
|
277
277
|
* @param {number} pr The pull request
|
|
278
278
|
* @param {import("./types.mjs").Judgement} judgement The verifier's judgement
|
|
279
279
|
* @param {boolean} [all] Require every feature, as `plan --all` does for a release
|
package/dist/attachments/save.js
CHANGED
|
@@ -5,6 +5,7 @@ const interface_api_1 = require("@antelopejs/interface-api");
|
|
|
5
5
|
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
6
6
|
const interface_file_storage_1 = require("@antelopejs/interface-file-storage");
|
|
7
7
|
const access_1 = require("./access");
|
|
8
|
+
const type_check_1 = require("@antelopejs/interface-dms/utils/internal/type-check");
|
|
8
9
|
const constraints_1 = require("./constraints");
|
|
9
10
|
const fields_1 = require("./fields");
|
|
10
11
|
const registry_1 = require("./registry");
|
|
@@ -111,7 +112,7 @@ function assertBodyDepth(request) {
|
|
|
111
112
|
depth: 2,
|
|
112
113
|
}));
|
|
113
114
|
for (let node = pending.pop(); node; node = pending.pop()) {
|
|
114
|
-
if (!(node.value
|
|
115
|
+
if (!(0, type_check_1.isObject)(node.value) || (0, type_check_1.isNull)(node.value))
|
|
115
116
|
continue;
|
|
116
117
|
if (node.depth > MAX_BODY_DEPTH)
|
|
117
118
|
throw new interface_api_1.HTTPResult(BAD_REQUEST, `The JSON body nests more than ${MAX_BODY_DEPTH} levels deep.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.js","sourceRoot":"","sources":["../../src/attachments/save.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"save.js","sourceRoot":"","sources":["../../src/attachments/save.ts"],"names":[],"mappings":";;AA8MA,gDAUC;AAxND,6DAAuD;AACvD,gEAA6D;AAC7D,+EAM4C;AAM5C,qCAAkD;AAClD,oFAG6D;AAC7D,+CAAwD;AACxD,qCAIkB;AAClB,yCAA4E;AAE5E,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAQtD,KAAK,UAAU,eAAe,CAAC,GAAwB;IACrD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAA,oCAAW,EAAC,GAAG,CAAC,GAAG,CAAC;YAC9B,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAW,EAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW;YAC7D,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACZ,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,IAAA,wCAAe,EAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,yBAAyB;YACpE,MAAM,IA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AC7B,MAAM,IAAI,0BAAU,CAClB,WAAW,EACX,iCAAiC,cAAc,eAAe,CAC/D,CAAC;QACJ,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAOM,KAAK,UAAU,kBAAkB,CACtC,OAA8B,EAE9B,IAA6E;IAE7E,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC"}
|
|
@@ -161,7 +161,10 @@ const hasSparkline = computed(
|
|
|
161
161
|
() => props.showSparkline && sparkline.value.length > 0,
|
|
162
162
|
);
|
|
163
163
|
|
|
164
|
+
const caption = computed(() => data.value?.caption);
|
|
165
|
+
|
|
164
166
|
const footnote = computed(() => {
|
|
167
|
+
if (caption.value) return caption.value;
|
|
165
168
|
const isComparing = delta.value !== null;
|
|
166
169
|
const text = (isComparing && props.compareLabel) || props.description;
|
|
167
170
|
if (text) return processI18n(text);
|
|
@@ -101,6 +101,8 @@ export interface KpiCardResponse {
|
|
|
101
101
|
delta?: number;
|
|
102
102
|
previousValue?: number;
|
|
103
103
|
sparkline?: number[];
|
|
104
|
+
/** Shown in place of the description and the comparison label when non-empty. */
|
|
105
|
+
caption?: string;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
export interface TopListItem {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@antelopejs/core": ">=1.21.0 <2",
|
|
98
|
-
"@antelopejs/tooling-configs": "^0.
|
|
98
|
+
"@antelopejs/tooling-configs": "^0.5.0",
|
|
99
99
|
"@types/archiver": "^6.0.4",
|
|
100
100
|
"@types/chai": "^4.3.20",
|
|
101
101
|
"@types/jsonwebtoken": "^9.0.10",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"frontend:dev": "pnpm --dir playground frontend:dev",
|
|
157
157
|
"frontend:build": "pnpm --dir playground frontend:build",
|
|
158
158
|
"frontend:start": "pnpm --dir playground frontend:start",
|
|
159
|
-
"typecheck": "node scripts/unless-prebuilt.mjs pnpm --filter @antelopejs/interface-dms
|
|
159
|
+
"typecheck": "node scripts/unless-prebuilt.mjs pnpm --filter @antelopejs/interface-dms exec tsc && tsc --noEmit",
|
|
160
160
|
"test": "node scripts/unless-prebuilt.mjs pnpm run build && NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test .",
|
|
161
161
|
"test:unit": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/backend-checks.cjs && node scripts/backend-checks.test.mjs && node scripts/docs-scripts.test.mjs && node scripts/json-record.test.mjs && DMS_TEST_DIR=dist/test/unit NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test .",
|
|
162
162
|
"test:integration": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/integration NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test .",
|