(
ref: ConnectionRef,
)
| 2679 | ); |
| 2680 | |
| 2681 | const connectionsRefresh = ( |
| 2682 | ref: ConnectionRef, |
| 2683 | ): Effect.Effect< |
| 2684 | readonly Tool[], |
| 2685 | ConnectionNotFoundError | IntegrationNotFoundError | StorageFailure |
| 2686 | > => |
| 2687 | Effect.gen(function* () { |
| 2688 | const row = yield* findConnectionRow(ref); |
| 2689 | if (!row) { |
| 2690 | return yield* new ConnectionNotFoundError({ |
| 2691 | owner: ref.owner, |
| 2692 | integration: ref.integration, |
| 2693 | name: ref.name, |
| 2694 | }); |
| 2695 | } |
| 2696 | const integrationRow = yield* findIntegrationRow(ref.integration); |
| 2697 | if (!integrationRow) { |
| 2698 | return yield* new IntegrationNotFoundError({ slug: ref.integration }); |
| 2699 | } |
| 2700 | return yield* produceConnectionTools(integrationRow, ref); |
| 2701 | }); |
| 2702 | |
| 2703 | // No health-check capability ⇒ "unknown" rather than an error: the caller |
| 2704 | // can still render the connection, just without a liveness verdict. |
no test coverage detected