@punks/backend-entity-manager 0.0.116 → 0.0.118

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/cjs/index.js CHANGED
@@ -2371,8 +2371,8 @@ const Public = () => common.SetMetadata(AuthenticationGuardsSymbols.Public, true
2371
2371
  const Authenticated = () => common.SetMetadata(AuthenticationGuardsSymbols.Authenticated, true);
2372
2372
  const Roles = (...roles) => common.SetMetadata(AuthenticationGuardsSymbols.Roles, roles);
2373
2373
  const MemberOf = (...groups) => common.SetMetadata(AuthenticationGuardsSymbols.MemberOf, groups);
2374
- const buildRolesGuard = ({ mainRole, inheritedRoles, }, options) => Roles(mainRole.uid, ...(!options?.exact && inheritedRoles
2375
- ? inheritedRoles.map((role) => role.uid)
2374
+ const buildRolesGuard = ({ mainRole, secondaryRoles, }, options) => Roles(mainRole.uid, ...(!options?.exact && secondaryRoles
2375
+ ? secondaryRoles.map((role) => role.uid)
2376
2376
  : []));
2377
2377
 
2378
2378
  const WpRolesService = () => common.applyDecorators(common.Injectable(), common.SetMetadata(AuthenticationExtensionSymbols.RolesService, true));
@@ -2504,11 +2504,7 @@ exports.AuthGuard = AuthGuard_1 = class AuthGuard {
2504
2504
  id: user.id,
2505
2505
  userName: user.userName,
2506
2506
  email: user.email,
2507
- roles: roles?.map((role) => ({
2508
- id: role.id,
2509
- name: role.name,
2510
- uid: role.uid,
2511
- })),
2507
+ roles: roles?.map((role) => role.uid),
2512
2508
  },
2513
2509
  }
2514
2510
  : {}),
@@ -21178,7 +21174,9 @@ exports.EntityManagerInitializer = EntityManagerInitializer_1 = class EntityMana
21178
21174
  const adapterDict = backendCore.toDict(adapters, (a) => a.meta.entityName);
21179
21175
  const authDict = backendCore.toDict(auth, (a) => a.meta.entityName);
21180
21176
  const sortedEntities = lodash.exports.orderBy(entities, (x) => x.meta.name);
21181
- this.logger.log(`Discovered entities: \n${sortedEntities.join(" \n")}`);
21177
+ this.logger.log(`Discovered entities: \n${sortedEntities
21178
+ .map((x) => x.discoveredClass.name)
21179
+ .join(" \n")}`);
21182
21180
  for (const entity of sortedEntities) {
21183
21181
  const entityName = entity.meta.name;
21184
21182
  const repository = repositoriesDict[entityName];