@@ -16,7 +16,6 @@ import {
1616 WS_METHODS ,
1717} from "@t3tools/contracts" ;
1818import {
19- type RelayClientEnvironmentRecord ,
2019 type RelayEnvironmentLinkResponse ,
2120 type RelayManagedEndpointProviderKind ,
2221} from "@t3tools/contracts/relay" ;
@@ -33,14 +32,6 @@ import {
3332 requestRelayClientInstallConfirmation ,
3433} from "./relayClientInstallDialog" ;
3534
36- export function normalizeRelayBaseUrl ( value : string | null | undefined ) : string | null {
37- const trimmed = value ?. trim ( ) ;
38- if ( ! trimmed ) {
39- return null ;
40- }
41- return trimmed . replace ( / \/ + $ / g, "" ) ;
42- }
43-
4435function relayUrl ( ) : string | null {
4536 return resolveCloudPublicConfig ( ) . relayUrl ;
4637}
@@ -194,53 +185,6 @@ export interface CloudLinkTarget {
194185
195186export type CloudLinkState = EnvironmentCloudLinkStateResult ;
196187
197- export function collectCloudLinkTargets ( input : {
198- readonly primary : CloudLinkTarget | null ;
199- readonly saved : ReadonlyArray < CloudLinkTarget > ;
200- } ) : ReadonlyArray < CloudLinkTarget > {
201- const byId = new Map < string , CloudLinkTarget > ( ) ;
202- if ( input . primary ) {
203- byId . set ( input . primary . environmentId , input . primary ) ;
204- }
205- for ( const environment of input . saved ) {
206- if ( ! byId . has ( environment . environmentId ) ) {
207- byId . set ( environment . environmentId , environment ) ;
208- }
209- }
210- return [ ...byId . values ( ) ] ;
211- }
212-
213- export function listManagedCloudEnvironments ( input : {
214- readonly clerkToken : string ;
215- } ) : Effect . Effect <
216- ReadonlyArray < RelayClientEnvironmentRecord > ,
217- CloudEnvironmentLinkError ,
218- ManagedRelay . ManagedRelayClient
219- > {
220- return Effect . gen ( function * ( ) {
221- const configuredRelayUrl = relayUrl ( ) ;
222- if ( ! configuredRelayUrl ) {
223- return yield * new CloudEnvironmentLinkError ( {
224- message : "T3CODE_RELAY_URL is not configured." ,
225- } ) ;
226- }
227- const relayClient = yield * ManagedRelay . ManagedRelayClient ;
228- return yield * relayClient
229- . listEnvironments ( {
230- clerkToken : input . clerkToken ,
231- } )
232- . pipe (
233- Effect . mapError (
234- ( cause ) =>
235- new CloudEnvironmentLinkError ( {
236- message : "Could not list relay-managed environments." ,
237- cause,
238- } ) ,
239- ) ,
240- ) ;
241- } ) ;
242- }
243-
244188export function readPrimaryCloudLinkState ( input : {
245189 readonly target : CloudLinkTarget ;
246190} ) : Effect . Effect < CloudLinkState | null , CloudEnvironmentLinkError , HttpClient . HttpClient > {
0 commit comments