(
ref: ConnectionRef,
)
| 4750 | ); |
| 4751 | |
| 4752 | const connectionsRefresh = ( |
| 4753 | ref: ConnectionRef, |
| 4754 | ): Effect.Effect< |
| 4755 | readonly Tool[], |
| 4756 | ConnectionNotFoundError | IntegrationNotFoundError | OrgWriteDeniedError | StorageFailure |
| 4757 | > => |
| 4758 | Effect.gen(function* () { |
| 4759 | yield* guardOrgWrite(ref.owner); |
| 4760 | const row = yield* findConnectionRow(ref); |
| 4761 | if (!row) { |
| 4762 | return yield* new ConnectionNotFoundError({ |
| 4763 | owner: ref.owner, |
| 4764 | integration: ref.integration, |
| 4765 | name: ref.name, |
| 4766 | }); |
| 4767 | } |
| 4768 | const integrationRow = yield* findIntegrationRow(ref.integration); |
| 4769 | if (!integrationRow) { |
| 4770 | return yield* new IntegrationNotFoundError({ slug: ref.integration }); |
| 4771 | } |
| 4772 | return yield* produceConnectionTools(integrationRow, ref); |
| 4773 | }); |
| 4774 | |
| 4775 | // No health-check capability ⇒ "unknown" rather than an error: the caller |
| 4776 | // can still render the connection, just without a liveness verdict. |
no test coverage detected