@punks/backend-entity-manager 0.0.115 → 0.0.117

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,7 +2371,7 @@ 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?.inheritRoles && inheritedRoles
2374
+ const buildRolesGuard = ({ mainRole, inheritedRoles, }, options) => Roles(mainRole.uid, ...(!options?.exact && inheritedRoles
2375
2375
  ? inheritedRoles.map((role) => role.uid)
2376
2376
  : []));
2377
2377
 
@@ -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
  : {}),
@@ -22027,6 +22023,11 @@ class TypeOrmRepository {
22027
22023
  throw new Error("Invalid 'id' parameter.");
22028
22024
  }
22029
22025
  this.logger.debug("Updating entity", { id, entity });
22026
+ // await this.innerRepository.preload(id as any)
22027
+ // await this.innerRepository.save({
22028
+ // id,
22029
+ // ...entity,
22030
+ // } as unknown as TEntity)
22030
22031
  await this.innerRepository.update(id, entity);
22031
22032
  const current = await this.get(id);
22032
22033
  if (!current) {