@opengis/surveyor 0.0.10 → 0.0.12

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 (64) hide show
  1. package/dist/chunks/{AppIcon-Di5F4Bu_.js → AppIcon-CO70tpMX.js} +1 -1
  2. package/dist/chunks/{AppealDetailField-DNpsGpPY.js → AppealDetailField-DNRGpnyD.js} +2 -2
  3. package/dist/chunks/{AppealStatusBadge-z77wwkFD.js → AppealStatusBadge-BlAaNUSK.js} +2 -2
  4. package/dist/chunks/{AppealStatusBadge-MP1qD952.js → AppealStatusBadge-Ct3EcB4_.js} +15 -1
  5. package/dist/chunks/{ApplicationHistorySection-DIoFZwH6.js → ApplicationHistorySection-D7KPV2cX.js} +155 -141
  6. package/dist/chunks/{BaseModal-DP_ilBdg.js → BaseModal-SjP521X9.js} +2 -2
  7. package/dist/chunks/{FormFilePicker-D5fAUE0Z.js → FormFilePicker-DxPQlxgy.js} +2 -2
  8. package/dist/chunks/{MapLayerMenu-CI5cbLEC.js → MapLayerMenu-AUeTqgEp.js} +1 -1
  9. package/dist/chunks/{RegistryForm-DbCxZsr0.js → RegistryForm-BlK1lExt.js} +2 -2
  10. package/dist/chunks/{RegistryFormModal-D_KLGj2d.js → RegistryFormModal-DhzEpxys.js} +3 -3
  11. package/dist/chunks/{RegistryToolbar-DvbrASlj.js → RegistryToolbar-DXOEcD84.js} +45 -154
  12. package/dist/chunks/{SurveyorTeleport-D6-KXe_5.js → SurveyorTeleport-CnSF0Ptl.js} +1 -1
  13. package/dist/chunks/TablePagination-CUtnDQQ_.js +116 -0
  14. package/dist/chunks/{UserAccessBadge-B5Q1LvNv.js → UserAccessBadge-DyZDv7Oo.js} +1 -1
  15. package/dist/chunks/{UserTypeBadge-CuAMctTK.js → UserTypeBadge-LvnMuKGo.js} +1 -1
  16. package/dist/chunks/{VerifiedBadge-D6L7mCdp.js → VerifiedBadge-bk0n-rlC.js} +2 -2
  17. package/dist/chunks/{buildSchema-CccjX9TJ.js → buildSchema-DEfhZEM8.js} +1 -1
  18. package/dist/chunks/{card-ylC5NYbz.js → card-BBx1zR0E.js} +316 -306
  19. package/dist/chunks/{card-BsTSF6aL.js → card-Bj4zFzbe.js} +47 -44
  20. package/dist/chunks/{card-CI7ntIHf.js → card-C-ohjNkC.js} +5 -5
  21. package/dist/chunks/{card--XUb1kFK.js → card-DEJs9IIP.js} +6 -6
  22. package/dist/chunks/card-VnUCFC7v.js +609 -0
  23. package/dist/chunks/{card-BrjnXf1N.js → card-_YyJbLNI.js} +13 -10
  24. package/dist/chunks/{certificates-BnseQylH.js → certificates-Be6u7Cix.js} +1 -1
  25. package/dist/chunks/{certificates-aJ-hvaP-.js → certificates-DtfZTFN9.js} +13 -12
  26. package/dist/chunks/{create-Bi7-j9Ri.js → create-Cgeu7aKO.js} +348 -293
  27. package/dist/chunks/{filterQuery-CvfZrkTC.js → filterQuery-Dka-mIso.js} +7 -3
  28. package/dist/chunks/{forgot-DnixBqdc.js → forgot-DoG6vXhq.js} +2 -2
  29. package/dist/chunks/{form-DDjELqZ9.js → form-CEfc_shb.js} +1 -1
  30. package/dist/chunks/{form-Bh6i5n1U.js → form-DZ3CbtkT.js} +1 -1
  31. package/dist/chunks/{login-BWCQdEkv.js → login-BWGylcSU.js} +2 -2
  32. package/dist/chunks/{map-CwsVIW79.js → map-DkKsEnCM.js} +1126 -831
  33. package/dist/chunks/{map-layers-BLiEYC4C.js → map-layers-BmuIMLHa.js} +13 -12
  34. package/dist/chunks/{organizations-mc6FlSwe.js → organizations-BO1dIl7v.js} +15 -14
  35. package/dist/chunks/{profile-F7mr0poI.js → profile-CkwMFh82.js} +3 -3
  36. package/dist/chunks/{registration-BRF4985_.js → registration-3GLgq-ae.js} +2 -2
  37. package/dist/chunks/{requests-7pD2ckdx.js → requests-BZ2jrt5J.js} +12 -11
  38. package/dist/chunks/{requests-BCJN-CNx.js → requests-rWq8ok3C.js} +5 -5
  39. package/dist/chunks/{resendSurveyorRegistration-BHTTVIw1.js → resendSurveyorRegistration-BQjL9IgM.js} +1 -1
  40. package/dist/chunks/{reset-OZCgLi6f.js → reset-CP9LsLkC.js} +2 -2
  41. package/dist/chunks/{resources-2e8RFqWR.js → resources-Cj8BzrBX.js} +18 -13
  42. package/dist/chunks/{surveyorAccount-C7UiiIYg.js → surveyorAccount-Cfba7ZVZ.js} +1 -1
  43. package/dist/chunks/{useEntityPath-8s0Y1tjA.js → useEntityPath-C5Owtidc.js} +1 -1
  44. package/dist/chunks/{users-CAEjpaI1.js → users-DOiQeVwn.js} +15 -14
  45. package/dist/index.css +1 -1
  46. package/dist/index.js +40 -40
  47. package/migrations/20261016120000_map_layers.sql +156 -156
  48. package/migrations/20261016150000_password_reset.sql +15 -15
  49. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  50. package/package.json +1 -1
  51. package/server/dictionaries/index.ts +17 -17
  52. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  53. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  54. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  55. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  56. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
  57. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
  58. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  59. package/server/plugins/convertVector.ts +1 -1
  60. package/server/resources/helpers/settlement_lookup.ts +7 -7
  61. package/server/resources/surveyor-admin/map_layers.ts +69 -69
  62. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  63. package/server/resources/surveyor-admin/organizations.ts +61 -61
  64. package/dist/chunks/card-Cu8QOSIw.js +0 -539
