@antelopejs/dms 0.20.6 → 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.
Files changed (109) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/control/commands-verify.mjs +8 -49
  3. package/bin/control/options.mjs +0 -1
  4. package/bin/control/run-state.mjs +1 -1
  5. package/bin/control/timing.mjs +1 -16
  6. package/bin/control/timing.test.mjs +0 -11
  7. package/bin/control/verify/decode.mjs +4 -144
  8. package/bin/control/verify/decode.test.mjs +1 -149
  9. package/bin/control/verify/formal.mjs +22 -218
  10. package/bin/control/verify/formal.test.mjs +60 -117
  11. package/bin/control/verify/map.test.mjs +0 -73
  12. package/bin/control/verify/types.mjs +4 -18
  13. package/bin/dms-control.mjs +0 -2
  14. package/dist/implementations/dms/page/controller.d.ts +2 -1
  15. package/dist/implementations/dms/page/controller.js.map +1 -1
  16. package/dist/implementations/dms-builder/engine/configure-target.d.ts +8 -0
  17. package/dist/implementations/dms-builder/engine/configure-target.js +36 -0
  18. package/dist/implementations/dms-builder/engine/configure-target.js.map +1 -0
  19. package/dist/implementations/dms-builder/engine/connection-access-config.js +2 -2
  20. package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -1
  21. package/dist/implementations/dms-builder/engine/database-access.d.ts +1 -1
  22. package/dist/implementations/dms-builder/engine/database-access.js +2 -2
  23. package/dist/implementations/dms-builder/engine/database-check-input.d.ts +3 -2
  24. package/dist/implementations/dms-builder/engine/database-check-input.js.map +1 -1
  25. package/dist/implementations/dms-builder/engine/database-check.js +2 -2
  26. package/dist/implementations/dms-builder/engine/database-check.js.map +1 -1
  27. package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
  28. package/dist/implementations/dms-builder/engine/index.js +1 -0
  29. package/dist/implementations/dms-builder/engine/index.js.map +1 -1
  30. package/dist/implementations/dms-builder/engine/probe-answer.d.ts +44 -1
  31. package/dist/implementations/dms-builder/engine/probe-answer.js +2 -5
  32. package/dist/implementations/dms-builder/engine/probe-answer.js.map +1 -1
  33. package/dist/mcp/tools/builder-compose.js +19 -3
  34. package/dist/mcp/tools/builder-compose.js.map +1 -1
  35. package/dist/mcp/tools/builder-pages.js +68 -6
  36. package/dist/mcp/tools/builder-pages.js.map +1 -1
  37. package/dist/mcp/tools/builder-request-targets.d.ts +14 -0
  38. package/dist/mcp/tools/builder-request-targets.js +256 -0
  39. package/dist/mcp/tools/builder-request-targets.js.map +1 -0
  40. package/dist/mcp/tools/index.d.ts +1 -0
  41. package/dist/mcp/tools/index.js +3 -1
  42. package/dist/mcp/tools/index.js.map +1 -1
  43. package/dist/mcp/tools/mockup-apply-to-page.d.ts +2 -0
  44. package/dist/mcp/tools/mockup-apply-to-page.js +15 -1
  45. package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
  46. package/dist/mockup/apply-to-page.d.ts +1 -0
  47. package/dist/mockup/apply-to-page.js +3 -2
  48. package/dist/mockup/apply-to-page.js.map +1 -1
  49. package/dist/mockup/compile.js +7 -1
  50. package/dist/mockup/compile.js.map +1 -1
  51. package/dist/mockup/files.d.ts +1 -1
  52. package/dist/mockup/files.js +2 -2
  53. package/dist/mockup/sample-routes.d.ts +3 -0
  54. package/dist/mockup/sample-routes.js +53 -0
  55. package/dist/mockup/sample-routes.js.map +1 -0
  56. package/dist/pages/settings/users/roles.js.map +1 -1
  57. package/dist/store/internal/frontend/frontend-ready.d.ts +2 -1
  58. package/dist/store/internal/frontend/frontend-ready.js.map +1 -1
  59. package/dist/store/operations.js +4 -4
  60. package/dist/store/operations.js.map +1 -1
  61. package/dist/utils/upload-constraints.d.ts +1 -1
  62. package/dist/utils/upload-constraints.js +2 -2
  63. package/dist/utils/upload-constraints.js.map +1 -1
  64. package/dist/validation/issue-message.d.ts +1 -1
  65. package/dist/validation/issue-message.js +3 -3
  66. package/dist/validation/issue-message.js.map +1 -1
  67. package/frontend-vue/layers/dms-core/app/utils/formatter.ts +1 -0
  68. package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +11 -14
  69. package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +5 -5
  70. package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +7 -2
  71. package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +9 -5
  72. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +4 -1
  73. package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +7 -17
  74. package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +5 -1
  75. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +17 -1
  76. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +9 -0
  77. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupCatalog.ts +4 -1
  78. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +18 -16
  79. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +8 -1
  80. package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
  81. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -5
  82. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +2 -2
  83. package/frontend-vue/layers/dms-ui/app/build/composables/layout/sidePanelState.ts +5 -2
  84. package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +6 -3
  85. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +13 -13
  86. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/writeError.ts +2 -2
  87. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +6 -1
  88. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +1 -1
  89. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +26 -18
  90. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +7 -2
  91. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +2 -1
  92. package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +82 -0
  93. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +10 -1
  94. package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +2 -0
  95. package/frontend-vue/layers/dms-ui/app/composables/form/useUploadWithProgress.ts +6 -1
  96. package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +2 -2
  97. package/package.json +32 -30
  98. package/skills/dms-project/scripts/dms-dev.sh +0 -0
  99. package/bin/control/verify/behaviour.mjs +0 -183
  100. package/bin/control/verify/behaviour.test.mjs +0 -472
  101. package/bin/control/verify/emit.mjs +0 -539
  102. package/bin/control/verify/judgement.mjs +0 -101
  103. package/bin/control/verify/verdict.mjs +0 -327
  104. package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +0 -23
  105. package/frontend-vue/scripts/probes/frontend-behavior.cjs +0 -606
  106. package/frontend-vue/scripts/probes/frontend-legacy.cjs +0 -620
  107. package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +0 -322
  108. package/frontend-vue/scripts/prove-comment-emit.mjs +0 -171
  109. package/frontend-vue/scripts/prove-component-registration.mjs +0 -259
