@roamcode.ai/server 1.1.0 → 1.2.0

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.
@@ -14,13 +14,22 @@ interface RelayAccountRecord {
14
14
  createdAt: number;
15
15
  updatedAt: number;
16
16
  }
17
- interface CreateRelayAccountInput {
17
+ interface RelayAccountFields {
18
18
  label: string;
19
- credential: string;
20
19
  plan?: RelayAccountPlan;
21
20
  maxRoutes?: number;
22
21
  maxDevicesPerRoute?: number;
23
22
  }
23
+ interface RelayAccountCredentialMaterial {
24
+ credentialHash: string;
25
+ credentialLookup: string;
26
+ }
27
+ type CreateRelayAccountInput = RelayAccountFields & (({
28
+ credential: string;
29
+ } & Partial<Record<keyof RelayAccountCredentialMaterial, never>>) | ({
30
+ credential?: never;
31
+ } & RelayAccountCredentialMaterial));
32
+ type RelayAccountCredentialInput = string | RelayAccountCredentialMaterial;
24
33
  interface UpdateRelayAccountInput {
25
34
  label?: string;
26
35
  status?: RelayAccountStatus;
@@ -35,9 +44,11 @@ interface RelayAccountStore {
35
44
  listAccounts(options?: {
36
45
  includeDeleted?: boolean;
37
46
  }): RelayAccountRecord[];
47
+ /** Verify ownership for recovery without granting a suspended account route access. */
48
+ verifyCredential(credential: string): RelayAccountRecord | undefined;
38
49
  authenticate(credential: string): RelayAccountRecord | undefined;
39
50
  updateAccount(id: string, input: UpdateRelayAccountInput, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
40
- rotateCredential(id: string, credential: string, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
51
+ rotateCredential(id: string, credential: RelayAccountCredentialInput, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
41
52
  close(): void;
42
53
  }
43
54
 
@@ -94,6 +105,7 @@ interface RelayRouteStore {
94
105
  }
95
106
 
96
107
  interface BlindRelayMetrics {
108
+ activeConnections: number;
97
109
  activeHosts: number;
98
110
  activeDevices: number;
99
111
  acceptedConnections: number;