@7365admin1/layer-common 4.73.1-staging.455 → 4.74.0
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.
- package/CHANGELOG.md +15 -4
- package/assets/css/primitives.css +0 -43
- package/components/AccessCardPreviewDialog.vue +50 -286
- package/components/AppSelect.vue +3 -77
- package/components/BuildingUnitFormEdit.vue +0 -6
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +17 -74
- package/components/HidIntercomManagement.vue +14 -183
- package/components/HidQrCodeConfiguration.vue +195 -17
- package/components/HidReaderManagement.vue +0 -398
- package/components/HidReaderUserRoster.vue +3 -44
- package/components/HidUserEnrollment.vue +155 -845
- package/components/InvitationClientForm.vue +1 -19
- package/components/MemberMain.vue +14 -66
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +5 -267
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -165
- package/composables/useHidNavigation.ts +1 -25
- package/composables/useMember.ts +0 -16
- package/composables/usePeople.ts +0 -19
- package/composables/useServiceProvider.ts +2 -33
- package/package.json +1 -1
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/member.d.ts +0 -4
- package/types/people.d.ts +1 -28
- package/types/service-provider.d.ts +0 -5
- package/utils/role.ts +5 -37
- package/components/BuildingUnitManagement.vue +0 -298
- package/components/HidAccessPermissions.vue +0 -424
- package/components/HidProfileQrCode.vue +0 -332
- package/composables/useHidReaderSelection.ts +0 -50
- package/composables/useSiteCategory.ts +0 -45
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
- package/utils/hid-permission-assignments.ts +0 -190
- package/utils/hid-reader-selection.ts +0 -52
- package/utils/occupancy-role.ts +0 -109
- package/utils/service-type.ts +0 -30
|
@@ -28,22 +28,6 @@ export type HidReaderPayload = {
|
|
|
28
28
|
lastCallbackType?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export type HidProfileQr = {
|
|
32
|
-
readerId: string;
|
|
33
|
-
userId: string;
|
|
34
|
-
memberId: string;
|
|
35
|
-
hidUserId: string;
|
|
36
|
-
registration: string;
|
|
37
|
-
readerName: string;
|
|
38
|
-
portalName: string;
|
|
39
|
-
qrEnabled: boolean;
|
|
40
|
-
issued: boolean;
|
|
41
|
-
qrValue: string;
|
|
42
|
-
issuedAt: string;
|
|
43
|
-
/** null when the permission lookup itself failed, so "unknown" stays distinct from "no". */
|
|
44
|
-
assigned: boolean | null;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
31
|
type HidIdentityPayload = {
|
|
48
32
|
site?: string;
|
|
49
33
|
hidUserId?: string | number;
|
|
@@ -155,28 +139,6 @@ export type HidSipAccountData = {
|
|
|
155
139
|
provisionedAt: string;
|
|
156
140
|
};
|
|
157
141
|
|
|
158
|
-
/** One row of the site's SIP account list - who owns the extension, never its password. */
|
|
159
|
-
export type HidSipAccountListItem = {
|
|
160
|
-
_id: string;
|
|
161
|
-
userId: string;
|
|
162
|
-
name: string;
|
|
163
|
-
email: string;
|
|
164
|
-
/**
|
|
165
|
-
* What the owner is called after their name on the contact list: their
|
|
166
|
-
* "Blk 1/Level 1/Unit 1" when they live here, and their membership type -
|
|
167
|
-
* "Security Agency" - when they do not. "" only when the site knows neither.
|
|
168
|
-
*
|
|
169
|
-
* Optional because an API still on the `@7365admin1/core` release that
|
|
170
|
-
* predates it answers without the field; the contact picker falls back to the
|
|
171
|
-
* bare name rather than showing a dangling separator.
|
|
172
|
-
*/
|
|
173
|
-
unitLabel?: string;
|
|
174
|
-
extension: string;
|
|
175
|
-
username: string;
|
|
176
|
-
status: string;
|
|
177
|
-
provisionedAt: string;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
142
|
/**
|
|
181
143
|
* True only for the specific validation error an API that predates core #1878
|
|
182
144
|
* returns when the discover body carries `site`. Deliberately narrow: after
|
|
@@ -204,36 +166,6 @@ export default function useHidAmico() {
|
|
|
204
166
|
});
|
|
205
167
|
}
|
|
206
168
|
|
|
207
|
-
/**
|
|
208
|
-
* The signed-in member's own QR code on one reader.
|
|
209
|
-
*
|
|
210
|
-
* No user id in the path: the server takes the caller from the session, so
|
|
211
|
-
* these cannot be pointed at somebody else. `assigned` in the response says
|
|
212
|
-
* whether the HID permissions screen actually admits this member to the
|
|
213
|
-
* reader - issuing a code does not grant access, and the screen has to be
|
|
214
|
-
* able to say so.
|
|
215
|
-
*/
|
|
216
|
-
function getProfileQr(readerId: string) {
|
|
217
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
218
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
219
|
-
{ method: "GET" },
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function issueProfileQr(readerId: string) {
|
|
224
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
225
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
226
|
-
{ method: "POST" },
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function deleteProfileQr(readerId: string) {
|
|
231
|
-
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
232
|
-
`${basePath}/readers/${readerId}/profile-qr`,
|
|
233
|
-
{ method: "DELETE" },
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
169
|
function createReader(payload: HidReaderPayload) {
|
|
238
170
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers`, {
|
|
239
171
|
method: "POST",
|
|
@@ -325,36 +257,6 @@ export default function useHidAmico() {
|
|
|
325
257
|
});
|
|
326
258
|
}
|
|
327
259
|
|
|
328
|
-
/**
|
|
329
|
-
* Which credentials a reader accepts at the door.
|
|
330
|
-
*
|
|
331
|
-
* Separate from `setReaderConfiguration` on purpose. That one is the generic
|
|
332
|
-
* configuration endpoint, gated by an allowlist of writable objects; this is
|
|
333
|
-
* a dedicated route that validates the four methods against the reader's own
|
|
334
|
-
* `capabilities` and confirms the write by reading the device back, so a
|
|
335
|
-
* refusal here names the credential the hardware would not take.
|
|
336
|
-
*/
|
|
337
|
-
function setReaderIdentificationMethods(readerId: string, payload: HidApiRecord) {
|
|
338
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
339
|
-
`${basePath}/readers/${readerId}/identification-methods`,
|
|
340
|
-
{ method: "PUT", body: payload },
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Put a reader back to the settings iService holds for it.
|
|
346
|
-
*
|
|
347
|
-
* A POST rather than a GET because it WRITES: reading the reader's
|
|
348
|
-
* configuration is only the first half, and anything that drifted is
|
|
349
|
-
* re-applied before this returns.
|
|
350
|
-
*/
|
|
351
|
-
function reconcileReaderIdentificationMethods(readerId: string) {
|
|
352
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
353
|
-
`${basePath}/readers/${readerId}/identification-methods/reconcile`,
|
|
354
|
-
{ method: "POST" },
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
260
|
function getIdentities(readerId: string, query: HidApiRecord = {}) {
|
|
359
261
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers/${readerId}/identities`, {
|
|
360
262
|
method: "GET",
|
|
@@ -512,27 +414,6 @@ export default function useHidAmico() {
|
|
|
512
414
|
);
|
|
513
415
|
}
|
|
514
416
|
|
|
515
|
-
function getUserPasswordStatus(readerId: string, hidUserId: string | number) {
|
|
516
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
517
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
518
|
-
{ method: "GET" },
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
function setUserPassword(readerId: string, hidUserId: string | number, password: string) {
|
|
523
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
524
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
525
|
-
{ method: "PUT", body: { password } },
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function deleteUserPassword(readerId: string, hidUserId: string | number) {
|
|
530
|
-
return useNuxtApp().$api<HidApiRecord>(
|
|
531
|
-
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
532
|
-
{ method: "DELETE" },
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
417
|
function deleteUserPin(readerId: string, hidUserId: string | number) {
|
|
537
418
|
return useNuxtApp().$api<{ data: { pinEnrolled: boolean } }>(
|
|
538
419
|
`${basePath}/readers/${readerId}/users/${hidUserId}/pin`,
|
|
@@ -593,42 +474,6 @@ export default function useHidAmico() {
|
|
|
593
474
|
);
|
|
594
475
|
}
|
|
595
476
|
|
|
596
|
-
/**
|
|
597
|
-
* The site's SIP accounts for the intercom contact picker. Site-scoped only:
|
|
598
|
-
* the organisation never decided who may read this — the site guard does —
|
|
599
|
-
* and sending one narrowed the list on a customer site whose accounts were
|
|
600
|
-
* provisioned by a managing agent.
|
|
601
|
-
*/
|
|
602
|
-
function getSipAccounts(siteId: string) {
|
|
603
|
-
return useNuxtApp().$api<{ data: HidSipAccountListItem[] }>(
|
|
604
|
-
`${basePath}/sites/${siteId}/intercom/sip-accounts`,
|
|
605
|
-
{ method: "GET" },
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Wake the resident's phone for a call the web phone has just placed.
|
|
611
|
-
*
|
|
612
|
-
* The SIP INVITE is the call and travels over the WebSocket, not through the
|
|
613
|
-
* API; this only rings the resident's mobile so somebody is there to answer
|
|
614
|
-
* it. It is therefore fired after the INVITE and never awaited in a way that
|
|
615
|
-
* could fail the call — see `startWebCall` in `HidIntercomManagement.vue`.
|
|
616
|
-
*
|
|
617
|
-
* `notified: false` with a reason is a normal response, not an error: staff
|
|
618
|
-
* extensions and external SIP addresses have no resident behind them.
|
|
619
|
-
*/
|
|
620
|
-
function notifyIntercomCall(
|
|
621
|
-
siteId: string,
|
|
622
|
-
payload: { orgId: string; destination: string; callId: string; readerId?: string },
|
|
623
|
-
) {
|
|
624
|
-
return useNuxtApp().$api<{
|
|
625
|
-
data: { notified: boolean; delivered?: number; reason?: string };
|
|
626
|
-
}>(
|
|
627
|
-
`${basePath}/sites/${siteId}/intercom/notify-call`,
|
|
628
|
-
{ method: "POST", body: payload },
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
477
|
function getPermissionCandidates(
|
|
633
478
|
siteId: string,
|
|
634
479
|
query: {
|
|
@@ -660,9 +505,6 @@ export default function useHidAmico() {
|
|
|
660
505
|
|
|
661
506
|
return {
|
|
662
507
|
getReaders,
|
|
663
|
-
getProfileQr,
|
|
664
|
-
issueProfileQr,
|
|
665
|
-
deleteProfileQr,
|
|
666
508
|
discoverReader,
|
|
667
509
|
createReader,
|
|
668
510
|
updateReader,
|
|
@@ -677,8 +519,6 @@ export default function useHidAmico() {
|
|
|
677
519
|
issueVisitorQr,
|
|
678
520
|
getReaderConfiguration,
|
|
679
521
|
setReaderConfiguration,
|
|
680
|
-
setReaderIdentificationMethods,
|
|
681
|
-
reconcileReaderIdentificationMethods,
|
|
682
522
|
getLogs,
|
|
683
523
|
setUserImage,
|
|
684
524
|
deleteUserImage,
|
|
@@ -690,9 +530,6 @@ export default function useHidAmico() {
|
|
|
690
530
|
getUserPinStatus,
|
|
691
531
|
setUserPin,
|
|
692
532
|
deleteUserPin,
|
|
693
|
-
getUserPasswordStatus,
|
|
694
|
-
setUserPassword,
|
|
695
|
-
deleteUserPassword,
|
|
696
533
|
getIdentities,
|
|
697
534
|
getReaderUsers,
|
|
698
535
|
getReaderAccessLogs,
|
|
@@ -703,8 +540,6 @@ export default function useHidAmico() {
|
|
|
703
540
|
makeIntercomCall,
|
|
704
541
|
finalizeIntercomCall,
|
|
705
542
|
ensureSipAccount,
|
|
706
|
-
getSipAccounts,
|
|
707
|
-
notifyIntercomCall,
|
|
708
543
|
getSitePermissions,
|
|
709
544
|
getPermissionCandidates,
|
|
710
545
|
updateSitePermissions,
|
|
@@ -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-
|
|
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
|
},
|
package/composables/useMember.ts
CHANGED
|
@@ -70,22 +70,15 @@ 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
|
-
people = false,
|
|
76
73
|
} = {}) {
|
|
77
74
|
const query: Record<string, any> = { page, limit, type, status };
|
|
78
75
|
|
|
79
|
-
// Organization app Members: every person, site-limited ones as one row
|
|
80
|
-
// with `limitedTo` (core 2026-09-29). Only sent when asked for.
|
|
81
|
-
if (people) query.people = 1;
|
|
82
76
|
if (search) query.search = search;
|
|
83
77
|
// "other-site": only members holding a role pinned to another site.
|
|
84
78
|
if (roleState) query.roleState = roleState;
|
|
85
79
|
if (user) query.user = user;
|
|
86
80
|
if (org) query.org = org;
|
|
87
81
|
if (siteId) query.siteId = siteId;
|
|
88
|
-
if (unit) query.unit = unit;
|
|
89
82
|
return useNuxtApp().$api<Record<string, any>>("/api/members", {
|
|
90
83
|
method: "GET",
|
|
91
84
|
query,
|
|
@@ -161,14 +154,6 @@ export default function useMember() {
|
|
|
161
154
|
});
|
|
162
155
|
}
|
|
163
156
|
|
|
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
157
|
function getByUserTypeOrg(user: string, type: string, org: string) {
|
|
173
158
|
return useNuxtApp().$api<TMember>(
|
|
174
159
|
`/api/members/user/${user}/app/${type}/org`,
|
|
@@ -237,7 +222,6 @@ export default function useMember() {
|
|
|
237
222
|
undoCrossSiteRoleFix,
|
|
238
223
|
getSiteAccess,
|
|
239
224
|
saveSiteAccess,
|
|
240
|
-
updateMemberUnit,
|
|
241
225
|
members,
|
|
242
226
|
member,
|
|
243
227
|
page,
|
package/composables/usePeople.ts
CHANGED
|
@@ -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,9 +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
18
|
};
|
|
22
19
|
|
|
23
20
|
export type TSiteProviderCompany = {
|
|
@@ -93,8 +90,6 @@ export default function useServiceProvider() {
|
|
|
93
90
|
status = "",
|
|
94
91
|
/** "engagements": also providers engaged through an accepted invitation. */
|
|
95
92
|
include = "",
|
|
96
|
-
/** A building unit id, or "none": providers on no unit yet. */
|
|
97
|
-
unit = "",
|
|
98
93
|
} = {}) {
|
|
99
94
|
return useNuxtApp().$api<Record<string, any>>("/api/service-providers", {
|
|
100
95
|
method: "GET",
|
|
@@ -107,7 +102,6 @@ export default function useServiceProvider() {
|
|
|
107
102
|
siteId,
|
|
108
103
|
...(status ? { status } : {}),
|
|
109
104
|
...(include ? { include } : {}),
|
|
110
|
-
...(unit ? { unit } : {}),
|
|
111
105
|
},
|
|
112
106
|
});
|
|
113
107
|
}
|
|
@@ -275,17 +269,6 @@ export default function useServiceProvider() {
|
|
|
275
269
|
);
|
|
276
270
|
}
|
|
277
271
|
|
|
278
|
-
/** Attach a provider to a building unit, or detach it (`unit` ""). */
|
|
279
|
-
async function updateUnit(id: string, unit: string) {
|
|
280
|
-
return useNuxtApp().$api<Record<string, any>>(
|
|
281
|
-
`/api/service-providers/${id}/unit`,
|
|
282
|
-
{
|
|
283
|
-
method: "PATCH",
|
|
284
|
-
body: { unit },
|
|
285
|
-
}
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
272
|
async function getByEmail({
|
|
290
273
|
email = "",
|
|
291
274
|
orgId = "",
|
|
@@ -310,29 +293,17 @@ export default function useServiceProvider() {
|
|
|
310
293
|
* Members > Service Providers: the provider people with access to this
|
|
311
294
|
* site, and one entry per provider company with its head count. The
|
|
312
295
|
* site's own organisation only - the server refuses anyone else.
|
|
313
|
-
* `unit`: a building unit id, or "none" (people on no unit yet).
|
|
314
296
|
*/
|
|
315
|
-
function getSiteMembers(siteId: string
|
|
297
|
+
function getSiteMembers(siteId: string): Promise<{
|
|
316
298
|
items: TSiteProviderMember[];
|
|
317
299
|
companies: TSiteProviderCompany[];
|
|
318
300
|
}> {
|
|
319
301
|
return useNuxtApp().$api("/api/service-providers/site-members", {
|
|
320
302
|
method: "GET",
|
|
321
|
-
query: { siteId
|
|
303
|
+
query: { siteId },
|
|
322
304
|
});
|
|
323
305
|
}
|
|
324
306
|
|
|
325
|
-
/** Attach one of those people to a building unit, or detach them (`unit` ""). */
|
|
326
|
-
function updateSiteMemberUnit(id: string, unit: string) {
|
|
327
|
-
return useNuxtApp().$api<Record<string, any>>(
|
|
328
|
-
`/api/service-providers/site-members/${id}/unit`,
|
|
329
|
-
{
|
|
330
|
-
method: "PATCH",
|
|
331
|
-
body: { unit },
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
307
|
/** The same list as an Excel file, under the same filters. */
|
|
337
308
|
function exportSiteMembers(
|
|
338
309
|
siteId: string,
|
|
@@ -349,7 +320,6 @@ export default function useServiceProvider() {
|
|
|
349
320
|
|
|
350
321
|
return {
|
|
351
322
|
getSiteMembers,
|
|
352
|
-
updateSiteMemberUnit,
|
|
353
323
|
exportSiteMembers,
|
|
354
324
|
serviceProviders,
|
|
355
325
|
serviceProvider,
|
|
@@ -368,7 +338,6 @@ export default function useServiceProvider() {
|
|
|
368
338
|
add,
|
|
369
339
|
addViaInvite,
|
|
370
340
|
updateStatus,
|
|
371
|
-
updateUnit,
|
|
372
341
|
getByEmail,
|
|
373
342
|
};
|
|
374
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.
|
|
5
|
+
"version": "4.74.0",
|
|
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 physical HID cards."
|
|
7
7
|
>
|
|
8
|
-
<HidUserEnrollment :site="siteId"
|
|
8
|
+
<HidUserEnrollment :site="siteId" card-management />
|
|
9
9
|
</HidEnabledGate>
|
|
10
10
|
</v-container>
|
|
11
11
|
</template>
|
package/types/document.d.ts
CHANGED
|
@@ -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
|
};
|
package/types/facility.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 = {
|
package/utils/role.ts
CHANGED
|
@@ -36,28 +36,12 @@ export function withCurrentRole<T extends { _id?: unknown; name?: unknown }>(
|
|
|
36
36
|
* a member showed "Security" and Assign Role could not fix it). Rows from an
|
|
37
37
|
* older server carry no `roleState` and render exactly as before.
|
|
38
38
|
*/
|
|
39
|
-
export function memberRoleChip(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
limitedTo?: unknown;
|
|
45
|
-
},
|
|
46
|
-
/** The Organization app's Members list: there is no "this site" there. */
|
|
47
|
-
orgLevel = false,
|
|
48
|
-
): { text: string; tone: "info" | "warn" } | null {
|
|
39
|
+
export function memberRoleChip(item: {
|
|
40
|
+
roleName?: unknown;
|
|
41
|
+
roleState?: unknown;
|
|
42
|
+
roleSiteName?: unknown;
|
|
43
|
+
}): { text: string; tone: "info" | "warn" } | null {
|
|
49
44
|
const name = typeof item?.roleName === "string" ? item.roleName : "";
|
|
50
|
-
const limited = limitedSites(item);
|
|
51
|
-
if (orgLevel && limited.length) {
|
|
52
|
-
return {
|
|
53
|
-
text: limited.map((l) => `${l.roleName || "No role"} (${l.siteName || "a site"})`).join(", "),
|
|
54
|
-
tone: "info",
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
if (orgLevel && item?.roleState === "other-site") {
|
|
58
|
-
const site = typeof item?.roleSiteName === "string" && item.roleSiteName ? item.roleSiteName : "";
|
|
59
|
-
return { text: site ? `${name || "Role"} (${site})` : name || "Role", tone: "info" };
|
|
60
|
-
}
|
|
61
45
|
switch (item?.roleState) {
|
|
62
46
|
case "missing":
|
|
63
47
|
return { text: "No role assigned - assign one", tone: "warn" };
|
|
@@ -111,19 +95,3 @@ export function safeReturnTo(value: unknown): string {
|
|
|
111
95
|
const path = Array.isArray(value) ? value[0] : value;
|
|
112
96
|
return typeof path === "string" && /^\/(?!\/)[^\s\\]*$/.test(path) ? path : "";
|
|
113
97
|
}
|
|
114
|
-
|
|
115
|
-
type TLimitedSite = { siteId?: string; siteName?: string; roleName?: string };
|
|
116
|
-
|
|
117
|
-
/** The sites a site-limited person may open (server `limitedTo`; org Members). */
|
|
118
|
-
export function limitedSites(item: { limitedTo?: unknown } | null | undefined): TLimitedSite[] {
|
|
119
|
-
return Array.isArray(item?.limitedTo) ? (item!.limitedTo as TLimitedSite[]) : [];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* The Organization app's Members "Sites" cell (owner report 2026-09-29, Aigle
|
|
124
|
-
* / Kanesan): a person limited to sites stays on the list and says where.
|
|
125
|
-
*/
|
|
126
|
-
export function siteAccessLabel(item: { limitedTo?: unknown } | null | undefined): string {
|
|
127
|
-
const names = limitedSites(item).map((l) => l.siteName || "a site");
|
|
128
|
-
return names.length ? `Limited to: ${names.join(", ")}` : "All sites";
|
|
129
|
-
}
|