@antelopejs/dms 0.25.4 → 0.25.6-next.1105.g9b73018

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 (69) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/E2E.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
  5. package/dist/implementations/dms-builder/engine/driver-probe.d.ts +1 -1
  6. package/dist/mcp/tool.d.ts +1 -1
  7. package/frontend-vue/.prettierignore +1 -0
  8. package/frontend-vue/build/backend-boundary.ts +80 -80
  9. package/frontend-vue/layers/dms-auth/server/backend-answers.ts +12 -9
  10. package/frontend-vue/layers/dms-auth/server/oauth.ts +6 -6
  11. package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +1 -2
  12. package/frontend-vue/layers/dms-core/app/build/utils/siteLayoutResync.ts +92 -0
  13. package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +2 -33
  14. package/frontend-vue/layers/dms-core/app/composables/period/types.ts +1 -4
  15. package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +1 -3
  16. package/frontend-vue/layers/dms-core/app/composables/useFormValidation.ts +1 -2
  17. package/frontend-vue/layers/dms-core/app/types/composed-text.ts +1 -4
  18. package/frontend-vue/layers/dms-core/app/types/confirm-dialog.ts +1 -2
  19. package/frontend-vue/layers/dms-core/app/types/data-type.ts +1 -2
  20. package/frontend-vue/layers/dms-core/app/types/json.ts +1 -3
  21. package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -17
  22. package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +3 -2
  23. package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +11 -8
  24. package/frontend-vue/layers/dms-layout/app/build/components/layout/StageCard.vue +1 -5
  25. package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +3 -1
  26. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +3 -3
  27. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/roles/role-permissions.ts +1 -1
  28. package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityOverview.ts +1 -3
  29. package/frontend-vue/layers/dms-layout/app/build/utils/module-store-install.ts +1 -3
  30. package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +1 -5
  31. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +4 -2
  32. package/frontend-vue/layers/dms-ui/app/build/components/blocks/BlockActions.vue +4 -2
  33. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +1 -4
  34. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSectionEditing.ts +1 -2
  35. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +1 -2
  36. package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useRefreshTriggers.ts +1 -2
  37. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +1 -3
  38. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +4 -5
  39. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +4 -5
  40. package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +1 -2
  41. package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +1 -2
  42. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +35 -37
  43. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +1 -4
  44. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/recordLink.ts +1 -4
  45. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +1 -3
  46. package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +1 -1
  47. package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +1 -5
  48. package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +3 -4
  49. package/frontend-vue/layers/dms-ui/app/components/blocks/KeyValueListBlock.vue +4 -2
  50. package/frontend-vue/layers/dms-ui/app/components/blocks/StatGroupBlock.vue +4 -2
  51. package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +2 -3
  52. package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +5 -1
  53. package/frontend-vue/layers/dms-ui/app/components/form/components/DatePicker.vue +4 -2
  54. package/frontend-vue/layers/dms-ui/app/components/form/components/InputCalendar.vue +4 -2
  55. package/frontend-vue/layers/dms-ui/app/components/form/components/InputCode.vue +1 -2
  56. package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +1 -6
  57. package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -4
  58. package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +5 -8
  59. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +4 -2
  60. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +5 -10
  61. package/frontend-vue/layers/dms-ui/app/types/modal.ts +1 -9
  62. package/frontend-vue/layers/dms-ui/app/types/quick-actions.ts +1 -2
  63. package/frontend-vue/layers/dms-ui/app/utils/mockupAssistant.ts +1 -4
  64. package/frontend-vue/layers/dms-ui/app/utils/semanticTint.ts +1 -6
  65. package/frontend-vue/package.json +6 -6
  66. package/frontend-vue/scripts/check-api-error-presentation.mjs +3 -3
  67. package/frontend-vue/scripts/check-page-invariants.mjs +6 -9
  68. package/frontend-vue/scripts/dms-components-script.mjs +7 -7
  69. package/package.json +8 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.25.5
