@iamnnort/nestjs-serializer 2.2.0 → 2.2.1

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/index.d.mts CHANGED
@@ -51,6 +51,7 @@ declare const SerializerInterceptor: (config: {
51
51
  extendedScopes?: string[];
52
52
  limitedScopes?: string[];
53
53
  secretScopes?: string[];
54
+ allowedScopes?: string[];
54
55
  fields?: string[];
55
56
  }) => {
56
57
  new (serializerService: SerializerService): {
package/dist/index.d.ts CHANGED
@@ -51,6 +51,7 @@ declare const SerializerInterceptor: (config: {
51
51
  extendedScopes?: string[];
52
52
  limitedScopes?: string[];
53
53
  secretScopes?: string[];
54
+ allowedScopes?: string[];
54
55
  fields?: string[];
55
56
  }) => {
56
57
  new (serializerService: SerializerService): {
package/dist/index.js CHANGED
@@ -9199,6 +9199,7 @@ SerializerService = exports.SerializerService = _ts_decorate([
9199
9199
  ], SerializerService);
9200
9200
 
9201
9201
  // src/interceptor.ts
9202
+
9202
9203
  function _ts_decorate2(decorators, target, key, desc) {
9203
9204
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9204
9205
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -9243,6 +9244,9 @@ var SerializerInterceptor = /* @__PURE__ */ __name((config) => {
9243
9244
  if (request.query.secret) {
9244
9245
  return config.secretScopes || this.serializerService.config.globalSecretScopes || config.scopes;
9245
9246
  }
9247
+ if (request.query.scopes && config.allowedScopes) {
9248
+ return _lodash.intersection.call(void 0, request.query.scopes, config.allowedScopes);
9249
+ }
9246
9250
  return config.scopes;
9247
9251
  }
9248
9252
  };