@ziggs-ai/api-client 0.1.23 → 0.1.24

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.
@@ -126,8 +126,15 @@ export async function respondToAgreement(agreementId, action, creds, opts = {})
126
126
  }
127
127
  const proposedTo = agreement.parties?.proposedTo;
128
128
  if (isBroadcastTarget(proposedTo)) {
129
- if (action === 'reject')
130
- return agreement;
129
+ if (action === 'reject') {
130
+ // ZIG-719: an open/broadcast proposal is offered to many via a sentinel
131
+ // `proposedTo` ('everyone' | 'org'), so there is no per-recipient party
132
+ // slot for one recipient to reject and nothing a single reject could
133
+ // change server-side. Returning the agreement here reported a fake
134
+ // success while the item stayed claimable. Fail honestly instead — the
135
+ // caller either claims it (action=approve → POST /claim) or ignores it.
136
+ throw new Error(`Agreement ${agreementId} is an open/broadcast proposal (proposedTo="${String(proposedTo)}") and cannot be rejected by a single recipient — it has no personal approval slot. Ignore it to pass on it, or use action=approve to claim it.`);
137
+ }
131
138
  const { agreement: updated } = await claimAgreement(agreementId, creds);
132
139
  return updated;
133
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",