@7365admin1/layer-common 4.81.1-staging.468 → 4.81.1

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 (50) hide show
  1. package/CHANGELOG.md +10 -4
  2. package/assets/css/primitives.css +0 -57
  3. package/assets/css/robot-hero.css +0 -3
  4. package/components/AccessCardDetailsDialog.vue +4 -57
  5. package/components/AccessCardPreviewDialog.vue +50 -291
  6. package/components/AppSelect.vue +4 -143
  7. package/components/BuildingUnitFormEdit.vue +0 -6
  8. package/components/Dialog/UpdateMoreAction.vue +1 -11
  9. package/components/DocumentForm.vue +112 -407
  10. package/components/DocumentManagement.vue +12 -213
  11. package/components/Facility/BookingSetup.vue +0 -63
  12. package/components/HidAccessLogDashboard.vue +17 -74
  13. package/components/HidIntercomManagement.vue +14 -183
  14. package/components/HidQrCodeConfiguration.vue +195 -17
  15. package/components/HidReaderManagement.vue +0 -398
  16. package/components/HidReaderUserRoster.vue +3 -44
  17. package/components/HidUserEnrollment.vue +248 -1521
  18. package/components/InvitationClientForm.vue +1 -19
  19. package/components/Robot/Detail.vue +1 -6
  20. package/components/VisitorForm.vue +0 -12
  21. package/components/VisitorManagement.vue +5 -267
  22. package/composables/useDocument.ts +0 -7
  23. package/composables/useFacility.ts +0 -11
  24. package/composables/useHidAmico.ts +0 -165
  25. package/composables/useHidNavigation.ts +1 -25
  26. package/composables/useMember.ts +0 -12
  27. package/composables/usePeople.ts +0 -19
  28. package/composables/useServiceProvider.ts +2 -40
  29. package/package.json +1 -1
  30. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
  31. package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
  32. package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
  33. package/types/document.d.ts +0 -14
  34. package/types/facility.d.ts +0 -4
  35. package/types/member.d.ts +0 -4
  36. package/types/people.d.ts +1 -28
  37. package/types/service-provider.d.ts +0 -5
  38. package/utils/robot-display.ts +2 -25
  39. package/components/BuildingUnitManagement.vue +0 -298
  40. package/components/HidAccessPermissions.vue +0 -424
  41. package/components/HidProfileQrCode.vue +0 -332
  42. package/components/Robot/FaultClearSteps.vue +0 -11
  43. package/composables/useHidReaderSelection.ts +0 -50
  44. package/composables/useSiteCategory.ts +0 -45
  45. package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
  46. package/utils/hid-enrolment-subject.ts +0 -144
  47. package/utils/hid-permission-assignments.ts +0 -190
  48. package/utils/hid-reader-selection.ts +0 -52
  49. package/utils/occupancy-role.ts +0 -109
  50. package/utils/service-type.ts +0 -30
@@ -46,33 +46,9 @@ export default function useHidNavigation() {
46
46
  },
47
47
  },
48
48
  {
49
- // "HID Reader Users" now points at `access-mgmt/administrator`, not at
50
- // `access-mgmt/hid-users`.
51
- //
52
- // Both routes mount a roster of the reader's users, but only this one
53
- // can act on them. `administrator` renders HidUserEnrollment WITHOUT
54
- // `card-management`, and that prop is what gates the Enroll action:
55
- // <template v-if="!props.cardManagement" #actions>
56
- // `hid-users` renders HidReaderUserRoster, which is read-only apart
57
- // from PIN management. So the menu entry with this name used to lead
58
- // to the screen that cannot enrol, while the screen that can was
59
- // reachable only by typing the URL.
60
- //
61
- // `hid-users` is left in place and simply unlisted - the same state
62
- // `administrator` was in - so any existing link to it still resolves.
63
49
  title: "HID Reader Users",
64
50
  route: {
65
- name: "org-site-access-mgmt-administrator",
66
- params: { org, site },
67
- },
68
- },
69
- {
70
- // The signed-in member's own pass, not somebody else's. Every other
71
- // entry in this group acts on a resident or a visitor; this one has
72
- // no subject but the caller.
73
- title: "HID QR Code",
74
- route: {
75
- name: "org-site-access-mgmt-hid-qr-code",
51
+ name: "org-site-access-mgmt-hid-users",
76
52
  params: { org, site },
77
53
  },
78
54
  },
