@fkn/lib 0.9.27 → 0.9.29
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/{api-Dv7Fy_CF.d.ts → api-CxrIIOW8.d.ts} +319 -1
- package/api.d.ts +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-ZRqclRzO.d.ts → cloud-BpruQ4I2.d.ts} +3 -3
- package/cloud.d.ts +3 -3
- package/{contract-BergoFCw.d.ts → contract-DLyjkumA.d.ts} +124 -2
- package/contract.d.ts +2 -2
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/{extension-CJUeVRXf.d.ts → extension-DNkuFy1Y.d.ts} +2 -2
- package/extension.d.ts +2 -2
- package/http.d.ts +1 -1
- package/{index-BhO-wymH.d.ts → index-DH3_12nU.d.ts} +36 -36
- package/index.cjs +1 -1
- package/index.d.ts +6 -5
- package/index.js +48 -47
- package/{net-C9Me0zVw.d.ts → net-DOkodxE3.d.ts} +2 -2
- package/net.d.ts +1 -1
- package/package.json +6 -1
- package/packages.d.ts +1 -1
- package/{proxy-DkuZfeI4.d.ts → proxy-YNFaF0dC.d.ts} +2 -2
- package/rooms.cjs +1 -0
- package/rooms.d.ts +46 -0
- package/rooms.js +142 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import { A as ProxyFetchInit, C as PackageQuery, D as PickOptions,
|
|
2
|
+
import { $ as TcpSocketOptions, A as ProxyFetchInit, B as RoomJoinOptions, C as PackageQuery, D as PickOptions, F as RoomCreateOptions, G as RoomsErrorCode, O as Placement, P as Resolvers, R as RoomEvent, S as OverlayState, T as PackagesErrorCode, U as RoomPermission, Z as TcpSocketListenerOptions, _ as InstallOptions, a as ConflictChoice, c as ConnectAvailability, i as AdoptState, it as WriteData, j as ProxyFetchInput, l as ConnectOptions, m as FrameConsentRequest, nt as UdpSocketOptions, o as ConflictRequest, r as AdoptRequest, tt as UdpDatagram, y as IpFamily } from "./contract-DLyjkumA.js";
|
|
3
3
|
import { Remote } from "osra";
|
|
4
4
|
//#region src/api-epochs.d.ts
|
|
5
5
|
type EpochListener<T> = (remote: T, epoch: number) => void;
|
|
@@ -275,6 +275,165 @@ declare const onApiEpoch: (listener: EpochListener<{
|
|
|
275
275
|
ok: true;
|
|
276
276
|
}>;
|
|
277
277
|
};
|
|
278
|
+
rooms: {
|
|
279
|
+
available: () => Promise<boolean>;
|
|
280
|
+
create: (options?: RoomCreateOptions | undefined) => Promise<{
|
|
281
|
+
id: string;
|
|
282
|
+
key: string;
|
|
283
|
+
invite: string;
|
|
284
|
+
self: {
|
|
285
|
+
id: string;
|
|
286
|
+
permissions: {
|
|
287
|
+
readonly block: boolean;
|
|
288
|
+
readonly receive: boolean;
|
|
289
|
+
readonly remove: boolean;
|
|
290
|
+
readonly send: boolean;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
owner: string;
|
|
294
|
+
defaults: () => Promise<{
|
|
295
|
+
readonly send: boolean;
|
|
296
|
+
readonly receive: boolean;
|
|
297
|
+
}>;
|
|
298
|
+
members: () => Promise<{
|
|
299
|
+
id: string;
|
|
300
|
+
permissions: {
|
|
301
|
+
readonly block: boolean;
|
|
302
|
+
readonly receive: boolean;
|
|
303
|
+
readonly remove: boolean;
|
|
304
|
+
readonly send: boolean;
|
|
305
|
+
};
|
|
306
|
+
}[]>;
|
|
307
|
+
send: (text: string) => Promise<{
|
|
308
|
+
error: RoomsErrorCode;
|
|
309
|
+
message: string;
|
|
310
|
+
} | {
|
|
311
|
+
ok: true;
|
|
312
|
+
}>;
|
|
313
|
+
setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
|
|
314
|
+
error: RoomsErrorCode;
|
|
315
|
+
message: string;
|
|
316
|
+
} | {
|
|
317
|
+
ok: true;
|
|
318
|
+
}>;
|
|
319
|
+
grant: (id: string, permission: RoomPermission) => Promise<{
|
|
320
|
+
error: RoomsErrorCode;
|
|
321
|
+
message: string;
|
|
322
|
+
} | {
|
|
323
|
+
ok: true;
|
|
324
|
+
}>;
|
|
325
|
+
revoke: (id: string, permission: RoomPermission) => Promise<{
|
|
326
|
+
error: RoomsErrorCode;
|
|
327
|
+
message: string;
|
|
328
|
+
} | {
|
|
329
|
+
ok: true;
|
|
330
|
+
}>;
|
|
331
|
+
remove: (id: string) => Promise<{
|
|
332
|
+
error: RoomsErrorCode;
|
|
333
|
+
message: string;
|
|
334
|
+
} | {
|
|
335
|
+
ok: true;
|
|
336
|
+
}>;
|
|
337
|
+
block: (id: string) => Promise<{
|
|
338
|
+
error: RoomsErrorCode;
|
|
339
|
+
message: string;
|
|
340
|
+
} | {
|
|
341
|
+
ok: true;
|
|
342
|
+
}>;
|
|
343
|
+
unblock: (id: string) => Promise<{
|
|
344
|
+
error: RoomsErrorCode;
|
|
345
|
+
message: string;
|
|
346
|
+
} | {
|
|
347
|
+
ok: true;
|
|
348
|
+
}>;
|
|
349
|
+
on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
|
|
350
|
+
leave: () => Promise<void>;
|
|
351
|
+
closed: Promise<{
|
|
352
|
+
reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
|
|
353
|
+
}>;
|
|
354
|
+
} | {
|
|
355
|
+
error: RoomsErrorCode;
|
|
356
|
+
message: string;
|
|
357
|
+
}>;
|
|
358
|
+
join: (invite: string, options?: RoomJoinOptions | undefined) => Promise<{
|
|
359
|
+
id: string;
|
|
360
|
+
key: string;
|
|
361
|
+
invite: string;
|
|
362
|
+
self: {
|
|
363
|
+
id: string;
|
|
364
|
+
permissions: {
|
|
365
|
+
readonly block: boolean;
|
|
366
|
+
readonly receive: boolean;
|
|
367
|
+
readonly remove: boolean;
|
|
368
|
+
readonly send: boolean;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
owner: string;
|
|
372
|
+
defaults: () => Promise<{
|
|
373
|
+
readonly send: boolean;
|
|
374
|
+
readonly receive: boolean;
|
|
375
|
+
}>;
|
|
376
|
+
members: () => Promise<{
|
|
377
|
+
id: string;
|
|
378
|
+
permissions: {
|
|
379
|
+
readonly block: boolean;
|
|
380
|
+
readonly receive: boolean;
|
|
381
|
+
readonly remove: boolean;
|
|
382
|
+
readonly send: boolean;
|
|
383
|
+
};
|
|
384
|
+
}[]>;
|
|
385
|
+
send: (text: string) => Promise<{
|
|
386
|
+
error: RoomsErrorCode;
|
|
387
|
+
message: string;
|
|
388
|
+
} | {
|
|
389
|
+
ok: true;
|
|
390
|
+
}>;
|
|
391
|
+
setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
|
|
392
|
+
error: RoomsErrorCode;
|
|
393
|
+
message: string;
|
|
394
|
+
} | {
|
|
395
|
+
ok: true;
|
|
396
|
+
}>;
|
|
397
|
+
grant: (id: string, permission: RoomPermission) => Promise<{
|
|
398
|
+
error: RoomsErrorCode;
|
|
399
|
+
message: string;
|
|
400
|
+
} | {
|
|
401
|
+
ok: true;
|
|
402
|
+
}>;
|
|
403
|
+
revoke: (id: string, permission: RoomPermission) => Promise<{
|
|
404
|
+
error: RoomsErrorCode;
|
|
405
|
+
message: string;
|
|
406
|
+
} | {
|
|
407
|
+
ok: true;
|
|
408
|
+
}>;
|
|
409
|
+
remove: (id: string) => Promise<{
|
|
410
|
+
error: RoomsErrorCode;
|
|
411
|
+
message: string;
|
|
412
|
+
} | {
|
|
413
|
+
ok: true;
|
|
414
|
+
}>;
|
|
415
|
+
block: (id: string) => Promise<{
|
|
416
|
+
error: RoomsErrorCode;
|
|
417
|
+
message: string;
|
|
418
|
+
} | {
|
|
419
|
+
ok: true;
|
|
420
|
+
}>;
|
|
421
|
+
unblock: (id: string) => Promise<{
|
|
422
|
+
error: RoomsErrorCode;
|
|
423
|
+
message: string;
|
|
424
|
+
} | {
|
|
425
|
+
ok: true;
|
|
426
|
+
}>;
|
|
427
|
+
on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
|
|
428
|
+
leave: () => Promise<void>;
|
|
429
|
+
closed: Promise<{
|
|
430
|
+
reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
|
|
431
|
+
}>;
|
|
432
|
+
} | {
|
|
433
|
+
error: RoomsErrorCode;
|
|
434
|
+
message: string;
|
|
435
|
+
}>;
|
|
436
|
+
};
|
|
278
437
|
account: {
|
|
279
438
|
info: () => Promise<{
|
|
280
439
|
name: string;
|
|
@@ -592,6 +751,165 @@ declare const currentApiEpoch: () => {
|
|
|
592
751
|
ok: true;
|
|
593
752
|
}>;
|
|
594
753
|
};
|
|
754
|
+
rooms: {
|
|
755
|
+
available: () => Promise<boolean>;
|
|
756
|
+
create: (options?: RoomCreateOptions | undefined) => Promise<{
|
|
757
|
+
id: string;
|
|
758
|
+
key: string;
|
|
759
|
+
invite: string;
|
|
760
|
+
self: {
|
|
761
|
+
id: string;
|
|
762
|
+
permissions: {
|
|
763
|
+
readonly block: boolean;
|
|
764
|
+
readonly receive: boolean;
|
|
765
|
+
readonly remove: boolean;
|
|
766
|
+
readonly send: boolean;
|
|
767
|
+
};
|
|
768
|
+
};
|
|
769
|
+
owner: string;
|
|
770
|
+
defaults: () => Promise<{
|
|
771
|
+
readonly send: boolean;
|
|
772
|
+
readonly receive: boolean;
|
|
773
|
+
}>;
|
|
774
|
+
members: () => Promise<{
|
|
775
|
+
id: string;
|
|
776
|
+
permissions: {
|
|
777
|
+
readonly block: boolean;
|
|
778
|
+
readonly receive: boolean;
|
|
779
|
+
readonly remove: boolean;
|
|
780
|
+
readonly send: boolean;
|
|
781
|
+
};
|
|
782
|
+
}[]>;
|
|
783
|
+
send: (text: string) => Promise<{
|
|
784
|
+
error: RoomsErrorCode;
|
|
785
|
+
message: string;
|
|
786
|
+
} | {
|
|
787
|
+
ok: true;
|
|
788
|
+
}>;
|
|
789
|
+
setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
|
|
790
|
+
error: RoomsErrorCode;
|
|
791
|
+
message: string;
|
|
792
|
+
} | {
|
|
793
|
+
ok: true;
|
|
794
|
+
}>;
|
|
795
|
+
grant: (id: string, permission: RoomPermission) => Promise<{
|
|
796
|
+
error: RoomsErrorCode;
|
|
797
|
+
message: string;
|
|
798
|
+
} | {
|
|
799
|
+
ok: true;
|
|
800
|
+
}>;
|
|
801
|
+
revoke: (id: string, permission: RoomPermission) => Promise<{
|
|
802
|
+
error: RoomsErrorCode;
|
|
803
|
+
message: string;
|
|
804
|
+
} | {
|
|
805
|
+
ok: true;
|
|
806
|
+
}>;
|
|
807
|
+
remove: (id: string) => Promise<{
|
|
808
|
+
error: RoomsErrorCode;
|
|
809
|
+
message: string;
|
|
810
|
+
} | {
|
|
811
|
+
ok: true;
|
|
812
|
+
}>;
|
|
813
|
+
block: (id: string) => Promise<{
|
|
814
|
+
error: RoomsErrorCode;
|
|
815
|
+
message: string;
|
|
816
|
+
} | {
|
|
817
|
+
ok: true;
|
|
818
|
+
}>;
|
|
819
|
+
unblock: (id: string) => Promise<{
|
|
820
|
+
error: RoomsErrorCode;
|
|
821
|
+
message: string;
|
|
822
|
+
} | {
|
|
823
|
+
ok: true;
|
|
824
|
+
}>;
|
|
825
|
+
on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
|
|
826
|
+
leave: () => Promise<void>;
|
|
827
|
+
closed: Promise<{
|
|
828
|
+
reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
|
|
829
|
+
}>;
|
|
830
|
+
} | {
|
|
831
|
+
error: RoomsErrorCode;
|
|
832
|
+
message: string;
|
|
833
|
+
}>;
|
|
834
|
+
join: (invite: string, options?: RoomJoinOptions | undefined) => Promise<{
|
|
835
|
+
id: string;
|
|
836
|
+
key: string;
|
|
837
|
+
invite: string;
|
|
838
|
+
self: {
|
|
839
|
+
id: string;
|
|
840
|
+
permissions: {
|
|
841
|
+
readonly block: boolean;
|
|
842
|
+
readonly receive: boolean;
|
|
843
|
+
readonly remove: boolean;
|
|
844
|
+
readonly send: boolean;
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
owner: string;
|
|
848
|
+
defaults: () => Promise<{
|
|
849
|
+
readonly send: boolean;
|
|
850
|
+
readonly receive: boolean;
|
|
851
|
+
}>;
|
|
852
|
+
members: () => Promise<{
|
|
853
|
+
id: string;
|
|
854
|
+
permissions: {
|
|
855
|
+
readonly block: boolean;
|
|
856
|
+
readonly receive: boolean;
|
|
857
|
+
readonly remove: boolean;
|
|
858
|
+
readonly send: boolean;
|
|
859
|
+
};
|
|
860
|
+
}[]>;
|
|
861
|
+
send: (text: string) => Promise<{
|
|
862
|
+
error: RoomsErrorCode;
|
|
863
|
+
message: string;
|
|
864
|
+
} | {
|
|
865
|
+
ok: true;
|
|
866
|
+
}>;
|
|
867
|
+
setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
|
|
868
|
+
error: RoomsErrorCode;
|
|
869
|
+
message: string;
|
|
870
|
+
} | {
|
|
871
|
+
ok: true;
|
|
872
|
+
}>;
|
|
873
|
+
grant: (id: string, permission: RoomPermission) => Promise<{
|
|
874
|
+
error: RoomsErrorCode;
|
|
875
|
+
message: string;
|
|
876
|
+
} | {
|
|
877
|
+
ok: true;
|
|
878
|
+
}>;
|
|
879
|
+
revoke: (id: string, permission: RoomPermission) => Promise<{
|
|
880
|
+
error: RoomsErrorCode;
|
|
881
|
+
message: string;
|
|
882
|
+
} | {
|
|
883
|
+
ok: true;
|
|
884
|
+
}>;
|
|
885
|
+
remove: (id: string) => Promise<{
|
|
886
|
+
error: RoomsErrorCode;
|
|
887
|
+
message: string;
|
|
888
|
+
} | {
|
|
889
|
+
ok: true;
|
|
890
|
+
}>;
|
|
891
|
+
block: (id: string) => Promise<{
|
|
892
|
+
error: RoomsErrorCode;
|
|
893
|
+
message: string;
|
|
894
|
+
} | {
|
|
895
|
+
ok: true;
|
|
896
|
+
}>;
|
|
897
|
+
unblock: (id: string) => Promise<{
|
|
898
|
+
error: RoomsErrorCode;
|
|
899
|
+
message: string;
|
|
900
|
+
} | {
|
|
901
|
+
ok: true;
|
|
902
|
+
}>;
|
|
903
|
+
on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
|
|
904
|
+
leave: () => Promise<void>;
|
|
905
|
+
closed: Promise<{
|
|
906
|
+
reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
|
|
907
|
+
}>;
|
|
908
|
+
} | {
|
|
909
|
+
error: RoomsErrorCode;
|
|
910
|
+
message: string;
|
|
911
|
+
}>;
|
|
912
|
+
};
|
|
595
913
|
account: {
|
|
596
914
|
info: () => Promise<{
|
|
597
915
|
name: string;
|
package/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { P as Resolvers } from "./contract-
|
|
2
|
-
import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-
|
|
1
|
+
import { P as Resolvers } from "./contract-DLyjkumA.js";
|
|
2
|
+
import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-CxrIIOW8.js";
|
|
3
3
|
export { API_DEADLINE_MS, BrokerUnreachableError, type Resolvers, apiInFlight, apiLastCall, apiPromise, apiWithin, currentApiEpoch, hasTransport, onApiEpoch };
|
package/cloud/dns.d.ts
CHANGED
package/cloud/fetch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cloudFetch } from "../proxy-
|
|
1
|
+
import { t as cloudFetch } from "../proxy-YNFaF0dC.js";
|
|
2
2
|
export { cloudFetch as fetch };
|
package/cloud/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-DOkodxE3.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { i as Frame, r as AttachFrameOptions } from "./index-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-YNFaF0dC.js";
|
|
2
|
+
import { i as Frame, r as AttachFrameOptions } from "./index-DH3_12nU.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-CBVaShOR.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-DOkodxE3.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
//#region src/cloud/frame.d.ts
|
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-YNFaF0dC.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-BpruQ4I2.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-CBVaShOR.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-DOkodxE3.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
|
@@ -179,6 +179,106 @@ type MountDescriptor = {
|
|
|
179
179
|
/** the connecting app, as the BROKER knows it */
|
|
180
180
|
from: string;
|
|
181
181
|
};
|
|
182
|
+
type RoomPermission = 'send' | 'receive' | 'remove' | 'block';
|
|
183
|
+
type RoomPermissions = Readonly<Record<RoomPermission, boolean>>;
|
|
184
|
+
type RoomDefaults = Readonly<{
|
|
185
|
+
send: boolean;
|
|
186
|
+
receive: boolean;
|
|
187
|
+
}>;
|
|
188
|
+
/** A participant as this room sees them. The id is fresh in every room. */
|
|
189
|
+
type RoomMember = {
|
|
190
|
+
id: string;
|
|
191
|
+
permissions: RoomPermissions;
|
|
192
|
+
};
|
|
193
|
+
type RoomMessage = {
|
|
194
|
+
seq: number;
|
|
195
|
+
from: string;
|
|
196
|
+
at: number;
|
|
197
|
+
text: string;
|
|
198
|
+
};
|
|
199
|
+
type RoomEvent = {
|
|
200
|
+
type: 'message';
|
|
201
|
+
message: RoomMessage;
|
|
202
|
+
} | {
|
|
203
|
+
type: 'joined';
|
|
204
|
+
member: RoomMember;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'left';
|
|
207
|
+
id: string;
|
|
208
|
+
reason: 'left' | 'removed' | 'blocked';
|
|
209
|
+
} | {
|
|
210
|
+
type: 'permissions';
|
|
211
|
+
id: string;
|
|
212
|
+
permissions: RoomPermissions;
|
|
213
|
+
} | {
|
|
214
|
+
type: 'defaults';
|
|
215
|
+
defaults: RoomDefaults;
|
|
216
|
+
};
|
|
217
|
+
type RoomsErrorCode = 'invalid' | 'not-found' | 'bad-key' | 'full' | 'blocked' | 'denied' | 'rate-limited' | 'too-large' | 'unavailable' | 'closed';
|
|
218
|
+
/** A refusal, as data. `packages` crosses the hop the same way, and for the same reason. */
|
|
219
|
+
type RoomsFail = {
|
|
220
|
+
error: RoomsErrorCode;
|
|
221
|
+
message: string;
|
|
222
|
+
};
|
|
223
|
+
/** Why the room ended for this app. It ends once. */
|
|
224
|
+
type RoomEnd = {
|
|
225
|
+
reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
|
|
226
|
+
};
|
|
227
|
+
type RoomCreateOptions = {
|
|
228
|
+
/** aborting it leaves the room; it never bounds the wait for the broker */
|
|
229
|
+
signal?: AbortSignal;
|
|
230
|
+
members?: number;
|
|
231
|
+
defaults?: Partial<RoomDefaults>;
|
|
232
|
+
};
|
|
233
|
+
type RoomJoinOptions = {
|
|
234
|
+
signal?: AbortSignal;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* A joined room, held by the broker: it owns the socket, the room key and the derived message key,
|
|
238
|
+
* and hands the app plaintext and member ids only.
|
|
239
|
+
*
|
|
240
|
+
* Every member that can be refused answers with a `RoomsFail` rather than throwing, so a refusal
|
|
241
|
+
* survives the osra hop as data. `leave` and `on` cannot be refused.
|
|
242
|
+
*/
|
|
243
|
+
type RoomHandle = {
|
|
244
|
+
/** the room's uuid */
|
|
245
|
+
id: string;
|
|
246
|
+
/** the room key, base64url. The api never sees it. Anyone holding it and the id can join. */
|
|
247
|
+
key: string;
|
|
248
|
+
/** `id` and `key` as one string, the thing to put in a link */
|
|
249
|
+
invite: string;
|
|
250
|
+
self: RoomMember;
|
|
251
|
+
owner: string;
|
|
252
|
+
defaults: () => Promise<RoomDefaults>;
|
|
253
|
+
members: () => Promise<RoomMember[]>;
|
|
254
|
+
/** at most 4,096 bytes of UTF-8, sealed before it leaves the browser; never truncated */
|
|
255
|
+
send: (text: string) => Promise<RoomsFail | {
|
|
256
|
+
ok: true;
|
|
257
|
+
}>;
|
|
258
|
+
setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<RoomsFail | {
|
|
259
|
+
ok: true;
|
|
260
|
+
}>;
|
|
261
|
+
grant: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
262
|
+
ok: true;
|
|
263
|
+
}>;
|
|
264
|
+
revoke: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
|
|
265
|
+
ok: true;
|
|
266
|
+
}>;
|
|
267
|
+
remove: (id: string) => Promise<RoomsFail | {
|
|
268
|
+
ok: true;
|
|
269
|
+
}>;
|
|
270
|
+
block: (id: string) => Promise<RoomsFail | {
|
|
271
|
+
ok: true;
|
|
272
|
+
}>;
|
|
273
|
+
unblock: (id: string) => Promise<RoomsFail | {
|
|
274
|
+
ok: true;
|
|
275
|
+
}>;
|
|
276
|
+
/** the `account.onChange` shape: one broker-side registration, unsubscribed by the returned function */
|
|
277
|
+
on: (listener: (event: RoomEvent) => void) => (() => void);
|
|
278
|
+
leave: () => Promise<void>;
|
|
279
|
+
/** settles once, when the room ends for this app. Never rejects. */
|
|
280
|
+
closed: Promise<RoomEnd>;
|
|
281
|
+
};
|
|
182
282
|
type IpFamily = 'IPv4' | 'IPv6';
|
|
183
283
|
/** Viewport rect plus optional corner radii, as the overlay host reports them. */
|
|
184
284
|
type OverlayRect = {
|
|
@@ -209,8 +309,25 @@ type DnsLookup = <T extends boolean = false>(hostname: string, options?: {
|
|
|
209
309
|
family?: 0 | 4 | 6;
|
|
210
310
|
}) => Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>;
|
|
211
311
|
type ProxyFetchInput = string | URL | Request;
|
|
312
|
+
/**
|
|
313
|
+
* What a cloud.fetch accepts beyond the platform's own RequestInit.
|
|
314
|
+
*
|
|
315
|
+
* `spread` sends THIS request through any healthy node, taken in turn, instead of the node the
|
|
316
|
+
* WebVPN session is on. The default keeps every request on that one node: it is the node the header
|
|
317
|
+
* names, and it is what an upstream that remembers a source address expects. Spreading is for an
|
|
318
|
+
* upstream that meters per address, where it multiplies the budget by the number of healthy nodes.
|
|
319
|
+
* AniList is the measured case: its live bucket answers `x-ratelimit-limit: 30` a minute per
|
|
320
|
+
* address, shared by every user behind one node.
|
|
321
|
+
*
|
|
322
|
+
* A spread request is the app's own choice and is not announced: the header keeps naming the
|
|
323
|
+
* session's node, which every request not carrying this flag still goes through. Only the cloud
|
|
324
|
+
* backend reads it; the extension and the desktop fetch from the user's own address and ignore it.
|
|
325
|
+
*
|
|
326
|
+
* `render` used to sit here. It set a request header the proxy never read and never listed for CORS,
|
|
327
|
+
* so a caller that passed it failed its own preflight; nothing did, and it is gone.
|
|
328
|
+
*/
|
|
212
329
|
type ProxyFetchInit = (RequestInit & {
|
|
213
|
-
|
|
330
|
+
spread?: boolean;
|
|
214
331
|
}) | undefined;
|
|
215
332
|
type ProxyFetch = (input: ProxyFetchInput, init: ProxyFetchInit) => Promise<Response>;
|
|
216
333
|
type TcpSocketOptions = {
|
|
@@ -381,6 +498,11 @@ type Resolvers = {
|
|
|
381
498
|
ok: true;
|
|
382
499
|
}>;
|
|
383
500
|
};
|
|
501
|
+
rooms: {
|
|
502
|
+
available: () => Promise<boolean>;
|
|
503
|
+
create: (options?: RoomCreateOptions) => Promise<RoomsFail | RoomHandle>;
|
|
504
|
+
join: (invite: string, options?: RoomJoinOptions) => Promise<RoomsFail | RoomHandle>;
|
|
505
|
+
};
|
|
384
506
|
account: {
|
|
385
507
|
info: () => Promise<Account | null>;
|
|
386
508
|
login: (consumerOrigin: string) => Promise<boolean>;
|
|
@@ -403,4 +525,4 @@ type Resolvers = {
|
|
|
403
525
|
hideInstallPrompt: () => void;
|
|
404
526
|
};
|
|
405
527
|
//#endregion
|
|
406
|
-
export { ProxyFetchInit as A,
|
|
528
|
+
export { TcpSocketOptions as $, ProxyFetchInit as A, RoomJoinOptions as B, PackageQuery as C, PickOptions as D, PackagesFail as E, RoomCreateOptions as F, RoomsErrorCode as G, RoomMessage as H, RoomDefaults as I, StorageEntry as J, RoomsFail as K, RoomEnd as L, Quota as M, Radii as N, Placement as O, Resolvers as P, TcpSocketListenerResult as Q, RoomEvent as R, OverlayState as S, PackagesErrorCode as T, RoomPermission as U, RoomMember as V, RoomPermissions as W, SurfaceRect as X, StorageQuota as Y, TcpSocketListenerOptions as Z, InstallOptions as _, ConflictChoice as a, MountDescriptor as b, ConnectAvailability as c, DisplayLevel as d, TcpSocketResult as et, DnsLookup as f, HiddenSurface as g, FrameFetchScope as h, AdoptState as i, WriteData as it, ProxyFetchInput as j, ProxyFetch as k, ConnectOptions as l, FrameConsentRequest as m, AddressLookupResult as n, UdpSocketOptions as nt, ConflictRequest as o, EncryptionState as p, SetOverlayHost as q, AdoptRequest as r, UdpSocketResult as rt, ConflictSide as s, Account as t, UdpDatagram as tt, DisplayCause as u, InstalledPackage as v, PackageResult as w, OverlayRect as x, IpFamily as y, RoomHandle as z };
|
package/contract.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import { A as ProxyFetchInit, B as
|
|
3
|
-
export { Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FrameConsentRequest, FrameFetchScope, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, SetOverlayHost, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WriteData };
|
|
2
|
+
import { $ as TcpSocketOptions, A as ProxyFetchInit, B as RoomJoinOptions, C as PackageQuery, D as PickOptions, E as PackagesFail, F as RoomCreateOptions, G as RoomsErrorCode, H as RoomMessage, I as RoomDefaults, J as StorageEntry, K as RoomsFail, L as RoomEnd, M as Quota, N as Radii, O as Placement, P as Resolvers, Q as TcpSocketListenerResult, R as RoomEvent, S as OverlayState, T as PackagesErrorCode, U as RoomPermission, V as RoomMember, W as RoomPermissions, X as SurfaceRect, Y as StorageQuota, Z as TcpSocketListenerOptions, _ as InstallOptions, a as ConflictChoice, b as MountDescriptor, c as ConnectAvailability, d as DisplayLevel, et as TcpSocketResult, f as DnsLookup, g as HiddenSurface, h as FrameFetchScope, i as AdoptState, it as WriteData, j as ProxyFetchInput, k as ProxyFetch, l as ConnectOptions, m as FrameConsentRequest, n as AddressLookupResult, nt as UdpSocketOptions, o as ConflictRequest, p as EncryptionState, q as SetOverlayHost, r as AdoptRequest, rt as UdpSocketResult, s as ConflictSide, t as Account, tt as UdpDatagram, u as DisplayCause, v as InstalledPackage, w as PackageResult, x as OverlayRect, y as IpFamily, z as RoomHandle } from "./contract-DLyjkumA.js";
|
|
3
|
+
export { Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FrameConsentRequest, FrameFetchScope, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SetOverlayHost, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WriteData };
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
2
|
+
import { P as Resolvers, rt as UdpSocketResult } from "./contract-DLyjkumA.js";
|
|
3
|
+
import "./api-CxrIIOW8.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-
|
|
1
|
+
import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-DH3_12nU.js";
|
|
2
2
|
//#region ../web-extension/lib/lib/forgeable-headers.d.ts
|
|
3
3
|
declare const FORGEABLE_HEADERS: string[];
|
|
4
4
|
declare const hasForgedCookie: (unsafeHeaders: [string, string][] | undefined) => boolean;
|
|
@@ -352,7 +352,7 @@ declare const promptInstall: (reason?: string) => Promise<boolean>;
|
|
|
352
352
|
declare const isExtensionAvailable: () => boolean;
|
|
353
353
|
declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
|
|
354
354
|
reason?: string;
|
|
355
|
-
|
|
355
|
+
spread?: boolean;
|
|
356
356
|
}) => Promise<Response>;
|
|
357
357
|
declare namespace extension_d_exports {
|
|
358
358
|
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as modifyRequestHeadersPermission, B as fetch, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as PermissionRequest, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PermissionGrant, h as supportsOperation, i as promptInstall, j as removeRequestHeaderRule, k as RequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as assertForgeableHeaders, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as permissions, w as LOCATOR_UNSUPPORTED, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as assertFetchableUrl } from "./extension-
|
|
2
|
-
import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-
|
|
1
|
+
import { A as modifyRequestHeadersPermission, B as fetch, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as PermissionRequest, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PermissionGrant, h as supportsOperation, i as promptInstall, j as removeRequestHeaderRule, k as RequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as assertForgeableHeaders, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as permissions, w as LOCATOR_UNSUPPORTED, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as assertFetchableUrl } from "./extension-DNkuFy1Y.js";
|
|
2
|
+
import { C as OperationRequest, S as GateTools, _ as isType, a as FrameBackend, b as Executor, c as attachFramePermission, d as handleRevivableModules, f as BoxedVideoElement, g as createVideoElementHandle, h as box, i as Frame, l as createFrame, m as VideoElementState, n as attachFrame, o as GotoOptions, p as RemoteVideoElement, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as revive, w as SelectorPart, x as Gate, y as type } from "./index-DH3_12nU.js";
|
|
3
3
|
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Socket, t as Server$1 } from "./net-
|
|
1
|
+
import { n as Socket, t as Server$1 } from "./net-DOkodxE3.js";
|
|
2
2
|
import { Buffer } from "buffer";
|
|
3
3
|
import { Stream } from "stream";
|
|
4
4
|
import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
|