@fourier-labs/harbour 0.1.42 → 0.1.43-rc.1

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.
@@ -295,8 +295,11 @@ function renderIntegrationsStatus(status) {
295
295
  if (!status.linked)
296
296
  return "This app is not linked yet; `harbour integrations request` links it.";
297
297
  const lines = [`App ${status.appId}`];
298
- for (const grant of status.grants)
298
+ for (const grant of status.grants) {
299
299
  lines.push(` ${grant.connection} [${grant.environment}, ${grant.identityMode}] ${grant.status} — ${grant.readiness}${grant.expiresAt ? ` until ${grant.expiresAt}` : ""}: ${grant.operations.join(", ")}`);
300
+ if (grant.failure)
301
+ lines.push(` ${grant.failure.message} ${grant.failure.remediation}`);
302
+ }
300
303
  for (const request of status.requests)
301
304
  lines.push(` request ${request.requestId}: ${request.state} (${request.reason})`);
302
305
  if (!status.grants.length && !status.requests.length)
@@ -100,6 +100,8 @@ export async function requestIntegrations(root, client, tenantId, bundle, option
100
100
  // a changed per-app name) is still attached to it as pending: READY only once the grant no longer waits on it.
101
101
  for (const item of submitted) {
102
102
  const grant = grants.find(candidate => candidate.grantId === item.grantId);
103
+ if (grant?.failure)
104
+ throw new CliError(grant.failure.code, `${grant.failure.message} ${grant.failure.remediation}`);
103
105
  if (grant?.readiness === "ready" && grant.pendingRequestId !== item.requestId)
104
106
  item.state = "READY";
105
107
  }
@@ -259,5 +261,5 @@ export async function integrationsStatus(root, client) {
259
261
  if (!lock?.appId)
260
262
  return { linked: false, grants: [], requests: [] };
261
263
  const listed = await client.list(lock.appId);
262
- return { appId: lock.appId, linked: true, grants: listed.grants.map(grant => ({ connection: grant.connection, environment: grant.environment, identityMode: grant.identityMode, status: grant.status, operations: grant.operations, resources: grant.resources, expiresAt: grant.expiresAt, readiness: grant.readiness, pendingRequestId: grant.pendingRequestId })), requests: listed.requests };
264
+ return { appId: lock.appId, linked: true, grants: listed.grants.map(grant => ({ connection: grant.connection, environment: grant.environment, identityMode: grant.identityMode, status: grant.status, operations: grant.operations, resources: grant.resources, expiresAt: grant.expiresAt, readiness: grant.readiness, pendingRequestId: grant.pendingRequestId, failure: grant.failure })), requests: listed.requests };
263
265
  }
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.1.42";
1
+ export const CLI_VERSION = "0.1.43-rc.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fourier-labs/harbour",
3
- "version": "0.1.42",
3
+ "version": "0.1.43-rc.1",
4
4
  "description": "Harbour productionisation helper",
5
5
  "type": "module",
6
6
  "bin": {