@@ -70,8 +70,6 @@ export default function useMember() {
70
70
  status = "active",
71
71
  siteId = "",
72
72
  roleState = "",
73
- /** A building unit id, or "none": members on no unit yet. */
74
- unit = "",
75
73
  people = false,
76
74
  } = {}) {
77
75
  const query: Record<string, any> = { page, limit, type, status };
@@ -85,7 +83,6 @@ export default function useMember() {
85
83
  if (user) query.user = user;
86
84
  if (org) query.org = org;
87
85
  if (siteId) query.siteId = siteId;
88
- if (unit) query.unit = unit;
89
86
  return useNuxtApp().$api<Record<string, any>>("/api/members", {
90
87
  method: "GET",
91
88
  query,
@@ -161,14 +158,6 @@ export default function useMember() {
161
158
  });
162
159
  }
163
160
 
164
- /** Attach a member to a building unit, or detach them (`unit` ""). */
165
- function updateMemberUnit(id: string, unit: string) {
166
- return useNuxtApp().$api<Record<string, any>>("/api/members/unit", {
167
- method: "PUT",
168
- body: { id, unit },
169
- });
170
- }
171
-
172
161
  function getByUserTypeOrg(user: string, type: string, org: string) {
173
162
  return useNuxtApp().$api<TMember>(
174
163
  `/api/members/user/${user}/app/${type}/org`,
@@ -237,7 +226,6 @@ export default function useMember() {
237
226
  undoCrossSiteRoleFix,
238
227
  getSiteAccess,
239
228
  saveSiteAccess,
240
- updateMemberUnit,
241
229
  members,
242
230
  member,
243
231
  page,
@@ -115,24 +115,6 @@ export default function () {
115
115
  });
116
116
  }
117
117
 
118
- /**
119
- * The blocks, levels and units at a site that actually have an occupant.
120
- * The other half of the unit picker: this narrows the cascade, then
121
- * `getPeopleByUnit` answers "which person in this unit?".
122
- */
123
- async function getOccupiedStructure(
124
- site: string,
125
- { type = "", status = "active", block = "", level = "" } = {}
126
- ) {
127
- return await useNuxtApp().$api<Record<string, any>>(
128
- `/api/people/site/${site}/occupied-structure`,
129
- {
130
- method: "GET",
131
- query: { type, status, block, level },
132
- }
133
- );
134
- }
135
-
136
118
  async function getPeopleByUnit(
137
119
  _id: string,
138
120
  { status = "active", type = "" } = {}
@@ -166,7 +148,6 @@ export default function () {
166
148
  findPersonByPlateNumberMultipleResult,
167
149
  findPersonByContact,
168
150
  getPeopleByUnit,
169
- getOccupiedStructure,
170
151
  searchCompanyList,
171
152
  findUsersByPlateNumber,
172
153
  reviewResidentPerson,
@@ -15,16 +15,6 @@ export type TSiteProviderMember = {
15
15
  lastLoginAt?: string | null;
16
16
  /** a subcontractor: the provider that brought its company onto the site */
17
17
  invitedVia?: string;
18
- /** The building unit this person is attached to (a unit's Management tab). */
19
- unit?: string | null;
20
- unitName?: string;
21
- /**
22
- * The person's user account. NOT yet returned by the endpoint — the
23
- * repository projects it but the service layer drops it. Anything acting on
24
- * the PERSON (assigning an access card writes it onto the card as `userId`)
25
- * needs this rather than `_id`, which identifies the membership.
26
- */
27
- user?: string | null;
28
18
  };
29
19
 
30
20
  export type TSiteProviderCompany = {
@@ -100,8 +90,6 @@ export default function useServiceProvider() {
100
90
  status = "",
101
91
  /** "engagements": also providers engaged through an accepted invitation. */
102
92
  include = "",
103
- /** A building unit id, or "none": providers on no unit yet. */
104
- unit = "",
105
93
  } = {}) {
106
94
  return useNuxtApp().$api<Record<string, any>>("/api/service-providers", {
107
95
  method: "GET",
@@ -114,7 +102,6 @@ export default function useServiceProvider() {
114
102
  siteId,
115
103
  ...(status ? { status } : {}),
116
104
  ...(include ? { include } : {}),
117
- ...(unit ? { unit } : {}),
118
105
  },
119
106
  });
120
107
  }
@@ -282,17 +269,6 @@ export default function useServiceProvider() {
282
269
  );
283
270
  }
284
271
 
285
- /** Attach a provider to a building unit, or detach it (`unit` ""). */
286
- async function updateUnit(id: string, unit: string) {
287
- return useNuxtApp().$api<Record<string, any>>(
288
- `/api/service-providers/${id}/unit`,
289
- {
290
- method: "PATCH",
291
- body: { unit },
292
- }
293
- );
294
- }
295
-
296
272
  async function getByEmail({
297
273
  email = "",
298
274
  orgId = "",
@@ -317,29 +293,17 @@ export default function useServiceProvider() {
317
293
  * Members > Service Providers: the provider people with access to this
318
294
  * site, and one entry per provider company with its head count. The
319
295
  * site's own organisation only - the server refuses anyone else.
320
- * `unit`: a building unit id, or "none" (people on no unit yet).
321
296
  */
322
- function getSiteMembers(siteId: string, unit = ""): Promise<{
297
+ function getSiteMembers(siteId: string): Promise<{
323
298
  items: TSiteProviderMember[];
324
299
  companies: TSiteProviderCompany[];
325
300
  }> {
326
301
  return useNuxtApp().$api("/api/service-providers/site-members", {
327
302
  method: "GET",
328
- query: { siteId, ...(unit ? { unit } : {}) },
303
+ query: { siteId },
329
304
  });
330
305
  }
331
306
 
332
- /** Attach one of those people to a building unit, or detach them (`unit` ""). */
333
- function updateSiteMemberUnit(id: string, unit: string) {
334
- return useNuxtApp().$api<Record<string, any>>(
335
- `/api/service-providers/site-members/${id}/unit`,
336
- {
337
- method: "PATCH",
338
- body: { unit },
339
- }
340
- );
341
- }
342
-
343
307
  /** The same list as an Excel file, under the same filters. */
344
308
  function exportSiteMembers(
345
309
  siteId: string,
@@ -356,7 +320,6 @@ export default function useServiceProvider() {
356
320
 
357
321
  return {
358
322
  getSiteMembers,
359
- updateSiteMemberUnit,
360
323
  exportSiteMembers,
361
324
  serviceProviders,
362
325
  serviceProvider,
@@ -375,7 +338,6 @@ export default function useServiceProvider() {
375
338
  add,
376
339
  addViaInvite,
377
340
  updateStatus,
378
- updateUnit,
379
341
  getByEmail,
380
342
  };
381
343
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.81.1-staging.468",
5
+ "version": "4.81.1",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -5,7 +5,7 @@
5
5
  :org="orgId"
6
6
  message="Enable HID as a service for this site before managing HID users."
7
7
  >
8
- <HidUserEnrollment :site="siteId" :org="orgId" />
8
+ <HidUserEnrollment :site="siteId" />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -5,7 +5,7 @@
5
5
  :org="orgId"
6
6
  message="Enable HID as a service for this site before managing physical HID cards."
7
7
  >
8
- <HidUserEnrollment :site="siteId" :org="orgId" card-management />
8
+ <HidUserEnrollment :site="siteId" card-management />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -5,7 +5,7 @@
5
5
  :org="orgId"
6
6
  message="Enable HID as a service for this site before managing HID readers."
7
7
  >
8
- <HidReaderManagement :site="siteId" :org="orgId" />
8
+ <HidReaderManagement :site="siteId" />
9
9
  </HidEnabledGate>
10
10
  </v-container>
11
11
  </template>
@@ -3,18 +3,4 @@ declare type TDocument = {
3
3
  name: string;
4
4
  attachment: string;
5
5
  type: string;
6
- /**
7
- * Set at upload or renewal, absent when the document never expires.
8
- *
9
- * An ISO instant on the way out of the API and a `YYYY-MM-DD` string on the
10
- * way back in, which is what `InputDatePicker` binds to - hence the loose
11
- * type rather than `string`.
12
- */
13
- expiryDate?: string | Date | null;
14
- remarks?: string;
15
- size?: number;
16
- parentId?: string | null;
17
- createdAt?: string | Date;
18
- updatedAt?: string | Date;
19
- status?: string;
20
6
  };
@@ -73,10 +73,6 @@ declare type TFacility = {
73
73
  hourInterval?: number;
74
74
  isBookingFeeEnabled: boolean;
75
75
  isGuestEnabled: boolean;
76
- /** Residents may complete this facility's checklist themselves. */
77
- isResidentChecklistEnabled?: boolean;
78
- /** Security may complete it. Mutually exclusive with the above. */
79
- isSecurityChecklistEnabled?: boolean;
80
76
  bookingAmount: number | null;
81
77
  peakBookingFeeAmount?: number | null;
82
78
  bookingFeeGuestAmount?: number | null;
package/types/member.d.ts CHANGED
@@ -10,10 +10,6 @@ declare type TMember = {
10
10
  customerOrgId?: string;
11
11
  customerSiteId?: string;
12
12
  status?: string;
13
- email?: string;
14
- /** The building unit this member manages (a unit's Management tab). */
15
- unit?: string | null;
16
- unitName?: string;
17
13
  createdAt?: string;
18
14
  updatedAt?: string;
19
15
  deletedAt?: string;
package/types/people.d.ts CHANGED
@@ -22,38 +22,11 @@ declare type TPeople = {
22
22
  email?: string;
23
23
  files?: { name: string, id: string }[];
24
24
  isOwner?: boolean;
25
- /**
26
- * Owner / occupant / person-in-charge, as the BUSINESS people form asks it.
27
- * Absent on everyone else - `isOwner` is still the flag that decides unit
28
- * ownership, and the server derives it from this when it is sent. See
29
- * `OccupancyRoles` in core's `person.model.ts`.
30
- */
31
- occupancyRole?: TOccupancyRole;
32
- // Link to this person's `users` row. Empty for the person types that carry
33
- // no login, and empty for a resident whose account was never written.
34
- user?: string;
35
- };
36
-
37
- declare type TOccupancyRole = "owner" | "occupant" | "person-in-charge";
38
-
39
- /** One standing and everything the product says about it. See `utils/occupancy-role.ts`. */
40
- declare type TOccupancyRoleOption = {
41
- value: TOccupancyRole;
42
- /** The label a stored role is printed with. */
43
- title: string;
44
- /** The row menu's wording. */
45
- action: string;
46
- /** The confirmation's heading and its sentence. */
47
- prompt: string;
48
- description: string;
49
25
  };
50
26
 
51
27
  declare type TPlateNumber = { plateNumber: string, recNo?: string, _id?: string, status: TVehicleStatus, type: TVehicleType, anprCameras?: TVehicleAnprCamera[] };
52
28
 
53
29
 
54
- // `""` is the FORM's "nothing picked yet" - it is stripped from the payload
55
- // before it is sent, because absence is what the server reads as "never
56
- // asked". See `PeopleFormMgmt.vue`.
57
- declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type" | "isOwner"> & { status?: string; user?: string; occupancyRole?: TOccupancyRole | "" }
30
+ declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type" | "isOwner"> & { status?: string }
58
31
 
59
32
  declare type TPeopleType = "guest" | "resident" | "tenant"
@@ -7,11 +7,6 @@ declare type TServiceProvider = {
7
7
  serviceProviderOrgId: string;
8
8
  type: string;
9
9
  nature: string;
10
- status?: string;
11
- email?: string;
12
- /** The building unit this provider serves (a unit's Management tab). */
13
- unit?: string | null;
14
- unitName?: string;
15
10
  };
16
11
 
17
12
  declare type TServiceProviderName = {
@@ -162,27 +162,6 @@ export function robotFaultText(state: { fault?: { message?: unknown; code?: unkn
162
162
  return text ? `Fault: ${text}` : null;
163
163
  }
164
164
 
165
- /**
166
- * The maker's steps to clear a fault on the robot itself (core `profile.clearFault`,
167
- * from its manual), shown only while the robot reports a fault. None = nothing shown.
168
- */
169
- export function robotClearFaultSteps(state: {
170
- fault?: unknown;
171
- profile?: { clearFault?: unknown } | null;
172
- } | null | undefined): string[] {
173
- const steps = state?.profile?.clearFault;
174
- if (!state?.fault || !Array.isArray(steps)) return [];
175
- return steps.filter((s): s is string => typeof s === "string" && !!s.trim()).map((s) => s.trim());
176
- }
177
-
178
- /** A fault's words without its code repeated in front ("306 · ..."), for a place that already shows the code. */
179
- export function faultWordsWithoutCode(fault: { code?: unknown; message?: unknown } | null | undefined): string {
180
- const code = typeof fault?.code === "string" ? fault.code.trim() : "";
181
- const message = typeof fault?.message === "string" ? fault.message.trim() : "";
182
- const prefix = `${code} · `;
183
- return code && message.startsWith(prefix) ? message.slice(prefix.length) : message || code;
184
- }
185
-
186
165
  /**
187
166
  * A small square around a clicked pixel, as the polygon a spot command takes.
188
167
  *
@@ -1859,12 +1838,10 @@ export function commandOutcome(
1859
1838
  if (elapsedMs < COMMAND_WATCH_MS) return null;
1860
1839
  const fault = typeof reading.fault?.message === "string" ? reading.fault.message : "";
1861
1840
  // The fault was already there when this command was sent: it is not this command's result.
1862
- // Core's fault words may end in a sentence ("... then send the task again."): no doubled period.
1863
- const faultWords = fault.replace(/\.\s*$/, "");
1864
1841
  if (fault && fault === input.faultBefore) {
1865
- return { ok: false, done: true, text: `${who} is still stopped by an earlier fault (${faultWords}). Clear it on the robot or in its maker's app, then try again.` };
1842
+ return { ok: false, done: true, text: `${who} is still stopped by an earlier fault (${fault}). Clear it on the robot or in its maker's app, then try again.` };
1866
1843
  }
1867
- const reason = reading.online === false ? "it stopped reporting" : faultWords || (said && !RESTING.test(said) ? said : "");
1844
+ const reason = reading.online === false ? "it stopped reporting" : fault || (said && !RESTING.test(said) ? said : "");
1868
1845
  return {
1869
1846
  ok: false,
1870
1847
  done: true,