@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/dist/index.mjs
CHANGED
|
@@ -14213,7 +14213,10 @@ var NOTIFICATION_CATEGORIES = [
|
|
|
14213
14213
|
key: "serviceProviderInvite",
|
|
14214
14214
|
label: "Service Provider Invitations",
|
|
14215
14215
|
description: "When a property manager invites your company to provide services at a site.",
|
|
14216
|
-
channels: { inApp: true, push: true, email:
|
|
14216
|
+
channels: { inApp: true, push: true, email: false },
|
|
14217
|
+
channelNote: {
|
|
14218
|
+
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."
|
|
14219
|
+
},
|
|
14217
14220
|
permissionResources: ["service-provider-mgmt"],
|
|
14218
14221
|
rendered: true
|
|
14219
14222
|
},
|
|
@@ -14240,7 +14243,12 @@ var NOTIFICATION_CATEGORIES = [
|
|
|
14240
14243
|
channelNote: { email: NO_EMAIL_RECIPIENT },
|
|
14241
14244
|
permissionResources: ["emergency-contact"],
|
|
14242
14245
|
safety: true,
|
|
14243
|
-
|
|
14246
|
+
// Nothing sends this. The sender below exists, but the only place emergency
|
|
14247
|
+
// contacts are written is `iservice365-API-core`, and the change that would
|
|
14248
|
+
// have called it from there (API-core #997) was closed, not merged. Until a
|
|
14249
|
+
// caller exists this stays out of the screen rather than offering a switch
|
|
14250
|
+
// over a message that never arrives.
|
|
14251
|
+
rendered: false
|
|
14244
14252
|
},
|
|
14245
14253
|
{
|
|
14246
14254
|
key: "virtualPatrol",
|
|
@@ -15053,6 +15061,19 @@ async function requireUserFieldWrite(req, userId, field, grant) {
|
|
|
15053
15061
|
return await requirePlatformStaff(req, grant);
|
|
15054
15062
|
return await requireSelfOrPlatformStaff(req, userId, grant);
|
|
15055
15063
|
}
|
|
15064
|
+
async function requireVerificationListReach(req, orgId) {
|
|
15065
|
+
if (orgId) {
|
|
15066
|
+
await requireOrgReach(req, orgId);
|
|
15067
|
+
return;
|
|
15068
|
+
}
|
|
15069
|
+
await requirePlatformStaff(req);
|
|
15070
|
+
}
|
|
15071
|
+
async function requireVerificationReach(req, verification) {
|
|
15072
|
+
const org = verification?.metadata?.org?.toString?.() ?? "";
|
|
15073
|
+
if (!org)
|
|
15074
|
+
return;
|
|
15075
|
+
await requireOrgReach(req, org);
|
|
15076
|
+
}
|
|
15056
15077
|
|
|
15057
15078
|
// src/services/service-provider-invite.service.ts
|
|
15058
15079
|
var INVITE_VALID_HOURS = 72;
|
|
@@ -27103,6 +27124,7 @@ function useVerificationController() {
|
|
|
27103
27124
|
});
|
|
27104
27125
|
}
|
|
27105
27126
|
try {
|
|
27127
|
+
await requireVerificationListReach(req, orgId);
|
|
27106
27128
|
const data = await _getVerifications({
|
|
27107
27129
|
search,
|
|
27108
27130
|
page,
|
|
@@ -27190,6 +27212,7 @@ function useVerificationController() {
|
|
|
27190
27212
|
return;
|
|
27191
27213
|
}
|
|
27192
27214
|
try {
|
|
27215
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
27193
27216
|
await _cancelUserInvitation(otpId);
|
|
27194
27217
|
res.json({
|
|
27195
27218
|
message: "User invite has been cancelled."
|
|
@@ -85124,7 +85147,7 @@ function useVerificationControllerV2() {
|
|
|
85124
85147
|
cancelUserInvitation: _cancelUserInvitation,
|
|
85125
85148
|
resendSignUpVerification: _resendSignUpVerification
|
|
85126
85149
|
} = useVerificationServiceV2();
|
|
85127
|
-
const { getVerifications: _getVerifications } = useVerificationRepoV2();
|
|
85150
|
+
const { getVerifications: _getVerifications, getVerificationById: _getVerificationById } = useVerificationRepoV2();
|
|
85128
85151
|
async function verify(req, res, next) {
|
|
85129
85152
|
try {
|
|
85130
85153
|
const schema2 = Joi142.object({ verificationCode: Joi142.string().required() });
|
|
@@ -85305,6 +85328,7 @@ function useVerificationControllerV2() {
|
|
|
85305
85328
|
}
|
|
85306
85329
|
const { search, page, status, app, email, type } = value;
|
|
85307
85330
|
try {
|
|
85331
|
+
await requireVerificationListReach(req, null);
|
|
85308
85332
|
const data = await _getVerifications({
|
|
85309
85333
|
search,
|
|
85310
85334
|
page,
|
|
@@ -85331,6 +85355,7 @@ function useVerificationControllerV2() {
|
|
|
85331
85355
|
return;
|
|
85332
85356
|
}
|
|
85333
85357
|
try {
|
|
85358
|
+
await requireVerificationReach(req, await _getVerificationById(otpId));
|
|
85334
85359
|
await _cancelUserInvitation(otpId);
|
|
85335
85360
|
res.json({
|
|
85336
85361
|
message: "User invite has been cancelled."
|