@arbidocs/sdk 0.4.158 → 0.4.159

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.cjs CHANGED
@@ -5474,12 +5474,14 @@ async function suggestSignatureFields(arbi, docId, version) {
5474
5474
  return data.fields;
5475
5475
  }
5476
5476
  function assignSuggestions(suggestions, signers) {
5477
- const groups = [...new Set(suggestions.map((s2) => s2.group))];
5477
+ const groups = [...new Set(suggestions.filter((s2) => !s2.signer_email).map((s2) => s2.group))];
5478
5478
  return suggestions.flatMap((s2, i2) => {
5479
- const signer = signers[groups.indexOf(s2.group)];
5479
+ const signer = s2.signer_email ?? signers[groups.indexOf(s2.group)];
5480
5480
  if (!signer) return [];
5481
5481
  const { type, page, x: x2, y: y2, width, height } = s2;
5482
- return [{ id: `s${i2 + 1}`, type, page, x: x2, y: y2, width, height, signer, required: true }];
5482
+ return [
5483
+ { id: `s${i2 + 1}`, type, page, x: x2, y: y2, width, height, signer, required: s2.required ?? true }
5484
+ ];
5483
5485
  });
5484
5486
  }
5485
5487
  async function createSignatureRequest(arbi, docId, { fields, version, message, send = true }) {