4
+
5
+ [compare changes](https://github.com/AntelopeJS/dms/compare/v0.25.4...v0.25.5)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **dms:** Reload the site layout again when a navigation cancels the resync's reload ([#1314](https://github.com/AntelopeJS/dms/pull/1314))
10
+
11
+ ### 📦 Build
12
+
13
+ - **deps:** Bump tooling-configs to 0.10.15 and run sync ([#1312](https://github.com/AntelopeJS/dms/pull/1312))
14
+
15
+ ### ❤️ Contributors
16
+
17
+ - Antony Rizzitelli
18
+
3
19
  ## v0.25.4
4
20
 
5
21
  [compare changes](https://github.com/AntelopeJS/dms/compare/v0.25.3...v0.25.4)
package/E2E.md CHANGED
@@ -130,7 +130,7 @@ test("the administrator reads the onboarding state", async () => {
130
130
  4. Give each journey that needs the development dashboard `frontend: "dev"`, and add `e2e/playwright.dev.config.ts` with `e2eConfig({ frontend: "dev" })`. Run it with `playwright test -c e2e/playwright.dev.config.ts`.
131
131
  5. A journey that fails today because of a product finding gets `knownFailures`, never a skip. A journey that changes the run's playground for later backends gets `last: true`.
132
132
  6. Tag `@smoke` on about 5 fast journeys, the `smoke` journey first, none that needs `backend: "watch"`, `withBaseBackend`, `standby: false` or `frontend: "dev"`.
133
- 7. Copy the `e2e` and `e2e-report` jobs of AntelopeJS/dms's `ci.yml` and the `e2e` line of its `ubuntu` gate. Nothing runs on a draft or the none tier. A pull request runs `--grep @smoke`. The merge queue, a manual run, a pull request labelled `ci:full` and the nightly schedule run the whole suite with `--shard=i/N --add-reporter=blob`, which keeps the config's reporters, with N chosen so that one shard stays under about 30 minutes, and `e2e-report` merges the shards' blob reports. A dev config runs in the same job, after the build config.
133
+ 7. Copy AntelopeJS/dms's `e2e.yml` reusable workflow, which holds the `e2e` and `e2e-report` jobs, and the `e2e` job of its `ci.yml` that calls it with the tier, along with the `e2e` line of its `ubuntu` gate. Nothing runs on a draft or the none tier. A pull request runs `--grep @smoke`. The merge queue, a manual run, a pull request labelled `ci:full` and the nightly schedule run the whole suite with `--shard=i/N --add-reporter=blob`, which keeps the config's reporters, with N chosen so that one shard stays under about 30 minutes, and `e2e-report` merges the shards' blob reports. A dev config runs in the same job, after the build config.
134
134
 
135
135
  ## Move off verify.config.ts
136
136
 
package/README.md CHANGED
@@ -79,7 +79,7 @@ export class SalesPage extends PageController("sales", {
79
79
 
80
80
  | Package | Supported | Tested with |
81
81
  | ------------------------------------------- | ---------------- | ----------- |
82
- | `@antelopejs/core` | `~1.24.5` | `1.24.8` |
82
+ | `@antelopejs/core` | `~1.24.5` | `1.24.12` |
83
83
  | `@antelopejs/interface-api` | `>=0.3.5 <0.4.0` | `0.3.5` |
84
84
  | `@antelopejs/interface-api-util` | `>=0.3.3 <0.4.0` | `0.3.3` |
85
85
  | `@antelopejs/interface-core` | `>=0.5.2 <0.6.0` | `0.5.2` |
@@ -1 +1 @@
1
- {"version":3,"file":"dms-database.js","sourceRoot":"","sources":["../../../../src/implementations/dms-builder/engine/dms-database.ts"],"names":[],"mappings":";;;;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,uCAA8D;AAC9D,2DAAgF;AAChF,uCAA+C;AAC/C,qDAO0B;AAC1B,qEAIkC;AAClC,mDAA2C;AAC3C,iDAA+C;AAE/C,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AACxD,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,eAAe;IACf,oBAAoB;CACrB,CAAC,CAAC;AAEH,SAAS,YAAY,CACnB,KAA8B,EAC9B,IAAY;IAEZ,OAAO,IAAA,yBAAQ,EAAC,IAAA,8BAAa,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;AAChE,CAAC;AAGD,0BAAiC,KAAa;IAC5C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAY,IAAI,CAAC,KAAK,CAClC,iBAAE,CAAC,YAAY,CACb,mBAAI,CAAC,OAAO,CAAC,IAAA,4BAAkB,GAAE,EAAE,KAAK,EAAE,cAAc,CAAC,EACzD,MAAM,CACP,CACF,CAAC;QACF,OAAO,IAAA,4BAAa,EAAC,QAAQ,CAAC,IAAI,IAAA,wBAAQ,EAAC,QAA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C;IACjB,CAAC;IACD,MAAM,UAAU,GAAG,IAAA,uCAAc,EAAC,KAAK,CAAC,CAAC,IAAI,CAC3C,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAA,wCAAoB,EAAC,KAAK,CAAC,CAC3E,CAAC;IACF,IAAI,UAAU,EAAE,CAAC;QACf,IAAA,uBAAM,EACJ,WAAW,UAAU,CAAC,CAAC,CAAC,0JAA0J,CACnL,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,yBAAQ,EAAC,KAAK,EAAE,CAAC,wBAAO,CAAC,CAAC,CAAC;IAC3C,IAAI,OAAO,IAAI,IAAA,uCAAmB,EAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,IAAA,uBAAM,EACJ,uPAAuP,CACxP,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAGD;IACE,MAAM,KAAK,GAAG,IAAA,uCAAc,GAAE,CAAC;IAC/B,OAAO,KAAK,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"dms-database.js","sourceRoot":"","sources":["../../../../src/implementations/dms-builder/engine/dms-database.ts"],"names":[],"mappings":";;;;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,uCAA8D;AAC9D,2DAAgF;AAChF,uCAA+C;AAC/C,qDAO0B;AAC1B,qEAIkC;AAClC,mDAA2C;AAC3C,iDAA+C;AAE/C,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AACxD,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,eAAe;IACf,oBAAoB;CACrB,CAAC,CAAC;AAEH,SAAS,YAAY,CACnB,KAA8B,EAC9B,IAAY;IAEZ,OAAO,IAAA,yBAAQ,EAAC,IAAA,8BAAa,EAAC,KAAK,E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AbortSignal>;
6
+ signal: z.ZodInstanceOf<AbortSignal>;
7
7
  }, z.core.$strip>], null>, z.ZodPromise<z.ZodUnknown>>;
8
8
  export type LoadedProbe = z.infer<typeof ProbeExport>;
9
9
  export interface ProbeTarget {
@@ -35,7 +35,7 @@ export interface McpToolSpec<Fields extends McpInputFields> {
35
35
  run(args: z.infer<z.ZodObject<Fields>>, sessionId: string | undefined, client: McpClient | undefined): Promise<McpToolResult>;
36
36
  }
37
37
  export declare function textResult(text: string, isError?: boolean): McpToolResult;
38
- export declare const ThrownReasonSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<Error, Error>, z.ZodTransform<string, Error>>, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>;
38
+ export declare const ThrownReasonSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodInstanceOf<Error>, z.ZodTransform<string, Error>>, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>;
39
39
  export declare function thrownResult(toolName: string, reason: string): McpToolResult;
40
40
  export declare function jsonResult(value: JsonValue, isError?: boolean): McpToolResult;
41
41
  export declare function defineTool<Fields extends McpInputFields>(spec: McpToolSpec<Fields>): McpTool;
@@ -0,0 +1 @@
1
+ tests/fixtures/mockup-starters/
@@ -1,51 +1,51 @@
1
- import { existsSync, readFileSync, realpathSync } from 'node:fs'
2
- import { dirname, isAbsolute, join, relative, sep } from 'node:path'
3
- import type { DmsVitePluginEntry } from '#dms/frontend-build'
1
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
2
+ import { dirname, isAbsolute, join, relative, sep } from "node:path";
3
+ import type { DmsVitePluginEntry } from "#dms/frontend-build";
4
4
 
5
- type VitePlugin = Extract<DmsVitePluginEntry, { name: string }>
5
+ type VitePlugin = Extract<DmsVitePluginEntry, { name: string }>;
6
6
 
7
- const BACKEND_PACKAGE = "@antelopejs/dms"
8
- const BACKEND_SOURCE = 'src'
9
- const QUERY_OR_HASH = /[?#].*$/
7
+ const BACKEND_PACKAGE = "@antelopejs/dms";
8
+ const BACKEND_SOURCE = "src";
9
+ const QUERY_OR_HASH = /[?#].*$/;
10
10
 
11
- const backendRoots = new Map<string, string | null>()
11
+ const backendRoots = new Map<string, string | null>();
12
12
 
13
13
  /** Whether a parsed manifest names its package. */
14
14
  function isNamedManifest(value: unknown): value is { name: string } {
15
- return (
16
- typeof value === 'object' &&
17
- value !== null &&
18
- 'name' in value &&
19
- typeof value.name === 'string'
20
- )
15
+ return (
16
+ typeof value === "object" &&
17
+ value !== null &&
18
+ "name" in value &&
19
+ typeof value.name === "string"
20
+ );
21
21
  }
22
22
 
23
23
  /** The package name a `package.json` declares, or `undefined`. */
24
24
  function packageName(manifest: string): string | undefined {
25
- try {
26
- const parsed: unknown = JSON.parse(readFileSync(manifest, 'utf8'))
27
- return isNamedManifest(parsed) ? parsed.name : undefined
28
- } catch {
29
- return undefined
30
- }
25
+ try {
26
+ const parsed: unknown = JSON.parse(readFileSync(manifest, "utf8"));
27
+ return isNamedManifest(parsed) ? parsed.name : undefined;
28
+ } catch {
29
+ return undefined;
30
+ }
31
31
  }
32
32
 
33
33
  /** The directory of the backend package that holds `directory`, or null. */
34
34
  function backendRoot(directory: string): string | null {
35
- const known = backendRoots.get(directory)
36
- if (known !== undefined) {
37
- return known
38
- }
39
- const manifest = join(directory, 'package.json')
40
- const parent = dirname(directory)
41
- let root: string | null = null
42
- if (existsSync(manifest)) {
43
- root = packageName(manifest) === BACKEND_PACKAGE ? directory : null
44
- } else if (parent !== directory) {
45
- root = backendRoot(parent)
46
- }
47
- backendRoots.set(directory, root)
48
- return root
35
+ const known = backendRoots.get(directory);
36
+ if (known !== undefined) {
37
+ return known;
38
+ }
39
+ const manifest = join(directory, "package.json");
40
+ const parent = dirname(directory);
41
+ let root: string | null = null;
42
+ if (existsSync(manifest)) {
43
+ root = packageName(manifest) === BACKEND_PACKAGE ? directory : null;
44
+ } else if (parent !== directory) {
45
+ root = backendRoot(parent);
46
+ }
47
+ backendRoots.set(directory, root);
48
+ return root;
49
49
  }
50
50
 
51
51
  /**
@@ -55,28 +55,28 @@ function backendRoot(directory: string): string | null {
55
55
  * the build workspace. Virtual ids and ids that are not files are ignored.
56
56
  */
57
57
  function backendSourceFile(id: string): string | undefined {
58
- const path = id.replace(QUERY_OR_HASH, '')
59
- if (!isAbsolute(path)) {
60
- return undefined
61
- }
62
- let real: string
63
- try {
64
- real = realpathSync(path)
65
- } catch {
66
- return undefined
67
- }
68
- const root = backendRoot(dirname(real))
69
- if (root === null) {
70
- return undefined
71
- }
72
- return relative(root, real).split(sep)[0] === BACKEND_SOURCE
73
- ? real
74
- : undefined
58
+ const path = id.replace(QUERY_OR_HASH, "");
59
+ if (!isAbsolute(path)) {
60
+ return undefined;
61
+ }
62
+ let real: string;
63
+ try {
64
+ real = realpathSync(path);
65
+ } catch {
66
+ return undefined;
67
+ }
68
+ const root = backendRoot(dirname(real));
69
+ if (root === null) {
70
+ return undefined;
71
+ }
72
+ return relative(root, real).split(sep)[0] === BACKEND_SOURCE
73
+ ? real
74
+ : undefined;
75
75
  }
76
76
 
77
77
  /** `path` with `/` separators, the form Vite gives an importer, so a boundary error names both paths alike on every OS. */
78
78
  function forwardSlashes(path: string): string {
79
- return path.split(sep).join('/')
79
+ return path.split(sep).join("/");
80
80
  }
81
81
 
82
82
  /**
@@ -92,36 +92,36 @@ function forwardSlashes(path: string): string {
92
92
  * restores it on every run: change the plugin in the pack, not here.
93
93
  */
94
94
  export function backendBoundary(): VitePlugin {
95
- return {
96
- ...boundaryCheck(),
97
- config: () => ({ worker: { plugins: () => [boundaryCheck()] } }),
98
- }
95
+ return {
96
+ ...boundaryCheck(),
97
+ config: () => ({ worker: { plugins: () => [boundaryCheck()] } }),
98
+ };
99
99
  }
100
100
 
101
101
  /** The check alone, as a worker build runs it. */
102
102
  function boundaryCheck(): VitePlugin {
103
- return {
104
- name: `${BACKEND_PACKAGE}:backend-boundary`,
105
- enforce: 'pre',
106
- async resolveId(source, importer, options) {
107
- const resolved = await this.resolve(source, importer, {
108
- ...options,
109
- skipSelf: true,
110
- })
111
- if (resolved === null) {
112
- return resolved
113
- }
114
- const file = backendSourceFile(resolved.id)
115
- if (file === undefined) {
116
- return resolved
117
- }
118
- const from =
119
- importer === undefined
120
- ? 'an entry point'
121
- : forwardSlashes(importer.replace(QUERY_OR_HASH, ''))
122
- return this.error(
123
- `Backend boundary: ${from} imports ${forwardSlashes(file)}, which is under the src of ${BACKEND_PACKAGE}. The frontend reaches the backend only through its HTTP interface.`,
124
- )
125
- },
126
- }
103
+ return {
104
+ name: `${BACKEND_PACKAGE}:backend-boundary`,
105
+ enforce: "pre",
106
+ async resolveId(source, importer, options) {
107
+ const resolved = await this.resolve(source, importer, {
108
+ ...options,
109
+ skipSelf: true,
110
+ });
111
+ if (resolved === null) {
112
+ return resolved;
113
+ }
114
+ const file = backendSourceFile(resolved.id);
115
+ if (file === undefined) {
116
+ return resolved;
117
+ }
118
+ const from =
119
+ importer === undefined
120
+ ? "an entry point"
121
+ : forwardSlashes(importer.replace(QUERY_OR_HASH, ""));
122
+ return this.error(
123
+ `Backend boundary: ${from} imports ${forwardSlashes(file)}, which is under the src of ${BACKEND_PACKAGE}. The frontend reaches the backend only through its HTTP interface.`,
124
+ );
125
+ },
126
+ };
127
127
  }
@@ -74,15 +74,18 @@ export type LoginOutcome =
74
74
  * `/api/auth/oauth/:provider/callback`), the backend's `LoginOutcome`.
75
75
  */
76
76
  export const loginOutcome = z.union([
77
- twoFactorChallenge.transform(
78
- (answer): LoginOutcome => ({ kind: "2fa", answer }),
79
- ),
80
- tenantAssignment.transform(
81
- (answer): LoginOutcome => ({ kind: "tenant-assignment", answer }),
82
- ),
83
- sessionTokens.transform(
84
- (tokens): LoginOutcome => ({ kind: "session", tokens }),
85
- ),
77
+ twoFactorChallenge.transform((answer): LoginOutcome => ({
78
+ kind: "2fa",
79
+ answer,
80
+ })),
81
+ tenantAssignment.transform((answer): LoginOutcome => ({
82
+ kind: "tenant-assignment",
83
+ answer,
84
+ })),
85
+ sessionTokens.transform((tokens): LoginOutcome => ({
86
+ kind: "session",
87
+ tokens,
88
+ })),
86
89
  ]);
87
90
 
88
91
  /**
@@ -203,12 +203,12 @@ function validCallback(flow: OAuthFlow | undefined, query: URLSearchParams) {
203
203
  const state = query.get("state");
204
204
  return Boolean(
205
205
  flow &&
206
- flow.expiresAt >= Date.now() &&
207
- isString(code) &&
208
- code.length <= MAX_CALLBACK_PARAMETER_LENGTH &&
209
- isString(state) &&
210
- state.length <= MAX_CALLBACK_PARAMETER_LENGTH &&
211
- sameState(state, flow.state),
206
+ flow.expiresAt >= Date.now() &&
207
+ isString(code) &&
208
+ code.length <= MAX_CALLBACK_PARAMETER_LENGTH &&
209
+ isString(state) &&
210
+ state.length <= MAX_CALLBACK_PARAMETER_LENGTH &&
211
+ sameState(state, flow.state),
212
212
  );
213
213
  }
214
214
 
@@ -3,8 +3,7 @@ import { isNumber, isObject, isString } from "../../utils/type-check";
3
3
 
4
4
  /** What a preview does to one block (`packages/dms/src/pages/settings/users/role-preview.ts`). */
5
5
  export type PermissionPreviewBlock =
6
- | { state: "hidden" }
7
- | { state: "readonly" | "limited"; withheld: string[] };
6
+ { state: "hidden" } | { state: "readonly" | "limited"; withheld: string[] };
8
7
 
9
8
  export type PermissionPreviewState = PermissionPreviewBlock["state"];
10
9
 
@@ -0,0 +1,92 @@
1
+ import { router as inertiaRouter } from "@inertiajs/vue3";
2
+
3
+ /** How long a cancelled reload waits for the page to settle before it starts again anyway. */
4
+ const SETTLE_TIMEOUT_MS = 2_000;
5
+
6
+ /**
7
+ * Resolves once the page on screen settles after a visit cancelled a reload:
8
+ * Inertia sets a new page (a visit, a prefetched one or a history step), a
9
+ * visit that was neither cancelled nor interrupted finishes, or
10
+ * `SETTLE_TIMEOUT_MS` pass, so a cancellation that nothing follows cannot
11
+ * hold the resync.
12
+ */
13
+ function pageSettled(): Promise<void> {
14
+ return new Promise((resolve) => {
15
+ const stops = [
16
+ inertiaRouter.on("navigate", () => settle()),
17
+ inertiaRouter.on("finish", (event) => {
18
+ const { visit } = event.detail;
19
+ if (!visit.cancelled && !visit.interrupted) settle();
20
+ }),
21
+ ];
22
+ const timer = setTimeout(() => settle(), SETTLE_TIMEOUT_MS);
23
+ function settle(): void {
24
+ clearTimeout(timer);
25
+ for (const stop of stops) stop();
26
+ resolve();
27
+ }
28
+ });
29
+ }
30
+
31
+ /**
32
+ * A partial reload of the page on screen: the server sends the site layout
33
+ * and the page fresh, and they replace the browser's copies, the layout
34
+ * Inertia carries from page to page included. Resolves `landed` when its
35
+ * answer reached the page, a redirect included. Resolves `cancelled` when a
36
+ * visit cancelled or interrupted it, and `dropped` when another visit or a
37
+ * history step set a page while it ran, which makes Inertia drop its answer:
38
+ * both leave the layout the browser holds. A failure rejects and leaves the
39
+ * page as it is: Inertia would otherwise show the error in its place.
40
+ */
41
+ function reloadSiteLayoutAndPage(): Promise<
42
+ "landed" | "cancelled" | "dropped"
43
+ > {
44
+ return new Promise((resolve, reject) => {
45
+ let failure: Error | undefined;
46
+ const pagesSetBy: Array<string | undefined> = [];
47
+ const stopWatching = inertiaRouter.on("navigate", (event) => {
48
+ pagesSetBy.push(event.detail.visitId);
49
+ });
50
+ const reload = (): void =>
51
+ inertiaRouter.reload({
52
+ only: ["shared", "page"],
53
+ onHttpException: (response) => {
54
+ failure = new Error(`Site layout reload failed (${response.status})`);
55
+ return false;
56
+ },
57
+ onNetworkError: (error) => {
58
+ failure = error;
59
+ return false;
60
+ },
61
+ onFinish: (visit) => {
62
+ stopWatching();
63
+ if (failure) reject(failure);
64
+ else if (visit.cancelled || visit.interrupted) resolve("cancelled");
65
+ else if (pagesSetBy.some((visitId) => visitId !== visit.id)) {
66
+ resolve("dropped");
67
+ } else resolve("landed");
68
+ },
69
+ });
70
+ try {
71
+ reload();
72
+ } catch (error) {
73
+ stopWatching();
74
+ throw error;
75
+ }
76
+ });
77
+ }
78
+
79
+ /**
80
+ * Reloads the site layout and the page on screen until a reload lands: once
81
+ * the page settles after a visit cancelled it, and again at once when
82
+ * another page was set while it ran. Each reload that does not land follows
83
+ * a visit, so this ends once navigation stops.
84
+ */
85
+ export async function resyncSiteLayout(): Promise<void> {
86
+ inertiaRouter.flushAll();
87
+ for (;;) {
88
+ const outcome = await reloadSiteLayoutAndPage();
89
+ if (outcome === "landed") return;
90
+ if (outcome === "cancelled") await pageSettled();
91
+ }
92
+ }
@@ -1,5 +1,5 @@
1
- import { router as inertiaRouter } from "@inertiajs/vue3";
2
1
  import { layoutUrlWithQuery } from "../../utils/pageQuery";
2
+ import { resyncSiteLayout } from "../../build/utils/siteLayoutResync";
3
3
  import { onBeforeMount, toRaw } from "vue";
4
4
  import { withoutTrailingSlash } from "ufo";
5
5
 
@@ -100,30 +100,6 @@ export function extractRouteParams(
100
100
  return buildParamBag(paramNames, match.slice(1));
101
101
  }
102
102
 
103
- /**
104
- * A partial reload of the page on screen: the server sends the site layout
105
- * and the page fresh, and they replace the browser's copies, the layout
106
- * Inertia carries from page to page included. A failure rejects and leaves
107
- * the page as it is: Inertia would otherwise show the error in its place.
108
- */
109
- function reloadSiteLayoutAndPage(): Promise<void> {
110
- return new Promise((resolve, reject) => {
111
- let failure: Error | undefined;
112
- inertiaRouter.reload({
113
- only: ["shared", "page"],
114
- onHttpException: (response) => {
115
- failure = new Error(`Site layout reload failed (${response.status})`);
116
- return false;
117
- },
118
- onNetworkError: (error) => {
119
- failure = error;
120
- return false;
121
- },
122
- onFinish: () => (failure ? reject(failure) : resolve()),
123
- });
124
- });
125
- }
126
-
127
103
  interface SiteLayoutResponse {
128
104
  siteLayout: SiteLayout;
129
105
  siteLayoutTree: SiteLayoutTree;
@@ -310,13 +286,6 @@ const useSiteLayoutRequests = () => {
310
286
  await loadingPromise.value;
311
287
  };
312
288
 
313
- const resync = async (): Promise<void> => {
314
- inertiaRouter.flushAll();
315
- const path = window.location.pathname;
316
- await reloadSiteLayoutAndPage();
317
- if (window.location.pathname !== path) await reloadSiteLayoutAndPage();
318
- };
319
-
320
289
  const refreshIfStale = async () => {
321
290
  const elapsed = Date.now() - lastRefreshTime.value;
322
291
  if (elapsed < STALE_THRESHOLD_MS) {
@@ -338,7 +307,7 @@ const useSiteLayoutRequests = () => {
338
307
  loadingError,
339
308
  loadSiteLayout,
340
309
  refresh,
341
- resync,
310
+ resync: resyncSiteLayout,
342
311
  differsFromServer: () => siteLayoutDiffersFromServer(state),
343
312
  refreshIfStale,
344
313
  clearPageLayoutCaches,
@@ -16,10 +16,7 @@ export type PeriodPreset =
16
16
  | "custom";
17
17
 
18
18
  export type PeriodComparison =
19
- | "none"
20
- | "previous-period"
21
- | "previous-year"
22
- | "custom";
19
+ "none" | "previous-period" | "previous-year" | "custom";
23
20
 
24
21
  export interface PeriodRange {
25
22
  from: Date;
@@ -64,9 +64,7 @@ type CompiledMessage = { type: 0 } | { t: 0 };
64
64
 
65
65
  /** A message `rt` renders: its source text, a message function or a compiled AST. */
66
66
  type RenderableMessage =
67
- | string
68
- | ((...args: never[]) => string)
69
- | CompiledMessage;
67
+ string | ((...args: never[]) => string) | CompiledMessage;
70
68
 
71
69
  function isRenderableMessage(value: unknown): value is RenderableMessage {
72
70
  if (typeof value === "string" || typeof value === "function") return true;
@@ -24,8 +24,7 @@ interface FormIssue {
24
24
  }
25
25
 
26
26
  type FormValidationResult<Output> =
27
- | { value: Output; issues?: undefined }
28
- | { issues: FormIssue[] };
27
+ { value: Output; issues?: undefined } | { issues: FormIssue[] };
29
28
 
30
29
  /** A zod schema as the Standard Schema `UForm` validates with. */
31
30
  export interface LocalizedSchema<Output> {
@@ -57,10 +57,7 @@ export type ComposedTextTypedParam =
57
57
  export type ComposedTextParamType = ComposedTextTypedParam["type"];
58
58
 
59
59
  export type ComposedTextParam =
60
- | string
61
- | number
62
- | ComposedTextTypedParam
63
- | ComposedText;
60
+ string | number | ComposedTextTypedParam | ComposedText;
64
61
 
65
62
  /** Any text a block draws: a plain string (`$` for an i18n key) or a composed text. */
66
63
  export type BlockText = string | ComposedText;
@@ -52,8 +52,7 @@ export interface ConfirmDialogLinkTarget {
52
52
 
53
53
  /** Where a dialog's secondary action leads (backend `ConfirmDialogSecondaryTarget`). */
54
54
  export type ConfirmDialogSecondaryTarget =
55
- | ConfirmDialogLinkTarget
56
- | ConfirmDialogDownloadTarget;
55
+ ConfirmDialogLinkTarget | ConfirmDialogDownloadTarget;
57
56
 
58
57
  /**
59
58
  * A button next to cancel and confirm, running its target with the dialog
@@ -1,6 +1,5 @@
1
1
  export type ComponentOrNoInput =
2
- | ComponentInfo<ComponentOptionsData>
3
- | "noInput";
2
+ ComponentInfo<ComponentOptionsData> | "noInput";
4
3
 
5
4
  export interface DataTypeConfig {
6
5
  id: string;
@@ -1,6 +1,4 @@
1
1
  export type JsonPrimitive = string | number | boolean | null;
2
2
 
3
3
  export type JsonValue =
4
- | JsonPrimitive
5
- | JsonValue[]
6
- | { [key: string]: JsonValue };
4
+ JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };
@@ -5,12 +5,7 @@ import type { JsonValue } from "./json";
5
5
  * `src/store/types.ts` in `@antelopejs/dms`).
6
6
  */
7
7
  export type StoreModuleState =
8
- | "available"
9
- | "busy"
10
- | "active"
11
- | "disabled"
12
- | "error"
13
- | "pending";
8
+ "available" | "busy" | "active" | "disabled" | "error" | "pending";
14
9
 
15
10
  /** Where a module's code comes from (`ModuleSourceKind` on the backend). */
16
11
  export type ModuleSourceKind = "npm" | "github" | "gitlab" | "git" | "local";
@@ -18,19 +13,10 @@ export type ModuleSourceKind = "npm" | "github" | "gitlab" | "git" | "local";
18
13
  export type StoreFrontendState = "none" | "synced" | "pending" | "unknown";
19
14
 
20
15
  export type StoreOperationKind =
21
- | "install"
22
- | "update"
23
- | "enable"
24
- | "disable"
25
- | "uninstall"
26
- | "apply";
16
+ "install" | "update" | "enable" | "disable" | "uninstall" | "apply";
27
17
 
28
18
  export type StoreOperationStep =
29
- | "resolve"
30
- | "dependencies"
31
- | "unload"
32
- | "load"
33
- | "save";
19
+ "resolve" | "dependencies" | "unload" | "load" | "save";
34
20
 
35
21
  export interface StoreOperation {
36
22
  moduleId: string;
@@ -35,8 +35,9 @@ import { headerButtonProps } from "./headerButton";
35
35
  * component places there names the component, which runs it. Buttons behind
36
36
  * a permission the user lacks never reach the client.
37
37
  */
38
- export interface LayoutHeaderAction
39
- extends Partial<Omit<CustomButton, "id" | "color" | "variant">> {
38
+ export interface LayoutHeaderAction extends Partial<
39
+ Omit<CustomButton, "id" | "color" | "variant">
40
+ > {
40
41
  id: string;
41
42
  color?: ButtonProps["color"];
42
43
  variant?: ButtonProps["variant"];