@antelopejs/dms 0.20.7 → 0.20.8-next.916.gd319141
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/bin/control/commands-verify.mjs +8 -49
- package/bin/control/options.mjs +0 -1
- package/bin/control/run-state.mjs +1 -1
- package/bin/control/timing.mjs +1 -16
- package/bin/control/timing.test.mjs +0 -11
- package/bin/control/verify/decode.mjs +4 -144
- package/bin/control/verify/decode.test.mjs +1 -149
- package/bin/control/verify/formal.mjs +22 -218
- package/bin/control/verify/formal.test.mjs +60 -117
- package/bin/control/verify/map.test.mjs +0 -73
- package/bin/control/verify/types.mjs +4 -18
- package/bin/dms-control.mjs +0 -2
- package/dist/implementations/dms/page/controller.d.ts +2 -1
- package/dist/implementations/dms/page/controller.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-access-config.js +2 -2
- package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-access.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/database-access.js +2 -2
- package/dist/implementations/dms-builder/engine/database-check-input.d.ts +3 -2
- package/dist/implementations/dms-builder/engine/database-check-input.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-check.js +2 -2
- package/dist/implementations/dms-builder/engine/database-check.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-answer.d.ts +44 -1
- package/dist/implementations/dms-builder/engine/probe-answer.js +2 -5
- package/dist/implementations/dms-builder/engine/probe-answer.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -1
- package/dist/mockup/files.js +2 -2
- package/dist/pages/settings/users/roles.js.map +1 -1
- package/dist/store/internal/frontend/frontend-ready.d.ts +2 -1
- package/dist/store/internal/frontend/frontend-ready.js.map +1 -1
- package/dist/store/operations.js +4 -4
- package/dist/store/operations.js.map +1 -1
- package/dist/utils/upload-constraints.d.ts +1 -1
- package/dist/utils/upload-constraints.js +2 -2
- package/dist/utils/upload-constraints.js.map +1 -1
- package/dist/validation/issue-message.d.ts +1 -1
- package/dist/validation/issue-message.js +3 -3
- package/dist/validation/issue-message.js.map +1 -1
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +11 -14
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +5 -5
- package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +7 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +9 -5
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +4 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +7 -17
- package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +5 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupCatalog.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +18 -16
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/layout/sidePanelState.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +13 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/writeError.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +26 -18
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +2 -0
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +2 -2
- package/package.json +32 -30
- package/skills/dms-project/scripts/dms-dev.sh +0 -0
- package/bin/control/verify/behaviour.mjs +0 -183
- package/bin/control/verify/behaviour.test.mjs +0 -472
- package/bin/control/verify/emit.mjs +0 -539
- package/bin/control/verify/judgement.mjs +0 -101
- package/bin/control/verify/verdict.mjs +0 -327
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +0 -23
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +0 -606
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +0 -620
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +0 -322
- package/frontend-vue/scripts/prove-comment-emit.mjs +0 -171
- package/frontend-vue/scripts/prove-component-registration.mjs +0 -259
|
@@ -13,27 +13,17 @@ export interface ModulesListingError {
|
|
|
13
13
|
|
|
14
14
|
export const ENDPOINT_MODULES_LISTING = "/dms/modules-listing";
|
|
15
15
|
|
|
16
|
-
function numberOrUndefined(value: unknown): number | undefined {
|
|
17
|
-
return isNumber(value) ? value : undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
/** The HTTP status a failed request carries: its response's, else its own. */
|
|
21
|
-
function readStatus(
|
|
22
|
-
if (
|
|
23
|
-
const { response } =
|
|
17
|
+
function readStatus(cause: unknown): number | undefined {
|
|
18
|
+
if (cause === null || !isObject(cause)) return undefined;
|
|
19
|
+
const { response } = cause;
|
|
24
20
|
const responseStatus =
|
|
25
|
-
response !== null && isObject(response)
|
|
26
|
-
|
|
27
|
-
: undefined;
|
|
28
|
-
return (
|
|
29
|
-
responseStatus ??
|
|
30
|
-
numberOrUndefined(error.statusCode) ??
|
|
31
|
-
numberOrUndefined(error.status)
|
|
32
|
-
);
|
|
21
|
+
response !== null && isObject(response) ? response.status : undefined;
|
|
22
|
+
return [responseStatus, cause.statusCode, cause.status].find(isNumber);
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
function toListingError(
|
|
36
|
-
const status = readStatus(
|
|
25
|
+
function toListingError(cause: unknown): ModulesListingError {
|
|
26
|
+
const status = readStatus(cause);
|
|
37
27
|
if (status === HTTP_FORBIDDEN) return { kind: "forbidden", status };
|
|
38
28
|
return { kind: "failed", status };
|
|
39
29
|
}
|
|
@@ -8,6 +8,7 @@ import DmsSegmentedControl from "#dms-ui/app/components/segmented/SegmentedContr
|
|
|
8
8
|
import DmsStatGroup, {
|
|
9
9
|
type StatGroupItem,
|
|
10
10
|
} from "#dms-ui/app/components/stat-group/StatGroup.vue";
|
|
11
|
+
import type { JsonValue } from "#dms-core/app/types/json";
|
|
11
12
|
import type { Tone } from "#dms-core/app/types/tone";
|
|
12
13
|
import { useKeyboardPlatform } from "#dms-ui/app/composables/global/keyboardPlatform";
|
|
13
14
|
import DmsChipGroup from "#dms-ui/app/entries/components/form/ChipGroup";
|
|
@@ -144,7 +145,10 @@ const category = ref<string>(MODULE_CATEGORY_ALL);
|
|
|
144
145
|
const SORT_MODE_PREFERENCE_KEY = "modulesPage.sort";
|
|
145
146
|
const { getPreference, setPreference } = usePreferences();
|
|
146
147
|
const sortMode = computed<ModuleSortMode>({
|
|
147
|
-
get: () =>
|
|
148
|
+
get: () =>
|
|
149
|
+
parseModuleSortMode(
|
|
150
|
+
getPreference<JsonValue | undefined>(SORT_MODE_PREFERENCE_KEY),
|
|
151
|
+
),
|
|
148
152
|
set: (mode) => setPreference(SORT_MODE_PREFERENCE_KEY, mode),
|
|
149
153
|
});
|
|
150
154
|
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type ComputedRef,
|
|
6
6
|
type Ref,
|
|
7
7
|
} from "vue";
|
|
8
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
8
9
|
import { MOCKUP_LIST_ENDPOINT } from "../../utils/mockup";
|
|
9
10
|
import {
|
|
10
11
|
parseBlockCatalog,
|
|
@@ -28,7 +29,9 @@ export function useMockupCatalog(authFetch: AuthFetch): MockupCatalog {
|
|
|
28
29
|
const hasFailed = shallowRef(false);
|
|
29
30
|
onMounted(async () => {
|
|
30
31
|
try {
|
|
31
|
-
const parsed = parseBlockCatalog(
|
|
32
|
+
const parsed = parseBlockCatalog(
|
|
33
|
+
await authFetch<JsonValue>(CATALOG_ENDPOINT),
|
|
34
|
+
);
|
|
32
35
|
blocks.value = parsed ?? [];
|
|
33
36
|
hasFailed.value = !parsed;
|
|
34
37
|
} catch {
|
|
@@ -7,11 +7,13 @@ import {
|
|
|
7
7
|
type ComputedRef,
|
|
8
8
|
type ShallowRef,
|
|
9
9
|
} from "vue";
|
|
10
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
10
11
|
import {
|
|
11
12
|
isNumber,
|
|
12
13
|
isObject,
|
|
13
14
|
isString,
|
|
14
15
|
} from "../../../../../dms-core/app/utils/type-check";
|
|
16
|
+
import { isObjectValue } from "../../utils/json";
|
|
15
17
|
import {
|
|
16
18
|
mockupEndpoint,
|
|
17
19
|
type MockupIssue,
|
|
@@ -112,12 +114,8 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
112
114
|
return isObject(value) && value !== null && !Array.isArray(value);
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function parseSource(value: unknown): SpecSource | undefined {
|
|
120
|
-
if (!isRecord(value) || !isString(value.digest)) return undefined;
|
|
117
|
+
function parseSource(value: JsonValue | undefined): SpecSource | undefined {
|
|
118
|
+
if (!isObjectValue(value) || !isString(value.digest)) return undefined;
|
|
121
119
|
const spec = parseMockupSpec(value.spec);
|
|
122
120
|
return spec ? { spec, digest: value.digest } : undefined;
|
|
123
121
|
}
|
|
@@ -126,23 +124,25 @@ type WriteAnswer =
|
|
|
126
124
|
| { ok: true; digest: string }
|
|
127
125
|
| { ok: false; issue: MockupIssue };
|
|
128
126
|
|
|
129
|
-
function parseWriteAnswer(
|
|
130
|
-
|
|
127
|
+
function parseWriteAnswer(
|
|
128
|
+
value: JsonValue | undefined,
|
|
129
|
+
): WriteAnswer | undefined {
|
|
130
|
+
if (!isObjectValue(value)) return undefined;
|
|
131
131
|
if (value.ok === true && isString(value.digest)) {
|
|
132
132
|
return { ok: true, digest: value.digest };
|
|
133
133
|
}
|
|
134
|
-
const [first] =
|
|
135
|
-
if (value.ok !== false || !
|
|
134
|
+
const [first] = Array.isArray(value.errors) ? value.errors : [];
|
|
135
|
+
if (value.ok !== false || !isObjectValue(first)) return undefined;
|
|
136
136
|
const { path, message } = first;
|
|
137
137
|
return isString(path) && isString(message)
|
|
138
138
|
? { ok: false, issue: { path, message } }
|
|
139
139
|
: undefined;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
function statusOf(
|
|
143
|
-
if (!isRecord(
|
|
144
|
-
const response = isRecord(
|
|
145
|
-
return [
|
|
142
|
+
function statusOf(cause: unknown): number | undefined {
|
|
143
|
+
if (!isRecord(cause)) return undefined;
|
|
144
|
+
const response = isRecord(cause.response) ? cause.response : {};
|
|
145
|
+
return [cause.status, cause.statusCode, response.status].find(isNumber);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
function sameSpec(
|
|
@@ -186,7 +186,9 @@ class MockupSpecSync {
|
|
|
186
186
|
onError?: (cause: unknown) => void,
|
|
187
187
|
): Promise<SpecSource | undefined> {
|
|
188
188
|
try {
|
|
189
|
-
const source = parseSource(
|
|
189
|
+
const source = parseSource(
|
|
190
|
+
await this.options.authFetch<JsonValue>(this.endpoint),
|
|
191
|
+
);
|
|
190
192
|
if (!source) onError?.(new Error("spec.json could not be read"));
|
|
191
193
|
return source;
|
|
192
194
|
} catch (error) {
|
|
@@ -352,7 +354,7 @@ class MockupSpecSync {
|
|
|
352
354
|
this.isWriting = true;
|
|
353
355
|
try {
|
|
354
356
|
const answer = parseWriteAnswer(
|
|
355
|
-
await this.options.authFetch(this.endpoint, {
|
|
357
|
+
await this.options.authFetch<JsonValue>(this.endpoint, {
|
|
356
358
|
method: "PUT",
|
|
357
359
|
body: { spec, digest: this.digest },
|
|
358
360
|
}),
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type ShallowRef,
|
|
7
7
|
watch,
|
|
8
8
|
} from "vue";
|
|
9
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
9
10
|
import {
|
|
10
11
|
parsePreviewOutboundMessage,
|
|
11
12
|
type PreviewBlockRect,
|
|
@@ -73,7 +74,7 @@ export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
|
73
74
|
},
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
function onMessage(event: MessageEvent): void {
|
|
77
|
+
function onMessage(event: MessageEvent<JsonValue>): void {
|
|
77
78
|
const target = options.frame.value?.contentWindow;
|
|
78
79
|
if (!target || event.source !== target) return;
|
|
79
80
|
const message = parsePreviewOutboundMessage(event.data);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
1
2
|
import {
|
|
2
3
|
isObject,
|
|
3
4
|
isNumber,
|
|
@@ -73,11 +74,10 @@ function emptyPreferences(): DrawerSizePreferences {
|
|
|
73
74
|
return { widths: {}, heights: {} };
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
function readSizes(value:
|
|
77
|
+
function readSizes(value: JsonValue | undefined): Record<string, number> {
|
|
77
78
|
if (!isObject(value) || value === null) return {};
|
|
78
|
-
const entries: [string, unknown][] = Object.entries(value);
|
|
79
79
|
return Object.fromEntries(
|
|
80
|
-
entries.filter(
|
|
80
|
+
Object.entries(value).filter(
|
|
81
81
|
(entry): entry is [string, number] =>
|
|
82
82
|
isNumber(entry[1]) && Number.isFinite(entry[1]),
|
|
83
83
|
),
|
|
@@ -91,7 +91,7 @@ function readSizes(value: unknown): Record<string, number> {
|
|
|
91
91
|
* @internal
|
|
92
92
|
*/
|
|
93
93
|
export function readDrawerSizePreferences(
|
|
94
|
-
value:
|
|
94
|
+
value: JsonValue | DrawerSizePreferences | undefined,
|
|
95
95
|
): DrawerSizePreferences {
|
|
96
96
|
if (!isObject(value) || value === null) return emptyPreferences();
|
|
97
97
|
const record = value;
|
|
@@ -11,9 +11,6 @@ export interface RelationBadges {
|
|
|
11
11
|
hidden: string[];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const textOf = (value: unknown): string =>
|
|
15
|
-
value === undefined || value === null ? "" : String(value);
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* The text a related row shows: its label, or its key when the label is
|
|
19
16
|
* empty. A raw id (join skipped) is shown as is.
|
|
@@ -24,9 +21,9 @@ export function readRelationLabel(
|
|
|
24
21
|
valueKey = DEFAULT_RELATION_VALUE_KEY,
|
|
25
22
|
): string {
|
|
26
23
|
if (isObject(item) && item !== null) {
|
|
27
|
-
return
|
|
24
|
+
return String(item[labelKey] ?? "") || String(item[valueKey] ?? "");
|
|
28
25
|
}
|
|
29
|
-
return
|
|
26
|
+
return String(item ?? "");
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
/**
|
|
@@ -29,7 +29,7 @@ function isComponentDeclaration(value: unknown): value is ComponentDeclaration {
|
|
|
29
29
|
return "props" in value || "extends" in value || "mixins" in value;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function ownPropNames(props:
|
|
32
|
+
function ownPropNames({ props }: ComponentDeclaration): string[] {
|
|
33
33
|
if (Array.isArray(props)) return props.filter(isString);
|
|
34
34
|
return isObject(props) && props !== null ? Object.keys(props) : [];
|
|
35
35
|
}
|
|
@@ -54,7 +54,7 @@ function declaredProps(
|
|
|
54
54
|
) {
|
|
55
55
|
if (!component) return names;
|
|
56
56
|
const declaration = declarationOf(component);
|
|
57
|
-
for (const name of ownPropNames(declaration
|
|
57
|
+
for (const name of ownPropNames(declaration)) names.add(camelize(name));
|
|
58
58
|
if (isComponentDeclaration(declaration.extends))
|
|
59
59
|
declaredProps(declaration.extends, names);
|
|
60
60
|
const { mixins } = declaration;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { JsonValue } from "#dms-core/app/types/json";
|
|
2
3
|
import { isObject, isString } from "#dms-core/app/utils/type-check";
|
|
3
4
|
import {
|
|
4
5
|
resolveSidePanelWidthBounds,
|
|
@@ -43,7 +44,7 @@ function emptyPreferences(): SidePanelPreferences {
|
|
|
43
44
|
return { openId: null, widths: {} };
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
function readWidths(value:
|
|
47
|
+
function readWidths(value: JsonValue | undefined): Record<string, number> {
|
|
47
48
|
if (!isObject(value) || value === null) return {};
|
|
48
49
|
return Object.fromEntries(
|
|
49
50
|
Object.entries(value).filter((entry): entry is [string, number] =>
|
|
@@ -58,7 +59,9 @@ function readWidths(value: unknown): Record<string, number> {
|
|
|
58
59
|
*
|
|
59
60
|
* @internal
|
|
60
61
|
*/
|
|
61
|
-
export function readSidePanelPreferences(
|
|
62
|
+
export function readSidePanelPreferences(
|
|
63
|
+
value: JsonValue | SidePanelPreferences | undefined,
|
|
64
|
+
): SidePanelPreferences {
|
|
62
65
|
if (!isObject(value) || value === null) return emptyPreferences();
|
|
63
66
|
const openId = isString(value.openId) ? value.openId : null;
|
|
64
67
|
return { openId, widths: readWidths(value.widths) };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
1
2
|
import {
|
|
2
3
|
isString,
|
|
3
4
|
isObject,
|
|
@@ -362,7 +363,9 @@ function isStringRecord(value: unknown): value is Record<string, string> {
|
|
|
362
363
|
);
|
|
363
364
|
}
|
|
364
365
|
|
|
365
|
-
function isRememberedPeriods(
|
|
366
|
+
function isRememberedPeriods(
|
|
367
|
+
store: JsonValue | undefined,
|
|
368
|
+
): store is RememberedPeriods {
|
|
366
369
|
return (
|
|
367
370
|
isObject(store) &&
|
|
368
371
|
store !== null &&
|
|
@@ -370,7 +373,7 @@ function isRememberedPeriods(store: unknown): store is RememberedPeriods {
|
|
|
370
373
|
);
|
|
371
374
|
}
|
|
372
375
|
|
|
373
|
-
function storedPeriods(store:
|
|
376
|
+
function storedPeriods(store: JsonValue | undefined): RememberedPeriods {
|
|
374
377
|
return isRememberedPeriods(store) ? store : {};
|
|
375
378
|
}
|
|
376
379
|
|
|
@@ -380,7 +383,7 @@ function storedPeriods(store: unknown): RememberedPeriods {
|
|
|
380
383
|
* cookie, which must not grow with every page a user ever opened.
|
|
381
384
|
*/
|
|
382
385
|
export function rememberPeriod(
|
|
383
|
-
store:
|
|
386
|
+
store: JsonValue | undefined,
|
|
384
387
|
key: string,
|
|
385
388
|
query: Record<string, string>,
|
|
386
389
|
limit = REMEMBERED_PERIODS_LIMIT,
|
|
@@ -11,25 +11,25 @@ export const DEFAULT_ROW_ID_KEY = "_id";
|
|
|
11
11
|
/** What a failed request reports to listeners: its body or its message. */
|
|
12
12
|
export type ErrorPayload = string | number | boolean | object;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (isNumber(value)) return String(value);
|
|
17
|
-
return undefined;
|
|
18
|
-
};
|
|
14
|
+
const isRowId = (value: unknown): value is string | number =>
|
|
15
|
+
isString(value) || isNumber(value);
|
|
19
16
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const isErrorPayload = (value: unknown): value is ErrorPayload =>
|
|
18
|
+
isString(value) ||
|
|
19
|
+
isNumber(value) ||
|
|
20
|
+
isBoolean(value) ||
|
|
21
|
+
(isObject(value) && !isNull(value));
|
|
24
22
|
|
|
25
23
|
export const getItemId = (
|
|
26
24
|
item: Data,
|
|
27
25
|
idKey: string = DEFAULT_ROW_ID_KEY,
|
|
28
26
|
): string | undefined => {
|
|
29
|
-
|
|
27
|
+
const id = [get(item, idKey), item._id, item.id].find(isRowId);
|
|
28
|
+
return id === undefined ? undefined : String(id);
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
export const getErrorPayload = (
|
|
33
|
-
if (!isObject(
|
|
34
|
-
|
|
31
|
+
export const getErrorPayload = (cause: unknown): ErrorPayload | undefined => {
|
|
32
|
+
if (!isObject(cause) || isNull(cause)) return undefined;
|
|
33
|
+
const payload = cause.data || cause.message;
|
|
34
|
+
return isErrorPayload(payload) ? payload : undefined;
|
|
35
35
|
};
|
|
@@ -9,13 +9,13 @@ import { describeFieldErrors } from "#dms-core/app/composables/useFieldErrors";
|
|
|
9
9
|
* required."). Never the raw ofetch error line.
|
|
10
10
|
*/
|
|
11
11
|
export function tableWriteErrorOptions(
|
|
12
|
-
|
|
12
|
+
cause: unknown,
|
|
13
13
|
translate: I18nTranslate,
|
|
14
14
|
columns: ReadonlyArray<Pick<TableViewColumn, "accessorKey" | "header">>,
|
|
15
15
|
processI18n: (text: string) => string,
|
|
16
16
|
fallbackKey = "dms.action_error.generic",
|
|
17
17
|
): ResolveApiErrorOptions {
|
|
18
|
-
const summary = describeFieldErrors(
|
|
18
|
+
const summary = describeFieldErrors(cause, translate, (field) => {
|
|
19
19
|
const column = columns.find((entry) => entry.accessorKey === field);
|
|
20
20
|
return column ? processI18n(column.header) : undefined;
|
|
21
21
|
});
|
|
@@ -346,7 +346,7 @@ function issueFor(
|
|
|
346
346
|
: undefined;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
function clampSketchHeight(height:
|
|
349
|
+
function clampSketchHeight(height: JsonWritable | undefined): number {
|
|
350
350
|
if (!isNumber(height) || !Number.isFinite(height)) {
|
|
351
351
|
return SKETCH_DEFAULT_HEIGHT_PX;
|
|
352
352
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { JsonValue } from "../../../../dms-core/app/types/json";
|
|
1
2
|
import {
|
|
2
3
|
isBoolean,
|
|
3
4
|
isNumber,
|
|
4
5
|
isObject,
|
|
5
6
|
isString,
|
|
6
7
|
} from "../../../../dms-core/app/utils/type-check";
|
|
8
|
+
import { isObjectValue } from "./json";
|
|
7
9
|
import {
|
|
8
10
|
isPreviewTheme,
|
|
9
11
|
isPreviewTree,
|
|
@@ -194,12 +196,12 @@ export function isPreviewNavigation(
|
|
|
194
196
|
);
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
function isFiniteNumber(value:
|
|
199
|
+
function isFiniteNumber(value: JsonValue | undefined): value is number {
|
|
198
200
|
return isNumber(value) && Number.isFinite(value);
|
|
199
201
|
}
|
|
200
202
|
|
|
201
|
-
function parseRect(value:
|
|
202
|
-
if (!
|
|
203
|
+
function parseRect(value: JsonValue | undefined): PreviewRect | undefined {
|
|
204
|
+
if (!isObjectValue(value)) return undefined;
|
|
203
205
|
const { x, y, width, height } = value;
|
|
204
206
|
return isFiniteNumber(x) &&
|
|
205
207
|
isFiniteNumber(y) &&
|
|
@@ -209,8 +211,8 @@ function parseRect(value: unknown): PreviewRect | undefined {
|
|
|
209
211
|
: undefined;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
|
-
function parseFont(value:
|
|
213
|
-
if (!
|
|
214
|
+
function parseFont(value: JsonValue | undefined): PreviewFont | undefined {
|
|
215
|
+
if (!isObjectValue(value)) return undefined;
|
|
214
216
|
const { family, size, weight, lineHeight, letterSpacing, color, align } =
|
|
215
217
|
value;
|
|
216
218
|
return isString(family) &&
|
|
@@ -224,13 +226,17 @@ function parseFont(value: unknown): PreviewFont | undefined {
|
|
|
224
226
|
: undefined;
|
|
225
227
|
}
|
|
226
228
|
|
|
227
|
-
function parseBlockRect(
|
|
228
|
-
|
|
229
|
+
function parseBlockRect(
|
|
230
|
+
value: JsonValue | undefined,
|
|
231
|
+
): PreviewBlockRect | undefined {
|
|
232
|
+
if (!isObjectValue(value) || !isString(value.path)) return undefined;
|
|
229
233
|
const rect = parseRect(value.rect);
|
|
230
234
|
return rect ? { path: value.path, rect } : undefined;
|
|
231
235
|
}
|
|
232
236
|
|
|
233
|
-
function parseBlockRects(
|
|
237
|
+
function parseBlockRects(
|
|
238
|
+
value: JsonValue | undefined,
|
|
239
|
+
): PreviewBlockRect[] | undefined {
|
|
234
240
|
if (!Array.isArray(value)) return undefined;
|
|
235
241
|
const blocks = value.map(parseBlockRect);
|
|
236
242
|
return blocks.every((block) => block !== undefined) ? blocks : undefined;
|
|
@@ -335,14 +341,14 @@ export function previewInspectMessage(enabled: boolean): PreviewInspectMessage {
|
|
|
335
341
|
|
|
336
342
|
/** The fields of a posted message the outbound parsers read, unchecked. */
|
|
337
343
|
interface PostedFields {
|
|
338
|
-
height?:
|
|
339
|
-
message?:
|
|
340
|
-
path?:
|
|
341
|
-
blocks?:
|
|
342
|
-
text?:
|
|
343
|
-
rect?:
|
|
344
|
-
font?:
|
|
345
|
-
id?:
|
|
344
|
+
height?: JsonValue;
|
|
345
|
+
message?: JsonValue;
|
|
346
|
+
path?: JsonValue;
|
|
347
|
+
blocks?: JsonValue;
|
|
348
|
+
text?: JsonValue;
|
|
349
|
+
rect?: JsonValue;
|
|
350
|
+
font?: JsonValue;
|
|
351
|
+
id?: JsonValue;
|
|
346
352
|
}
|
|
347
353
|
|
|
348
354
|
const OUTBOUND_PARSERS: Record<
|
|
@@ -378,9 +384,11 @@ const OUTBOUND_PARSERS: Record<
|
|
|
378
384
|
* the embedding page ignores those.
|
|
379
385
|
*/
|
|
380
386
|
export function parsePreviewOutboundMessage(
|
|
381
|
-
data:
|
|
387
|
+
data: JsonValue | undefined,
|
|
382
388
|
): PreviewOutboundMessage | undefined {
|
|
383
|
-
if (!
|
|
389
|
+
if (!isObjectValue(data) || data.channel !== PREVIEW_CHANNEL) {
|
|
390
|
+
return undefined;
|
|
391
|
+
}
|
|
384
392
|
const type = data.type;
|
|
385
393
|
if (!isString(type) || !Object.hasOwn(OUTBOUND_PARSERS, type))
|
|
386
394
|
return undefined;
|
|
@@ -4,7 +4,12 @@ import {
|
|
|
4
4
|
isNumber,
|
|
5
5
|
isString,
|
|
6
6
|
} from "../../../../dms-core/app/utils/type-check";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
isJsonObject,
|
|
9
|
+
isObjectValue,
|
|
10
|
+
type JsonObject,
|
|
11
|
+
type JsonWritable,
|
|
12
|
+
} from "./json";
|
|
8
13
|
import type { MockupSpecNode } from "./mockupSpec";
|
|
9
14
|
|
|
10
15
|
/**
|
|
@@ -171,7 +176,7 @@ function isBlockType(value: JsonValue): value is JsonObject & MockupBlockType {
|
|
|
171
176
|
|
|
172
177
|
/** The block types of a catalog answer, those it describes wrongly left out; none when the answer is not a JSON object with a `blocks` list. */
|
|
173
178
|
export function parseBlockCatalog(
|
|
174
|
-
value:
|
|
179
|
+
value: JsonWritable | undefined,
|
|
175
180
|
): MockupBlockType[] | undefined {
|
|
176
181
|
if (!isJsonObject(value) || !Array.isArray(value.blocks)) return undefined;
|
|
177
182
|
return value.blocks.filter(isBlockType);
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
isJsonValue,
|
|
6
6
|
isObjectValue,
|
|
7
7
|
type JsonObject,
|
|
8
|
+
type JsonWritable,
|
|
8
9
|
} from "./json";
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -111,7 +112,7 @@ function isMockupSpecPage(
|
|
|
111
112
|
|
|
112
113
|
/** The spec `value` holds, or undefined when it is not JSON or not a spec the editor can change. */
|
|
113
114
|
export function parseMockupSpec(
|
|
114
|
-
value:
|
|
115
|
+
value: JsonWritable | undefined,
|
|
115
116
|
): MockupSpecDocument | undefined {
|
|
116
117
|
if (!isJsonObject(value)) return undefined;
|
|
117
118
|
const { pages } = value;
|
|
@@ -134,6 +134,7 @@ function isApexLeaf(
|
|
|
134
134
|
* deep watcher only reacts to a new series, breaks that loop. Functions
|
|
135
135
|
* (formatters, event handlers) and dates are kept as they are.
|
|
136
136
|
*/
|
|
137
|
+
// oxlint-disable-next-line anti-slop/no-unknown-parameters -- Recursive copy of the untyped Props.series and RawOptionSection values: each nested value it walks is only known once isApexLeaf, Array.isArray or isObject classifies it.
|
|
137
138
|
function toApexInput(value: unknown): ApexInput {
|
|
138
139
|
const raw = toRaw(value);
|
|
139
140
|
if (isApexLeaf(raw)) return raw;
|
|
@@ -149,6 +150,7 @@ function toApexInput(value: unknown): ApexInput {
|
|
|
149
150
|
return copy;
|
|
150
151
|
}
|
|
151
152
|
|
|
153
|
+
// oxlint-disable-next-line anti-slop/no-unknown-parameters -- Takes Props.series, which the component declares unknown, and the RawOptionSection options, and hands both to toApexInput.
|
|
152
154
|
function rawApexInput(value: unknown): ApexInput {
|
|
153
155
|
const copy = toApexInput(value);
|
|
154
156
|
return isObject(copy) ? markRaw(copy) : copy;
|
|
@@ -171,9 +171,9 @@ function createExportToasts(
|
|
|
171
171
|
function showFailure(
|
|
172
172
|
toastId: string | number,
|
|
173
173
|
opts: RunExportJobOptions,
|
|
174
|
-
|
|
174
|
+
cause: unknown,
|
|
175
175
|
): void {
|
|
176
|
-
presenter.presentError(
|
|
176
|
+
presenter.presentError(cause, {
|
|
177
177
|
fallbackKey: opts.labels?.errorTitle ?? "dms.table.export.error_title",
|
|
178
178
|
replaceToastId: toastId,
|
|
179
179
|
actions: buildRetryActions(opts, () => toastId),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.8-next.916.gd319141",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, 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",
|
|
@@ -66,9 +66,37 @@
|
|
|
66
66
|
"LICENSE"
|
|
67
67
|
],
|
|
68
68
|
"license": "Apache-2.0",
|
|
69
|
+
"packageManager": "pnpm@10.2.0",
|
|
69
70
|
"engines": {
|
|
70
71
|
"node": "^20.19.0 || >=22.12.0"
|
|
71
72
|
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && tsc && tsc-alias",
|
|
75
|
+
"dev": "ajs project run --inspect -w -p playground",
|
|
76
|
+
"frontend:dev": "pnpm --dir playground frontend:dev",
|
|
77
|
+
"frontend:build": "pnpm --dir playground frontend:build",
|
|
78
|
+
"frontend:start": "pnpm --dir playground frontend:start",
|
|
79
|
+
"typecheck": "node scripts/unless-prebuilt.mjs pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder exec tsc && tsc --noEmit",
|
|
80
|
+
"test": "node scripts/unless-prebuilt.mjs pnpm run build && ajs module test .",
|
|
81
|
+
"check:backend": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/backend-checks.cjs",
|
|
82
|
+
"test:unit": "pnpm run check:backend && node scripts/backend-checks.test.mjs && node scripts/docs-scripts.test.mjs && node scripts/json-record.test.mjs && node scripts/test-files.test.mjs && DMS_TEST_DIR=dist/test/unit ajs module test . $(node scripts/test-files.mjs dist/test/unit dist/test/unit/builder)",
|
|
83
|
+
"test:integration": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/integration ajs module test .",
|
|
84
|
+
"test:builder": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder ajs module test .",
|
|
85
|
+
"test:builder:1": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder ajs module test . $(node scripts/test-files.mjs dist/test/unit/builder --shard=1/2)",
|
|
86
|
+
"test:builder:2": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder ajs module test . $(node scripts/test-files.mjs dist/test/unit/builder --shard=2/2)",
|
|
87
|
+
"test:watch": "tsc -w & tsc-alias -w",
|
|
88
|
+
"release": "pnpm --filter @antelopejs/interface-dms build && pnpm --dir frontend-vue install --frozen-lockfile && release-it",
|
|
89
|
+
"prepack": "pnpm run build",
|
|
90
|
+
"knip": "knip --dependencies",
|
|
91
|
+
"knip:all": "knip",
|
|
92
|
+
"docs:catalog": "node scripts/docs-catalog.mjs",
|
|
93
|
+
"docs:catalog:check": "node scripts/docs-catalog.mjs --check",
|
|
94
|
+
"mockup:schema": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/mockup-schema.mjs",
|
|
95
|
+
"mockup:schema:check": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/mockup-schema.mjs --check",
|
|
96
|
+
"check:frontend-declarations": "node scripts/check-frontend-declarations.mjs",
|
|
97
|
+
"docs:screenshots": "node scripts/docs-screenshots.mjs",
|
|
98
|
+
"realtime:tabs-check": "node scripts/realtime-tabs-check.mjs"
|
|
99
|
+
},
|
|
72
100
|
"antelopeJs": {
|
|
73
101
|
"implements": [
|
|
74
102
|
"@antelopejs/interface-dms",
|
|
@@ -81,7 +109,6 @@
|
|
|
81
109
|
]
|
|
82
110
|
},
|
|
83
111
|
"dependencies": {
|
|
84
|
-
"2fa": "^0.1.2",
|
|
85
112
|
"@antelopejs/interface-api": ">=0.3.2 <0.4.0",
|
|
86
113
|
"@antelopejs/interface-api-util": ">=0.3.0 <0.4.0",
|
|
87
114
|
"@antelopejs/interface-core": ">=0.5.1 <0.6.0",
|
|
@@ -94,6 +121,7 @@
|
|
|
94
121
|
"@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
|
|
95
122
|
"@csstools/css-tokenizer": "4.0.0",
|
|
96
123
|
"@types/jsonwebtoken": "^9.0.10",
|
|
124
|
+
"2fa": "^0.1.2",
|
|
97
125
|
"archiver": "^7.0.1",
|
|
98
126
|
"csv-stringify": "^6.7.0",
|
|
99
127
|
"defu": "^6.1.4",
|
|
@@ -120,7 +148,7 @@
|
|
|
120
148
|
"@antelopejs/mysql": ">=0.2.3 <0.3.0",
|
|
121
149
|
"@antelopejs/postgres": ">=0.4.1 <0.5.0",
|
|
122
150
|
"@antelopejs/rethinkdb": "~1.10.2",
|
|
123
|
-
"@antelopejs/tooling-configs": ">=0.
|
|
151
|
+
"@antelopejs/tooling-configs": ">=0.8.0 <0.9.0",
|
|
124
152
|
"@types/archiver": "^6.0.4",
|
|
125
153
|
"@types/chai": "^4.3.20",
|
|
126
154
|
"@types/jsdom": "^28.0.3",
|
|
@@ -195,31 +223,5 @@
|
|
|
195
223
|
"typescript": {
|
|
196
224
|
"optional": true
|
|
197
225
|
}
|
|
198
|
-
},
|
|
199
|
-
"scripts": {
|
|
200
|
-
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && tsc && tsc-alias",
|
|
201
|
-
"dev": "ajs project run --inspect -w -p playground",
|
|
202
|
-
"frontend:dev": "pnpm --dir playground frontend:dev",
|
|
203
|
-
"frontend:build": "pnpm --dir playground frontend:build",
|
|
204
|
-
"frontend:start": "pnpm --dir playground frontend:start",
|
|
205
|
-
"typecheck": "node scripts/unless-prebuilt.mjs pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder exec tsc && tsc --noEmit",
|
|
206
|
-
"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 .",
|
|
207
|
-
"check:backend": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/backend-checks.cjs",
|
|
208
|
-
"test:unit": "pnpm run check:backend && node scripts/backend-checks.test.mjs && node scripts/docs-scripts.test.mjs && node scripts/json-record.test.mjs && node scripts/test-files.test.mjs && DMS_TEST_DIR=dist/test/unit NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test . $(node scripts/test-files.mjs dist/test/unit dist/test/unit/builder)",
|
|
209
|
-
"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 .",
|
|
210
|
-
"test:builder": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test .",
|
|
211
|
-
"test:builder:1": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test . $(node scripts/test-files.mjs dist/test/unit/builder --shard=1/2)",
|
|
212
|
-
"test:builder:2": "node scripts/unless-prebuilt.mjs pnpm run build && DMS_TEST_DIR=dist/test/unit/builder NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--require=\\\"$PWD/scripts/backend-runtime-boundaries.cjs\\\"\" ajs module test . $(node scripts/test-files.mjs dist/test/unit/builder --shard=2/2)",
|
|
213
|
-
"test:watch": "tsc -w & tsc-alias -w",
|
|
214
|
-
"release": "pnpm --filter @antelopejs/interface-dms build && pnpm --dir frontend-vue install --frozen-lockfile && release-it",
|
|
215
|
-
"knip": "knip --dependencies",
|
|
216
|
-
"knip:all": "knip",
|
|
217
|
-
"docs:catalog": "node scripts/docs-catalog.mjs",
|
|
218
|
-
"docs:catalog:check": "node scripts/docs-catalog.mjs --check",
|
|
219
|
-
"mockup:schema": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/mockup-schema.mjs",
|
|
220
|
-
"mockup:schema:check": "node scripts/unless-prebuilt.mjs pnpm run build && node scripts/mockup-schema.mjs --check",
|
|
221
|
-
"check:frontend-declarations": "node scripts/check-frontend-declarations.mjs",
|
|
222
|
-
"docs:screenshots": "node scripts/docs-screenshots.mjs",
|
|
223
|
-
"realtime:tabs-check": "node scripts/realtime-tabs-check.mjs"
|
|
224
226
|
}
|
|
225
|
-
}
|
|
227
|
+
}
|
|
File without changes
|