mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-09 03:41:17 +02:00
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: codex <codex@users.noreply.github.com>
68 lines
2.2 KiB
TypeScript
68 lines
2.2 KiB
TypeScript
import * as Schema from "effect/Schema";
|
|
|
|
import { TrimmedNonEmptyString } from "./baseSchemas.ts";
|
|
|
|
export const AdvertisedEndpointProviderKind = Schema.Literals([
|
|
"core",
|
|
"private-network",
|
|
"tunnel",
|
|
"manual",
|
|
]);
|
|
export type AdvertisedEndpointProviderKind = typeof AdvertisedEndpointProviderKind.Type;
|
|
|
|
export const AdvertisedEndpointReachability = Schema.Literals([
|
|
"loopback",
|
|
"lan",
|
|
"private-network",
|
|
"public",
|
|
]);
|
|
export type AdvertisedEndpointReachability = typeof AdvertisedEndpointReachability.Type;
|
|
|
|
export const AdvertisedEndpointHostedHttpsCompatibility = Schema.Literals([
|
|
"compatible",
|
|
"mixed-content-blocked",
|
|
"requires-configuration",
|
|
"unknown",
|
|
]);
|
|
export type AdvertisedEndpointHostedHttpsCompatibility =
|
|
typeof AdvertisedEndpointHostedHttpsCompatibility.Type;
|
|
|
|
export const AdvertisedEndpointStatus = Schema.Literals(["available", "unavailable", "unknown"]);
|
|
export type AdvertisedEndpointStatus = typeof AdvertisedEndpointStatus.Type;
|
|
|
|
export const AdvertisedEndpointSource = Schema.Literals([
|
|
"desktop-core",
|
|
"desktop-addon",
|
|
"server",
|
|
"user",
|
|
]);
|
|
export type AdvertisedEndpointSource = typeof AdvertisedEndpointSource.Type;
|
|
|
|
export const AdvertisedEndpointProvider = Schema.Struct({
|
|
id: TrimmedNonEmptyString,
|
|
label: TrimmedNonEmptyString,
|
|
kind: AdvertisedEndpointProviderKind,
|
|
isAddon: Schema.Boolean,
|
|
});
|
|
export type AdvertisedEndpointProvider = typeof AdvertisedEndpointProvider.Type;
|
|
|
|
export const AdvertisedEndpointCompatibility = Schema.Struct({
|
|
hostedHttpsApp: AdvertisedEndpointHostedHttpsCompatibility,
|
|
desktopApp: Schema.Literals(["compatible", "unknown"]),
|
|
});
|
|
export type AdvertisedEndpointCompatibility = typeof AdvertisedEndpointCompatibility.Type;
|
|
|
|
export const AdvertisedEndpoint = Schema.Struct({
|
|
id: TrimmedNonEmptyString,
|
|
label: TrimmedNonEmptyString,
|
|
provider: AdvertisedEndpointProvider,
|
|
httpBaseUrl: TrimmedNonEmptyString,
|
|
wsBaseUrl: TrimmedNonEmptyString,
|
|
reachability: AdvertisedEndpointReachability,
|
|
compatibility: AdvertisedEndpointCompatibility,
|
|
source: AdvertisedEndpointSource,
|
|
status: AdvertisedEndpointStatus,
|
|
isDefault: Schema.optional(Schema.Boolean),
|
|
description: Schema.optional(TrimmedNonEmptyString),
|
|
});
|
|
export type AdvertisedEndpoint = typeof AdvertisedEndpoint.Type;
|