@docmana/sdk 0.40.0 → 0.41.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.
package/dist/index.mjs CHANGED
@@ -654,25 +654,28 @@ function reviewConflictDetails(raw) {
654
654
  const actor = isRecord(raw.decidedBy) ? raw.decidedBy : {};
655
655
  const id = text(actor.id, 200);
656
656
  const name = text(actor.name, 200);
657
- const firstName = text(actor.firstName, 200);
658
- const lastName = text(actor.lastName, 200);
659
- const email = text(actor.email, 200);
657
+ const profile = {
658
+ firstName: text(actor.firstName, 200),
659
+ lastName: text(actor.lastName, 200),
660
+ email: text(actor.email, 200)
661
+ };
660
662
  const source = actor.source === "integrator" || actor.source === "token" ? actor.source : null;
661
663
  const decidedBy = [
662
664
  id,
663
665
  name,
664
- firstName,
665
- lastName,
666
- email,
666
+ ...Object.values(profile),
667
667
  source
668
668
  ].some((part) => part !== null) ? {
669
669
  ...id !== null ? { id } : {},
670
670
  ...name !== null ? { name } : {},
671
- ...firstName !== null ? { firstName } : {},
672
- ...lastName !== null ? { lastName } : {},
673
- ...email !== null ? { email } : {},
674
671
  ...source ? { source } : {}
675
672
  } : null;
673
+ if (decidedBy) {
674
+ for (const [key, value] of Object.entries(profile)) {
675
+ if (value !== null)
676
+ Object.defineProperty(decidedBy, key, { value, writable: true, configurable: true });
677
+ }
678
+ }
676
679
  const currentVersion = version(raw.currentVersion) ?? version(raw.version);
677
680
  const decidedAt = text(raw.decidedAt, 40) ?? text(raw.submittedAt, 40);
678
681
  return {