@veilway/sdk 0.2.14-alpha → 0.2.15-alpha
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/dist/src/index.d.ts +24 -0
- package/dist/src/index.js +12 -0
- package/dist/src/schema.d.ts +669 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export type Replay = Schemas["Replay"];
|
|
|
11
11
|
export type Session = Schemas["Session"];
|
|
12
12
|
export type Exit = Schemas["Exit"];
|
|
13
13
|
export type Link = Schemas["Link"];
|
|
14
|
+
export type Upstream = Schemas["Upstream"];
|
|
15
|
+
export type UpstreamPreview = Schemas["UpstreamPreview"];
|
|
16
|
+
export type UpstreamPreviewRequest = Schemas["UpstreamPreviewRequest"];
|
|
17
|
+
export type UpstreamConfirmed = Schemas["UpstreamConfirmed"];
|
|
18
|
+
export type UpstreamRemoved = Schemas["UpstreamRemoved"];
|
|
14
19
|
export type InboundInfo = Schemas["InboundInfo"];
|
|
15
20
|
export type Problem = Schemas["Problem"];
|
|
16
21
|
/** A config v1 document. The generated schema calls it an object nobody can fill in, so the client takes any object and the node does the checking. */
|
|
@@ -89,6 +94,25 @@ export declare class Client {
|
|
|
89
94
|
listInbounds(): Promise<InboundInfo[]>;
|
|
90
95
|
/** Every enabled node link with its state and its counters. */
|
|
91
96
|
listLinks(): Promise<Link[]>;
|
|
97
|
+
/** Every enabled upstream, the subscription of another provider that an exit uses: its state and why, the provider, the profile, transport and exit in use, quota, notices as plain text, the refresh state, a move of the provider's endpoint or new refresh hosts that wait for `confirmUpstream`, and its counters. No key, no secret and no link. */
|
|
98
|
+
listUpstreams(): Promise<Upstream[]>;
|
|
99
|
+
/** Fetches the subscription of another provider from the node with the device the request gives, which takes a place at the provider, and returns what the document holds. The node keeps the document for `expires_in_secs` for the config that names the same link and device, so that the provider is not asked again; `declinePreview` gives the place back. At most four wait. Throws `body_invalid` (422) for a request the node cannot read, `provider_failed` (502) when the provider cannot be asked or its answer fails the checks, and `previews_full` (409). */
|
|
100
|
+
previewUpstream(request: UpstreamPreviewRequest): Promise<UpstreamPreview>;
|
|
101
|
+
/** Says no to a preview: the provider is told to release the place. Throws `preview_not_found` for one that was declined, taken by a config or ran out. */
|
|
102
|
+
declinePreview(id: string): Promise<{
|
|
103
|
+
id: string;
|
|
104
|
+
}>;
|
|
105
|
+
/** Removes an upstream: the provider is told that the device left, for at most ten seconds, and `confirmed` says whether it took the word. The upstream stops and a config that still names it does not start it again: apply a config without it to finish. */
|
|
106
|
+
removeUpstream(tag: string): Promise<UpstreamRemoved>;
|
|
107
|
+
/** Confirms the move of the provider's endpoint and the new refresh hosts that `listUpstreams` reports as pending. Without options both are confirmed; with them a field that is left out is false. The answer says what had been waiting. */
|
|
108
|
+
confirmUpstream(tag: string, options?: {
|
|
109
|
+
move?: boolean;
|
|
110
|
+
hosts?: boolean;
|
|
111
|
+
}): Promise<UpstreamConfirmed>;
|
|
112
|
+
/** Asks the upstream to connect again now: every wait it was in starts over. */
|
|
113
|
+
retryUpstream(tag: string): Promise<{
|
|
114
|
+
tag: string;
|
|
115
|
+
}>;
|
|
92
116
|
/** The event stream. It ends when the node closes it or when `signal` aborts, and throws when the node refuses it or sends something that is not an event. Event names this client does not know are skipped. */
|
|
93
117
|
events(signal?: AbortSignal): AsyncGenerator<NodeEvent, void, undefined>;
|
|
94
118
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -65,6 +65,18 @@ export class Client {
|
|
|
65
65
|
async listInbounds() { return (await this.json("GET", "/v1/inbounds")).inbounds; }
|
|
66
66
|
/** Every enabled node link with its state and its counters. */
|
|
67
67
|
async listLinks() { return (await this.json("GET", "/v1/links")).links; }
|
|
68
|
+
/** Every enabled upstream, the subscription of another provider that an exit uses: its state and why, the provider, the profile, transport and exit in use, quota, notices as plain text, the refresh state, a move of the provider's endpoint or new refresh hosts that wait for `confirmUpstream`, and its counters. No key, no secret and no link. */
|
|
69
|
+
async listUpstreams() { return (await this.json("GET", "/v1/upstreams")).upstreams; }
|
|
70
|
+
/** Fetches the subscription of another provider from the node with the device the request gives, which takes a place at the provider, and returns what the document holds. The node keeps the document for `expires_in_secs` for the config that names the same link and device, so that the provider is not asked again; `declinePreview` gives the place back. At most four wait. Throws `body_invalid` (422) for a request the node cannot read, `provider_failed` (502) when the provider cannot be asked or its answer fails the checks, and `previews_full` (409). */
|
|
71
|
+
previewUpstream(request) { return this.json("POST", "/v1/upstreams/preview", {}, request); }
|
|
72
|
+
/** Says no to a preview: the provider is told to release the place. Throws `preview_not_found` for one that was declined, taken by a config or ran out. */
|
|
73
|
+
declinePreview(id) { return this.json("POST", "/v1/upstreams/preview/" + encodeURIComponent(id) + "/decline"); }
|
|
74
|
+
/** Removes an upstream: the provider is told that the device left, for at most ten seconds, and `confirmed` says whether it took the word. The upstream stops and a config that still names it does not start it again: apply a config without it to finish. */
|
|
75
|
+
removeUpstream(tag) { return this.json("DELETE", "/v1/upstreams/" + encodeURIComponent(tag)); }
|
|
76
|
+
/** Confirms the move of the provider's endpoint and the new refresh hosts that `listUpstreams` reports as pending. Without options both are confirmed; with them a field that is left out is false. The answer says what had been waiting. */
|
|
77
|
+
confirmUpstream(tag, options = {}) { return this.json("POST", "/v1/upstreams/" + encodeURIComponent(tag) + "/confirm", {}, options); }
|
|
78
|
+
/** Asks the upstream to connect again now: every wait it was in starts over. */
|
|
79
|
+
retryUpstream(tag) { return this.json("POST", "/v1/upstreams/" + encodeURIComponent(tag) + "/retry"); }
|
|
68
80
|
/** The event stream. It ends when the node closes it or when `signal` aborts, and throws when the node refuses it or sends something that is not an event. Event names this client does not know are skipped. */
|
|
69
81
|
async *events(signal) {
|
|
70
82
|
let reader;
|
package/dist/src/schema.d.ts
CHANGED
|
@@ -208,6 +208,108 @@ export interface paths {
|
|
|
208
208
|
patch?: never;
|
|
209
209
|
trace?: never;
|
|
210
210
|
};
|
|
211
|
+
"/v1/upstreams": {
|
|
212
|
+
parameters: {
|
|
213
|
+
query?: never;
|
|
214
|
+
header?: never;
|
|
215
|
+
path?: never;
|
|
216
|
+
cookie?: never;
|
|
217
|
+
};
|
|
218
|
+
/** Every enabled upstream, the subscription of another provider that an exit uses, with its state and the reason, the provider's name, the profile, transport and exit in use, its quota and notices as plain text, the largest packet it takes, the fingerprint of the signing key its document is signed under, when its document was last refreshed and why a refresh failed, a move of the provider's endpoint or new refresh hosts that wait for the operator, and its counters. No key, no secret and no link. */
|
|
219
|
+
get: operations["listUpstreams"];
|
|
220
|
+
put?: never;
|
|
221
|
+
post?: never;
|
|
222
|
+
delete?: never;
|
|
223
|
+
options?: never;
|
|
224
|
+
head?: never;
|
|
225
|
+
patch?: never;
|
|
226
|
+
trace?: never;
|
|
227
|
+
};
|
|
228
|
+
"/v1/upstreams/preview": {
|
|
229
|
+
parameters: {
|
|
230
|
+
query?: never;
|
|
231
|
+
header?: never;
|
|
232
|
+
path?: never;
|
|
233
|
+
cookie?: never;
|
|
234
|
+
};
|
|
235
|
+
get?: never;
|
|
236
|
+
put?: never;
|
|
237
|
+
/** Fetches the subscription of another provider from this node, with the device the body gives, and shows what the document holds. The fetch is the enrollment: it takes a place at the provider, so the provider sees this node's address and never the panel's. The document is verified under the key in the link, kept in memory for ten minutes under the id, and nothing is written to the config or the state file. A config that names the same link and device within that time takes the document and makes the place permanent without asking the provider again. At most four previews wait. The private key and the device secret are never in an answer. */
|
|
238
|
+
post: operations["previewUpstream"];
|
|
239
|
+
delete?: never;
|
|
240
|
+
options?: never;
|
|
241
|
+
head?: never;
|
|
242
|
+
patch?: never;
|
|
243
|
+
trace?: never;
|
|
244
|
+
};
|
|
245
|
+
"/v1/upstreams/preview/{id}/decline": {
|
|
246
|
+
parameters: {
|
|
247
|
+
query?: never;
|
|
248
|
+
header?: never;
|
|
249
|
+
path?: never;
|
|
250
|
+
cookie?: never;
|
|
251
|
+
};
|
|
252
|
+
get?: never;
|
|
253
|
+
put?: never;
|
|
254
|
+
/** Says no to a preview: the provider is told to release the place the preview took, and the node keeps nothing. */
|
|
255
|
+
post: operations["declinePreview"];
|
|
256
|
+
delete?: never;
|
|
257
|
+
options?: never;
|
|
258
|
+
head?: never;
|
|
259
|
+
patch?: never;
|
|
260
|
+
trace?: never;
|
|
261
|
+
};
|
|
262
|
+
"/v1/upstreams/{tag}": {
|
|
263
|
+
parameters: {
|
|
264
|
+
query?: never;
|
|
265
|
+
header?: never;
|
|
266
|
+
path?: never;
|
|
267
|
+
cookie?: never;
|
|
268
|
+
};
|
|
269
|
+
get?: never;
|
|
270
|
+
put?: never;
|
|
271
|
+
post?: never;
|
|
272
|
+
/** Removes an upstream: the provider is told that the device left, for at most ten seconds, and the document and the keys leave the state file. The answer says whether the provider took the word. When it did not, the document stays in the state file and the same call again tells the provider again; the answer is 404 only when the running config has no such upstream, so a removal that was not confirmed can be retried while the config still names it. The upstream stops, and a config that still names it does not start it again, not even after a restart (a tombstone in the state file keeps it down until a config that no longer names it that way has been in force); apply a config without it to finish. A config applied without the upstream, with no call to this route, never tells the provider anything. */
|
|
273
|
+
delete: operations["removeUpstream"];
|
|
274
|
+
options?: never;
|
|
275
|
+
head?: never;
|
|
276
|
+
patch?: never;
|
|
277
|
+
trace?: never;
|
|
278
|
+
};
|
|
279
|
+
"/v1/upstreams/{tag}/confirm": {
|
|
280
|
+
parameters: {
|
|
281
|
+
query?: never;
|
|
282
|
+
header?: never;
|
|
283
|
+
path?: never;
|
|
284
|
+
cookie?: never;
|
|
285
|
+
};
|
|
286
|
+
get?: never;
|
|
287
|
+
put?: never;
|
|
288
|
+
/** Confirms what the node reported as pending for the upstream: the move of the provider's endpoint, which the next refresh then tries first, and the refresh hosts and static mirrors the provider added. Until then the node keeps using the endpoint and hosts it had. Without a body both are confirmed; with one, a field that is left out is false. The answer says what had been waiting. */
|
|
289
|
+
post: operations["confirmUpstream"];
|
|
290
|
+
delete?: never;
|
|
291
|
+
options?: never;
|
|
292
|
+
head?: never;
|
|
293
|
+
patch?: never;
|
|
294
|
+
trace?: never;
|
|
295
|
+
};
|
|
296
|
+
"/v1/upstreams/{tag}/retry": {
|
|
297
|
+
parameters: {
|
|
298
|
+
query?: never;
|
|
299
|
+
header?: never;
|
|
300
|
+
path?: never;
|
|
301
|
+
cookie?: never;
|
|
302
|
+
};
|
|
303
|
+
get?: never;
|
|
304
|
+
put?: never;
|
|
305
|
+
/** Asks the upstream to connect again now, at the operator's word: every wait it was in starts over. */
|
|
306
|
+
post: operations["retryUpstream"];
|
|
307
|
+
delete?: never;
|
|
308
|
+
options?: never;
|
|
309
|
+
head?: never;
|
|
310
|
+
patch?: never;
|
|
311
|
+
trace?: never;
|
|
312
|
+
};
|
|
211
313
|
"/v1/users": {
|
|
212
314
|
parameters: {
|
|
213
315
|
query?: never;
|
|
@@ -282,7 +384,7 @@ export interface components {
|
|
|
282
384
|
saved: boolean;
|
|
283
385
|
};
|
|
284
386
|
/** @enum {string} */
|
|
285
|
-
Backend: "netstack" | "l3" | "block" | "chain";
|
|
387
|
+
Backend: "netstack" | "l3" | "block" | "chain" | "upstream";
|
|
286
388
|
/** @description Tags or names of one kind. */
|
|
287
389
|
Changes: {
|
|
288
390
|
added: string[];
|
|
@@ -1270,6 +1372,193 @@ export interface components {
|
|
|
1270
1372
|
*/
|
|
1271
1373
|
window: number;
|
|
1272
1374
|
};
|
|
1375
|
+
/** @description What the node is doing for one upstream. Nothing in it is a key, a secret, a token or the link. */
|
|
1376
|
+
Upstream: {
|
|
1377
|
+
counters: components["schemas"]["UpstreamCounters"];
|
|
1378
|
+
/** @description The exit of the provider in use, and the exits it offers. */
|
|
1379
|
+
exit: string | null;
|
|
1380
|
+
/**
|
|
1381
|
+
* Format: int64
|
|
1382
|
+
* @description When the document stops being current and when it was last refreshed, in Unix seconds.
|
|
1383
|
+
*/
|
|
1384
|
+
expires_at: number | null;
|
|
1385
|
+
/**
|
|
1386
|
+
* Format: uint16
|
|
1387
|
+
* @description The largest packet the carrier takes now. Null until a profile is in use.
|
|
1388
|
+
*/
|
|
1389
|
+
mtu: number | null;
|
|
1390
|
+
/** @description What the provider says to the device, as plain text. */
|
|
1391
|
+
notices: string[];
|
|
1392
|
+
offered_exits: string[];
|
|
1393
|
+
pending_hosts: string[];
|
|
1394
|
+
/** @description A move of the provider's endpoint, and refresh hosts, that the provider announced and the operator has not confirmed. The old endpoint and hosts are used meanwhile. */
|
|
1395
|
+
pending_move: string | null;
|
|
1396
|
+
/** @description The profile in use, and the transport it is connected over. */
|
|
1397
|
+
profile: string | null;
|
|
1398
|
+
provider: string | null;
|
|
1399
|
+
quota: components["schemas"]["UpstreamQuota"] | null;
|
|
1400
|
+
/** @description Plain words for why the state is what it is. Empty while it is up. */
|
|
1401
|
+
reason: string;
|
|
1402
|
+
/** @description Why the last refresh failed. Null once one has gone through. */
|
|
1403
|
+
refresh_error: string | null;
|
|
1404
|
+
/** Format: int64 */
|
|
1405
|
+
refreshed_at: number | null;
|
|
1406
|
+
/** @description The fingerprint of the signing key the document in force is signed under. After the provider rotated its key this is the new one, which `signing_key` and the link in the upstream's config do not name until the operator confirms it. */
|
|
1407
|
+
signing_key: string | null;
|
|
1408
|
+
state: components["schemas"]["UpstreamStatus"];
|
|
1409
|
+
/**
|
|
1410
|
+
* Format: uint64
|
|
1411
|
+
* @description Seconds the upstream has been in `state`.
|
|
1412
|
+
*/
|
|
1413
|
+
state_secs: number;
|
|
1414
|
+
tag: string;
|
|
1415
|
+
transport: components["schemas"]["Transport"] | null;
|
|
1416
|
+
};
|
|
1417
|
+
/** @description A class of transports the operator allows an upstream to use, as the client engine ranks them from strongest to weakest. `cover` is always allowed. */
|
|
1418
|
+
UpstreamClass: "cover" | "no_cover" | "exposed" | "plain";
|
|
1419
|
+
/** @description What the operator confirms: the move of the provider's endpoint the node reported as pending, and the refresh hosts it reported. A field that is left out is false when the other one is given, and the body may be left out altogether, which confirms both. */
|
|
1420
|
+
UpstreamConfirm: {
|
|
1421
|
+
/** @description Take the new refresh hosts and static mirrors the provider announced. */
|
|
1422
|
+
hosts?: boolean;
|
|
1423
|
+
/** @description Follow the move to the new endpoint: the next refresh tries it first. */
|
|
1424
|
+
move?: boolean;
|
|
1425
|
+
};
|
|
1426
|
+
/** @description What a confirmation did: false for each thing that did not wait for it. */
|
|
1427
|
+
UpstreamConfirmed: {
|
|
1428
|
+
hosts: boolean;
|
|
1429
|
+
moved: boolean;
|
|
1430
|
+
};
|
|
1431
|
+
/** @description Totals since the node started, or since the upstream first ran. */
|
|
1432
|
+
UpstreamCounters: {
|
|
1433
|
+
/**
|
|
1434
|
+
* Format: uint64
|
|
1435
|
+
* @description Packets out of the tunnel that answered no live flow of a device, and were dropped.
|
|
1436
|
+
*/
|
|
1437
|
+
dropped: number;
|
|
1438
|
+
/** Format: uint64 */
|
|
1439
|
+
refresh_failures: number;
|
|
1440
|
+
/** Format: uint64 */
|
|
1441
|
+
refreshes: number;
|
|
1442
|
+
/**
|
|
1443
|
+
* Format: uint64
|
|
1444
|
+
* @description Flows refused because the upstream was down.
|
|
1445
|
+
*/
|
|
1446
|
+
refused: number;
|
|
1447
|
+
/**
|
|
1448
|
+
* Format: uint64
|
|
1449
|
+
* @description Packets handed to the provider's tunnel, and packets it had no room or no session for.
|
|
1450
|
+
*/
|
|
1451
|
+
sent: number;
|
|
1452
|
+
/** Format: uint64 */
|
|
1453
|
+
starts: number;
|
|
1454
|
+
/**
|
|
1455
|
+
* Format: uint64
|
|
1456
|
+
* @description Changes between up and not up, and starts of the tunnel over again.
|
|
1457
|
+
*/
|
|
1458
|
+
state_flips: number;
|
|
1459
|
+
traffic: components["schemas"]["Traffic"];
|
|
1460
|
+
/** Format: uint64 */
|
|
1461
|
+
unsent: number;
|
|
1462
|
+
};
|
|
1463
|
+
/** @description What a decline of a preview did: the provider was told to release the place. */
|
|
1464
|
+
UpstreamDeclined: {
|
|
1465
|
+
id: string;
|
|
1466
|
+
};
|
|
1467
|
+
UpstreamExit: {
|
|
1468
|
+
name: string;
|
|
1469
|
+
tag: string;
|
|
1470
|
+
};
|
|
1471
|
+
/** @description The answer to a preview: the document the provider sent, verified under the key of the link, as the operator reads it before saying yes. Fetching it took a place at the provider. The place is given back when the preview is declined or runs out, and made permanent by the config that names the same link and device within `expires_in_secs`. */
|
|
1472
|
+
UpstreamPreview: {
|
|
1473
|
+
/**
|
|
1474
|
+
* Format: int64
|
|
1475
|
+
* @description When the account ends, in Unix seconds. Null for never or unknown.
|
|
1476
|
+
*/
|
|
1477
|
+
account_expires_at: number | null;
|
|
1478
|
+
/** @description The classes of transports the profiles list: the operator's consent is asked for each besides `cover`. */
|
|
1479
|
+
classes: components["schemas"]["UpstreamClass"][];
|
|
1480
|
+
/**
|
|
1481
|
+
* Format: uint16
|
|
1482
|
+
* @description How many devices the account may have, null for no limit or unknown, and how many the document lists.
|
|
1483
|
+
*/
|
|
1484
|
+
device_limit: number | null;
|
|
1485
|
+
/** Format: uint */
|
|
1486
|
+
devices: number;
|
|
1487
|
+
/**
|
|
1488
|
+
* Format: int64
|
|
1489
|
+
* @description When the document stops being current, in Unix seconds.
|
|
1490
|
+
*/
|
|
1491
|
+
expires_at: number;
|
|
1492
|
+
/**
|
|
1493
|
+
* Format: uint64
|
|
1494
|
+
* @description How long the node keeps the document for the config that names it.
|
|
1495
|
+
*/
|
|
1496
|
+
expires_in_secs: number;
|
|
1497
|
+
/** @description The fingerprint of the key the document is signed with, which is the one in the link and the one for `signing_key` of the config. */
|
|
1498
|
+
fingerprint: string;
|
|
1499
|
+
id: string;
|
|
1500
|
+
profiles: components["schemas"]["UpstreamProfile"][];
|
|
1501
|
+
/** @description The provider's own name for itself, shown as its claim next to the fingerprint. */
|
|
1502
|
+
provider: string;
|
|
1503
|
+
quota: components["schemas"]["UpstreamQuota"] | null;
|
|
1504
|
+
/** Format: uint64 */
|
|
1505
|
+
serial: number;
|
|
1506
|
+
};
|
|
1507
|
+
/** @description What the node needs to fetch the subscription of another provider with a device the panel made. The key and the secret are used for the fetch and are never in any answer, log or error. */
|
|
1508
|
+
UpstreamPreviewRequest: {
|
|
1509
|
+
/**
|
|
1510
|
+
* @description Whether the node is to be allowed to dial private addresses of the profiles. It decides which profiles the review marks as refused.
|
|
1511
|
+
* @default false
|
|
1512
|
+
*/
|
|
1513
|
+
allow_private: boolean;
|
|
1514
|
+
/** @description The device secret, 16 bytes as 22 characters of base64url. */
|
|
1515
|
+
device_secret: string;
|
|
1516
|
+
/** @description A native veilway://sub/ link. Carried, file, legacy and plain-address forms are refused. */
|
|
1517
|
+
link: string;
|
|
1518
|
+
/** @description The WireGuard private key of the device, 44 characters of standard base64 as a config writes a key. */
|
|
1519
|
+
private_key: string;
|
|
1520
|
+
/** @description The tag of a direct or socks5 outbound of the running config the provider is reached through. Left out: from the node itself. */
|
|
1521
|
+
via?: string;
|
|
1522
|
+
};
|
|
1523
|
+
/** @description One profile of a provider's document. */
|
|
1524
|
+
UpstreamProfile: {
|
|
1525
|
+
classes: components["schemas"]["UpstreamClass"][];
|
|
1526
|
+
/** @description The exits the provider lists for the profile, by tag and name. */
|
|
1527
|
+
exits: components["schemas"]["UpstreamExit"][];
|
|
1528
|
+
id: string;
|
|
1529
|
+
/** Format: uint16 */
|
|
1530
|
+
mtu: number;
|
|
1531
|
+
name: string;
|
|
1532
|
+
/** @description Private addresses the profile names to dial. */
|
|
1533
|
+
private_addresses: string[];
|
|
1534
|
+
/** @description What a censor can see, worked out by the node. */
|
|
1535
|
+
rating: components["schemas"]["Rating"];
|
|
1536
|
+
/** @description Why this node would not use the profile under the request's settings. Null when it would. */
|
|
1537
|
+
refused: string | null;
|
|
1538
|
+
/** @description In the provider's order. */
|
|
1539
|
+
transports: components["schemas"]["Transport"][];
|
|
1540
|
+
};
|
|
1541
|
+
/** @description What the provider says an account has used and has. A quota of 0 is none. */
|
|
1542
|
+
UpstreamQuota: {
|
|
1543
|
+
/** Format: uint64 */
|
|
1544
|
+
quota_bytes: number;
|
|
1545
|
+
/** Format: uint64 */
|
|
1546
|
+
used_bytes: number;
|
|
1547
|
+
};
|
|
1548
|
+
/** @description What a removal did. `confirmed` says whether the provider took the word that the device left; when it did not, the place stays until the provider removes it. The upstream is not run again by a config that still names it. */
|
|
1549
|
+
UpstreamRemoved: {
|
|
1550
|
+
confirmed: boolean;
|
|
1551
|
+
tag: string;
|
|
1552
|
+
};
|
|
1553
|
+
/** @description The tag of an upstream the node was asked to connect again. */
|
|
1554
|
+
UpstreamRetried: {
|
|
1555
|
+
tag: string;
|
|
1556
|
+
};
|
|
1557
|
+
/** @enum {string} */
|
|
1558
|
+
UpstreamStatus: "fetching" | "connecting" | "up" | "down";
|
|
1559
|
+
Upstreams: {
|
|
1560
|
+
upstreams: components["schemas"]["Upstream"][];
|
|
1561
|
+
};
|
|
1273
1562
|
/** @description The data of a `usage_reset` event: the user's quota count was started over through the API, and with `totals` their traffic counters went back to zero as well. A user who was out of quota gets a `user_restored` right behind it. */
|
|
1274
1563
|
UsageReset: {
|
|
1275
1564
|
totals: boolean;
|
|
@@ -1979,6 +2268,385 @@ export interface operations {
|
|
|
1979
2268
|
};
|
|
1980
2269
|
};
|
|
1981
2270
|
};
|
|
2271
|
+
listUpstreams: {
|
|
2272
|
+
parameters: {
|
|
2273
|
+
query?: never;
|
|
2274
|
+
header?: never;
|
|
2275
|
+
path?: never;
|
|
2276
|
+
cookie?: never;
|
|
2277
|
+
};
|
|
2278
|
+
requestBody?: never;
|
|
2279
|
+
responses: {
|
|
2280
|
+
/** @description The answer. */
|
|
2281
|
+
200: {
|
|
2282
|
+
headers: {
|
|
2283
|
+
[name: string]: unknown;
|
|
2284
|
+
};
|
|
2285
|
+
content: {
|
|
2286
|
+
"application/json": components["schemas"]["Upstreams"];
|
|
2287
|
+
};
|
|
2288
|
+
};
|
|
2289
|
+
/** @description The request was not finished within 30 seconds. */
|
|
2290
|
+
408: {
|
|
2291
|
+
headers: {
|
|
2292
|
+
[name: string]: unknown;
|
|
2293
|
+
};
|
|
2294
|
+
content: {
|
|
2295
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2296
|
+
};
|
|
2297
|
+
};
|
|
2298
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2299
|
+
503: {
|
|
2300
|
+
headers: {
|
|
2301
|
+
[name: string]: unknown;
|
|
2302
|
+
};
|
|
2303
|
+
content: {
|
|
2304
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2305
|
+
};
|
|
2306
|
+
};
|
|
2307
|
+
};
|
|
2308
|
+
};
|
|
2309
|
+
previewUpstream: {
|
|
2310
|
+
parameters: {
|
|
2311
|
+
query?: never;
|
|
2312
|
+
header?: never;
|
|
2313
|
+
path?: never;
|
|
2314
|
+
cookie?: never;
|
|
2315
|
+
};
|
|
2316
|
+
requestBody: {
|
|
2317
|
+
content: {
|
|
2318
|
+
"application/json": components["schemas"]["UpstreamPreviewRequest"];
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
responses: {
|
|
2322
|
+
/** @description The answer. */
|
|
2323
|
+
200: {
|
|
2324
|
+
headers: {
|
|
2325
|
+
[name: string]: unknown;
|
|
2326
|
+
};
|
|
2327
|
+
content: {
|
|
2328
|
+
"application/json": components["schemas"]["UpstreamPreview"];
|
|
2329
|
+
};
|
|
2330
|
+
};
|
|
2331
|
+
/** @description The body is not one JSON document, or could not be read to its end. */
|
|
2332
|
+
400: {
|
|
2333
|
+
headers: {
|
|
2334
|
+
[name: string]: unknown;
|
|
2335
|
+
};
|
|
2336
|
+
content: {
|
|
2337
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2338
|
+
};
|
|
2339
|
+
};
|
|
2340
|
+
/** @description The body was not read within 30 seconds. Nothing was fetched: once the node has begun to fetch, the answer waits for the provider and is never this one. */
|
|
2341
|
+
408: {
|
|
2342
|
+
headers: {
|
|
2343
|
+
[name: string]: unknown;
|
|
2344
|
+
};
|
|
2345
|
+
content: {
|
|
2346
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2347
|
+
};
|
|
2348
|
+
};
|
|
2349
|
+
/** @description Four previews already wait. Nothing was fetched. */
|
|
2350
|
+
409: {
|
|
2351
|
+
headers: {
|
|
2352
|
+
[name: string]: unknown;
|
|
2353
|
+
};
|
|
2354
|
+
content: {
|
|
2355
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2356
|
+
};
|
|
2357
|
+
};
|
|
2358
|
+
/** @description The body is larger than 4 MiB. */
|
|
2359
|
+
413: {
|
|
2360
|
+
headers: {
|
|
2361
|
+
[name: string]: unknown;
|
|
2362
|
+
};
|
|
2363
|
+
content: {
|
|
2364
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2365
|
+
};
|
|
2366
|
+
};
|
|
2367
|
+
/** @description The body was not sent as application/json. */
|
|
2368
|
+
415: {
|
|
2369
|
+
headers: {
|
|
2370
|
+
[name: string]: unknown;
|
|
2371
|
+
};
|
|
2372
|
+
content: {
|
|
2373
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2374
|
+
};
|
|
2375
|
+
};
|
|
2376
|
+
/** @description A part of the body is not what a preview takes, or names an outbound the running config does not have. Nothing was fetched. */
|
|
2377
|
+
422: {
|
|
2378
|
+
headers: {
|
|
2379
|
+
[name: string]: unknown;
|
|
2380
|
+
};
|
|
2381
|
+
content: {
|
|
2382
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
/** @description The provider could not be asked, or its answer did not pass the checks, for instance because it is signed by another key than the link's, or the account has no device place left. The code is provider_failed and the message says why in plain words. Nothing was kept. */
|
|
2386
|
+
502: {
|
|
2387
|
+
headers: {
|
|
2388
|
+
[name: string]: unknown;
|
|
2389
|
+
};
|
|
2390
|
+
content: {
|
|
2391
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2392
|
+
};
|
|
2393
|
+
};
|
|
2394
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2395
|
+
503: {
|
|
2396
|
+
headers: {
|
|
2397
|
+
[name: string]: unknown;
|
|
2398
|
+
};
|
|
2399
|
+
content: {
|
|
2400
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2401
|
+
};
|
|
2402
|
+
};
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
declinePreview: {
|
|
2406
|
+
parameters: {
|
|
2407
|
+
query?: never;
|
|
2408
|
+
header?: never;
|
|
2409
|
+
path: {
|
|
2410
|
+
id: string;
|
|
2411
|
+
};
|
|
2412
|
+
cookie?: never;
|
|
2413
|
+
};
|
|
2414
|
+
requestBody?: never;
|
|
2415
|
+
responses: {
|
|
2416
|
+
/** @description The answer. */
|
|
2417
|
+
200: {
|
|
2418
|
+
headers: {
|
|
2419
|
+
[name: string]: unknown;
|
|
2420
|
+
};
|
|
2421
|
+
content: {
|
|
2422
|
+
"application/json": components["schemas"]["UpstreamDeclined"];
|
|
2423
|
+
};
|
|
2424
|
+
};
|
|
2425
|
+
/** @description No preview of that id waits: it was declined, a config took it, or it ran out. */
|
|
2426
|
+
404: {
|
|
2427
|
+
headers: {
|
|
2428
|
+
[name: string]: unknown;
|
|
2429
|
+
};
|
|
2430
|
+
content: {
|
|
2431
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2432
|
+
};
|
|
2433
|
+
};
|
|
2434
|
+
/** @description The request was not finished within 30 seconds. */
|
|
2435
|
+
408: {
|
|
2436
|
+
headers: {
|
|
2437
|
+
[name: string]: unknown;
|
|
2438
|
+
};
|
|
2439
|
+
content: {
|
|
2440
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2444
|
+
503: {
|
|
2445
|
+
headers: {
|
|
2446
|
+
[name: string]: unknown;
|
|
2447
|
+
};
|
|
2448
|
+
content: {
|
|
2449
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2450
|
+
};
|
|
2451
|
+
};
|
|
2452
|
+
};
|
|
2453
|
+
};
|
|
2454
|
+
removeUpstream: {
|
|
2455
|
+
parameters: {
|
|
2456
|
+
query?: never;
|
|
2457
|
+
header?: never;
|
|
2458
|
+
path: {
|
|
2459
|
+
tag: string;
|
|
2460
|
+
};
|
|
2461
|
+
cookie?: never;
|
|
2462
|
+
};
|
|
2463
|
+
requestBody?: never;
|
|
2464
|
+
responses: {
|
|
2465
|
+
/** @description The answer. */
|
|
2466
|
+
200: {
|
|
2467
|
+
headers: {
|
|
2468
|
+
[name: string]: unknown;
|
|
2469
|
+
};
|
|
2470
|
+
content: {
|
|
2471
|
+
"application/json": components["schemas"]["UpstreamRemoved"];
|
|
2472
|
+
};
|
|
2473
|
+
};
|
|
2474
|
+
/** @description The running config has no upstream of that tag. Nothing was changed. */
|
|
2475
|
+
404: {
|
|
2476
|
+
headers: {
|
|
2477
|
+
[name: string]: unknown;
|
|
2478
|
+
};
|
|
2479
|
+
content: {
|
|
2480
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2481
|
+
};
|
|
2482
|
+
};
|
|
2483
|
+
/** @description The request was not finished within 30 seconds. */
|
|
2484
|
+
408: {
|
|
2485
|
+
headers: {
|
|
2486
|
+
[name: string]: unknown;
|
|
2487
|
+
};
|
|
2488
|
+
content: {
|
|
2489
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2490
|
+
};
|
|
2491
|
+
};
|
|
2492
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2493
|
+
503: {
|
|
2494
|
+
headers: {
|
|
2495
|
+
[name: string]: unknown;
|
|
2496
|
+
};
|
|
2497
|
+
content: {
|
|
2498
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2499
|
+
};
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
};
|
|
2503
|
+
confirmUpstream: {
|
|
2504
|
+
parameters: {
|
|
2505
|
+
query?: never;
|
|
2506
|
+
header?: never;
|
|
2507
|
+
path: {
|
|
2508
|
+
tag: string;
|
|
2509
|
+
};
|
|
2510
|
+
cookie?: never;
|
|
2511
|
+
};
|
|
2512
|
+
requestBody?: {
|
|
2513
|
+
content: {
|
|
2514
|
+
"application/json": components["schemas"]["UpstreamConfirm"];
|
|
2515
|
+
};
|
|
2516
|
+
};
|
|
2517
|
+
responses: {
|
|
2518
|
+
/** @description The answer. */
|
|
2519
|
+
200: {
|
|
2520
|
+
headers: {
|
|
2521
|
+
[name: string]: unknown;
|
|
2522
|
+
};
|
|
2523
|
+
content: {
|
|
2524
|
+
"application/json": components["schemas"]["UpstreamConfirmed"];
|
|
2525
|
+
};
|
|
2526
|
+
};
|
|
2527
|
+
/** @description The body is not one JSON document, or could not be read to its end. */
|
|
2528
|
+
400: {
|
|
2529
|
+
headers: {
|
|
2530
|
+
[name: string]: unknown;
|
|
2531
|
+
};
|
|
2532
|
+
content: {
|
|
2533
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2534
|
+
};
|
|
2535
|
+
};
|
|
2536
|
+
/** @description The running config has no upstream of that tag. Nothing was changed. */
|
|
2537
|
+
404: {
|
|
2538
|
+
headers: {
|
|
2539
|
+
[name: string]: unknown;
|
|
2540
|
+
};
|
|
2541
|
+
content: {
|
|
2542
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2543
|
+
};
|
|
2544
|
+
};
|
|
2545
|
+
/** @description The request was not finished within 30 seconds. */
|
|
2546
|
+
408: {
|
|
2547
|
+
headers: {
|
|
2548
|
+
[name: string]: unknown;
|
|
2549
|
+
};
|
|
2550
|
+
content: {
|
|
2551
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2552
|
+
};
|
|
2553
|
+
};
|
|
2554
|
+
/** @description The body is larger than 4 MiB. */
|
|
2555
|
+
413: {
|
|
2556
|
+
headers: {
|
|
2557
|
+
[name: string]: unknown;
|
|
2558
|
+
};
|
|
2559
|
+
content: {
|
|
2560
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2561
|
+
};
|
|
2562
|
+
};
|
|
2563
|
+
/** @description The body was not sent as application/json. */
|
|
2564
|
+
415: {
|
|
2565
|
+
headers: {
|
|
2566
|
+
[name: string]: unknown;
|
|
2567
|
+
};
|
|
2568
|
+
content: {
|
|
2569
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2570
|
+
};
|
|
2571
|
+
};
|
|
2572
|
+
/** @description The body is JSON and not what a confirmation takes. Nothing was changed. */
|
|
2573
|
+
422: {
|
|
2574
|
+
headers: {
|
|
2575
|
+
[name: string]: unknown;
|
|
2576
|
+
};
|
|
2577
|
+
content: {
|
|
2578
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2579
|
+
};
|
|
2580
|
+
};
|
|
2581
|
+
/** @description state_unwritten: the state file of the upstreams could not be written, so the answer is not kept. */
|
|
2582
|
+
500: {
|
|
2583
|
+
headers: {
|
|
2584
|
+
[name: string]: unknown;
|
|
2585
|
+
};
|
|
2586
|
+
content: {
|
|
2587
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2588
|
+
};
|
|
2589
|
+
};
|
|
2590
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2591
|
+
503: {
|
|
2592
|
+
headers: {
|
|
2593
|
+
[name: string]: unknown;
|
|
2594
|
+
};
|
|
2595
|
+
content: {
|
|
2596
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2597
|
+
};
|
|
2598
|
+
};
|
|
2599
|
+
};
|
|
2600
|
+
};
|
|
2601
|
+
retryUpstream: {
|
|
2602
|
+
parameters: {
|
|
2603
|
+
query?: never;
|
|
2604
|
+
header?: never;
|
|
2605
|
+
path: {
|
|
2606
|
+
tag: string;
|
|
2607
|
+
};
|
|
2608
|
+
cookie?: never;
|
|
2609
|
+
};
|
|
2610
|
+
requestBody?: never;
|
|
2611
|
+
responses: {
|
|
2612
|
+
/** @description The answer. */
|
|
2613
|
+
200: {
|
|
2614
|
+
headers: {
|
|
2615
|
+
[name: string]: unknown;
|
|
2616
|
+
};
|
|
2617
|
+
content: {
|
|
2618
|
+
"application/json": components["schemas"]["UpstreamRetried"];
|
|
2619
|
+
};
|
|
2620
|
+
};
|
|
2621
|
+
/** @description The running config has no upstream of that tag. Nothing was changed. */
|
|
2622
|
+
404: {
|
|
2623
|
+
headers: {
|
|
2624
|
+
[name: string]: unknown;
|
|
2625
|
+
};
|
|
2626
|
+
content: {
|
|
2627
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2628
|
+
};
|
|
2629
|
+
};
|
|
2630
|
+
/** @description The request was not finished within 30 seconds. */
|
|
2631
|
+
408: {
|
|
2632
|
+
headers: {
|
|
2633
|
+
[name: string]: unknown;
|
|
2634
|
+
};
|
|
2635
|
+
content: {
|
|
2636
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2637
|
+
};
|
|
2638
|
+
};
|
|
2639
|
+
/** @description The node already serves as many connections, or as many event streams, as it takes at once. */
|
|
2640
|
+
503: {
|
|
2641
|
+
headers: {
|
|
2642
|
+
[name: string]: unknown;
|
|
2643
|
+
};
|
|
2644
|
+
content: {
|
|
2645
|
+
"application/json": components["schemas"]["ErrorBody"];
|
|
2646
|
+
};
|
|
2647
|
+
};
|
|
2648
|
+
};
|
|
2649
|
+
};
|
|
1982
2650
|
listUsers: {
|
|
1983
2651
|
parameters: {
|
|
1984
2652
|
query?: never;
|