@punks/backend-entity-manager 0.0.110 → 0.0.111

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
@@ -2342,6 +2342,19 @@ __decorate([
2342
2342
  __metadata("design:type", Array)
2343
2343
  ], StringFacet.prototype, "items", void 0);
2344
2344
 
2345
+ const CurrentUser = common.createParamDecorator((data, context) => {
2346
+ const request = context.switchToHttp().getRequest();
2347
+ if (!request.auth) {
2348
+ return undefined;
2349
+ }
2350
+ const user = request.auth.user;
2351
+ const roles = request.auth.roles;
2352
+ return {
2353
+ user,
2354
+ roles,
2355
+ };
2356
+ });
2357
+
2345
2358
  const AuthenticationExtensionSymbols = {
2346
2359
  UserService: Symbol.for("WP.EXT:AUTHENTICATION.USER_SERVICE"),
2347
2360
  RolesService: Symbol.for("WP.EXT:AUTHENTICATION.ROLES_SERVICE"),
@@ -27706,6 +27719,7 @@ exports.AwsS2BucketError = AwsS2BucketError;
27706
27719
  exports.AwsSesEmailTemplate = AwsSesEmailTemplate;
27707
27720
  exports.BooleanFacet = BooleanFacet;
27708
27721
  exports.BooleanFacetItem = BooleanFacetItem;
27722
+ exports.CurrentUser = CurrentUser;
27709
27723
  exports.EntityManagerConfigurationError = EntityManagerConfigurationError;
27710
27724
  exports.EntityManagerException = EntityManagerException;
27711
27725
  exports.EntityManagerSymbols = EntityManagerSymbols;