@infuro/cms-core 1.0.66 → 1.0.67
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/dist/admin.cjs +94 -21
- package/dist/admin.js +94 -21
- package/dist/api.cjs +36 -36
- package/dist/api.js +3 -3
- package/dist/auth.cjs +51 -51
- package/dist/auth.js +3 -3
- package/dist/{chunk-6DBDJ4VD.js → chunk-2ISSXYBZ.js} +2 -2
- package/dist/{chunk-MVHDC3XF.js → chunk-5NOZSG6J.js} +22 -11
- package/dist/{chunk-QYRXLURF.cjs → chunk-BVLN75LP.cjs} +443 -78
- package/dist/{chunk-T33KU5G5.js → chunk-GLLCLRCQ.js} +394 -29
- package/dist/{chunk-J7FMZK66.cjs → chunk-O4AFPDQ4.cjs} +22 -11
- package/dist/{chunk-4U6DATGZ.cjs → chunk-OV5TRZET.cjs} +7 -7
- package/dist/{chunk-KM2I6AFP.cjs → chunk-SS3K7OIM.cjs} +9 -9
- package/dist/{chunk-NR44CK5E.js → chunk-ZY64VJMS.js} +1 -1
- package/dist/index.cjs +269 -265
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +6 -6
- package/dist/migrations/1783300000000-CreateOrderAssigneesTable.ts +43 -0
- package/dist/{order-assignees-handlers-NPKD64P6.cjs → order-assignees-handlers-KF7RMTV5.cjs} +77 -8
- package/dist/{order-assignees-handlers-LKMAGLG6.js → order-assignees-handlers-L3RVKUBS.js} +77 -8
- package/dist/{order-completion-otp-handlers-NK65LOLV.cjs → order-completion-otp-handlers-DZAXK4GQ.cjs} +67 -13
- package/dist/{order-completion-otp-handlers-LFRHXWK4.js → order-completion-otp-handlers-HFGCPC4O.js} +67 -13
- package/dist/{rbac-debug-db-5R6XFPSV.js → rbac-debug-db-DFZWZ6GV.js} +1 -1
- package/dist/{rbac-debug-db-JKK2MCWF.cjs → rbac-debug-db-KWV7D5PQ.cjs} +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO4AFPDQ4_cjs = require('./chunk-O4AFPDQ4.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var typeorm = require('typeorm');
|
|
6
6
|
|
|
@@ -273,7 +273,7 @@ var RBAC_ADMIN_ONLY_ENTITIES = /* @__PURE__ */ new Set([
|
|
|
273
273
|
"permissions"
|
|
274
274
|
]);
|
|
275
275
|
function sessionHasEntityAccess(user, entity, action) {
|
|
276
|
-
return
|
|
276
|
+
return chunkO4AFPDQ4_cjs.explainSessionEntityAccess(user, entity, action).allowed;
|
|
277
277
|
}
|
|
278
278
|
chunkUSNT2KNT_cjs.__name(sessionHasEntityAccess, "sessionHasEntityAccess");
|
|
279
279
|
function canManageRoles(user) {
|
|
@@ -364,8 +364,8 @@ function createAuthHelpersFromGetSession(getSession, NextResponse) {
|
|
|
364
364
|
}
|
|
365
365
|
const u = session.user;
|
|
366
366
|
const allowed = sessionHasEntityAccess(u, entity, action);
|
|
367
|
-
const { reason } =
|
|
368
|
-
|
|
367
|
+
const { reason } = chunkO4AFPDQ4_cjs.explainSessionEntityAccess(u, entity, action);
|
|
368
|
+
chunkO4AFPDQ4_cjs.logRbac("authHelpers.requireEntityPermission", {
|
|
369
369
|
entity,
|
|
370
370
|
action,
|
|
371
371
|
allowed,
|
|
@@ -397,10 +397,10 @@ function createAuthHelpersFromGetSession(getSession, NextResponse) {
|
|
|
397
397
|
}
|
|
398
398
|
const u = session.user;
|
|
399
399
|
if (u.isRBACAdmin) return null;
|
|
400
|
-
if (
|
|
400
|
+
if (chunkO4AFPDQ4_cjs.isVendorPortalUser(u)) return null;
|
|
401
401
|
if (u.adminAccess === true) return null;
|
|
402
402
|
if (u.adminAccess === false) {
|
|
403
|
-
|
|
403
|
+
chunkO4AFPDQ4_cjs.logRbac("requireAdminAccess denied (adminAccess:false)", {
|
|
404
404
|
email: u.email,
|
|
405
405
|
groupName: u.groupName,
|
|
406
406
|
isVendorPortal: u.isVendorPortal
|
|
@@ -412,7 +412,7 @@ function createAuthHelpersFromGetSession(getSession, NextResponse) {
|
|
|
412
412
|
status: 403
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
|
|
415
|
+
chunkO4AFPDQ4_cjs.logRbac("requireAdminAccess denied (no matching rule)", {
|
|
416
416
|
email: u.email,
|
|
417
417
|
adminAccess: u.adminAccess,
|
|
418
418
|
groupName: u.groupName,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOV5TRZET_cjs = require('./chunk-OV5TRZET.cjs');
|
|
4
4
|
var chunkOY2YTBMP_cjs = require('./chunk-OY2YTBMP.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkO4AFPDQ4_cjs = require('./chunk-O4AFPDQ4.cjs');
|
|
6
6
|
var chunk7L6KWI7S_cjs = require('./chunk-7L6KWI7S.cjs');
|
|
7
7
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
8
8
|
var _CredentialsProvider = require('next-auth/providers/credentials');
|
|
@@ -15,12 +15,12 @@ var _GoogleProvider__default = /*#__PURE__*/_interopDefault(_GoogleProvider);
|
|
|
15
15
|
|
|
16
16
|
// src/auth/seed-permissions.ts
|
|
17
17
|
async function seedAdministratorPermissions(dataSource, entityMap) {
|
|
18
|
-
const entities =
|
|
18
|
+
const entities = chunkO4AFPDQ4_cjs.getPermissionableEntityKeys(entityMap);
|
|
19
19
|
const groupRepo = dataSource.getRepository(entityMap.user_groups);
|
|
20
20
|
const permRepo = dataSource.getRepository(entityMap.permissions);
|
|
21
21
|
const adminGroup = await groupRepo.findOne({
|
|
22
22
|
where: {
|
|
23
|
-
name:
|
|
23
|
+
name: chunkO4AFPDQ4_cjs.ADMIN_GROUP_NAME,
|
|
24
24
|
deleted: false
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -260,13 +260,13 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
260
260
|
}
|
|
261
261
|
if (input.entityMap.contacts) {
|
|
262
262
|
try {
|
|
263
|
-
await
|
|
263
|
+
await chunkOV5TRZET_cjs.linkUnclaimedContactToUser(input.dataSource, input.entityMap.contacts, userId, email);
|
|
264
264
|
} catch {
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
if (input.entityMap.customer) {
|
|
268
268
|
try {
|
|
269
|
-
await
|
|
269
|
+
await chunkOV5TRZET_cjs.ensureCustomerForUser(input.dataSource, input.entityMap.customer, {
|
|
270
270
|
id: userId,
|
|
271
271
|
name: displayName,
|
|
272
272
|
email,
|
|
@@ -387,18 +387,18 @@ async function checkMultiVendorEnabledViaSettingsApi() {
|
|
|
387
387
|
chunkUSNT2KNT_cjs.__name(checkMultiVendorEnabledViaSettingsApi, "checkMultiVendorEnabledViaSettingsApi");
|
|
388
388
|
function sessionUserFromNextAuthUser(user) {
|
|
389
389
|
const g = user.group;
|
|
390
|
-
const isRBACAdmin =
|
|
390
|
+
const isRBACAdmin = chunkO4AFPDQ4_cjs.isSuperAdmin({
|
|
391
391
|
groupId: user.groupId ?? void 0,
|
|
392
392
|
groupName: g?.name,
|
|
393
393
|
isRBACAdmin: false
|
|
394
394
|
});
|
|
395
|
-
const entityPerms =
|
|
395
|
+
const entityPerms = chunkO4AFPDQ4_cjs.permissionRowsToRecord(g?.permissions);
|
|
396
396
|
const rawAdminAccess = user.adminAccess;
|
|
397
397
|
const adminAccess = rawAdminAccess === true ? true : rawAdminAccess === false ? false : void 0;
|
|
398
398
|
const vendorIds = user.vendorIds ?? [];
|
|
399
399
|
const vendorRole = user.vendorRole ?? null;
|
|
400
400
|
const isVendorRoleOwner = user.isVendorRoleOwner ?? false;
|
|
401
|
-
const { isVendorPortal, isVendorOwner: isVendorOwner2 } =
|
|
401
|
+
const { isVendorPortal, isVendorOwner: isVendorOwner2 } = chunkO4AFPDQ4_cjs.vendorPortalFlagsFromUser({
|
|
402
402
|
email: user.email,
|
|
403
403
|
isRBACAdmin,
|
|
404
404
|
groupName: g?.name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-
|
|
1
|
+
import { explainSessionEntityAccess, isVendorPortalUser, logRbac } from './chunk-5NOZSG6J.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { IsNull } from 'typeorm';
|
|
4
4
|
|