@alliance-droid/status-feedback-system 4.0.2 → 4.0.3

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/api.d.ts CHANGED
@@ -70,6 +70,8 @@ export interface BoardTransitions {
70
70
  publicStatus: PublicStatus;
71
71
  };
72
72
  targets: BoardTransition[];
73
+ /** Whether this user may manage status on this project (drives the UI affordance). */
74
+ canManage: boolean;
73
75
  }
74
76
  /** Result of applying a status change from the board. */
75
77
  export interface BoardStatusUpdate {
@@ -184,11 +184,13 @@ export function createFeedbackBoard(options) {
184
184
  try {
185
185
  const result = await client.getBoardTransitions(itemId, token);
186
186
  transitions = { ...transitions, [itemId]: result };
187
- statusPrivilege = true; // a successful load means the backend authorized this user
187
+ // The backend tells us whether this user may manage status (200 either
188
+ // way — no 403 console noise for ordinary signed-in users).
189
+ statusPrivilege = result.canManage;
188
190
  return result;
189
191
  }
190
192
  catch {
191
- // 401/403 → not signed in or not privileged for this item: no control.
193
+ // 401 (no/invalid token) or network error → no control.
192
194
  return null;
193
195
  }
194
196
  }
@@ -205,7 +207,8 @@ export function createFeedbackBoard(options) {
205
207
  if (!sample)
206
208
  return;
207
209
  privilegeProbed = true;
208
- statusPrivilege = (await loadTransitions(sample.id)) !== null;
210
+ // loadTransitions sets statusPrivilege from the result's canManage flag.
211
+ await loadTransitions(sample.id);
209
212
  }
210
213
  async function setStatus(itemId, status, reason) {
211
214
  const token = await resolveToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alliance-droid/status-feedback-system",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "type": "module",
5
5
  "description": "Drop-in system status pages and user feedback forms for SvelteKit apps",
6
6
  "svelte": "./dist/index.js",