@iamnnort/nestjs-serializer 2.0.0 → 2.0.2

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.mjs CHANGED
@@ -9054,10 +9054,8 @@ var SerializerService = class {
9054
9054
  __name(this, "SerializerService");
9055
9055
  }
9056
9056
  config;
9057
- globalEntityNames;
9058
9057
  constructor(config) {
9059
9058
  this.config = config;
9060
- this.globalEntityNames = config.globalEntityNames || [];
9061
9059
  }
9062
9060
  async transform(response, config) {
9063
9061
  if (!response) {
@@ -9108,7 +9106,7 @@ var SerializerService = class {
9108
9106
  const serializerFieldConfigs = global.serializerFieldConfigs.filter((fieldConfig) => {
9109
9107
  const isTarget = fieldConfig.target === entity.constructor;
9110
9108
  if (!isTarget) {
9111
- const isGlobalTarget = this.globalEntityNames.includes(fieldConfig.target.name);
9109
+ const isGlobalTarget = (this.config.globalEntityNames || []).includes(fieldConfig.target.name);
9112
9110
  if (!isGlobalTarget) {
9113
9111
  return false;
9114
9112
  }
@@ -9214,6 +9212,9 @@ var SerializerInterceptor = /* @__PURE__ */ __name((config) => {
9214
9212
  if (request.query.extended) {
9215
9213
  return config.extendedScopes || config.scopes;
9216
9214
  }
9215
+ if (request.query.limited) {
9216
+ return config.limitedScopes || this.serializerService.config.globalLimitedScopes || config.scopes;
9217
+ }
9217
9218
  return config.scopes;
9218
9219
  }
9219
9220
  };