tslocal 0.1.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.
- package/LICENSE +28 -0
- package/README.md +104 -0
- package/dist/index.cjs +695 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +744 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +744 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +651 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -0
- package/ts/src/client.ts +191 -0
- package/ts/src/errors.ts +68 -0
- package/ts/src/index.ts +28 -0
- package/ts/src/json.ts +20 -0
- package/ts/src/safesocket.ts +93 -0
- package/ts/src/transport.ts +104 -0
- package/ts/src/types.ts +1009 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region ts/src/transport.d.ts
|
|
4
|
+
interface TransportOptions {
|
|
5
|
+
socketPath?: string;
|
|
6
|
+
useSocketOnly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region ts/src/types.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* PeerStatus describes a peer node and its current state.
|
|
12
|
+
* WARNING: The fields in PeerStatus are merged by the AddPeer method in the StatusBuilder.
|
|
13
|
+
* When adding a new field to PeerStatus, you must update AddPeer to handle merging
|
|
14
|
+
* the new field. The AddPeer function is responsible for combining multiple updates
|
|
15
|
+
* to the same peer, and any new field that is not merged properly may lead to
|
|
16
|
+
* inconsistencies or lost data in the peer status.
|
|
17
|
+
*/
|
|
18
|
+
declare const PeerStatusSchema: z.ZodObject<{
|
|
19
|
+
ID: z.ZodDefault<z.ZodString>;
|
|
20
|
+
PublicKey: z.ZodDefault<z.ZodString>;
|
|
21
|
+
HostName: z.ZodDefault<z.ZodString>;
|
|
22
|
+
DNSName: z.ZodDefault<z.ZodString>;
|
|
23
|
+
OS: z.ZodDefault<z.ZodString>;
|
|
24
|
+
UserID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
25
|
+
AltSharerUserID: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
26
|
+
TailscaleIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
27
|
+
AllowedIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
28
|
+
Tags: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
29
|
+
PrimaryRoutes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
30
|
+
Addrs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
31
|
+
CurAddr: z.ZodDefault<z.ZodString>;
|
|
32
|
+
Relay: z.ZodDefault<z.ZodString>;
|
|
33
|
+
PeerRelay: z.ZodDefault<z.ZodString>;
|
|
34
|
+
RxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
35
|
+
TxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
36
|
+
Created: z.ZodDefault<z.ZodString>;
|
|
37
|
+
LastWrite: z.ZodDefault<z.ZodString>;
|
|
38
|
+
LastSeen: z.ZodDefault<z.ZodString>;
|
|
39
|
+
LastHandshake: z.ZodDefault<z.ZodString>;
|
|
40
|
+
Online: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
ExitNode: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
ExitNodeOption: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
Active: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
PeerAPIURL: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
45
|
+
TaildropTarget: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
46
|
+
NoFileSharingReason: z.ZodDefault<z.ZodString>;
|
|
47
|
+
Capabilities: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
48
|
+
CapMap: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<unknown[], unknown[] | null | undefined>>>>>, z.ZodTransform<Record<string, unknown[]>, Record<string, unknown[]> | null | undefined>>;
|
|
49
|
+
sshHostKeys: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
50
|
+
ShareeNode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
51
|
+
InNetworkMap: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
InMagicSock: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
InEngine: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
Expired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
55
|
+
KeyExpiry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
Location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
57
|
+
Country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
CountryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
City: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
CityCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
Latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
|
+
Longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
|
+
Priority: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
64
|
+
}, z.core.$strip>>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
type PeerStatus = z.infer<typeof PeerStatusSchema>;
|
|
67
|
+
/** TailnetStatus is information about a Tailscale network ("tailnet"). */
|
|
68
|
+
declare const TailnetStatusSchema: z.ZodObject<{
|
|
69
|
+
Name: z.ZodDefault<z.ZodString>;
|
|
70
|
+
MagicDNSSuffix: z.ZodDefault<z.ZodString>;
|
|
71
|
+
MagicDNSEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
type TailnetStatus = z.infer<typeof TailnetStatusSchema>;
|
|
74
|
+
/**
|
|
75
|
+
* A UserProfile is display-friendly data for a [User].
|
|
76
|
+
* It includes the LoginName for display purposes but *not* the Provider.
|
|
77
|
+
* It also includes derived data from one of the user's logins.
|
|
78
|
+
*/
|
|
79
|
+
declare const UserProfileSchema: z.ZodObject<{
|
|
80
|
+
ID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
81
|
+
LoginName: z.ZodDefault<z.ZodString>;
|
|
82
|
+
DisplayName: z.ZodDefault<z.ZodString>;
|
|
83
|
+
ProfilePicURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
type UserProfile = z.infer<typeof UserProfileSchema>;
|
|
86
|
+
/**
|
|
87
|
+
* ClientVersion is information about the latest client version that's available
|
|
88
|
+
* for the client (and whether they're already running it).
|
|
89
|
+
*
|
|
90
|
+
* It does not include a URL to download the client, as that varies by platform.
|
|
91
|
+
*/
|
|
92
|
+
declare const ClientVersionSchema: z.ZodObject<{
|
|
93
|
+
RunningLatest: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
94
|
+
LatestVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
UrgentSecurityUpdate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
96
|
+
Notify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
97
|
+
NotifyURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
NotifyText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
type ClientVersion = z.infer<typeof ClientVersionSchema>;
|
|
101
|
+
/** Status represents the entire state of the IPN network. */
|
|
102
|
+
declare const StatusSchema: z.ZodObject<{
|
|
103
|
+
Version: z.ZodDefault<z.ZodString>;
|
|
104
|
+
TUN: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
+
BackendState: z.ZodDefault<z.ZodString>;
|
|
106
|
+
HaveNodeKey: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
107
|
+
AuthURL: z.ZodDefault<z.ZodString>;
|
|
108
|
+
TailscaleIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
109
|
+
Self: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
110
|
+
ID: z.ZodDefault<z.ZodString>;
|
|
111
|
+
PublicKey: z.ZodDefault<z.ZodString>;
|
|
112
|
+
HostName: z.ZodDefault<z.ZodString>;
|
|
113
|
+
DNSName: z.ZodDefault<z.ZodString>;
|
|
114
|
+
OS: z.ZodDefault<z.ZodString>;
|
|
115
|
+
UserID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
116
|
+
AltSharerUserID: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
117
|
+
TailscaleIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
118
|
+
AllowedIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
119
|
+
Tags: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
120
|
+
PrimaryRoutes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
121
|
+
Addrs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
122
|
+
CurAddr: z.ZodDefault<z.ZodString>;
|
|
123
|
+
Relay: z.ZodDefault<z.ZodString>;
|
|
124
|
+
PeerRelay: z.ZodDefault<z.ZodString>;
|
|
125
|
+
RxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
126
|
+
TxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
127
|
+
Created: z.ZodDefault<z.ZodString>;
|
|
128
|
+
LastWrite: z.ZodDefault<z.ZodString>;
|
|
129
|
+
LastSeen: z.ZodDefault<z.ZodString>;
|
|
130
|
+
LastHandshake: z.ZodDefault<z.ZodString>;
|
|
131
|
+
Online: z.ZodDefault<z.ZodBoolean>;
|
|
132
|
+
ExitNode: z.ZodDefault<z.ZodBoolean>;
|
|
133
|
+
ExitNodeOption: z.ZodDefault<z.ZodBoolean>;
|
|
134
|
+
Active: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
PeerAPIURL: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
136
|
+
TaildropTarget: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
137
|
+
NoFileSharingReason: z.ZodDefault<z.ZodString>;
|
|
138
|
+
Capabilities: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
139
|
+
CapMap: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<unknown[], unknown[] | null | undefined>>>>>, z.ZodTransform<Record<string, unknown[]>, Record<string, unknown[]> | null | undefined>>;
|
|
140
|
+
sshHostKeys: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
141
|
+
ShareeNode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
142
|
+
InNetworkMap: z.ZodDefault<z.ZodBoolean>;
|
|
143
|
+
InMagicSock: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
+
InEngine: z.ZodDefault<z.ZodBoolean>;
|
|
145
|
+
Expired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
146
|
+
KeyExpiry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
Location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
148
|
+
Country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
CountryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
150
|
+
City: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
151
|
+
CityCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
Latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
153
|
+
Longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
154
|
+
Priority: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
155
|
+
}, z.core.$strip>>>;
|
|
156
|
+
}, z.core.$strip>>>;
|
|
157
|
+
ExitNodeStatus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
158
|
+
ID: z.ZodDefault<z.ZodString>;
|
|
159
|
+
Online: z.ZodDefault<z.ZodBoolean>;
|
|
160
|
+
TailscaleIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
161
|
+
}, z.core.$strip>>>;
|
|
162
|
+
Health: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
163
|
+
MagicDNSSuffix: z.ZodDefault<z.ZodString>;
|
|
164
|
+
CurrentTailnet: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
165
|
+
Name: z.ZodDefault<z.ZodString>;
|
|
166
|
+
MagicDNSSuffix: z.ZodDefault<z.ZodString>;
|
|
167
|
+
MagicDNSEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
+
}, z.core.$strip>>>;
|
|
169
|
+
CertDomains: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
170
|
+
Peer: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
171
|
+
ID: z.ZodDefault<z.ZodString>;
|
|
172
|
+
PublicKey: z.ZodDefault<z.ZodString>;
|
|
173
|
+
HostName: z.ZodDefault<z.ZodString>;
|
|
174
|
+
DNSName: z.ZodDefault<z.ZodString>;
|
|
175
|
+
OS: z.ZodDefault<z.ZodString>;
|
|
176
|
+
UserID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
177
|
+
AltSharerUserID: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
178
|
+
TailscaleIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
179
|
+
AllowedIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
180
|
+
Tags: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
181
|
+
PrimaryRoutes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
182
|
+
Addrs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
183
|
+
CurAddr: z.ZodDefault<z.ZodString>;
|
|
184
|
+
Relay: z.ZodDefault<z.ZodString>;
|
|
185
|
+
PeerRelay: z.ZodDefault<z.ZodString>;
|
|
186
|
+
RxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
187
|
+
TxBytes: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
188
|
+
Created: z.ZodDefault<z.ZodString>;
|
|
189
|
+
LastWrite: z.ZodDefault<z.ZodString>;
|
|
190
|
+
LastSeen: z.ZodDefault<z.ZodString>;
|
|
191
|
+
LastHandshake: z.ZodDefault<z.ZodString>;
|
|
192
|
+
Online: z.ZodDefault<z.ZodBoolean>;
|
|
193
|
+
ExitNode: z.ZodDefault<z.ZodBoolean>;
|
|
194
|
+
ExitNodeOption: z.ZodDefault<z.ZodBoolean>;
|
|
195
|
+
Active: z.ZodDefault<z.ZodBoolean>;
|
|
196
|
+
PeerAPIURL: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
197
|
+
TaildropTarget: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
198
|
+
NoFileSharingReason: z.ZodDefault<z.ZodString>;
|
|
199
|
+
Capabilities: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
200
|
+
CapMap: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<unknown[], unknown[] | null | undefined>>>>>, z.ZodTransform<Record<string, unknown[]>, Record<string, unknown[]> | null | undefined>>;
|
|
201
|
+
sshHostKeys: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
202
|
+
ShareeNode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
203
|
+
InNetworkMap: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
InMagicSock: z.ZodDefault<z.ZodBoolean>;
|
|
205
|
+
InEngine: z.ZodDefault<z.ZodBoolean>;
|
|
206
|
+
Expired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
207
|
+
KeyExpiry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
Location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
209
|
+
Country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
|
+
CountryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
|
+
City: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
CityCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
+
Latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
214
|
+
Longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
215
|
+
Priority: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
218
|
+
ID: string;
|
|
219
|
+
PublicKey: string;
|
|
220
|
+
HostName: string;
|
|
221
|
+
DNSName: string;
|
|
222
|
+
OS: string;
|
|
223
|
+
UserID: bigint;
|
|
224
|
+
TailscaleIPs: string[];
|
|
225
|
+
AllowedIPs: string[];
|
|
226
|
+
Tags: string[];
|
|
227
|
+
PrimaryRoutes: string[];
|
|
228
|
+
Addrs: string[];
|
|
229
|
+
CurAddr: string;
|
|
230
|
+
Relay: string;
|
|
231
|
+
PeerRelay: string;
|
|
232
|
+
RxBytes: bigint;
|
|
233
|
+
TxBytes: bigint;
|
|
234
|
+
Created: string;
|
|
235
|
+
LastWrite: string;
|
|
236
|
+
LastSeen: string;
|
|
237
|
+
LastHandshake: string;
|
|
238
|
+
Online: boolean;
|
|
239
|
+
ExitNode: boolean;
|
|
240
|
+
ExitNodeOption: boolean;
|
|
241
|
+
Active: boolean;
|
|
242
|
+
PeerAPIURL: string[];
|
|
243
|
+
TaildropTarget: bigint;
|
|
244
|
+
NoFileSharingReason: string;
|
|
245
|
+
Capabilities: string[];
|
|
246
|
+
CapMap: Record<string, unknown[]>;
|
|
247
|
+
sshHostKeys: string[];
|
|
248
|
+
InNetworkMap: boolean;
|
|
249
|
+
InMagicSock: boolean;
|
|
250
|
+
InEngine: boolean;
|
|
251
|
+
AltSharerUserID?: bigint | null | undefined;
|
|
252
|
+
ShareeNode?: boolean | null | undefined;
|
|
253
|
+
Expired?: boolean | null | undefined;
|
|
254
|
+
KeyExpiry?: string | null | undefined;
|
|
255
|
+
Location?: {
|
|
256
|
+
Country?: string | null | undefined;
|
|
257
|
+
CountryCode?: string | null | undefined;
|
|
258
|
+
City?: string | null | undefined;
|
|
259
|
+
CityCode?: string | null | undefined;
|
|
260
|
+
Latitude?: number | null | undefined;
|
|
261
|
+
Longitude?: number | null | undefined;
|
|
262
|
+
Priority?: bigint | null | undefined;
|
|
263
|
+
} | null | undefined;
|
|
264
|
+
}>, Record<string, {
|
|
265
|
+
ID: string;
|
|
266
|
+
PublicKey: string;
|
|
267
|
+
HostName: string;
|
|
268
|
+
DNSName: string;
|
|
269
|
+
OS: string;
|
|
270
|
+
UserID: bigint;
|
|
271
|
+
TailscaleIPs: string[];
|
|
272
|
+
AllowedIPs: string[];
|
|
273
|
+
Tags: string[];
|
|
274
|
+
PrimaryRoutes: string[];
|
|
275
|
+
Addrs: string[];
|
|
276
|
+
CurAddr: string;
|
|
277
|
+
Relay: string;
|
|
278
|
+
PeerRelay: string;
|
|
279
|
+
RxBytes: bigint;
|
|
280
|
+
TxBytes: bigint;
|
|
281
|
+
Created: string;
|
|
282
|
+
LastWrite: string;
|
|
283
|
+
LastSeen: string;
|
|
284
|
+
LastHandshake: string;
|
|
285
|
+
Online: boolean;
|
|
286
|
+
ExitNode: boolean;
|
|
287
|
+
ExitNodeOption: boolean;
|
|
288
|
+
Active: boolean;
|
|
289
|
+
PeerAPIURL: string[];
|
|
290
|
+
TaildropTarget: bigint;
|
|
291
|
+
NoFileSharingReason: string;
|
|
292
|
+
Capabilities: string[];
|
|
293
|
+
CapMap: Record<string, unknown[]>;
|
|
294
|
+
sshHostKeys: string[];
|
|
295
|
+
InNetworkMap: boolean;
|
|
296
|
+
InMagicSock: boolean;
|
|
297
|
+
InEngine: boolean;
|
|
298
|
+
AltSharerUserID?: bigint | null | undefined;
|
|
299
|
+
ShareeNode?: boolean | null | undefined;
|
|
300
|
+
Expired?: boolean | null | undefined;
|
|
301
|
+
KeyExpiry?: string | null | undefined;
|
|
302
|
+
Location?: {
|
|
303
|
+
Country?: string | null | undefined;
|
|
304
|
+
CountryCode?: string | null | undefined;
|
|
305
|
+
City?: string | null | undefined;
|
|
306
|
+
CityCode?: string | null | undefined;
|
|
307
|
+
Latitude?: number | null | undefined;
|
|
308
|
+
Longitude?: number | null | undefined;
|
|
309
|
+
Priority?: bigint | null | undefined;
|
|
310
|
+
} | null | undefined;
|
|
311
|
+
}> | null | undefined>>;
|
|
312
|
+
User: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
313
|
+
ID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
314
|
+
LoginName: z.ZodDefault<z.ZodString>;
|
|
315
|
+
DisplayName: z.ZodDefault<z.ZodString>;
|
|
316
|
+
ProfilePicURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
318
|
+
ID: bigint;
|
|
319
|
+
LoginName: string;
|
|
320
|
+
DisplayName: string;
|
|
321
|
+
ProfilePicURL?: string | null | undefined;
|
|
322
|
+
}>, Record<string, {
|
|
323
|
+
ID: bigint;
|
|
324
|
+
LoginName: string;
|
|
325
|
+
DisplayName: string;
|
|
326
|
+
ProfilePicURL?: string | null | undefined;
|
|
327
|
+
}> | null | undefined>>;
|
|
328
|
+
ClientVersion: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
329
|
+
RunningLatest: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
330
|
+
LatestVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
331
|
+
UrgentSecurityUpdate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
332
|
+
Notify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
333
|
+
NotifyURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
334
|
+
NotifyText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
|
+
}, z.core.$strip>>>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
type Status = z.infer<typeof StatusSchema>;
|
|
338
|
+
/**
|
|
339
|
+
* ServeConfig is the JSON type stored in the StateStore for
|
|
340
|
+
* StateKey "_serve/$PROFILE_ID" as returned by ServeConfigKey.
|
|
341
|
+
*/
|
|
342
|
+
declare const ServeConfigSchema: z.ZodObject<{
|
|
343
|
+
TCP: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
344
|
+
HTTPS: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
345
|
+
HTTP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
346
|
+
TCPForward: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
347
|
+
TerminateTLS: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
ProxyProtocol: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
349
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
350
|
+
HTTPS?: boolean | null | undefined;
|
|
351
|
+
HTTP?: boolean | null | undefined;
|
|
352
|
+
TCPForward?: string | null | undefined;
|
|
353
|
+
TerminateTLS?: string | null | undefined;
|
|
354
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
355
|
+
}>, Record<string, {
|
|
356
|
+
HTTPS?: boolean | null | undefined;
|
|
357
|
+
HTTP?: boolean | null | undefined;
|
|
358
|
+
TCPForward?: string | null | undefined;
|
|
359
|
+
TerminateTLS?: string | null | undefined;
|
|
360
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
361
|
+
}> | null | undefined>>;
|
|
362
|
+
Web: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
363
|
+
Handlers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
364
|
+
Path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
365
|
+
Proxy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
Text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
+
AcceptAppCaps: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
368
|
+
Redirect: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
370
|
+
AcceptAppCaps: string[];
|
|
371
|
+
Path?: string | null | undefined;
|
|
372
|
+
Proxy?: string | null | undefined;
|
|
373
|
+
Text?: string | null | undefined;
|
|
374
|
+
Redirect?: string | null | undefined;
|
|
375
|
+
}>, Record<string, {
|
|
376
|
+
AcceptAppCaps: string[];
|
|
377
|
+
Path?: string | null | undefined;
|
|
378
|
+
Proxy?: string | null | undefined;
|
|
379
|
+
Text?: string | null | undefined;
|
|
380
|
+
Redirect?: string | null | undefined;
|
|
381
|
+
}> | null | undefined>>;
|
|
382
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
383
|
+
Handlers: Record<string, {
|
|
384
|
+
AcceptAppCaps: string[];
|
|
385
|
+
Path?: string | null | undefined;
|
|
386
|
+
Proxy?: string | null | undefined;
|
|
387
|
+
Text?: string | null | undefined;
|
|
388
|
+
Redirect?: string | null | undefined;
|
|
389
|
+
}>;
|
|
390
|
+
}>, Record<string, {
|
|
391
|
+
Handlers: Record<string, {
|
|
392
|
+
AcceptAppCaps: string[];
|
|
393
|
+
Path?: string | null | undefined;
|
|
394
|
+
Proxy?: string | null | undefined;
|
|
395
|
+
Text?: string | null | undefined;
|
|
396
|
+
Redirect?: string | null | undefined;
|
|
397
|
+
}>;
|
|
398
|
+
}> | null | undefined>>;
|
|
399
|
+
Services: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
400
|
+
TCP: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
401
|
+
HTTPS: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
402
|
+
HTTP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
403
|
+
TCPForward: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
404
|
+
TerminateTLS: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
405
|
+
ProxyProtocol: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
406
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
407
|
+
HTTPS?: boolean | null | undefined;
|
|
408
|
+
HTTP?: boolean | null | undefined;
|
|
409
|
+
TCPForward?: string | null | undefined;
|
|
410
|
+
TerminateTLS?: string | null | undefined;
|
|
411
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
412
|
+
}>, Record<string, {
|
|
413
|
+
HTTPS?: boolean | null | undefined;
|
|
414
|
+
HTTP?: boolean | null | undefined;
|
|
415
|
+
TCPForward?: string | null | undefined;
|
|
416
|
+
TerminateTLS?: string | null | undefined;
|
|
417
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
418
|
+
}> | null | undefined>>;
|
|
419
|
+
Web: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
420
|
+
Handlers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
421
|
+
Path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
422
|
+
Proxy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
423
|
+
Text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
424
|
+
AcceptAppCaps: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
425
|
+
Redirect: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
426
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
427
|
+
AcceptAppCaps: string[];
|
|
428
|
+
Path?: string | null | undefined;
|
|
429
|
+
Proxy?: string | null | undefined;
|
|
430
|
+
Text?: string | null | undefined;
|
|
431
|
+
Redirect?: string | null | undefined;
|
|
432
|
+
}>, Record<string, {
|
|
433
|
+
AcceptAppCaps: string[];
|
|
434
|
+
Path?: string | null | undefined;
|
|
435
|
+
Proxy?: string | null | undefined;
|
|
436
|
+
Text?: string | null | undefined;
|
|
437
|
+
Redirect?: string | null | undefined;
|
|
438
|
+
}> | null | undefined>>;
|
|
439
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
440
|
+
Handlers: Record<string, {
|
|
441
|
+
AcceptAppCaps: string[];
|
|
442
|
+
Path?: string | null | undefined;
|
|
443
|
+
Proxy?: string | null | undefined;
|
|
444
|
+
Text?: string | null | undefined;
|
|
445
|
+
Redirect?: string | null | undefined;
|
|
446
|
+
}>;
|
|
447
|
+
}>, Record<string, {
|
|
448
|
+
Handlers: Record<string, {
|
|
449
|
+
AcceptAppCaps: string[];
|
|
450
|
+
Path?: string | null | undefined;
|
|
451
|
+
Proxy?: string | null | undefined;
|
|
452
|
+
Text?: string | null | undefined;
|
|
453
|
+
Redirect?: string | null | undefined;
|
|
454
|
+
}>;
|
|
455
|
+
}> | null | undefined>>;
|
|
456
|
+
Tun: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
457
|
+
}, z.core.$strip>>>>, z.ZodTransform<Record<string, {
|
|
458
|
+
TCP: Record<string, {
|
|
459
|
+
HTTPS?: boolean | null | undefined;
|
|
460
|
+
HTTP?: boolean | null | undefined;
|
|
461
|
+
TCPForward?: string | null | undefined;
|
|
462
|
+
TerminateTLS?: string | null | undefined;
|
|
463
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
464
|
+
}>;
|
|
465
|
+
Web: Record<string, {
|
|
466
|
+
Handlers: Record<string, {
|
|
467
|
+
AcceptAppCaps: string[];
|
|
468
|
+
Path?: string | null | undefined;
|
|
469
|
+
Proxy?: string | null | undefined;
|
|
470
|
+
Text?: string | null | undefined;
|
|
471
|
+
Redirect?: string | null | undefined;
|
|
472
|
+
}>;
|
|
473
|
+
}>;
|
|
474
|
+
Tun?: boolean | null | undefined;
|
|
475
|
+
}>, Record<string, {
|
|
476
|
+
TCP: Record<string, {
|
|
477
|
+
HTTPS?: boolean | null | undefined;
|
|
478
|
+
HTTP?: boolean | null | undefined;
|
|
479
|
+
TCPForward?: string | null | undefined;
|
|
480
|
+
TerminateTLS?: string | null | undefined;
|
|
481
|
+
ProxyProtocol?: bigint | null | undefined;
|
|
482
|
+
}>;
|
|
483
|
+
Web: Record<string, {
|
|
484
|
+
Handlers: Record<string, {
|
|
485
|
+
AcceptAppCaps: string[];
|
|
486
|
+
Path?: string | null | undefined;
|
|
487
|
+
Proxy?: string | null | undefined;
|
|
488
|
+
Text?: string | null | undefined;
|
|
489
|
+
Redirect?: string | null | undefined;
|
|
490
|
+
}>;
|
|
491
|
+
}>;
|
|
492
|
+
Tun?: boolean | null | undefined;
|
|
493
|
+
}> | null | undefined>>;
|
|
494
|
+
AllowFunnel: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>>, z.ZodTransform<Record<string, boolean>, Record<string, boolean> | null | undefined>>;
|
|
495
|
+
Foreground: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>>, z.ZodTransform<Record<string, unknown>, Record<string, unknown> | null | undefined>>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
type ServeConfig = z.infer<typeof ServeConfigSchema> & {
|
|
498
|
+
/**
|
|
499
|
+
* ETag is the checksum of the serve config that's populated
|
|
500
|
+
* by the LocalClient through the HTTP ETag header during a
|
|
501
|
+
* GetServeConfig request and is translated to an If-Match header
|
|
502
|
+
* during a SetServeConfig request.
|
|
503
|
+
*/
|
|
504
|
+
ETag: string;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* WhoIsResponse is the JSON type returned by tailscaled debug server's /whois?ip=$IP handler.
|
|
508
|
+
* In successful whois responses, Node and UserProfile are never nil.
|
|
509
|
+
*/
|
|
510
|
+
declare const WhoIsResponseSchema: z.ZodObject<{
|
|
511
|
+
Node: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
512
|
+
ID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
513
|
+
StableID: z.ZodDefault<z.ZodString>;
|
|
514
|
+
Name: z.ZodDefault<z.ZodString>;
|
|
515
|
+
User: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
516
|
+
Sharer: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
517
|
+
Key: z.ZodDefault<z.ZodString>;
|
|
518
|
+
KeyExpiry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
519
|
+
KeySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
520
|
+
Machine: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
521
|
+
DiscoKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
522
|
+
Addresses: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
523
|
+
AllowedIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
524
|
+
Endpoints: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
525
|
+
DERP: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
526
|
+
HomeDERP: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
527
|
+
Hostinfo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
528
|
+
IPNVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
529
|
+
FrontendLogID: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
530
|
+
BackendLogID: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
|
+
OS: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
532
|
+
OSVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
533
|
+
Container: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
534
|
+
Env: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
535
|
+
Distro: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
536
|
+
DistroVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
537
|
+
DistroCodeName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
|
+
App: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
|
+
Desktop: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
540
|
+
Package: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
541
|
+
DeviceModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
542
|
+
PushDeviceToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
543
|
+
Hostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
544
|
+
ShieldsUp: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
545
|
+
ShareeNode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
546
|
+
NoLogsNoSupport: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
547
|
+
WireIngress: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
548
|
+
IngressEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
549
|
+
AllowsUpdate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
550
|
+
Machine: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
551
|
+
GoArch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
552
|
+
GoArchVar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
553
|
+
GoVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
554
|
+
RoutableIPs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
555
|
+
RequestTags: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
556
|
+
WoLMACs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
557
|
+
Services: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
558
|
+
Proto: z.ZodDefault<z.ZodString>;
|
|
559
|
+
Port: z.ZodDefault<z.ZodNumber>;
|
|
560
|
+
Description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
561
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
562
|
+
Proto: string;
|
|
563
|
+
Port: number;
|
|
564
|
+
Description?: string | null | undefined;
|
|
565
|
+
}[], {
|
|
566
|
+
Proto: string;
|
|
567
|
+
Port: number;
|
|
568
|
+
Description?: string | null | undefined;
|
|
569
|
+
}[] | null | undefined>>;
|
|
570
|
+
NetInfo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
571
|
+
MappingVariesByDestIP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
572
|
+
WorkingIPv6: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
573
|
+
OSHasIPv6: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
574
|
+
WorkingUDP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
575
|
+
WorkingICMPv4: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
576
|
+
HavePortMap: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
577
|
+
UPnP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
578
|
+
PMP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
579
|
+
PCP: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
580
|
+
PreferredDERP: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
581
|
+
LinkType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
582
|
+
DERPLatency: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>, z.ZodTransform<Record<string, number>, Record<string, number> | null | undefined>>;
|
|
583
|
+
FirewallMode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
584
|
+
}, z.core.$strip>>>;
|
|
585
|
+
sshHostKeys: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
586
|
+
Cloud: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
587
|
+
Userspace: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
588
|
+
UserspaceRouter: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
589
|
+
AppConnector: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
590
|
+
ServicesHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
591
|
+
ExitNodeID: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
592
|
+
Location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
593
|
+
Country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
594
|
+
CountryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
595
|
+
City: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
596
|
+
CityCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
597
|
+
Latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
598
|
+
Longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
599
|
+
Priority: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
600
|
+
}, z.core.$strip>>>;
|
|
601
|
+
TPM: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
602
|
+
Manufacturer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
603
|
+
Vendor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
604
|
+
Model: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
605
|
+
FirmwareVersion: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
606
|
+
SpecRevision: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
607
|
+
FamilyIndicator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
608
|
+
}, z.core.$strip>>>;
|
|
609
|
+
StateEncrypted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
610
|
+
}, z.core.$strip>>>;
|
|
611
|
+
Created: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
612
|
+
Cap: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>>;
|
|
613
|
+
Tags: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
614
|
+
PrimaryRoutes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
615
|
+
LastSeen: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
616
|
+
Online: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
617
|
+
MachineAuthorized: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
618
|
+
Capabilities: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
619
|
+
CapMap: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<unknown[], unknown[] | null | undefined>>>>>, z.ZodTransform<Record<string, unknown[]>, Record<string, unknown[]> | null | undefined>>;
|
|
620
|
+
UnsignedPeerAPIOnly: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
621
|
+
ComputedName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
622
|
+
ComputedNameWithHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
623
|
+
DataPlaneAuditLogID: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
624
|
+
Expired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
625
|
+
SelfNodeV4MasqAddrForThisPeer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
626
|
+
SelfNodeV6MasqAddrForThisPeer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
627
|
+
IsWireGuardOnly: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
628
|
+
IsJailed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
629
|
+
ExitNodeDNSResolvers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
630
|
+
Addr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
631
|
+
BootstrapResolution: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
632
|
+
UseWithExitNode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
633
|
+
}, z.core.$strip>>>>, z.ZodTransform<{
|
|
634
|
+
BootstrapResolution: string[];
|
|
635
|
+
Addr?: string | null | undefined;
|
|
636
|
+
UseWithExitNode?: boolean | null | undefined;
|
|
637
|
+
}[], {
|
|
638
|
+
BootstrapResolution: string[];
|
|
639
|
+
Addr?: string | null | undefined;
|
|
640
|
+
UseWithExitNode?: boolean | null | undefined;
|
|
641
|
+
}[] | null | undefined>>;
|
|
642
|
+
}, z.core.$strip>>>;
|
|
643
|
+
UserProfile: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
644
|
+
ID: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, number | bigint>>>;
|
|
645
|
+
LoginName: z.ZodDefault<z.ZodString>;
|
|
646
|
+
DisplayName: z.ZodDefault<z.ZodString>;
|
|
647
|
+
ProfilePicURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
648
|
+
}, z.core.$strip>>>;
|
|
649
|
+
CapMap: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<unknown[], unknown[] | null | undefined>>>>>, z.ZodTransform<Record<string, unknown[]>, Record<string, unknown[]> | null | undefined>>;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
type WhoIsResponse = z.infer<typeof WhoIsResponseSchema>;
|
|
652
|
+
/** Alias for TailnetStatus for backward compatibility. */
|
|
653
|
+
declare const CurrentTailnetSchema: z.ZodObject<{
|
|
654
|
+
Name: z.ZodString;
|
|
655
|
+
MagicDNSSuffix: z.ZodString;
|
|
656
|
+
MagicDNSEnabled: z.ZodBoolean;
|
|
657
|
+
}, z.core.$strip>;
|
|
658
|
+
type CurrentTailnet = z.infer<typeof CurrentTailnetSchema>;
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region ts/src/client.d.ts
|
|
661
|
+
/**
|
|
662
|
+
* Client for the Tailscale Local API.
|
|
663
|
+
*
|
|
664
|
+
* Connections are reused via HTTP keep-alive.
|
|
665
|
+
*/
|
|
666
|
+
declare class LocalClient {
|
|
667
|
+
private readonly transport;
|
|
668
|
+
constructor(opts?: TransportOptions);
|
|
669
|
+
private doRequest;
|
|
670
|
+
private doRequestNice;
|
|
671
|
+
private get200;
|
|
672
|
+
private post200;
|
|
673
|
+
/** Get the current tailscaled status. */
|
|
674
|
+
status(): Promise<Status>;
|
|
675
|
+
/** Get the current tailscaled status without peer information. */
|
|
676
|
+
statusWithoutPeers(): Promise<Status>;
|
|
677
|
+
private doWhoIs;
|
|
678
|
+
/** Look up the owner of an IP address or IP:port. */
|
|
679
|
+
whoIs(remoteAddr: string): Promise<WhoIsResponse>;
|
|
680
|
+
/** Look up a peer by node key. */
|
|
681
|
+
whoIsNodeKey(nodeKey: string): Promise<WhoIsResponse>;
|
|
682
|
+
/** Look up the owner of an IP address with a specific protocol ("tcp" or "udp"). */
|
|
683
|
+
whoIsProto(proto: string, remoteAddr: string): Promise<WhoIsResponse>;
|
|
684
|
+
/** Get a TLS certificate and private key for the given domain. */
|
|
685
|
+
certPair(domain: string): Promise<{
|
|
686
|
+
cert: Buffer;
|
|
687
|
+
key: Buffer;
|
|
688
|
+
}>;
|
|
689
|
+
/** Get a TLS certificate with minimum validity duration (in seconds). */
|
|
690
|
+
certPairWithValidity(domain: string, minValiditySecs: number): Promise<{
|
|
691
|
+
cert: Buffer;
|
|
692
|
+
key: Buffer;
|
|
693
|
+
}>;
|
|
694
|
+
/**
|
|
695
|
+
* Get the current serve configuration.
|
|
696
|
+
*
|
|
697
|
+
* The returned ServeConfig has its ETag field populated from the
|
|
698
|
+
* HTTP Etag response header.
|
|
699
|
+
*/
|
|
700
|
+
getServeConfig(): Promise<ServeConfig>;
|
|
701
|
+
/**
|
|
702
|
+
* Set the serve configuration.
|
|
703
|
+
*
|
|
704
|
+
* The ETag field on the config is sent as the If-Match header
|
|
705
|
+
* for conditional updates.
|
|
706
|
+
*/
|
|
707
|
+
setServeConfig(config: ServeConfig): Promise<void>;
|
|
708
|
+
/** Close the underlying transport and release resources. */
|
|
709
|
+
destroy(): void;
|
|
710
|
+
}
|
|
711
|
+
//#endregion
|
|
712
|
+
//#region ts/src/errors.d.ts
|
|
713
|
+
/** Base error for all Tailscale Local API errors. */
|
|
714
|
+
declare class TailscaleError extends Error {
|
|
715
|
+
constructor(message: string);
|
|
716
|
+
}
|
|
717
|
+
/** Raised when the server returns HTTP 403. */
|
|
718
|
+
declare class AccessDeniedError extends TailscaleError {
|
|
719
|
+
constructor(message: string);
|
|
720
|
+
}
|
|
721
|
+
/** Raised when the server returns HTTP 412. */
|
|
722
|
+
declare class PreconditionsFailedError extends TailscaleError {
|
|
723
|
+
constructor(message: string);
|
|
724
|
+
}
|
|
725
|
+
/** Raised when a WhoIs lookup returns HTTP 404. */
|
|
726
|
+
declare class PeerNotFoundError extends TailscaleError {
|
|
727
|
+
constructor(message: string);
|
|
728
|
+
}
|
|
729
|
+
/** Raised when the connection to tailscaled fails. */
|
|
730
|
+
declare class ConnectionError extends TailscaleError {
|
|
731
|
+
constructor(message: string);
|
|
732
|
+
}
|
|
733
|
+
/** Raised when tailscaled is not running. */
|
|
734
|
+
declare class DaemonNotRunningError extends ConnectionError {
|
|
735
|
+
constructor(message: string);
|
|
736
|
+
}
|
|
737
|
+
/** Raised for unexpected HTTP status codes. */
|
|
738
|
+
declare class HttpError extends TailscaleError {
|
|
739
|
+
readonly status: number;
|
|
740
|
+
constructor(status: number, message: string);
|
|
741
|
+
}
|
|
742
|
+
//#endregion
|
|
743
|
+
export { AccessDeniedError, type ClientVersion, ClientVersionSchema, ConnectionError, type CurrentTailnet, CurrentTailnetSchema, DaemonNotRunningError, HttpError, LocalClient, PeerNotFoundError, type PeerStatus, PeerStatusSchema, PreconditionsFailedError, type ServeConfig, ServeConfigSchema, type Status, StatusSchema, type TailnetStatus, TailnetStatusSchema, TailscaleError, type UserProfile, UserProfileSchema, type WhoIsResponse, WhoIsResponseSchema };
|
|
744
|
+
//# sourceMappingURL=index.d.cts.map
|