@@ -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(store: unknown): store is RememberedPeriods {
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: unknown): RememberedPeriods {
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: unknown,
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 asRowId = (value: unknown): string | undefined => {
15
- if (isString(value)) return value;
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 asErrorPayload = (value: unknown): ErrorPayload | undefined => {
21
- if (isString(value) || isNumber(value) || isBoolean(value)) return value;
22
- return isObject(value) && !isNull(value) ? value : undefined;
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
- return asRowId(get(item, idKey)) ?? asRowId(item._id) ?? asRowId(item.id);
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 = (error: unknown): ErrorPayload | undefined => {
33
- if (!isObject(error) || isNull(error)) return undefined;
34
- return asErrorPayload(error.data || error.message);
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
- error: unknown,
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(error, translate, (field) => {
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
  });
@@ -13,6 +13,10 @@ import {
13
13
  parseMockupState,
14
14
  type MockupState,
15
15
  } from "../utils/mockup";
16
+ import {
17
+ FIXTURES_ONLY_QUERY,
18
+ FIXTURES_ONLY_VALUE,
19
+ } from "../utils/previewFixturesOnly";
16
20
  import { currentSketchScheme } from "../utils/sketch";
17
21
 
18
22
  /**
@@ -23,7 +27,8 @@ import { currentSketchScheme } from "../utils/sketch";
23
27
  */
24
28
  const props = defineProps<{ name: string }>();
25
29
 
26
- const PREVIEW_PATH = "/dms-preview";
30
+ /** The preview on the mockup's fixtures, which refuses every live route. */
31
+ const PREVIEW_PATH = `/dms-preview?${FIXTURES_ONLY_QUERY}=${FIXTURES_ONLY_VALUE}`;
27
32
  const BAND_HEIGHT_PX = 84;
28
33
  const HOME_ICON = "i-ph-house-light";
29
34
 
@@ -346,7 +346,7 @@ function issueFor(
346
346
  : undefined;
347
347
  }
348
348
 
349
- function clampSketchHeight(height: unknown): number {
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: unknown): value is number {
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: unknown): PreviewRect | undefined {
202
- if (!isRecord(value)) return undefined;
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: unknown): PreviewFont | undefined {
213
- if (!isRecord(value)) return undefined;
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(value: unknown): PreviewBlockRect | undefined {
228
- if (!isRecord(value) || !isString(value.path)) return undefined;
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(value: unknown): PreviewBlockRect[] | undefined {
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?: unknown;
339
- message?: unknown;
340
- path?: unknown;
341
- blocks?: unknown;
342
- text?: unknown;
343
- rect?: unknown;
344
- font?: unknown;
345
- id?: unknown;
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: Parameters<typeof isRecord>[0],
387
+ data: JsonValue | undefined,
382
388
  ): PreviewOutboundMessage | undefined {
383
- if (!isRecord(data) || data.channel !== PREVIEW_CHANNEL) return undefined;
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 { isJsonObject, isObjectValue, type JsonObject } from "./json";
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: unknown,
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: unknown,
115
+ value: JsonWritable | undefined,
115
116
  ): MockupSpecDocument | undefined {
116
117
  if (!isJsonObject(value)) return undefined;
117
118
  const { pages } = value;
@@ -0,0 +1,82 @@
1
+ /** The query `/dms-preview` reads to draw a mockup on its fixtures alone, and its value. */
2
+ export const FIXTURES_ONLY_QUERY = "fixtures";
3
+ export const FIXTURES_ONLY_VALUE = "only";
4
+
5
+ /** The routes answering a mockup's fixtures and its own state. */
6
+ const MOCKUP_ROUTES = "/api/mockup/";
7
+
8
+ /**
9
+ * What the dashboard reads on any page, none of it a block's data: its
10
+ * realtime session and page topics, its icons, the account's permissions,
11
+ * the system and onboarding state its shell checks, and the preview page
12
+ * itself, which a development reload fetches again.
13
+ */
14
+ const SHELL_ROUTES = [
15
+ "/api/realtime/",
16
+ "/api/_dms/",
17
+ "/api/system-state",
18
+ "/api/onboarding/informations",
19
+ "/dms/permissions",
20
+ "/dms-preview",
21
+ ];
22
+
23
+ /**
24
+ * Where the dashboard's own scripts, styles, fonts and images are served:
25
+ * `/assets/` and `/images/` built, the others in development.
26
+ */
27
+ const ASSET_PATHS = [
28
+ "/assets/",
29
+ "/images/",
30
+ "/_nuxt/",
31
+ "/frontend-modules/",
32
+ "/node_modules/",
33
+ "/@fs/",
34
+ "/@id/",
35
+ "/@vite/",
36
+ ];
37
+
38
+ /** Content a URL can carry itself, with no request. */
39
+ const INLINE = "data: blob:";
40
+
41
+ /** The parts of the frame's location the policy is built from. */
42
+ export type PolicyLocation = Pick<Location, "origin" | "host" | "protocol">;
43
+
44
+ /**
45
+ * The Content Security Policy of a preview drawn on fixtures. Every kind of
46
+ * load (images, media, styles and the URLs they import, fonts, prefetches,
47
+ * workers) and every connection reaches the mockup's routes, the
48
+ * dashboard's own and its assets only, so no value a block holds can make
49
+ * the frame read a live route, whatever block or data type draws it.
50
+ * Scripts stay the dashboard's own: the frame loads block code after the
51
+ * policy is set, and no value a block draws becomes a script.
52
+ */
53
+ export function fixturesOnlyPolicy(location: PolicyLocation): string {
54
+ const at = (paths: readonly string[]) =>
55
+ paths.map((path) => `${location.origin}${path}`).join(" ");
56
+ const socket = location.protocol === "https:" ? "wss:" : "ws:";
57
+ const loads = `${INLINE} ${at([MOCKUP_ROUTES, ...ASSET_PATHS])}`;
58
+ return [
59
+ `default-src ${loads}`,
60
+ `script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:`,
61
+ `worker-src ${loads}`,
62
+ `style-src 'unsafe-inline' ${loads}`,
63
+ `connect-src ${at([MOCKUP_ROUTES, ...SHELL_ROUTES, ...ASSET_PATHS])} ${socket}//${location.host}`,
64
+ "frame-src 'none'",
65
+ "object-src 'none'",
66
+ ].join("; ");
67
+ }
68
+
69
+ /**
70
+ * Puts {@link fixturesOnlyPolicy} on the document. The browser enforces it
71
+ * on every request made after, and it lasts as long as the document: the
72
+ * page that embeds the preview loads another document to read live routes.
73
+ */
74
+ export function applyFixturesOnlyPolicy(
75
+ document: Document,
76
+ location: PolicyLocation,
77
+ ): void {
78
+ const meta = document.createElement("meta");
79
+ meta.httpEquiv = "Content-Security-Policy";
80
+ meta.content = fixturesOnlyPolicy(location);
81
+ document.head.prepend(meta);
82
+ }
@@ -13,6 +13,10 @@ import {
13
13
  type PreviewResolvedNode,
14
14
  type PreviewTree,
15
15
  } from "../../build/utils/blockPreview";
16
+ import {
17
+ FIXTURES_ONLY_QUERY,
18
+ FIXTURES_ONLY_VALUE,
19
+ } from "../../build/utils/previewFixturesOnly";
16
20
  import { childComponentId } from "../../utils/componentId";
17
21
 
18
22
  const { resolveError } = useApiErrorPresenter();
@@ -71,7 +75,12 @@ function switchLocale(code: string): void {
71
75
  }
72
76
 
73
77
  const embed = props.embed
74
- ? useBlockPreviewEmbed({ root, initialState, setLocale: switchLocale })
78
+ ? useBlockPreviewEmbed({
79
+ root,
80
+ initialState,
81
+ setLocale: switchLocale,
82
+ fixturesOnly: route.query[FIXTURES_ONLY_QUERY] === FIXTURES_ONLY_VALUE,
83
+ })
75
84
  : undefined;
76
85
 
77
86
  const fetchedBlockTypes = ref<PreviewBlockTypes>();
@@ -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;
@@ -36,7 +36,12 @@ const FORBIDDEN_REQUEST_HEADERS = new Set([
36
36
  "upgrade",
37
37
  "via",
38
38
  ]);
39
- const FORBIDDEN_REQUEST_HEADER_PREFIXES = ["proxy-", "sec-"];
39
+ /**
40
+ * Prefixes of the names never copied: the browser's own (`proxy-`, `sec-`),
41
+ * and `x-dms-ui-`, which the dashboard relay forwards as the marker of a
42
+ * module's own UI, so no presign answer may set one.
43
+ */
44
+ const FORBIDDEN_REQUEST_HEADER_PREFIXES = ["proxy-", "sec-", "x-dms-ui-"];
40
45
 
41
46
  const isForbiddenRequestHeader = (name: string): boolean => {
42
47
  const normalized = name.trim().toLowerCase();
@@ -171,9 +171,9 @@ function createExportToasts(
171
171
  function showFailure(
172
172
  toastId: string | number,
173
173
  opts: RunExportJobOptions,
174
- error: unknown,
174
+ cause: unknown,
175
175
  ): void {
176
- presenter.presentError(error, {
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.6",
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.7.2 <0.8.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