@7365admin1/core 3.53.6 → 3.53.8
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 +23 -0
- package/dist/index.d.ts +17 -11
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/notification-category.util.test.mjs +46 -12
- package/test/verification-scope.test.mjs +96 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @iservice365/core
|
|
2
2
|
|
|
3
|
+
## 3.53.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c0298c6: Notification Settings: remove the two switches that governed nothing.
|
|
8
|
+
|
|
9
|
+
- Service Provider Invitations no longer offers a movable **Email** switch. No sender in the estate
|
|
10
|
+
ever calls the preference guard with `"email"`, so the switch a person could move did not suppress
|
|
11
|
+
the invitation email. The row is now dimmed with the reason, matching every other category.
|
|
12
|
+
- **Emergency Contacts** is no longer offered at all. Its sender exists here, but emergency contacts
|
|
13
|
+
are written in `iservice365-API-core` and the change that would have called it from there was
|
|
14
|
+
closed, not merged — so the switch governed a message that cannot arrive. It returns to the screen
|
|
15
|
+
the day a caller exists, with no schema change.
|
|
16
|
+
|
|
17
|
+
No delivery behaviour changes: nothing starts or stops being sent, and a person with no stored
|
|
18
|
+
preference behaves exactly as before.
|
|
19
|
+
|
|
20
|
+
## 3.53.7
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 185f92a: Scope the invitation list and cancel: `GET /api/verifications` refuses an estate-wide read to anyone who is not Seven365 staff, and `PUT /api/verifications/:id/cancel` authorizes against the stored verification's organisation.
|
|
25
|
+
|
|
3
26
|
## 3.53.6
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -13511,13 +13511,16 @@ declare class NotificationService {
|
|
|
13511
13511
|
* A switch that governs a notification nobody sends is a lie to the user, so a
|
|
13512
13512
|
* category is only `rendered` once something in the estate actually sends it.
|
|
13513
13513
|
*
|
|
13514
|
-
*
|
|
13515
|
-
* incident,
|
|
13516
|
-
* its recipients from role permissions at the site the event
|
|
13517
|
-
*
|
|
13518
|
-
*
|
|
13519
|
-
*
|
|
13520
|
-
*
|
|
13514
|
+
* Three of the four `safety: true` entries below send: `NotificationService`
|
|
13515
|
+
* has an incident, patrol and camera-fault sender wired to a live trigger, and
|
|
13516
|
+
* each resolves its recipients from role permissions at the site the event
|
|
13517
|
+
* happened on. Camera faults still ALSO raise the live socket toast they always
|
|
13518
|
+
* did — the stored notification is added beside it, not instead of it.
|
|
13519
|
+
*
|
|
13520
|
+
* The fourth, `emergencyContact`, is `rendered: false`: its sender exists here
|
|
13521
|
+
* but emergency contacts are written in `iservice365-API-core`, and the change
|
|
13522
|
+
* that would have called it from there was closed rather than merged. It goes
|
|
13523
|
+
* back on the screen the day a caller exists, with no schema change.
|
|
13521
13524
|
*
|
|
13522
13525
|
* The two marketplace order entries are the one place that rule is stretched:
|
|
13523
13526
|
* they are `rendered` before their senders exist, because the senders live in
|
|
@@ -13534,10 +13537,13 @@ declare class NotificationService {
|
|
|
13534
13537
|
* deliver, with the reason in `channelNote` — the house pattern is to show a
|
|
13535
13538
|
* control and explain why it is unavailable, never to hide it.
|
|
13536
13539
|
*
|
|
13537
|
-
* Email is `false`
|
|
13538
|
-
*
|
|
13539
|
-
* contact, a visitor, a site's configured alert list), not
|
|
13540
|
-
* there is no user whose preference could be consulted.
|
|
13540
|
+
* Email is `false` everywhere for a real reason: the module emails this system
|
|
13541
|
+
* sends are addressed to an email string stored on a record (a booking's
|
|
13542
|
+
* contact, a visitor, an invited company, a site's configured alert list), not
|
|
13543
|
+
* to a user account, so there is no user whose preference could be consulted.
|
|
13544
|
+
* No sender in the estate calls `filterRecipients` or `isChannelEnabled` with
|
|
13545
|
+
* `"email"`, so an email switch that a person could move would govern nothing —
|
|
13546
|
+
* the dimmed switch and its note are the honest control. Account and sign-in mail
|
|
13541
13547
|
* — one-time codes, address verification, password resets — is deliberately
|
|
13542
13548
|
* absent from this list entirely and can never be switched off by anything here.
|
|
13543
13549
|
*/
|
package/dist/index.js
CHANGED
|
@@ -14846,7 +14846,10 @@ var NOTIFICATION_CATEGORIES = [
|
|
|
14846
14846
|
key: "serviceProviderInvite",
|
|
14847
14847
|
label: "Service Provider Invitations",
|
|
14848
14848
|
description: "When a property manager invites your company to provide services at a site.",
|
|
14849
|
-
channels: { inApp: true, push: true, email:
|
|
14849
|
+
channels: { inApp: true, push: true, email: false },
|
|
14850
|
+
channelNote: {
|
|
14851
|
+
email: "The invitation email is the invitation itself \u2014 for a company that has no account here yet it is the only copy, so it is always sent to the address the invitation was addressed to. The switches above control the copy that reaches you inside the app."
|
|
14852
|
+
},
|
|
14850
14853
|
permissionResources: ["service-provider-mgmt"],
|
|
14851
14854
|
rendered: true
|
|
14852
14855
|
},
|
|
@@ -14873,7 +14876,12 @@ var NOTIFICATION_CATEGORIES = [
|
|
|
14873
14876
|
channelNote: { email: NO_EMAIL_RECIPIENT },
|
|
14874
14877
|
permissionResources: ["emergency-contact"],
|
|
14875
14878
|
safety: true,
|
|
14876
|
-
|
|
14879
|
+
// Nothing sends this. The sender below exists, but the only place emergency
|
|
14880
|
+
// contacts are written is `iservice365-API-core`, and the change that would
|
|
14881
|
+
// have called it from there (API-core #997) was closed, not merged. Until a
|
|
14882
|
+
// caller exists this stays out of the screen rather than offering a switch
|
|
14883
|
+
// over a message that never arrives.
|
|
14884
|
+
rendered: false
|
|
14877
14885
|
},
|
|
14878
14886
|
{
|
|
14879
14887
|
key: "virtualPatrol",
|
|
@@ -15682,6 +15690,19 @@ async function requireUserFieldWrite(req, userId, field, grant) {
|
|
|
15682
15690
|
return await requirePlatformStaff(req, grant);
|
|
15683
15691
|
return await requireSelfOrPlatformStaff(req, userId, grant);
|
|
15684
15692
|
}
|
|
15693
|
+
async function requireVerificationListReach(req, orgId) {
|
|
15694
|
+
if (orgId) {
|
|
15695
|
+
await requireOrgReach(req, orgId);
|
|
15696
|
+
return;
|
|
15697
|
+
}
|
|
15698
|
+
await requirePlatformStaff(req);
|
|
15699
|
+
}
|
|
15700
|
+
async function requireVerificationReach(req, verification) {
|
|
15701
|
+
const org = verification?.metadata?.org?.toString?.() ?? "";
|
|
15702
|
+
if (!org)
|
|
15703
|
+
return;
|
|
15704
|
+
await requireOrgReach(req, org);
|
|
15705
|
+
}
|
|
15685
15706
|
|
|
15686
15707
|
// src/services/service-provider-invite.service.ts
|
|
15687
15708
|
var INVITE_VALID_HOURS = 72;
|
|
@@ -27652,6 +27673,7 @@ function useVerificationController() {
|
|
|
27652
27673
|
});
|
|
27653
27674
|
}
|
|
27654
27675
|
try {
|
|
27676
|
+
await requireVerificationListReach(req, orgId);
|
|
27655
27677
|
const data = await _getVerifications({
|
|
27656
27678
|
search,
|
|
27657
27679
|
page,
|
|
@@ -27739,6 +27761,7 @@ function useVerificationController() {
|
|
|
27739
27761
|
return;
|
|
27740
27762
|
}
|
|
27741
27763
|
try {
|
|
27764
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
27742
27765
|
await _cancelUserInvitation(otpId);
|
|
27743
27766
|
res.json({
|
|
27744
27767
|
message: "User invite has been cancelled."
|
|
@@ -85028,7 +85051,7 @@ function useVerificationControllerV2() {
|
|
|
85028
85051
|
cancelUserInvitation: _cancelUserInvitation,
|
|
85029
85052
|
resendSignUpVerification: _resendSignUpVerification
|
|
85030
85053
|
} = useVerificationServiceV2();
|
|
85031
|
-
const { getVerifications: _getVerifications } = useVerificationRepoV2();
|
|
85054
|
+
const { getVerifications: _getVerifications, getVerificationById: _getVerificationById } = useVerificationRepoV2();
|
|
85032
85055
|
async function verify(req, res, next) {
|
|
85033
85056
|
try {
|
|
85034
85057
|
const schema2 = import_joi142.default.object({ verificationCode: import_joi142.default.string().required() });
|
|
@@ -85209,6 +85232,7 @@ function useVerificationControllerV2() {
|
|
|
85209
85232
|
}
|
|
85210
85233
|
const { search, page, status, app, email, type } = value;
|
|
85211
85234
|
try {
|
|
85235
|
+
await requireVerificationListReach(req, null);
|
|
85212
85236
|
const data = await _getVerifications({
|
|
85213
85237
|
search,
|
|
85214
85238
|
page,
|
|
@@ -85235,6 +85259,7 @@ function useVerificationControllerV2() {
|
|
|
85235
85259
|
return;
|
|
85236
85260
|
}
|
|
85237
85261
|
try {
|
|
85262
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
85238
85263
|
await _cancelUserInvitation(otpId);
|
|
85239
85264
|
res.json({
|
|
85240
85265
|
message: "User invite has been cancelled."
|