@7365admin1/layer-common 4.82.1-staging.475 → 4.83.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 +10 -4
- package/assets/css/primitives.css +0 -57
- package/assets/css/screens.css +4 -8
- package/components/AccessCardDetailsDialog.vue +4 -57
- package/components/AccessCardPreviewDialog.vue +50 -291
- package/components/AppSelect.vue +4 -143
- package/components/AttendanceDetailsDialog.vue +1 -48
- package/components/AttendanceMain.vue +10 -104
- package/components/AttendanceSettingsDialog.vue +1 -53
- package/components/BuildingUnitFormEdit.vue +0 -6
- package/components/BulletinBoardView.vue +1 -1
- 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 +250 -1573
- package/components/InventoryMain.vue +2 -11
- package/components/InvitationClientForm.vue +1 -19
- package/components/MemberMain.vue +1 -2
- package/components/MyAttendanceMain.vue +2 -60
- package/components/NotificationBell.vue +2 -14
- package/components/RolePermissionMain.vue +2 -4
- package/components/TableMain.vue +7 -22
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +5 -267
- package/composables/useAttendance.ts +0 -53
- package/composables/useAttendancePermission.ts +0 -25
- package/composables/useCleaningPermission.ts +0 -5
- 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/useLandscapingPermission.ts +0 -5
- package/composables/useMember.ts +0 -12
- package/composables/usePeople.ts +0 -19
- package/composables/usePestControlPermission.ts +0 -5
- package/composables/usePoolMaintenancePermission.ts +0 -5
- package/composables/useSecurityPermission.ts +0 -5
- package/composables/useServiceProvider.ts +2 -40
- package/constants/permissions.ts +0 -1
- package/nuxt.config.ts +0 -18
- package/package.json +2 -4
- 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/plugins/API.ts +0 -16
- package/types/attendance.d.ts +1 -13
- 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/notification-target.ts +4 -43
- package/utils/role.ts +2 -15
- package/components/AttendanceProxyDialog.vue +0 -391
- 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/server/plugins/no-powered-by.ts +0 -7
- package/utils/access-suspended.ts +0 -18
- package/utils/attendance-proxy.ts +0 -110
- package/utils/hid-enrolment-subject.ts +0 -144
- 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/sanitize-html.ts +0 -16
- package/utils/security-headers.ts +0 -52
- package/utils/service-type.ts +0 -30
|
@@ -57,30 +57,6 @@ export function useAttendancePermission() {
|
|
|
57
57
|
);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
// Site device mode switch. Widened, never swapped: the new key OR the existing
|
|
61
|
-
// settings key OR `*` - the same three the server accepts (core
|
|
62
|
-
// `SITE_DEVICE_MODE_PERMISSIONS`), so an admin who manages attendance
|
|
63
|
-
// settings today can use it without a role change.
|
|
64
|
-
const canManageSiteDeviceMode = computed(() => {
|
|
65
|
-
if (!userAppRole.value) return false;
|
|
66
|
-
if (moduleDenied("attendance-mgmt")) return false;
|
|
67
|
-
if (userAppRole.value.permissions.includes("*")) return true;
|
|
68
|
-
return (
|
|
69
|
-
hasPermission(
|
|
70
|
-
userAppRole.value,
|
|
71
|
-
permissions,
|
|
72
|
-
"attendance-mgmt",
|
|
73
|
-
"manage-site-device-mode"
|
|
74
|
-
) ||
|
|
75
|
-
hasPermission(
|
|
76
|
-
userAppRole.value,
|
|
77
|
-
permissions,
|
|
78
|
-
"attendance-mgmt",
|
|
79
|
-
"manage-attendance-settings"
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
60
|
const canViewOwnAttendance = computed(() => {
|
|
85
61
|
if (!userAppRole.value) return false;
|
|
86
62
|
if (moduleDenied("my-attendance")) return false;
|
|
@@ -109,7 +85,6 @@ export function useAttendancePermission() {
|
|
|
109
85
|
canViewAllAttendance,
|
|
110
86
|
canViewAttendanceDetails,
|
|
111
87
|
canManageAttendanceSettings,
|
|
112
|
-
canManageSiteDeviceMode,
|
|
113
88
|
canViewOwnAttendance,
|
|
114
89
|
canCheckInOut,
|
|
115
90
|
};
|
|
@@ -221,11 +221,6 @@ export default function useCleaningPermission() {
|
|
|
221
221
|
description:
|
|
222
222
|
"Allows the user to configure and manage attendance settings.",
|
|
223
223
|
},
|
|
224
|
-
"manage-site-device-mode": {
|
|
225
|
-
check: true,
|
|
226
|
-
description:
|
|
227
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
228
|
-
},
|
|
229
224
|
},
|
|
230
225
|
// my attendance permissions
|
|
231
226
|
"my-attendance": {
|
|
@@ -6,7 +6,6 @@ export default function useDocument() {
|
|
|
6
6
|
type = "all",
|
|
7
7
|
site = "",
|
|
8
8
|
parentId = "",
|
|
9
|
-
expiry = "all",
|
|
10
9
|
}: {
|
|
11
10
|
page?: number;
|
|
12
11
|
search?: string;
|
|
@@ -14,11 +13,6 @@ export default function useDocument() {
|
|
|
14
13
|
type?: string;
|
|
15
14
|
site?: string;
|
|
16
15
|
parentId?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Which tab is asking: "active" for Documents, "expired" for
|
|
19
|
-
* Document (Expired). Defaults to "all" so existing callers are unaffected.
|
|
20
|
-
*/
|
|
21
|
-
expiry?: string;
|
|
22
16
|
} = {}) {
|
|
23
17
|
const query: Record<string, any> = {
|
|
24
18
|
page,
|
|
@@ -27,7 +21,6 @@ export default function useDocument() {
|
|
|
27
21
|
type,
|
|
28
22
|
site,
|
|
29
23
|
parentId,
|
|
30
|
-
expiry,
|
|
31
24
|
};
|
|
32
25
|
|
|
33
26
|
return useNuxtApp().$api<Record<string, any>>(`/api/documents`, {
|
|
@@ -76,8 +76,6 @@ export default function usetFacility() {
|
|
|
76
76
|
hourInterval?: number;
|
|
77
77
|
isBookingFeeEnabled: boolean;
|
|
78
78
|
isGuestEnabled: boolean;
|
|
79
|
-
isResidentChecklistEnabled: boolean;
|
|
80
|
-
isSecurityChecklistEnabled: boolean;
|
|
81
79
|
bookingAmount: number | null;
|
|
82
80
|
peakBookingFeeAmount?: number | null;
|
|
83
81
|
bookingFeeGuestAmount?: number | null;
|
|
@@ -175,8 +173,6 @@ export default function usetFacility() {
|
|
|
175
173
|
hourInterval = 1,
|
|
176
174
|
isBookingFeeEnabled = false,
|
|
177
175
|
isGuestEnabled = false,
|
|
178
|
-
isResidentChecklistEnabled = false,
|
|
179
|
-
isSecurityChecklistEnabled = false,
|
|
180
176
|
bookingAmount = 0,
|
|
181
177
|
peakBookingFeeAmount = 0,
|
|
182
178
|
bookingFeeGuestAmount = 0,
|
|
@@ -240,13 +236,6 @@ export default function usetFacility() {
|
|
|
240
236
|
this.hourInterval = hourInterval;
|
|
241
237
|
this.isBookingFeeEnabled = isBookingFeeEnabled;
|
|
242
238
|
this.isGuestEnabled = isGuestEnabled;
|
|
243
|
-
// Exactly one owner, always. `isResidentChecklistEnabled` is the flag
|
|
244
|
-
// the apps gate on, so it decides, and security is its complement —
|
|
245
|
-
// stored rather than computed so each app can read its own flag without
|
|
246
|
-
// knowing the rule. A facility predating both fields lands on security,
|
|
247
|
-
// which is how every one of them already behaved.
|
|
248
|
-
this.isResidentChecklistEnabled = isResidentChecklistEnabled === true;
|
|
249
|
-
this.isSecurityChecklistEnabled = !this.isResidentChecklistEnabled;
|
|
250
239
|
this.bookingAmount = bookingAmount;
|
|
251
240
|
this.peakBookingFeeAmount = peakBookingFeeAmount;
|
|
252
241
|
this.bookingFeeGuestAmount = bookingFeeGuestAmount;
|
|
@@ -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
|
},
|
|
@@ -198,11 +198,6 @@ export default function useLandscapingPermission() {
|
|
|
198
198
|
check: true,
|
|
199
199
|
description: "Allows the user to configure and manage attendance settings.",
|
|
200
200
|
},
|
|
201
|
-
"manage-site-device-mode": {
|
|
202
|
-
check: true,
|
|
203
|
-
description:
|
|
204
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
205
|
-
},
|
|
206
201
|
},
|
|
207
202
|
// my attendance permissions
|
|
208
203
|
"my-attendance": {
|
package/composables/useMember.ts
CHANGED
|
@@ -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,
|
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,
|
|
@@ -213,11 +213,6 @@ export default function usePestControlPermission() {
|
|
|
213
213
|
check: true,
|
|
214
214
|
description: "Allows the user to configure and manage attendance settings.",
|
|
215
215
|
},
|
|
216
|
-
"manage-site-device-mode": {
|
|
217
|
-
check: true,
|
|
218
|
-
description:
|
|
219
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
220
|
-
},
|
|
221
216
|
},
|
|
222
217
|
// my attendance permissions
|
|
223
218
|
"my-attendance": {
|
|
@@ -213,11 +213,6 @@ export default function usePoolMaintenancePermission() {
|
|
|
213
213
|
check: true,
|
|
214
214
|
description: "Allows the user to configure and manage attendance settings.",
|
|
215
215
|
},
|
|
216
|
-
"manage-site-device-mode": {
|
|
217
|
-
check: true,
|
|
218
|
-
description:
|
|
219
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
220
|
-
},
|
|
221
216
|
},
|
|
222
217
|
// my attendance permissions
|
|
223
218
|
"my-attendance": {
|
|
@@ -491,11 +491,6 @@ export default function useSecurityPermission() {
|
|
|
491
491
|
description:
|
|
492
492
|
"Allows the user to configure and manage attendance settings.",
|
|
493
493
|
},
|
|
494
|
-
"manage-site-device-mode": {
|
|
495
|
-
check: true,
|
|
496
|
-
description:
|
|
497
|
-
"Allows the user to turn Site device mode on or off: one shared phone at the site checks staff in and out with a photo, their name and the last 4 characters of their NRIC.",
|
|
498
|
-
},
|
|
499
494
|
},
|
|
500
495
|
|
|
501
496
|
"my-attendance": {
|
|
@@ -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
|
|
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
|
|
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/constants/permissions.ts
CHANGED
|
@@ -206,7 +206,6 @@ export const PERMISSIONS = {
|
|
|
206
206
|
"see-all-attendance",
|
|
207
207
|
"see-attendance-details",
|
|
208
208
|
"manage-attendance-settings",
|
|
209
|
-
"manage-site-device-mode",
|
|
210
209
|
],
|
|
211
210
|
"my-attendance": ["see-own-attendance", "check-in-out"],
|
|
212
211
|
toilet_locations: ["create-toilet-location"],
|
package/nuxt.config.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
2
|
import vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
|
|
3
|
-
import { SECURITY_HEADERS } from "./utils/security-headers";
|
|
4
3
|
export default defineNuxtConfig({
|
|
5
4
|
ssr: false,
|
|
6
5
|
devtools: { enabled: false },
|
|
7
|
-
|
|
8
|
-
// Security headers for every app that extends this layer: the HTML shell gets
|
|
9
|
-
// them from Nitro, the static files from the `_headers` file the Cloudflare
|
|
10
|
-
// preset writes from these same rules. See utils/security-headers.ts.
|
|
11
|
-
routeRules: {
|
|
12
|
-
"/**": { headers: SECURITY_HEADERS },
|
|
13
|
-
// Stored files read with the signed-in session (API-core
|
|
14
|
-
// GET /api/files/object/<key>) instead of the public CDN. Unused until an
|
|
15
|
-
// app's API_DO_STORAGE_ENDPOINT points at /api/storage/<folder>; that switch
|
|
16
|
-
// goes with SPACES_PRIVATE_PREFIXES - see the storage runbook.
|
|
17
|
-
...(process.env.API_CORE
|
|
18
|
-
? { "/api/storage/**": { proxy: `${process.env.API_CORE}/api/files/object/**` } }
|
|
19
|
-
: {}),
|
|
20
|
-
},
|
|
21
6
|
build: {
|
|
22
7
|
transpile: ["vuetify"],
|
|
23
8
|
},
|
|
@@ -63,9 +48,6 @@ export default defineNuxtConfig({
|
|
|
63
48
|
cookieConfig: {
|
|
64
49
|
domain: (process.env.DOMAIN as string) ?? "localhost",
|
|
65
50
|
secure: true,
|
|
66
|
-
// Explicit, not the browser default: the API also reads `sid` from the
|
|
67
|
-
// cookie, so a cross-site form post must never carry it (CSRF).
|
|
68
|
-
sameSite: "lax",
|
|
69
51
|
maxAge: 30 * 24 * 60 * 60,
|
|
70
52
|
},
|
|
71
53
|
APP: (process.env.APP as string) ?? "App",
|
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.83.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.",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"pages",
|
|
23
23
|
"plugins",
|
|
24
24
|
"public",
|
|
25
|
-
"server",
|
|
26
25
|
"services",
|
|
27
26
|
"types",
|
|
28
27
|
"utils",
|
|
@@ -58,9 +57,8 @@
|
|
|
58
57
|
"@mdi/font": "^7.4.47",
|
|
59
58
|
"@types/qrcode": "^1.5.6",
|
|
60
59
|
"ckeditor5": "47.4.0",
|
|
61
|
-
"dompurify": "^3.3.1",
|
|
62
60
|
"hls.js": "^1.6.13",
|
|
63
|
-
"html2pdf.js": "^0.
|
|
61
|
+
"html2pdf.js": "^0.10.2",
|
|
64
62
|
"html5-qrcode": "^2.3.8",
|
|
65
63
|
"moment-timezone": "^0.6.0",
|
|
66
64
|
"nuxt-signature-pad": "^1.8.0",
|