@antelopejs/dms-database 0.5.0 → 0.5.2

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 (45) hide show
  1. package/README.md +4 -5
  2. package/dist/config.d.ts +2 -2
  3. package/dist/config.js.map +1 -1
  4. package/dist/db/models/diagram_layouts.model.js +1 -10
  5. package/dist/db/models/diagram_layouts.model.js.map +1 -1
  6. package/dist/routes/connections.js +7 -2
  7. package/dist/routes/connections.js.map +1 -1
  8. package/dist/routes/data.js +4 -1
  9. package/dist/routes/data.js.map +1 -1
  10. package/dist/service/builderRefusal.d.ts +2 -0
  11. package/dist/service/builderRefusal.js +28 -0
  12. package/dist/service/builderRefusal.js.map +1 -0
  13. package/dist/service/connectionRefusals.d.ts +17 -0
  14. package/dist/service/connectionRefusals.js +26 -0
  15. package/dist/service/connectionRefusals.js.map +1 -0
  16. package/dist/service/connectionState.d.ts +0 -2
  17. package/dist/service/connectionState.js +21 -11
  18. package/dist/service/connectionState.js.map +1 -1
  19. package/dist/service/connections.js +3 -2
  20. package/dist/service/connections.js.map +1 -1
  21. package/frontend-vue/app/build/components/DataGridFooter.vue +16 -1
  22. package/frontend-vue/app/build/composables/reloadForSelection.ts +3 -5
  23. package/frontend-vue/app/build/composables/useDataBrowserGrid.ts +1 -0
  24. package/frontend-vue/app/build/composables/useDataBrowserTabs.ts +91 -15
  25. package/frontend-vue/app/build/data/gridData.ts +22 -1
  26. package/frontend-vue/app/build/data/recentTables.ts +15 -14
  27. package/frontend-vue/app/build/data/useStagedSave.ts +0 -3
  28. package/frontend-vue/app/components/DataBrowser.vue +9 -14
  29. package/frontend-vue/app/components/DataBrowserSidebar.vue +1 -0
  30. package/frontend-vue/app/components/DataGrid.vue +5 -12
  31. package/frontend-vue/app/components/DatabaseSwitcher.vue +0 -2
  32. package/frontend-vue/app/components/TableInspector.vue +11 -6
  33. package/frontend-vue/i18n/locales/database-en-GB.json +12 -0
  34. package/frontend-vue/i18n/locales/database-fr-FR.json +12 -0
  35. package/frontend-vue/package.json +1 -1
  36. package/frontend-vue/pnpm-lock.yaml +5 -5
  37. package/frontend-vue/tests/dataBrowserDatabase.test.ts +89 -0
  38. package/frontend-vue/tests/databaseSwitcher.test.ts +11 -7
  39. package/frontend-vue/tests/editRequest.test.ts +0 -51
  40. package/frontend-vue/tests/externalBrowser.test.ts +125 -0
  41. package/frontend-vue/tests/persistence.test.ts +254 -4
  42. package/frontend-vue/tests/recentTables.test.ts +70 -0
  43. package/frontend-vue/tests/serverRender.test.ts +22 -0
  44. package/package.json +7 -7
  45. package/frontend-vue/app/build/data/staleDatabase.ts +0 -58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-database",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Database console for the AntelopeJS DMS: schemas, relation diagrams, a data browser and an AQL query console.",
5
5
  "keywords": [
6
6
  "admin",
@@ -71,18 +71,18 @@
71
71
  "@antelopejs/interface-api-util": ">=0.3.2 <0.4.0",
72
72
  "@antelopejs/interface-core": ">=0.5.1 <0.6.0",
73
73
  "@antelopejs/interface-database": ">=0.4.0 <0.5.0",
74
- "@antelopejs/interface-database-catalog": ">=0.0.4 <0.1.0",
74
+ "@antelopejs/interface-database-catalog": ">=0.1.0 <0.2.0",
75
75
  "@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0",
76
76
  "@antelopejs/interface-dms": ">=0.14.0 <0.15.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@antelopejs/core": "~1.23.2",
80
- "@antelopejs/dms": ">=0.20.0 <0.21.0",
79
+ "@antelopejs/core": "~1.24.0",
80
+ "@antelopejs/dms": ">=0.20.2 <0.21.0",
81
81
  "@antelopejs/dms-automation": ">=0.11.1 <0.12.0",
82
- "@antelopejs/dms-frontend": ">=0.11.1 <0.12.0",
82
+ "@antelopejs/dms-frontend": ">=0.11.4 <0.12.0",
83
83
  "@antelopejs/interface-data-api": ">=0.8.0 <0.9.0",
84
- "@antelopejs/mongodb": "~1.8.1",
85
- "@antelopejs/tooling-configs": ">=0.7.1 <0.8.0",
84
+ "@antelopejs/mongodb": "~1.8.4",
85
+ "@antelopejs/tooling-configs": ">=0.7.4 <0.8.0",
86
86
  "@types/chai": "^5.2.3",
87
87
  "@types/mocha": "^10.0.10",
88
88
  "@types/node": "^24.0.0",
@@ -1,58 +0,0 @@
1
- const STALE_MESSAGE =
2
- 'The selected database changed in another tab: reload the page'
3
- const STALE_KEY = 'dms_database.data.save.database_changed'
4
- const CONFLICT = 409
5
- const READ_ONLY_MESSAGE = /^Access to (.+) is read only$/
6
- const READ_ONLY_KEY = 'dms_database.data.save.read_only_access'
7
- const FORBIDDEN = 403
8
-
9
- function read(value: unknown, key: string): unknown {
10
- return typeof value === 'object' && value !== null
11
- ? Reflect.get(value, key)
12
- : undefined
13
- }
14
-
15
- /** A refusal of the edit route, as the error API presents it: a translated key with its parameters. */
16
- export class PresentableWriteError extends Error {
17
- readonly data: {
18
- message: string
19
- params: Record<string, string>
20
- severity: 'warning'
21
- }
22
-
23
- constructor(
24
- readonly statusCode: number,
25
- readonly response: unknown,
26
- key: string,
27
- params: Record<string, string> = {},
28
- ) {
29
- super(key)
30
- this.data = { message: key, params, severity: 'warning' }
31
- }
32
- }
33
-
34
- /**
35
- * Turns the edit route's refusals whose body the API sends as text (a write
36
- * from a stale tab, a write to a connection whose access is read only) into
37
- * ones the error API translates; any other error comes back as it is.
38
- */
39
- export function presentableWriteError(error: unknown): unknown {
40
- const response = read(error, 'response')
41
- const status =
42
- read(error, 'statusCode') ??
43
- read(error, 'status') ??
44
- read(response, 'status')
45
- const body = read(error, 'data') ?? read(response, '_data')
46
- const message = typeof body === 'string' ? body : read(body, 'message')
47
- if (status === CONFLICT && message === STALE_MESSAGE)
48
- return new PresentableWriteError(CONFLICT, response, STALE_KEY)
49
- const readOnly =
50
- status === FORBIDDEN && typeof message === 'string'
51
- ? READ_ONLY_MESSAGE.exec(message)
52
- : null
53
- return readOnly?.[1] === undefined
54
- ? error
55
- : new PresentableWriteError(FORBIDDEN, response, READ_ONLY_KEY, {
56
- connection: readOnly[1],
57
- })
58
- }