@@ -1,16 +1,16 @@
1
- -- Settlement lookup labels with the settlement type: "м. Львів", "с. Лисиничі".
2
- CREATE OR REPLACE VIEW surveyor.settlement_lookup AS
3
- SELECT
4
- settlement.katottg,
5
- settlement.level,
6
- concat_ws(' ',
7
- CASE settlement.type
8
- WHEN 201 THEN 'м.'
9
- WHEN 501 THEN 'м.'
10
- WHEN 503 THEN 'смт'
11
- WHEN 504 THEN 'с.'
12
- WHEN 505 THEN 'с-ще'
13
- END,
14
- trim(settlement.name)
15
- ) AS settlement_text
16
- FROM data_address.atu AS settlement;
1
+ -- Settlement lookup labels with the settlement type: "м. Львів", "с. Лисиничі".
2
+ CREATE OR REPLACE VIEW surveyor.settlement_lookup AS
3
+ SELECT
4
+ settlement.katottg,
5
+ settlement.level,
6
+ concat_ws(' ',
7
+ CASE settlement.type
8
+ WHEN 201 THEN 'м.'
9
+ WHEN 501 THEN 'м.'
10
+ WHEN 503 THEN 'смт'
11
+ WHEN 504 THEN 'с.'
12
+ WHEN 505 THEN 'с-ще'
13
+ END,
14
+ trim(settlement.name)
15
+ ) AS settlement_text
16
+ FROM data_address.atu AS settlement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/surveyor",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "description": "Surveyor admin and geodesist cabinet UI for embedded host applications",
@@ -1,17 +1,17 @@
1
- import applicationStatus from "./surveyor/application_status.js";
2
- import workTypes from "./surveyor/work_types.js";
3
- import accountTypes from "./surveyor/account_types.js";
4
- import yesNo from "./surveyor/yes_no.js";
5
- import mapLayerGroups from "./surveyor/map_layer_groups.js";
6
- import mapLayerTypes from "./surveyor/map_layer_types.js";
7
- import mapLayerComponents from "./surveyor/map_layer_components.js";
8
-
9
- export default [
10
- applicationStatus,
11
- workTypes,
12
- accountTypes,
13
- yesNo,
14
- mapLayerGroups,
15
- mapLayerTypes,
16
- mapLayerComponents,
17
- ];
1
+ import applicationStatus from "./surveyor/application_status.js";
2
+ import workTypes from "./surveyor/work_types.js";
3
+ import accountTypes from "./surveyor/account_types.js";
4
+ import yesNo from "./surveyor/yes_no.js";
5
+ import mapLayerGroups from "./surveyor/map_layer_groups.js";
6
+ import mapLayerTypes from "./surveyor/map_layer_types.js";
7
+ import mapLayerComponents from "./surveyor/map_layer_components.js";
8
+
9
+ export default [
10
+ applicationStatus,
11
+ workTypes,
12
+ accountTypes,
13
+ yesNo,
14
+ mapLayerGroups,
15
+ mapLayerTypes,
16
+ mapLayerComponents,
17
+ ];
@@ -1,11 +1,11 @@
1
- import type { DictionaryDefinition } from "@opengis/fcore";
2
-
3
- export default {
4
- code: "map-layer-components",
5
- name: "Компоненти карти",
6
- items: [
7
- { code: "map", name: "Карта" },
8
- { code: "application-form", name: "Форма окреслення геометрії заявки" },
9
- { code: "application-card", name: "Картка заявки" },
10
- ],
11
- } satisfies DictionaryDefinition;
1
+ import type { DictionaryDefinition } from "@opengis/fcore";
2
+
3
+ export default {
4
+ code: "map-layer-components",
5
+ name: "Компоненти карти",
6
+ items: [
7
+ { code: "map", name: "Карта" },
8
+ { code: "application-form", name: "Форма окреслення геометрії заявки" },
9
+ { code: "application-card", name: "Картка заявки" },
10
+ ],
11
+ } satisfies DictionaryDefinition;
@@ -1,10 +1,10 @@
1
- import type { DictionaryDefinition } from "@opengis/fcore";
2
-
3
- export default {
4
- code: "map-layer-groups",
5
- name: "Групи шарів карти",
6
- items: [
7
- { code: "base", name: "Базовий шар" },
8
- { code: "overlay", name: "Додатковий шар" },
9
- ],
10
- } satisfies DictionaryDefinition;
1
+ import type { DictionaryDefinition } from "@opengis/fcore";
2
+
3
+ export default {
4
+ code: "map-layer-groups",
5
+ name: "Групи шарів карти",
6
+ items: [
7
+ { code: "base", name: "Базовий шар" },
8
+ { code: "overlay", name: "Додатковий шар" },
9
+ ],
10
+ } satisfies DictionaryDefinition;
@@ -1,11 +1,11 @@
1
- import type { DictionaryDefinition } from "@opengis/fcore";
2
-
3
- export default {
4
- code: "map-layer-types",
5
- name: "Типи шарів карти",
6
- items: [
7
- { code: "raster", name: "Растрові тайли" },
8
- { code: "vector", name: "Векторні тайли" },
9
- { code: "applications", name: "Заявки" },
10
- ],
11
- } satisfies DictionaryDefinition;
1
+ import type { DictionaryDefinition } from "@opengis/fcore";
2
+
3
+ export default {
4
+ code: "map-layer-types",
5
+ name: "Типи шарів карти",
6
+ items: [
7
+ { code: "raster", name: "Растрові тайли" },
8
+ { code: "vector", name: "Векторні тайли" },
9
+ { code: "applications", name: "Заявки" },
10
+ ],
11
+ } satisfies DictionaryDefinition;
@@ -1,61 +1,61 @@
1
- import type { AppContext, User } from "@opengis/fcore";
2
- import { actor } from "../utils/shared.js";
3
-
4
- export type MapLayerComponent = "map" | "application-form" | "application-card";
5
-
6
- export type MapLayersInput = { component?: MapLayerComponent };
7
-
8
- export type MapLayer = {
9
- code: string;
10
- name: string;
11
- layer_group: "base" | "overlay";
12
- layer_type: "raster" | "vector" | "applications";
13
- tiles: string[];
14
- scheme: "xyz" | "tms";
15
- source_layer: string | null;
16
- attribution: string | null;
17
- minzoom: number | null;
18
- maxzoom: number | null;
19
- opacity: number;
20
- style: Record<string, unknown> | null;
21
- legend: Record<string, unknown> | null;
22
- preview: string | null;
23
- components: MapLayerComponent[];
24
- is_default: boolean;
25
- has_filters: boolean;
26
- };
27
-
28
- export type MapLayersResult = {
29
- default_base: string | null;
30
- base: MapLayer[];
31
- overlays: MapLayer[];
32
- };
33
-
34
- /**
35
- * Повертає увімкнені шари панелі карти, згруповані на базові та додаткові у порядку відображення.
36
- * Додаткові шари йдуть від верхнього до нижнього: перший у списку малюється поверх.
37
- * Якщо передано `component`, повертаються лише шари, налаштовані для цього компонента.
38
- */
39
- export async function mapLayers(
40
- { input, user, ctx }: { input: MapLayersInput; user: User | undefined; ctx: AppContext }
41
- ): Promise<MapLayersResult> {
42
- actor(user);
43
-
44
- const { rows }: { rows: MapLayer[] } = await ctx.pg.query(
45
- `SELECT code, name, layer_group, layer_type, tiles, scheme, source_layer, attribution,
46
- minzoom, maxzoom, opacity::float AS opacity, style, legend, preview, components,
47
- is_default, has_filters
48
- FROM surveyor.map_layers
49
- WHERE enabled
50
- AND ($1::text IS NULL OR components @> ARRAY[$1::text])
51
- ORDER BY layer_group, sort_order, name`,
52
- [input.component ?? null]
53
- );
54
-
55
- const base = rows.filter((layer) => layer.layer_group === "base");
56
- const overlays = rows.filter((layer) => layer.layer_group === "overlay");
57
- // Підложку вимкнути не можна, тому без явного значення активна перша.
58
- const defaultBase = base.find((layer) => layer.is_default) ?? base[0];
59
-
60
- return { default_base: defaultBase?.code ?? null, base, overlays };
61
- }
1
+ import type { AppContext, User } from "@opengis/fcore";
2
+ import { actor } from "../utils/shared.js";
3
+
4
+ export type MapLayerComponent = "map" | "application-form" | "application-card";
5
+
6
+ export type MapLayersInput = { component?: MapLayerComponent };
7
+
8
+ export type MapLayer = {
9
+ code: string;
10
+ name: string;
11
+ layer_group: "base" | "overlay";
12
+ layer_type: "raster" | "vector" | "applications";
13
+ tiles: string[];
14
+ scheme: "xyz" | "tms";
15
+ source_layer: string | null;
16
+ attribution: string | null;
17
+ minzoom: number | null;
18
+ maxzoom: number | null;
19
+ opacity: number;
20
+ style: Record<string, unknown> | null;
21
+ legend: Record<string, unknown> | null;
22
+ preview: string | null;
23
+ components: MapLayerComponent[];
24
+ is_default: boolean;
25
+ has_filters: boolean;
26
+ };
27
+
28
+ export type MapLayersResult = {
29
+ default_base: string | null;
30
+ base: MapLayer[];
31
+ overlays: MapLayer[];
32
+ };
33
+
34
+ /**
35
+ * Повертає увімкнені шари панелі карти, згруповані на базові та додаткові у порядку відображення.
36
+ * Додаткові шари йдуть від верхнього до нижнього: перший у списку малюється поверх.
37
+ * Якщо передано `component`, повертаються лише шари, налаштовані для цього компонента.
38
+ */
39
+ export async function mapLayers(
40
+ { input, user, ctx }: { input: MapLayersInput; user: User | undefined; ctx: AppContext }
41
+ ): Promise<MapLayersResult> {
42
+ actor(user);
43
+
44
+ const { rows }: { rows: MapLayer[] } = await ctx.pg.query(
45
+ `SELECT code, name, layer_group, layer_type, tiles, scheme, source_layer, attribution,
46
+ minzoom, maxzoom, opacity::float AS opacity, style, legend, preview, components,
47
+ is_default, has_filters
48
+ FROM surveyor.map_layers
49
+ WHERE enabled
50
+ AND ($1::text IS NULL OR components @> ARRAY[$1::text])
51
+ ORDER BY layer_group, sort_order, name`,
52
+ [input.component ?? null]
53
+ );
54
+
55
+ const base = rows.filter((layer) => layer.layer_group === "base");
56
+ const overlays = rows.filter((layer) => layer.layer_group === "overlay");
57
+ // Підложку вимкнути не можна, тому без явного значення активна перша.
58
+ const defaultBase = base.find((layer) => layer.is_default) ?? base[0];
59
+
60
+ return { default_base: defaultBase?.code ?? null, base, overlays };
61
+ }
@@ -1,52 +1,52 @@
1
- import type { AppContext, User } from "@opengis/fcore";
2
- import { BadRequestError, NotFoundError } from "@opengis/fcore";
3
- import { admin } from "../utils/shared.js";
4
-
5
- export type SurveyorAccountStatusInput = { enabled: boolean };
6
-
7
- /**
8
- * Повністю блокує або розблоковує обліковий запис геодезиста (`surveyors.enabled`)
9
- * та записує автора і значення зміни в аудит FCore. Членство в організаціях не змінюється.
10
- */
11
- export async function updateSurveyorAccountStatus(
12
- { id, input, user, ctx }: {
13
- id: string;
14
- input: SurveyorAccountStatusInput;
15
- user: User | undefined;
16
- ctx: AppContext;
17
- }
18
- ) {
19
- const uid = admin(user);
20
- if (typeof input.enabled !== "boolean") {
21
- throw new BadRequestError("Enabled must be a boolean");
22
- }
23
-
24
- const updated = await ctx.pg.query<{ surveyor_id: string }>(
25
- `UPDATE surveyor.surveyors
26
- SET enabled = $2, updated_by = $3, updated_at = now()
27
- WHERE surveyor_id = $1 AND enabled <> $2
28
- RETURNING surveyor_id`,
29
- [id, input.enabled, uid]
30
- );
31
-
32
- if (!updated.rows[0]) {
33
- const existing = await ctx.pg.query(
34
- "SELECT 1 FROM surveyor.surveyors WHERE surveyor_id = $1",
35
- [id]
36
- );
37
- if (!existing.rowCount) {
38
- throw new NotFoundError("Surveyor not found");
39
- }
40
- } else {
41
- await ctx.audit.write({
42
- module: "surveyor",
43
- resource: "surveyors",
44
- resourceId: id,
45
- action: input.enabled ? "unblock" : "block",
46
- userId: uid,
47
- fields: ["enabled"],
48
- changes: [{ field: "enabled", oldValue: !input.enabled, newValue: input.enabled }],
49
- });
50
- }
51
- return { id, enabled: input.enabled };
52
- }
1
+ import type { AppContext, User } from "@opengis/fcore";
2
+ import { BadRequestError, NotFoundError } from "@opengis/fcore";
3
+ import { admin } from "../utils/shared.js";
4
+
5
+ export type SurveyorAccountStatusInput = { enabled: boolean };
6
+
7
+ /**
8
+ * Повністю блокує або розблоковує обліковий запис геодезиста (`surveyors.enabled`)
9
+ * та записує автора і значення зміни в аудит FCore. Членство в організаціях не змінюється.
10
+ */
11
+ export async function updateSurveyorAccountStatus(
12
+ { id, input, user, ctx }: {
13
+ id: string;
14
+ input: SurveyorAccountStatusInput;
15
+ user: User | undefined;
16
+ ctx: AppContext;
17
+ }
18
+ ) {
19
+ const uid = admin(user);
20
+ if (typeof input.enabled !== "boolean") {
21
+ throw new BadRequestError("Enabled must be a boolean");
22
+ }
23
+
24
+ const updated = await ctx.pg.query<{ surveyor_id: string }>(
25
+ `UPDATE surveyor.surveyors
26
+ SET enabled = $2, updated_by = $3, updated_at = now()
27
+ WHERE surveyor_id = $1 AND enabled <> $2
28
+ RETURNING surveyor_id`,
29
+ [id, input.enabled, uid]
30
+ );
31
+
32
+ if (!updated.rows[0]) {
33
+ const existing = await ctx.pg.query(
34
+ "SELECT 1 FROM surveyor.surveyors WHERE surveyor_id = $1",
35
+ [id]
36
+ );
37
+ if (!existing.rowCount) {
38
+ throw new NotFoundError("Surveyor not found");
39
+ }
40
+ } else {
41
+ await ctx.audit.write({
42
+ module: "surveyor",
43
+ resource: "surveyors",
44
+ resourceId: id,
45
+ action: input.enabled ? "unblock" : "block",
46
+ userId: uid,
47
+ fields: ["enabled"],
48
+ changes: [{ field: "enabled", oldValue: !input.enabled, newValue: input.enabled }],
49
+ });
50
+ }
51
+ return { id, enabled: input.enabled };
52
+ }
@@ -1,53 +1,53 @@
1
- import type { AppContext, User } from "@opengis/fcore";
2
- import { BadRequestError, NotFoundError } from "@opengis/fcore";
3
- import { admin } from "../utils/shared.js";
4
-
5
- export type SurveyorStatusInput = { org_id: string; enabled: boolean };
6
-
7
- /**
8
- * Змінює доступ геодезиста до однієї організації (членство в `organization_surveyors`)
9
- * та записує автора і значення зміни в аудит FCore. Обліковий запис геодезиста не змінюється.
10
- */
11
- export async function updateSurveyorStatus(
12
- { id, input, user, ctx }: {
13
- id: string;
14
- input: SurveyorStatusInput;
15
- user: User | undefined;
16
- ctx: AppContext;
17
- }
18
- ) {
19
- const uid = admin(user);
20
- if (typeof input.enabled !== "boolean") {
21
- throw new BadRequestError("Enabled must be a boolean");
22
- }
23
-
24
- const updated = await ctx.pg.query<{ surveyor_id: string }>(
25
- `UPDATE surveyor.organization_surveyors
26
- SET enabled = $3
27
- WHERE org_id = $1 AND surveyor_id = $2 AND enabled <> $3
28
- RETURNING surveyor_id`,
29
- [input.org_id, id, input.enabled]
30
- );
31
-
32
- if (!updated.rows[0]) {
33
- const existing = await ctx.pg.query(
34
- "SELECT 1 FROM surveyor.organization_surveyors WHERE org_id = $1 AND surveyor_id = $2",
35
- [input.org_id, id]
36
- );
37
- if (!existing.rowCount) {
38
- throw new NotFoundError("Surveyor is not a member of this organization");
39
- }
40
- } else {
41
- await ctx.audit.write({
42
- module: "surveyor",
43
- resource: "surveyors",
44
- resourceId: id,
45
- action: input.enabled ? "enable" : "disable",
46
- userId: uid,
47
- fields: ["enabled"],
48
- changes: [{ field: "enabled", oldValue: !input.enabled, newValue: input.enabled }],
49
- metadata: { org_id: input.org_id },
50
- });
51
- }
52
- return { id, org_id: input.org_id, enabled: input.enabled };
53
- }
1
+ import type { AppContext, User } from "@opengis/fcore";
2
+ import { BadRequestError, NotFoundError } from "@opengis/fcore";
3
+ import { admin } from "../utils/shared.js";
4
+
5
+ export type SurveyorStatusInput = { org_id: string; enabled: boolean };
6
+
7
+ /**
8
+ * Змінює доступ геодезиста до однієї організації (членство в `organization_surveyors`)
9
+ * та записує автора і значення зміни в аудит FCore. Обліковий запис геодезиста не змінюється.
10
+ */
11
+ export async function updateSurveyorStatus(
12
+ { id, input, user, ctx }: {
13
+ id: string;
14
+ input: SurveyorStatusInput;
15
+ user: User | undefined;
16
+ ctx: AppContext;
17
+ }
18
+ ) {
19
+ const uid = admin(user);
20
+ if (typeof input.enabled !== "boolean") {
21
+ throw new BadRequestError("Enabled must be a boolean");
22
+ }
23
+
24
+ const updated = await ctx.pg.query<{ surveyor_id: string }>(
25
+ `UPDATE surveyor.organization_surveyors
26
+ SET enabled = $3
27
+ WHERE org_id = $1 AND surveyor_id = $2 AND enabled <> $3
28
+ RETURNING surveyor_id`,
29
+ [input.org_id, id, input.enabled]
30
+ );
31
+
32
+ if (!updated.rows[0]) {
33
+ const existing = await ctx.pg.query(
34
+ "SELECT 1 FROM surveyor.organization_surveyors WHERE org_id = $1 AND surveyor_id = $2",
35
+ [input.org_id, id]
36
+ );
37
+ if (!existing.rowCount) {
38
+ throw new NotFoundError("Surveyor is not a member of this organization");
39
+ }
40
+ } else {
41
+ await ctx.audit.write({
42
+ module: "surveyor",
43
+ resource: "surveyors",
44
+ resourceId: id,
45
+ action: input.enabled ? "enable" : "disable",
46
+ userId: uid,
47
+ fields: ["enabled"],
48
+ changes: [{ field: "enabled", oldValue: !input.enabled, newValue: input.enabled }],
49
+ metadata: { org_id: input.org_id },
50
+ });
51
+ }
52
+ return { id, org_id: input.org_id, enabled: input.enabled };
53
+ }
@@ -1,79 +1,79 @@
1
- <!DOCTYPE html>
2
- <html lang="uk">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Відновлення пароля</title>
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- color: #333;
12
- background-color: #f4f4f4;
13
- padding: 20px;
14
- }
15
-
16
- .email-container {
17
- max-width: 600px;
18
- margin: 0 auto;
19
- background-color: #ffffff;
20
- padding: 20px;
21
- border-radius: 5px;
22
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
- }
24
-
25
- h1 {
26
- font-size: 20px;
27
- color: #000;
28
- margin-bottom: 20px;
29
- }
30
-
31
- p {
32
- line-height: 1.6;
33
- margin: 10px 0;
34
- }
35
-
36
- .credentials {
37
- font-weight: bold;
38
- margin-top: 10px;
39
- }
40
-
41
- a {
42
- color: #007bff;
43
- text-decoration: none;
44
- }
45
-
46
- a:hover {
47
- text-decoration: underline;
48
- }
49
-
50
- .footer {
51
- font-size: 12px;
52
- color: #777;
53
- margin-top: 20px;
54
- text-align: center;
55
- }
56
- </style>
57
- </head>
58
-
59
- <body>
60
- <div class="email-container">
61
- <h1>Відновлення пароля до
62
- <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
- </h1>
64
- <p class="credentials">
65
- Логін: <strong>{{login}}</strong>
66
- </p>
67
- <p>
68
- Щоб встановити новий пароль, відкрийте це посилання або скопіюйте його в адресний рядок вашого браузера:<br>
69
- <a target="_blank" href="{{resetUrl}}">{{resetUrl}}</a>
70
- </p>
71
- <p>Посилання дійсне протягом 1 години і може бути використане лише один раз.</p>
72
- <p>Якщо ви не надсилали запит на відновлення пароля, проігноруйте цей лист — ваш поточний пароль залишиться без змін.</p>
73
- <div class="footer">
74
- Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
- </div>
76
- </div>
77
- </body>
78
-
79
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="uk">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Відновлення пароля</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ color: #333;
12
+ background-color: #f4f4f4;
13
+ padding: 20px;
14
+ }
15
+
16
+ .email-container {
17
+ max-width: 600px;
18
+ margin: 0 auto;
19
+ background-color: #ffffff;
20
+ padding: 20px;
21
+ border-radius: 5px;
22
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 20px;
27
+ color: #000;
28
+ margin-bottom: 20px;
29
+ }
30
+
31
+ p {
32
+ line-height: 1.6;
33
+ margin: 10px 0;
34
+ }
35
+
36
+ .credentials {
37
+ font-weight: bold;
38
+ margin-top: 10px;
39
+ }
40
+
41
+ a {
42
+ color: #007bff;
43
+ text-decoration: none;
44
+ }
45
+
46
+ a:hover {
47
+ text-decoration: underline;
48
+ }
49
+
50
+ .footer {
51
+ font-size: 12px;
52
+ color: #777;
53
+ margin-top: 20px;
54
+ text-align: center;
55
+ }
56
+ </style>
57
+ </head>
58
+
59
+ <body>
60
+ <div class="email-container">
61
+ <h1>Відновлення пароля до
62
+ <a target="_blank" href="{{protocol}}://{{host}}">кабінету геодезиста</a>
63
+ </h1>
64
+ <p class="credentials">
65
+ Логін: <strong>{{login}}</strong>
66
+ </p>
67
+ <p>
68
+ Щоб встановити новий пароль, відкрийте це посилання або скопіюйте його в адресний рядок вашого браузера:<br>
69
+ <a target="_blank" href="{{resetUrl}}">{{resetUrl}}</a>
70
+ </p>
71
+ <p>Посилання дійсне протягом 1 години і може бути використане лише один раз.</p>
72
+ <p>Якщо ви не надсилали запит на відновлення пароля, проігноруйте цей лист — ваш поточний пароль залишиться без змін.</p>
73
+ <div class="footer">
74
+ Це автоматично створений лист, будь ласка, не відповідайте на нього.
75
+ </div>
76
+ </div>
77
+ </body>
78
+
79
+ </html>
@@ -28,7 +28,7 @@ const protocol = grpc.loadPackageDefinition(definition) as unknown as {
28
28
  };
29
29
 
30
30
  export async function convertVector(input: ConvertInput): Promise<unknown> {
31
- const address = process.env.MAPNIK_SERVER?.trim();
31
+ const address = process.env.MAPNIK_SERVER?.trim() || process.env?.['mapnik.server'];
32
32
  if (!address) {
33
33
  throw new FCoreError("VECTOR_CONVERTER_UNAVAILABLE", "Не налаштовано MAPNIK_SERVER", 503);
34
34
  }