@opengis/surveyor 0.0.1 → 0.0.3

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 (46) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +175 -33
  3. package/dist/chunks/BaseModal-SQXvRRNW.js +90 -0
  4. package/dist/chunks/{RegistryForm-pvIcFR-V.js → RegistryForm-wG-c8GKf.js} +1 -1
  5. package/dist/chunks/{RegistryFormModal-BjGu7Upv.js → RegistryFormModal-R_iZYqGE.js} +2 -2
  6. package/dist/chunks/{RegistryToolbar-CiUgsjpU.js → RegistryToolbar-322DKUXi.js} +3 -3
  7. package/dist/chunks/SurveyorTeleport-CnSF0Ptl.js +23 -0
  8. package/dist/chunks/{VerifiedBadge-B6droMOf.js → VerifiedBadge-bk0n-rlC.js} +1 -1
  9. package/dist/chunks/{buildSchema-nkA4Y0YG.js → buildSchema-CccjX9TJ.js} +1 -1
  10. package/dist/chunks/card-B_SfARf7.js +1190 -0
  11. package/dist/chunks/card-C3y-j2TA.js +298 -0
  12. package/dist/chunks/{card--DHsMNBd.js → card-CWqi1K-x.js} +107 -106
  13. package/dist/chunks/card-DWpAv92l.js +539 -0
  14. package/dist/chunks/{card-BZn5CDw9.js → card-X9UVFgdR.js} +254 -248
  15. package/dist/chunks/{certificates-DueBDDvc.js → certificates-Cwch72-o.js} +131 -130
  16. package/dist/chunks/{create-l28e-bWl.js → create-DTP9x2uS.js} +278 -265
  17. package/dist/chunks/dom-BSjFG3O0.js +7 -0
  18. package/dist/chunks/{filterQuery-B9XNx1f1.js → filterQuery-CvfZrkTC.js} +1 -1
  19. package/dist/chunks/{form-CdGS1nVO.js → form-Bh6i5n1U.js} +1 -1
  20. package/dist/chunks/{form-QTkkzwbC.js → form-DDjELqZ9.js} +1 -1
  21. package/dist/chunks/{map-layers-qxWjos2V.js → map-layers-sT-gTiD_.js} +130 -125
  22. package/dist/chunks/{map-BW3iOhQg.js → map-qXQe_qam.js} +643 -630
  23. package/dist/chunks/{organizations-CZOINYMq.js → organizations-ByVE2f0c.js} +129 -124
  24. package/dist/chunks/requests-BTpLXrNj.js +233 -0
  25. package/dist/chunks/{resendSurveyorRegistration-DopjOHaM.js → resendSurveyorRegistration-BHTTVIw1.js} +1 -1
  26. package/dist/chunks/{resources-Cl_EvaIy.js → resources-2e8RFqWR.js} +1 -1
  27. package/dist/chunks/{surveyorAccount-BceNQypZ.js → surveyorAccount-C7UiiIYg.js} +1 -1
  28. package/dist/chunks/useEntityPath-C5Owtidc.js +98 -0
  29. package/dist/chunks/{users-DlaogjC_.js → users-U1P6xCP4.js} +106 -100
  30. package/dist/index.css +1 -1
  31. package/dist/index.js +215 -98
  32. package/package.json +83 -77
  33. package/plugin.d.ts +15 -0
  34. package/plugin.js +8 -10
  35. package/server/app.ts +2 -1
  36. package/server/resources/surveyor-admin/application_comments.ts +3 -3
  37. package/server/suggests/index.ts +17 -0
  38. package/surveyor-types.d.ts +5 -0
  39. package/README.npm.md +0 -51
  40. package/dist/chunks/AppIcon-C-4QykTP.js +0 -85
  41. package/dist/chunks/BaseModal-DrTTkLmR.js +0 -85
  42. package/dist/chunks/card-9LaB42Ol.js +0 -538
  43. package/dist/chunks/card-CNqXSyqX.js +0 -297
  44. package/dist/chunks/card-CgGOgGyd.js +0 -973
  45. package/dist/chunks/requests-DQJIhz00.js +0 -232
  46. package/server/embed.ts +0 -49
package/server/app.ts CHANGED
@@ -6,6 +6,7 @@ import fcoreFastify from '@opengis/fcore/fastify';
6
6
  //import fcoreFastify from '../../../npm/fcore/src/fastify.js';
