@lmzhen/dsh-evolution-core 0.59.4 → 0.59.6

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.
@@ -340,6 +340,7 @@ var MutationUnit = class {
340
340
  lock;
341
341
  targetKeys;
342
342
  targetKeysForSnapshot;
343
+ targetKeyResolver;
343
344
  journal;
344
345
  snapshots;
345
346
  claim;
@@ -376,6 +377,10 @@ var MutationUnit = class {
376
377
  now: this.now
377
378
  });
378
379
  }
380
+ async resolveTargetKeys(keys) {
381
+ if (keys === void 0 || this.targetKeyResolver === void 0) return keys;
382
+ return await this.targetKeyResolver(keys);
383
+ }
379
384
  preview(request) {
380
385
  const validation = validateMutationRequest(request, this.limits);
381
386
  return {
@@ -407,7 +412,7 @@ var MutationUnit = class {
407
412
  return await this.serial(async () => {
408
413
  let lease;
409
414
  try {
410
- lease = await this.lock.acquire(this.targetKeys);
415
+ lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeys));
411
416
  } catch (error) {
412
417
  return {
413
418
  ok: false,
@@ -650,7 +655,7 @@ var MutationUnit = class {
650
655
  return await this.serial(async () => {
651
656
  let lease;
652
657
  try {
653
- lease = await this.lock.acquire(this.targetKeysForSnapshot?.(snapshot) ?? this.targetKeys);
658
+ lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeysForSnapshot?.(snapshot) ?? this.targetKeys));
654
659
  } catch (error) {
655
660
  return {
656
661
  ok: false,
@@ -778,7 +783,7 @@ var MutationUnit = class {
778
783
  return await this.serial(async () => {
779
784
  let lease;
780
785
  try {
781
- lease = await this.lock.acquire(this.targetKeys);
786
+ lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeys));
782
787
  } catch (error) {
783
788
  return {
784
789
  ok: false,