@fourlights/strapi-plugin-deep-populate 1.11.1-beta.1 → 1.11.1-rc.0

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.
@@ -333,13 +333,13 @@ const traverseEntity = async (visitor2, options, entity) => {
333
333
  if (isNil(value) || isNil(attribute)) {
334
334
  continue;
335
335
  }
336
- parent = {
337
- schema: schema2,
338
- key,
339
- attribute,
340
- path: newPath
341
- };
342
336
  if (isRelationalAttribute(attribute)) {
337
+ parent = {
338
+ schema: schema2,
339
+ key,
340
+ attribute,
341
+ path: newPath
342
+ };
343
343
  const isMorphRelation = attribute.relation.toLowerCase().startsWith("morph");
344
344
  const method = isMorphRelation ? traverseMorphRelationTarget : traverseRelationTarget(getModel(attribute.target));
345
345
  if (isArray(value)) {
@@ -358,6 +358,12 @@ const traverseEntity = async (visitor2, options, entity) => {
358
358
  continue;
359
359
  }
360
360
  if (isMediaAttribute(attribute)) {
361
+ parent = {
362
+ schema: schema2,
363
+ key,
364
+ attribute,
365
+ path: newPath
366
+ };
361
367
  if (isArray(value)) {
362
368
  const res = new Array(value.length);
363
369
  for (let i2 = 0; i2 < value.length; i2 += 1) {
@@ -374,6 +380,12 @@ const traverseEntity = async (visitor2, options, entity) => {
374
380
  continue;
375
381
  }
376
382
  if (attribute.type === "component") {
383
+ parent = {
384
+ schema: schema2,
385
+ key,
386
+ attribute,
387
+ path: newPath
388
+ };
377
389
  const targetSchema = getModel(attribute.component);
378
390
  if (isArray(value)) {
379
391
  const res = new Array(value.length);
@@ -391,6 +403,12 @@ const traverseEntity = async (visitor2, options, entity) => {
391
403
  continue;
392
404
  }
393
405
  if (attribute.type === "dynamiczone" && isArray(value)) {
406
+ parent = {
407
+ schema: schema2,
408
+ key,
409
+ attribute,
410
+ path: newPath
411
+ };
394
412
  const res = new Array(value.length);
395
413
  for (let i2 = 0; i2 < value.length; i2 += 1) {
396
414
  const arrayPath = {
@@ -1616,7 +1634,7 @@ function createValidation(config2) {
1616
1634
  sync
1617
1635
  } = _ref, rest = _objectWithoutPropertiesLoose(_ref, ["value", "path", "label", "options", "originalValue", "sync"]);
1618
1636
  const {
1619
- name,
1637
+ name: name2,
1620
1638
  test,
1621
1639
  params,
1622
1640
  message
@@ -1635,14 +1653,14 @@ function createValidation(config2) {
1635
1653
  label,
1636
1654
  path: overrides.path || path
1637
1655
  }, params, overrides.params), resolve);
1638
- const error2 = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name);
1656
+ const error2 = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name2);
1639
1657
  error2.params = nextParams;
1640
1658
  return error2;
1641
1659
  }
1642
1660
  let ctx = _extends$3({
1643
1661
  path,
1644
1662
  parent,
1645
- type: name,
1663
+ type: name2,
1646
1664
  createError,
1647
1665
  resolve,
1648
1666
  options,
@@ -2309,20 +2327,20 @@ class StringSchema extends BaseSchema {
2309
2327
  matches(regex, options) {
2310
2328
  let excludeEmptyString = false;
2311
2329
  let message;
2312
- let name;
2330
+ let name2;
2313
2331
  if (options) {
2314
2332
  if (typeof options === "object") {
2315
2333
  ({
2316
2334
  excludeEmptyString = false,
2317
2335
  message,
2318
- name
2336
+ name: name2
2319
2337
  } = options);
2320
2338
  } else {
2321
2339
  message = options;
2322
2340
  }
2323
2341
  }
2324
2342
  return this.test({
2325
- name: name || "matches",
2343
+ name: name2 || "matches",
2326
2344
  message: message || string$2.matches,
2327
2345
  params: {
2328
2346
  regex
@@ -2417,11 +2435,11 @@ class DateSchema extends BaseSchema {
2417
2435
  _typeCheck(v) {
2418
2436
  return isDate(v) && !isNaN(v.getTime());
2419
2437
  }
2420
- prepareParam(ref, name) {
2438
+ prepareParam(ref, name2) {
2421
2439
  let param;
2422
2440
  if (!Reference.isRef(ref)) {
2423
2441
  let cast = this.cast(ref);
2424
- if (!this._typeCheck(cast)) throw new TypeError(`\`${name}\` must be a Date or a value that can be \`cast()\` to a Date`);
2442
+ if (!this._typeCheck(cast)) throw new TypeError(`\`${name2}\` must be a Date or a value that can be \`cast()\` to a Date`);
2425
2443
  param = cast;
2426
2444
  } else {
2427
2445
  param = ref;
@@ -3045,18 +3063,13 @@ function setLocale(custom) {
3045
3063
  });
3046
3064
  });
3047
3065
  }
3048
- function addMethod(schemaType, name, fn) {
3066
+ function addMethod(schemaType, name2, fn) {
3049
3067
  if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError("You must provide a yup schema constructor function");
3050
- if (typeof name !== "string") throw new TypeError("A Method name must be provided");
3068
+ if (typeof name2 !== "string") throw new TypeError("A Method name must be provided");
3051
3069
  if (typeof fn !== "function") throw new TypeError("Method function must be provided");
3052
- schemaType.prototype[name] = fn;
3070
+ schemaType.prototype[name2] = fn;
3053
3071
  }
3054
3072
  var httpErrors = { exports: {} };
3055
- /*!
3056
- * depd
3057
- * Copyright(c) 2015 Douglas Christopher Wilson
3058
- * MIT Licensed
3059
- */
3060
3073
  var browser;
3061
3074
  var hasRequiredBrowser;
3062
3075
  function requireBrowser() {
@@ -3183,12 +3196,6 @@ const require$$0 = {
3183
3196
  "510": "Not Extended",
3184
3197
  "511": "Network Authentication Required"
3185
3198
  };
3186
- /*!
3187
- * statuses
3188
- * Copyright(c) 2014 Jonathan Ong
3189
- * Copyright(c) 2016 Douglas Christopher Wilson
3190
- * MIT Licensed
3191
- */
3192
3199
  var statuses;
3193
3200
  var hasRequiredStatuses;
3194
3201
  function requireStatuses() {
@@ -3293,11 +3300,6 @@ function requireInherits_browser() {
3293
3300
  }
3294
3301
  return inherits_browser.exports;
3295
3302
  }
3296
- /*!
3297
- * toidentifier
3298
- * Copyright(c) 2016 Douglas Christopher Wilson
3299
- * MIT Licensed
3300
- */
3301
3303
  var toidentifier;
3302
3304
  var hasRequiredToidentifier;
3303
3305
  function requireToidentifier() {
@@ -3311,12 +3313,6 @@ function requireToidentifier() {
3311
3313
  }
3312
3314
  return toidentifier;
3313
3315
  }
3314
- /*!
3315
- * http-errors
3316
- * Copyright(c) 2014 Jonathan Ong
3317
- * Copyright(c) 2016 Douglas Christopher Wilson
3318
- * MIT Licensed
3319
- */
3320
3316
  var hasRequiredHttpErrors;
3321
3317
  function requireHttpErrors() {
3322
3318
  if (hasRequiredHttpErrors) return httpErrors.exports;
@@ -3384,8 +3380,8 @@ function requireHttpErrors() {
3384
3380
  inherits(HttpError, Error);
3385
3381
  return HttpError;
3386
3382
  }
3387
- function createClientErrorConstructor(HttpError, name, code) {
3388
- var className = toClassName(name);
3383
+ function createClientErrorConstructor(HttpError, name2, code) {
3384
+ var className = toClassName(name2);
3389
3385
  function ClientError(message) {
3390
3386
  var msg = message != null ? message : statuses2.message[code];
3391
3387
  var err = new Error(msg);
@@ -3423,8 +3419,8 @@ function requireHttpErrors() {
3423
3419
  return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode;
3424
3420
  };
3425
3421
  }
3426
- function createServerErrorConstructor(HttpError, name, code) {
3427
- var className = toClassName(name);
3422
+ function createServerErrorConstructor(HttpError, name2, code) {
3423
+ var className = toClassName(name2);
3428
3424
  function ServerError(message) {
3429
3425
  var msg = message != null ? message : statuses2.message[code];
3430
3426
  var err = new Error(msg);
@@ -3451,33 +3447,33 @@ function requireHttpErrors() {
3451
3447
  ServerError.prototype.expose = false;
3452
3448
  return ServerError;
3453
3449
  }
3454
- function nameFunc(func, name) {
3450
+ function nameFunc(func, name2) {
3455
3451
  var desc = Object.getOwnPropertyDescriptor(func, "name");
3456
3452
  if (desc && desc.configurable) {
3457
- desc.value = name;
3453
+ desc.value = name2;
3458
3454
  Object.defineProperty(func, "name", desc);
3459
3455
  }
3460
3456
  }
3461
3457
  function populateConstructorExports(exports, codes, HttpError) {
3462
3458
  codes.forEach(function forEachCode(code) {
3463
3459
  var CodeError;
3464
- var name = toIdentifier(statuses2.message[code]);
3460
+ var name2 = toIdentifier(statuses2.message[code]);
3465
3461
  switch (codeClass(code)) {
3466
3462
  case 400:
3467
- CodeError = createClientErrorConstructor(HttpError, name, code);
3463
+ CodeError = createClientErrorConstructor(HttpError, name2, code);
3468
3464
  break;
3469
3465
  case 500:
3470
- CodeError = createServerErrorConstructor(HttpError, name, code);
3466
+ CodeError = createServerErrorConstructor(HttpError, name2, code);
3471
3467
  break;
3472
3468
  }
3473
3469
  if (CodeError) {
3474
3470
  exports[code] = CodeError;
3475
- exports[name] = CodeError;
3471
+ exports[name2] = CodeError;
3476
3472
  }
3477
3473
  });
3478
3474
  }
3479
- function toClassName(name) {
3480
- return name.substr(-5) !== "Error" ? name + "Error" : name;
3475
+ function toClassName(name2) {
3476
+ return name2.substr(-5) !== "Error" ? name2 + "Error" : name2;
3481
3477
  }
3482
3478
  })(httpErrors);
3483
3479
  return httpErrors.exports;
@@ -5049,8 +5045,8 @@ function requireEnoent() {
5049
5045
  return;
5050
5046
  }
5051
5047
  const originalEmit = cp.emit;
5052
- cp.emit = function(name, arg1) {
5053
- if (name === "exit") {
5048
+ cp.emit = function(name2, arg1) {
5049
+ if (name2 === "exit") {
5054
5050
  const err = verifyENOENT(arg1, parsed);
5055
5051
  if (err) {
5056
5052
  return originalEmit.call(cp, "error", err);
@@ -5545,7 +5541,7 @@ function requireSignals$1() {
5545
5541
  };
5546
5542
  signals$1.getSignals = getSignals;
5547
5543
  const normalizeSignal = function({
5548
- name,
5544
+ name: name2,
5549
5545
  number: defaultNumber,
5550
5546
  description,
5551
5547
  action,
@@ -5553,11 +5549,11 @@ function requireSignals$1() {
5553
5549
  standard
5554
5550
  }) {
5555
5551
  const {
5556
- signals: { [name]: constantSignal }
5552
+ signals: { [name2]: constantSignal }
5557
5553
  } = _os.constants;
5558
5554
  const supported = constantSignal !== void 0;
5559
5555
  const number2 = supported ? constantSignal : defaultNumber;
5560
- return { name, number: number2, description, supported, action, forced, standard };
5556
+ return { name: name2, number: number2, description, supported, action, forced, standard };
5561
5557
  };
5562
5558
  return signals$1;
5563
5559
  }
@@ -5574,10 +5570,10 @@ function requireMain() {
5574
5570
  const signals2 = (0, _signals.getSignals)();
5575
5571
  return signals2.reduce(getSignalByName, {});
5576
5572
  };
5577
- const getSignalByName = function(signalByNameMemo, { name, number: number2, description, supported, action, forced, standard }) {
5573
+ const getSignalByName = function(signalByNameMemo, { name: name2, number: number2, description, supported, action, forced, standard }) {
5578
5574
  return {
5579
5575
  ...signalByNameMemo,
5580
- [name]: { name, number: number2, description, supported, action, forced, standard }
5576
+ [name2]: { name: name2, number: number2, description, supported, action, forced, standard }
5581
5577
  };
5582
5578
  };
5583
5579
  const signalsByName = getSignalsByName();
@@ -5593,10 +5589,10 @@ function requireMain() {
5593
5589
  if (signal === void 0) {
5594
5590
  return {};
5595
5591
  }
5596
- const { name, description, supported, action, forced, standard } = signal;
5592
+ const { name: name2, description, supported, action, forced, standard } = signal;
5597
5593
  return {
5598
5594
  [number2]: {
5599
- name,
5595
+ name: name2,
5600
5596
  number: number2,
5601
5597
  description,
5602
5598
  supported,
@@ -5607,7 +5603,7 @@ function requireMain() {
5607
5603
  };
5608
5604
  };
5609
5605
  const findSignalByNumber = function(number2, signals2) {
5610
- const signal = signals2.find(({ name }) => _os.constants.signals[name] === number2);
5606
+ const signal = signals2.find(({ name: name2 }) => _os.constants.signals[name2] === number2);
5611
5607
  if (signal !== void 0) {
5612
5608
  return signal;
5613
5609
  }
@@ -5617,10 +5613,10 @@ function requireMain() {
5617
5613
  main.signalsByNumber = signalsByNumber;
5618
5614
  return main;
5619
5615
  }
5620
- var error;
5616
+ var error$1;
5621
5617
  var hasRequiredError;
5622
5618
  function requireError() {
5623
- if (hasRequiredError) return error;
5619
+ if (hasRequiredError) return error$1;
5624
5620
  hasRequiredError = 1;
5625
5621
  const { signalsByName } = requireMain();
5626
5622
  const getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
@@ -5691,8 +5687,8 @@ ${error2.message}` : execaMessage;
5691
5687
  error2.killed = killed && !timedOut;
5692
5688
  return error2;
5693
5689
  };
5694
- error = makeError;
5695
- return error;
5690
+ error$1 = makeError;
5691
+ return error$1;
5696
5692
  }
5697
5693
  var stdio = { exports: {} };
5698
5694
  var hasRequiredStdio;
@@ -6762,15 +6758,15 @@ function requireFindUp$1() {
6762
6758
  const locatePath2 = requireLocatePath$1();
6763
6759
  const pathExists2 = requirePathExists$2();
6764
6760
  const stop = Symbol("findUp.stop");
6765
- module.exports = async (name, options = {}) => {
6761
+ module.exports = async (name2, options = {}) => {
6766
6762
  let directory = path.resolve(options.cwd || "");
6767
6763
  const { root } = path.parse(directory);
6768
- const paths = [].concat(name);
6764
+ const paths = [].concat(name2);
6769
6765
  const runMatcher = async (locateOptions) => {
6770
- if (typeof name !== "function") {
6766
+ if (typeof name2 !== "function") {
6771
6767
  return locatePath2(paths, locateOptions);
6772
6768
  }
6773
- const foundPath = await name(locateOptions.cwd);
6769
+ const foundPath = await name2(locateOptions.cwd);
6774
6770
  if (typeof foundPath === "string") {
6775
6771
  return locatePath2([foundPath], locateOptions);
6776
6772
  }
@@ -6790,15 +6786,15 @@ function requireFindUp$1() {
6790
6786
  directory = path.dirname(directory);
6791
6787
  }
6792
6788
  };
6793
- module.exports.sync = (name, options = {}) => {
6789
+ module.exports.sync = (name2, options = {}) => {
6794
6790
  let directory = path.resolve(options.cwd || "");
6795
6791
  const { root } = path.parse(directory);
6796
- const paths = [].concat(name);
6792
+ const paths = [].concat(name2);
6797
6793
  const runMatcher = (locateOptions) => {
6798
- if (typeof name !== "function") {
6794
+ if (typeof name2 !== "function") {
6799
6795
  return locatePath2.sync(paths, locateOptions);
6800
6796
  }
6801
- const foundPath = name(locateOptions.cwd);
6797
+ const foundPath = name2(locateOptions.cwd);
6802
6798
  if (typeof foundPath === "string") {
6803
6799
  return locatePath2.sync([foundPath], locateOptions);
6804
6800
  }
@@ -6957,12 +6953,6 @@ function requireStringify() {
6957
6953
  };
6958
6954
  return stringify;
6959
6955
  }
6960
- /*!
6961
- * is-number <https://github.com/jonschlinkert/is-number>
6962
- *
6963
- * Copyright (c) 2014-present, Jon Schlinkert.
6964
- * Released under the MIT License.
6965
- */
6966
6956
  var isNumber;
6967
6957
  var hasRequiredIsNumber;
6968
6958
  function requireIsNumber() {
@@ -6979,12 +6969,6 @@ function requireIsNumber() {
6979
6969
  };
6980
6970
  return isNumber;
6981
6971
  }
6982
- /*!
6983
- * to-regex-range <https://github.com/micromatch/to-regex-range>
6984
- *
6985
- * Copyright (c) 2015-present, Jon Schlinkert.
6986
- * Released under the MIT License.
6987
- */
6988
6972
  var toRegexRange_1;
6989
6973
  var hasRequiredToRegexRange;
6990
6974
  function requireToRegexRange() {
@@ -7196,12 +7180,6 @@ function requireToRegexRange() {
7196
7180
  toRegexRange_1 = toRegexRange;
7197
7181
  return toRegexRange_1;
7198
7182
  }
7199
- /*!
7200
- * fill-range <https://github.com/jonschlinkert/fill-range>
7201
- *
7202
- * Copyright (c) 2014-present, Jon Schlinkert.
7203
- * Licensed under the MIT License.
7204
- */
7205
7183
  var fillRange;
7206
7184
  var hasRequiredFillRange;
7207
7185
  function requireFillRange() {
@@ -9967,15 +9945,15 @@ function requireFindUp() {
9967
9945
  const locatePath2 = requireLocatePath();
9968
9946
  const pathExists2 = requirePathExists$1();
9969
9947
  const stop = Symbol("findUp.stop");
9970
- module.exports = async (name, options = {}) => {
9948
+ module.exports = async (name2, options = {}) => {
9971
9949
  let directory = path.resolve(options.cwd || "");
9972
9950
  const { root } = path.parse(directory);
9973
- const paths = [].concat(name);
9951
+ const paths = [].concat(name2);
9974
9952
  const runMatcher = async (locateOptions) => {
9975
- if (typeof name !== "function") {
9953
+ if (typeof name2 !== "function") {
9976
9954
  return locatePath2(paths, locateOptions);
9977
9955
  }
9978
- const foundPath = await name(locateOptions.cwd);
9956
+ const foundPath = await name2(locateOptions.cwd);
9979
9957
  if (typeof foundPath === "string") {
9980
9958
  return locatePath2([foundPath], locateOptions);
9981
9959
  }
@@ -9995,15 +9973,15 @@ function requireFindUp() {
9995
9973
  directory = path.dirname(directory);
9996
9974
  }
9997
9975
  };
9998
- module.exports.sync = (name, options = {}) => {
9976
+ module.exports.sync = (name2, options = {}) => {
9999
9977
  let directory = path.resolve(options.cwd || "");
10000
9978
  const { root } = path.parse(directory);
10001
- const paths = [].concat(name);
9979
+ const paths = [].concat(name2);
10002
9980
  const runMatcher = (locateOptions) => {
10003
- if (typeof name !== "function") {
9981
+ if (typeof name2 !== "function") {
10004
9982
  return locatePath2.sync(paths, locateOptions);
10005
9983
  }
10006
- const foundPath = name(locateOptions.cwd);
9984
+ const foundPath = name2(locateOptions.cwd);
10007
9985
  if (typeof foundPath === "string") {
10008
9986
  return locatePath2.sync([foundPath], locateOptions);
10009
9987
  }
@@ -10492,11 +10470,11 @@ function requireGracefulFs() {
10492
10470
  }
10493
10471
  });
10494
10472
  }
10495
- var debug = noop;
10473
+ var debug2 = noop;
10496
10474
  if (util.debuglog)
10497
- debug = util.debuglog("gfs4");
10475
+ debug2 = util.debuglog("gfs4");
10498
10476
  else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
10499
- debug = function() {
10477
+ debug2 = function() {
10500
10478
  var m = util.format.apply(util, arguments);
10501
10479
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
10502
10480
  console.error(m);
@@ -10531,7 +10509,7 @@ function requireGracefulFs() {
10531
10509
  })(fs.closeSync);
10532
10510
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
10533
10511
  process.on("exit", function() {
10534
- debug(fs[gracefulQueue]);
10512
+ debug2(fs[gracefulQueue]);
10535
10513
  require$$0$5.equal(fs[gracefulQueue].length, 0);
10536
10514
  });
10537
10515
  }
@@ -10783,7 +10761,7 @@ function requireGracefulFs() {
10783
10761
  return fs2;
10784
10762
  }
10785
10763
  function enqueue(elem) {
10786
- debug("ENQUEUE", elem[0].name, elem[1]);
10764
+ debug2("ENQUEUE", elem[0].name, elem[1]);
10787
10765
  fs[gracefulQueue].push(elem);
10788
10766
  retry();
10789
10767
  }
@@ -10810,10 +10788,10 @@ function requireGracefulFs() {
10810
10788
  var startTime = elem[3];
10811
10789
  var lastTime = elem[4];
10812
10790
  if (startTime === void 0) {
10813
- debug("RETRY", fn.name, args);
10791
+ debug2("RETRY", fn.name, args);
10814
10792
  fn.apply(null, args);
10815
10793
  } else if (Date.now() - startTime >= 6e4) {
10816
- debug("TIMEOUT", fn.name, args);
10794
+ debug2("TIMEOUT", fn.name, args);
10817
10795
  var cb = args.pop();
10818
10796
  if (typeof cb === "function")
10819
10797
  cb.call(null, err);
@@ -10822,7 +10800,7 @@ function requireGracefulFs() {
10822
10800
  var sinceStart = Math.max(lastTime - startTime, 1);
10823
10801
  var desiredDelay = Math.min(sinceStart * 1.2, 100);
10824
10802
  if (sinceAttempt >= desiredDelay) {
10825
- debug("RETRY", fn.name, args);
10803
+ debug2("RETRY", fn.name, args);
10826
10804
  fn.apply(null, args.concat([startTime]));
10827
10805
  } else {
10828
10806
  fs[gracefulQueue].push(elem);
@@ -10998,8 +10976,8 @@ function requireMark() {
10998
10976
  if (hasRequiredMark) return mark;
10999
10977
  hasRequiredMark = 1;
11000
10978
  var common2 = requireCommon();
11001
- function Mark(name, buffer, position, line, column) {
11002
- this.name = name;
10979
+ function Mark(name2, buffer, position, line, column) {
10980
+ this.name = name2;
11003
10981
  this.buffer = buffer;
11004
10982
  this.position = position;
11005
10983
  this.line = line;
@@ -11084,9 +11062,9 @@ function requireType() {
11084
11062
  }
11085
11063
  function Type(tag, options) {
11086
11064
  options = options || {};
11087
- Object.keys(options).forEach(function(name) {
11088
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
11089
- throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
11065
+ Object.keys(options).forEach(function(name2) {
11066
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name2) === -1) {
11067
+ throw new YAMLException('Unknown option "' + name2 + '" is met in definition of "' + tag + '" YAML type.');
11090
11068
  }
11091
11069
  });
11092
11070
  this.tag = tag;
@@ -11117,12 +11095,12 @@ function requireSchema() {
11117
11095
  var common2 = requireCommon();
11118
11096
  var YAMLException = requireException();
11119
11097
  var Type = requireType();
11120
- function compileList(schema2, name, result) {
11098
+ function compileList(schema2, name2, result) {
11121
11099
  var exclude = [];
11122
11100
  schema2.include.forEach(function(includedSchema) {
11123
- result = compileList(includedSchema, name, result);
11101
+ result = compileList(includedSchema, name2, result);
11124
11102
  });
11125
- schema2[name].forEach(function(currentType) {
11103
+ schema2[name2].forEach(function(currentType) {
11126
11104
  result.forEach(function(previousType, previousIndex) {
11127
11105
  if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
11128
11106
  exclude.push(previousIndex);
@@ -12108,6 +12086,18 @@ function requireLoader() {
12108
12086
  (c - 65536 & 1023) + 56320
12109
12087
  );
12110
12088
  }
12089
+ function setProperty(object2, key, value) {
12090
+ if (key === "__proto__") {
12091
+ Object.defineProperty(object2, key, {
12092
+ configurable: true,
12093
+ enumerable: true,
12094
+ writable: true,
12095
+ value
12096
+ });
12097
+ } else {
12098
+ object2[key] = value;
12099
+ }
12100
+ }
12111
12101
  var simpleEscapeCheck = new Array(256);
12112
12102
  var simpleEscapeMap = new Array(256);
12113
12103
  for (var i = 0; i < 256; i++) {
@@ -12146,7 +12136,7 @@ function requireLoader() {
12146
12136
  }
12147
12137
  }
12148
12138
  var directiveHandlers = {
12149
- YAML: function handleYamlDirective(state, name, args) {
12139
+ YAML: function handleYamlDirective(state, name2, args) {
12150
12140
  var match, major, minor;
12151
12141
  if (state.version !== null) {
12152
12142
  throwError(state, "duplication of %YAML directive");
@@ -12169,7 +12159,7 @@ function requireLoader() {
12169
12159
  throwWarning(state, "unsupported YAML version of the document");
12170
12160
  }
12171
12161
  },
12172
- TAG: function handleTagDirective(state, name, args) {
12162
+ TAG: function handleTagDirective(state, name2, args) {
12173
12163
  var handle, prefix;
12174
12164
  if (args.length !== 2) {
12175
12165
  throwError(state, "TAG directive accepts exactly two arguments");
@@ -12214,7 +12204,7 @@ function requireLoader() {
12214
12204
  for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) {
12215
12205
  key = sourceKeys[index2];
12216
12206
  if (!_hasOwnProperty.call(destination, key)) {
12217
- destination[key] = source[key];
12207
+ setProperty(destination, key, source[key]);
12218
12208
  overridableKeys[key] = true;
12219
12209
  }
12220
12210
  }
@@ -12253,7 +12243,7 @@ function requireLoader() {
12253
12243
  state.position = startPos || state.position;
12254
12244
  throwError(state, "duplicated mapping key");
12255
12245
  }
12256
- _result[keyNode] = valueNode;
12246
+ setProperty(_result, keyNode, valueNode);
12257
12247
  delete overridableKeys[keyNode];
12258
12248
  }
12259
12249
  return _result;
@@ -13685,9 +13675,9 @@ function requireJsYaml$1() {
13685
13675
  hasRequiredJsYaml$1 = 1;
13686
13676
  var loader2 = requireLoader();
13687
13677
  var dumper2 = requireDumper();
13688
- function deprecated(name) {
13678
+ function deprecated(name2) {
13689
13679
  return function() {
13690
- throw new Error("Function " + name + " is deprecated and cannot be used.");
13680
+ throw new Error("Function " + name2 + " is deprecated and cannot be used.");
13691
13681
  };
13692
13682
  }
13693
13683
  jsYaml$1.Type = requireType();
@@ -15093,7 +15083,7 @@ setLocale({
15093
15083
  }
15094
15084
  }
15095
15085
  });
15096
- function $constructor(name, initializer2, params) {
15086
+ function $constructor(name2, initializer2, params) {
15097
15087
  function init(inst, def) {
15098
15088
  var _a;
15099
15089
  Object.defineProperty(inst, "_zod", {
@@ -15101,7 +15091,7 @@ function $constructor(name, initializer2, params) {
15101
15091
  enumerable: false
15102
15092
  });
15103
15093
  (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
15104
- inst._zod.traits.add(name);
15094
+ inst._zod.traits.add(name2);
15105
15095
  initializer2(inst, def);
15106
15096
  for (const k in _.prototype) {
15107
15097
  if (!(k in inst))
@@ -15113,7 +15103,7 @@ function $constructor(name, initializer2, params) {
15113
15103
  const Parent = params?.Parent ?? Object;
15114
15104
  class Definition extends Parent {
15115
15105
  }
15116
- Object.defineProperty(Definition, "name", { value: name });
15106
+ Object.defineProperty(Definition, "name", { value: name2 });
15117
15107
  function _(def) {
15118
15108
  var _a;
15119
15109
  const inst = params?.Parent ? new Definition() : this;
@@ -15129,10 +15119,10 @@ function $constructor(name, initializer2, params) {
15129
15119
  value: (inst) => {
15130
15120
  if (params?.Parent && inst instanceof params.Parent)
15131
15121
  return true;
15132
- return inst?._zod?.traits?.has(name);
15122
+ return inst?._zod?.traits?.has(name2);
15133
15123
  }
15134
15124
  });
15135
- Object.defineProperty(_, "name", { value: name });
15125
+ Object.defineProperty(_, "name", { value: name2 });
15136
15126
  return _;
15137
15127
  }
15138
15128
  class $ZodAsyncError extends Error {
@@ -18343,7 +18333,7 @@ async function hasDeepPopulateCacheFullTextIndex(db, tableName, columnName) {
18343
18333
  }
18344
18334
  if (client === "mysql" || client === "mysql2") {
18345
18335
  return (await db.dialect.schemaInspector.getIndexes(tableName)).find(
18346
- ({ name }) => name === `${tableName}_${columnName}_fulltext`
18336
+ ({ name: name2 }) => name2 === `${tableName}_${columnName}_fulltext`
18347
18337
  ) !== void 0;
18348
18338
  }
18349
18339
  if (client === "pg" || client === "postgres") {
@@ -18490,7 +18480,13 @@ const register = async ({ strapi: strapi2 }) => {
18490
18480
  return result;
18491
18481
  });
18492
18482
  };
18493
- const version = "1.11.1-beta.1";
18483
+ const version = "1.11.1-rc.0";
18484
+ const name = "@fourlights/strapi-plugin-deep-populate";
18485
+ const error = (msg, context = void 0) => strapi.log.error(`[${name}] ${msg}`, context);
18486
+ const warn = (msg, context = void 0) => strapi.log.warn(`[${name}] ${msg}`, context);
18487
+ const info = (msg, context = void 0) => strapi.log.info(`[${name}] ${msg}`, context);
18488
+ const debug = (msg, context = void 0) => strapi.log.debug(`[${name}] ${msg}`, context);
18489
+ const log = { error, warn, info, debug };
18494
18490
  const sanitizeObject = (obj) => {
18495
18491
  if (obj === null || typeof obj !== "object") return obj;
18496
18492
  const dangerousProps = ["__proto__", "constructor", "prototype"];
@@ -18572,10 +18568,15 @@ const cache = ({ strapi: strapi2 }) => ({
18572
18568
  const documentService = strapi2.documents("plugin::deep-populate.cache");
18573
18569
  const hash = getHash(params);
18574
18570
  const entry = await documentService.findFirst({ filters: { hash: { $eq: hash } } });
18575
- return entry ? await documentService.update({
18576
- documentId: entry.documentId,
18577
- data: { populate: populate2, dependencies: dependencies.join(",") }
18578
- }) : await documentService.create({ data: { hash, params, populate: populate2, dependencies: dependencies.join(",") } });
18571
+ try {
18572
+ return entry ? await documentService.update({
18573
+ documentId: entry.documentId,
18574
+ data: { populate: populate2, dependencies: dependencies.join(",") }
18575
+ }) : await documentService.create({ data: { hash, params, populate: populate2, dependencies: dependencies.join(",") } });
18576
+ } catch (error2) {
18577
+ log.error("[Plugin: Deep Populate] Failed to save cached entry", { error: error2 });
18578
+ return;
18579
+ }
18579
18580
  },
18580
18581
  async clear(params) {
18581
18582
  const entry = await strapi2.documents("plugin::deep-populate.cache").findFirst({ filters: { hash: { $eq: getHash(params) } } });
@@ -18613,6 +18614,18 @@ async function _populateComponent({
18613
18614
  ...params
18614
18615
  }) {
18615
18616
  const componentLookup = lookup.length === 0 ? [attrName] : [...lookup, inDynamicZone ? "on" : "populate", attrName];
18617
+ if (strapi.getModel(schema2) === void 0) {
18618
+ if (inDynamicZone) {
18619
+ const dynamicZoneName = lookup[lookup.length - 1];
18620
+ log.warn(
18621
+ `[Plugin: Deep Populate] The dynamic zone '${dynamicZoneName}' is referencing a non-existing component '${schema2}'. You should fix this.`,
18622
+ { lookup }
18623
+ );
18624
+ } else {
18625
+ log.warn(`[Plugin: Deep Populate] Could not find component: '${schema2}'`);
18626
+ }
18627
+ return true;
18628
+ }
18616
18629
  const componentPopulate = populate2;
18617
18630
  set$2(componentPopulate, componentLookup, { populate: "*" });
18618
18631
  if (__allow?.components && !__allow.components.includes(schema2)) return { populate: "*" };
@@ -18734,8 +18747,7 @@ async function _populate({
18734
18747
  const newPopulate = {};
18735
18748
  const model = strapi.getModel(schema2);
18736
18749
  if (!model) {
18737
- strapi.log.warn(`[Plugin: Deep Populate] Could not find model for contentType: '${schema2}'`);
18738
- strapi.log.warn("Please create a bug report and share the troublesome contentType.");
18750
+ log.warn(`Could not find model for contentType: '${schema2}'`);
18739
18751
  return {};
18740
18752
  }
18741
18753
  let relations = getRelations(model);