7
7
 
8
8
  import dictionaries from './dictionaries/index.js';
9
+ import suggests from './suggests/index.js';
9
10
  import resources from './resources/index.js';
10
11
  import { createSurveyorRoutes } from './modules/surveyor/route.js';
11
12
  import { afterSurveyorUser } from './modules/surveyor/utils/permissions.js';
@@ -14,7 +15,7 @@ import viteDevPlugin from './plugins/vite.dev.js';
14
15
  import viteProdPlugin from './plugins/vite.prod.js';
15
16
 
16
17
  export default async function createApp() {
17
- const ctx = await createFCore({ resources, dictionaries, hooks: { afterUser: afterSurveyorUser } }) as AppContext;
18
+ const ctx = await createFCore({ resources, dictionaries, suggests, hooks: { afterUser: afterSurveyorUser } }) as AppContext;
18
19
  const app = Fastify({
19
20
  loggerInstance: ctx.logger,
20
21
  routerOptions: { maxParamLength: 2048 },
@@ -1,5 +1,5 @@
1
1
  import type { ResourceContract } from "@opengis/fcore";
2
- import { userLookup } from "../helpers/user_lookup.js";
2
+ import { actorLookup } from "../helpers/actor_lookup.js";
3
3
 
4
4
  // Internal read-only target for application relations; direct CRUD is disabled.
5
5
  export default {
@@ -16,9 +16,9 @@ export default {
16
16
  resource: { type: "string", read: true, write: false },
17
17
  resource_id: { type: "text", read: true, write: false },
18
18
  body: { type: "text", read: true, write: false },
19
- created_by: { type: "string", read: true, write: false, lookup: userLookup },
19
+ created_by: { type: "string", read: true, write: false, lookup: actorLookup },
20
20
  created_at: { type: "timestamp", read: true, write: false },
21
- updated_by: { type: "string", read: true, write: false, lookup: userLookup },
21
+ updated_by: { type: "string", read: true, write: false, lookup: actorLookup },
22
22
  updated_at: { type: "timestamp", read: true, write: false },
23
23
  },
24
24
  } satisfies ResourceContract;
@@ -0,0 +1,17 @@
1
+ import type { SuggestContract } from "@opengis/fcore";
2
+
3
+ const suggests: SuggestContract[] = [
4
+ {
5
+ name: "gis-layers",
6
+ module: "admin",
7
+ key: "id",
8
+ query: `
9
+ SELECT style_id as id, style_name as text FROM gis.style
10
+ WHERE style_name ILIKE '%' || :search || '%'
11
+ union all
12
+ SELECT dataset_id as id, dataset_name as text FROM gis.dataset
13
+ WHERE dataset_name ILIKE '%' || :search || '%'
14
+ `,
15
+ }
16
+ ];
17
+ export default suggests;
@@ -28,3 +28,8 @@ export declare const defaultSurveyorPaths: SurveyorHostPaths
28
28
  export declare const SURVEYOR_PATHS_KEY: symbol
29
29
 
30
30
  export declare function createSurveyorPlugin(options?: SurveyorPluginOptions): Plugin
31
+
32
+ export declare const SurveyorRoot: DefineComponent
33
+
34
+ export declare const SURVEYOR_ROOT_ID: 'surveyor-root'
35
+ export declare const SURVEYOR_PORTAL_ID: 'surveyor-portal'
package/README.npm.md DELETED
@@ -1,51 +0,0 @@
1
- # @opengis/surveyor
2
-
3
- Embedded Surveyor UI (admin registries, map, geodesist cabinet) and Fastify backend plugin.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm i @opengis/surveyor
9
- ```
10
-
11
- Peers: `vue`, `vue-router`, `lucide-vue-next`, `@opengis/core`, `@opengis/form`, `@opengis/filter`.
12
-
13
- Screen components load their pages via `defineAsyncComponent` (separate chunks under `dist/chunks/`), similar to `@opengis/gis`.
14
-
15
- ## Host frontend
16
-
17
- ```js
18
- import '@opengis/core/dist/index.css'
19
- import '@opengis/form/dist/index.css'
20
- import '@opengis/surveyor/style.css'
21
- import v3Core from '@opengis/core'
22
- import { createSurveyorPlugin } from '@opengis/surveyor'
23
-
24
- app.use(v3Core)
25
- app.use(createSurveyorPlugin())
26
- ```
27
-
28
- ### Routes (example)
29
-
30
- ```js
31
- export default [
32
- { path: '/srv-map', component: () => import('@opengis/surveyor').then((m) => m.Map) },
33
- { path: '/srv-requests/:number?', component: () => import('@opengis/surveyor').then((m) => m.Requests) },
34
- { path: '/srv-organisations/:id?', component: () => import('@opengis/surveyor').then((m) => m.Organisations) },
35
- { path: '/srv-certificates/:id?', component: () => import('@opengis/surveyor').then((m) => m.Certificates) },
36
- { path: '/srv-users/:id?', component: () => import('@opengis/surveyor').then((m) => m.Users) },
37
- { path: '/srv-map-layers/:id?', component: () => import('@opengis/surveyor').then((m) => m.MapLayers) },
38
- { path: '/surveyor-cabinet/requests/:segment?', component: () => import('@opengis/surveyor').then((m) => m.CabinetRequests) },
39
- { path: '/surveyor-cabinet/profile', component: () => import('@opengis/surveyor').then((m) => m.CabinetProfile) },
40
- ]
41
- ```
42
-
43
- Internal links in pages still use standalone paths (`/organizations`, `/requests`, …). For custom prefixes, mount host routes at the same paths or extend path injection in a future release.
44
-
45
- ## Host backend (Bun)
46
-
47
- ```js
48
- await fastify.register(import('@opengis/surveyor/plugin.js'), {})
49
- ```
50
-
51
- Run migrations from this package (`migrations/`) via your fcore migrate workflow.
@@ -1,85 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { computed as t, createBlock as n, defineComponent as r, openBlock as i, resolveDynamicComponent as a } from "vue";
3
- import { ArrowDown as o, ArrowRight as s, ArrowUp as c, ArrowUpDown as l, Award as u, Ban as d, Building2 as f, CalendarDays as p, Check as m, ChevronDown as h, ChevronLeft as g, ChevronRight as _, ChevronsLeft as v, ChevronsRight as y, CircleCheck as b, CircleX as x, ClipboardList as S, Columns3 as C, Download as w, ExternalLink as T, Eye as E, FileCheck2 as D, FileText as O, Filter as k, History as A, Home as ee, KeyRound as j, Layers as M, LogOut as N, Map as P, MapPinned as F, MessageSquare as I, MoreVertical as L, Pencil as R, Plus as z, Power as B, Search as V, Send as H, Settings as U, ShieldCheck as W, Trash2 as G, Upload as K, User as q, UserX as J, Users as Y, UsersRound as X } from "lucide-vue-next";
4
- //#region admin/src/components/ui/AppIcon.vue?vue&type=script&setup=true&lang.ts
5
- var Z = /*@__PURE__*/ r({
6
- __name: "AppIcon",
7
- props: {
8
- name: {
9
- type: null,
10
- required: !0
11
- },
12
- strokeWidth: {
13
- type: [Number, String],
14
- required: !1,
15
- default: 2
16
- }
17
- },
18
- setup(e, { expose: n }) {
19
- n();
20
- let r = {
21
- "arrow-down": o,
22
- "arrow-right": s,
23
- "arrow-up": c,
24
- "arrow-up-down": l,
25
- award: u,
26
- ban: d,
27
- "building-2": f,
28
- "calendar-days": p,
29
- check: m,
30
- "chevron-down": h,
31
- "chevron-left": g,
32
- "chevron-right": _,
33
- "chevrons-left": v,
34
- "chevrons-right": y,
35
- "circle-check": b,
36
- "circle-x": x,
37
- "clipboard-list": S,
38
- "columns-3": C,
39
- download: w,
40
- "external-link": T,
41
- eye: E,
42
- "file-check-2": D,
43
- "file-text": O,
44
- filter: k,
45
- history: A,
46
- home: ee,
47
- "key-round": j,
48
- layers: M,
49
- "log-out": N,
50
- map: P,
51
- "map-pinned": F,
52
- "message-square": I,
53
- "more-vertical": L,
54
- pencil: R,
55
- plus: z,
56
- power: B,
57
- search: V,
58
- send: H,
59
- settings: U,
60
- "shield-check": W,
61
- "trash-2": G,
62
- upload: K,
63
- user: q,
64
- "user-x": J,
65
- users: Y,
66
- "users-round": X
67
- }, i = e, a = {
68
- icons: r,
69
- props: i,
70
- icon: t(() => r[i.name])
71
- };
72
- return Object.defineProperty(a, "__isScriptSetup", {
73
- enumerable: !1,
74
- value: !0
75
- }), a;
76
- }
77
- });
78
- //#endregion
79
- //#region admin/src/components/ui/AppIcon.vue
80
- function Q(e, t, r, o, s, c) {
81
- return i(), n(a(o.icon), { "stroke-width": r.strokeWidth }, null, 8, ["stroke-width"]);
82
- }
83
- var $ = /*#__PURE__*/ e(Z, [["render", Q], ["__file", "C:/softpro/surveyor/admin/src/components/ui/AppIcon.vue"]]);
84
- //#endregion
85
- export { $ as t };
@@ -1,85 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderSlot as d, toDisplayString as f, withCtx as p, withModifiers as m } from "vue";
3
- //#region admin/src/components/ui/BaseModal.vue?vue&type=script&setup=true&lang.ts
4
- var h = /*@__PURE__*/ c({
5
- __name: "BaseModal",
6
- props: {
7
- modelValue: {
8
- type: Boolean,
9
- required: !0
10
- },
11
- title: {
12
- type: String,
13
- required: !0
14
- },
15
- width: {
16
- type: String,
17
- required: !1,
18
- default: "max-w-lg"
19
- }
20
- },
21
- emits: ["update:modelValue"],
22
- setup(e, { expose: t, emit: n }) {
23
- t();
24
- let r = n;
25
- function i() {
26
- r("update:modelValue", !1);
27
- }
28
- let a = {
29
- emit: r,
30
- close: i
31
- };
32
- return Object.defineProperty(a, "__isScriptSetup", {
33
- enumerable: !1,
34
- value: !0
35
- }), a;
36
- }
37
- }), g = { class: "flex items-center justify-between border-b border-slate-100 px-6 py-4" }, _ = { class: "text-lg font-semibold text-slate-900" }, v = { class: "min-h-0 flex-1 overflow-y-auto px-6 py-5" }, y = {
38
- key: 0,
39
- class: "shrink-0 border-t border-slate-100 px-6 py-4"
40
- };
41
- function b(e, c, h, b, x, S) {
42
- return u(), r(t, { to: "body" }, [s(n, { name: "fade" }, {
43
- default: p(() => [h.modelValue ? (u(), a("div", {
44
- key: 0,
45
- class: "fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4",
46
- onClick: m(b.close, ["self"])
47
- }, [s(n, {
48
- name: "pop",
49
- appear: ""
50
- }, {
51
- default: p(() => [h.modelValue ? (u(), a("div", {
52
- key: 0,
53
- class: l(["flex max-h-[90vh] w-full flex-col overflow-hidden rounded-2xl bg-white shadow-xl", h.width])
54
- }, [
55
- o("div", g, [o("h3", _, f(h.title), 1), o("button", {
56
- type: "button",
57
- class: "rounded-lg p-1.5 text-slate-400 hover:bg-slate-100 hover:text-slate-600",
58
- "aria-label": "Закрити",
59
- onClick: b.close
60
- }, [...c[0] ||= [o("svg", {
61
- class: "h-[18px] w-[18px]",
62
- fill: "none",
63
- viewBox: "0 0 24 24",
64
- stroke: "currentColor",
65
- "stroke-width": "2"
66
- }, [o("path", {
67
- "stroke-linecap": "round",
68
- "stroke-linejoin": "round",
69
- d: "M6 18L18 6M6 6l12 12"
70
- })], -1)]])]),
71
- o("div", v, [d(e.$slots, "default", {}, void 0, !0)]),
72
- e.$slots.footer ? (u(), a("div", y, [d(e.$slots, "footer", {}, void 0, !0)])) : i("", !0)
73
- ], 2)) : i("", !0)]),
74
- _: 3
75
- })])) : i("", !0)]),
76
- _: 3
77
- })]);
78
- }
79
- var x = /*#__PURE__*/ e(h, [
80
- ["render", b],
81
- ["__scopeId", "data-v-637bdb40"],
82
- ["__file", "C:/softpro/surveyor/admin/src/components/ui/BaseModal.vue"]
83
- ]);
84
- //#endregion
85
- export { x as t };