@deadair/sdk 0.87.0 → 0.87.1
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/index.js +45 -17
- package/dist/index.js.map +1 -1
- package/dist/stream/stream.client.d.ts +6 -0
- package/dist/stream/stream.client.d.ts.map +1 -1
- package/dist/stream/types/index.d.ts +1 -0
- package/dist/stream/types/index.d.ts.map +1 -1
- package/dist/stream/types/stream.listeners.types.d.ts +43 -0
- package/dist/stream/types/stream.listeners.types.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SdkFetch } from '../sdk-options.js';
|
|
2
|
+
import type { StreamListeners } from './types/stream.listeners.types.js';
|
|
2
3
|
import type { FetcherAuthorization, FetcherAuthorizationFinished, FetcherAuthorizationInput, FetcherAuthorizationStart } from './types/stream.types.js';
|
|
3
4
|
import { StreamArchiveClient } from './stream.archive.client.js';
|
|
4
5
|
export declare class StreamClient {
|
|
@@ -40,5 +41,10 @@ export declare class StreamClient {
|
|
|
40
41
|
* @description Finishes an authorization from the address the operator's browser ended up at
|
|
41
42
|
*/
|
|
42
43
|
finishFetcherAuthorization(body: FetcherAuthorizationInput): Promise<FetcherAuthorizationFinished>;
|
|
44
|
+
/**
|
|
45
|
+
* @name List stream listeners
|
|
46
|
+
* @description Who is connected to the station's stream right now, over Icecast and over HLS
|
|
47
|
+
*/
|
|
48
|
+
listStreamListeners(): Promise<StreamListeners>;
|
|
43
49
|
}
|
|
44
50
|
//# sourceMappingURL=stream.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.client.d.ts","sourceRoot":"","sources":["../../src/stream/stream.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EACR,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EAC5B,MAAM,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,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE;YAAE,YAAY,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAM/F;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC;;;OAGG;IACG,wBAAwB,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAK/D;;;OAGG;IACG,yBAAyB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAKrE;;;OAGG;IACG,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IASxG;;;OAGG;IACG,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC;CAIxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream/types/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream/types/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
/**
|
|
3
|
+
* One connection to the station's stream, as it stands at the moment of reading
|
|
4
|
+
* generated from [ListenerConnection](../../../../../apps/api/data/contracts/stream/stream.listeners.types.ck)
|
|
5
|
+
*/
|
|
6
|
+
export interface ListenerConnection {
|
|
7
|
+
/** `icecast` is a player holding a connection open on a mount. `hls` is a player re-fetching a playlist, counted while it keeps asking */
|
|
8
|
+
via: 'icecast' | 'hls';
|
|
9
|
+
/** The Icecast mount it is on, such as `/live.mp3`. Absent over HLS, whose players are counted across every playlist together */
|
|
10
|
+
mount?: string;
|
|
11
|
+
/** The address the station recorded. A listener's own only where the edge in front of the station is trusted to say so; behind a tunnel without `REAL_IP_FROM` it is the tunnel's */
|
|
12
|
+
address: string;
|
|
13
|
+
/** What the player said it was, cut to 512 characters. Absent when it sent nothing */
|
|
14
|
+
agent?: string;
|
|
15
|
+
/** How long it has been connected, to the second. Over HLS, since the first playlist fetch of this stretch of listening */
|
|
16
|
+
connectedMs: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An Icecast mount whose connections could not be read, so its listeners are missing from the list
|
|
20
|
+
* generated from [UnreadableMount](../../../../../apps/api/data/contracts/stream/stream.listeners.types.ck)
|
|
21
|
+
*/
|
|
22
|
+
export interface UnreadableMount {
|
|
23
|
+
mount: string;
|
|
24
|
+
/** `unresolved`: the station has not yet found an Icecast 2.5 it can ask. `refused`: Icecast answered 401 or 403. `unanswered`: a timeout, a failed connection, or a reply that was not a client list */
|
|
25
|
+
reason: 'unresolved' | 'refused' | 'unanswered';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Who is connected to the station's stream right now. Read on request and never stored
|
|
29
|
+
* generated from [StreamListeners](../../../../../apps/api/data/contracts/stream/stream.listeners.types.ck)
|
|
30
|
+
*/
|
|
31
|
+
export interface StreamListeners {
|
|
32
|
+
/** When this was read */
|
|
33
|
+
readAt: DateTime;
|
|
34
|
+
/** The audience count the station is acting on, the same figure as the console's tally. It can differ from the number of connections: it is kept by a separate reading, and one HLS entry can stand for two players with the same address and agent */
|
|
35
|
+
total: number;
|
|
36
|
+
/** Every connection that could be read, Icecast mounts first in the station's mount order, then HLS, each longest-connected first */
|
|
37
|
+
connections: ListenerConnection[];
|
|
38
|
+
/** The mounts that could not be read. Empty when every one was. A mount listed here is not an empty mount */
|
|
39
|
+
unreadable: UnreadableMount[];
|
|
40
|
+
}
|
|
41
|
+
/** Rehydrates every wire-encoded scalar in a StreamListeners into its runtime type. Mutates and returns `raw`. */
|
|
42
|
+
export declare function reviveStreamListeners(raw: StreamListeners): StreamListeners;
|
|
43
|
+
//# sourceMappingURL=stream.listeners.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.listeners.types.d.ts","sourceRoot":"","sources":["../../../src/stream/types/stream.listeners.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,0IAA0I;IAC1I,GAAG,EAAE,SAAS,GAAG,KAAK,CAAC;IACvB,iIAAiI;IACjI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qLAAqL;IACrL,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2HAA2H;IAC3H,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,yMAAyM;IACzM,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,yBAAyB;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,uPAAuP;IACvP,KAAK,EAAE,MAAM,CAAC;IACd,qIAAqI;IACrI,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,6GAA6G;IAC7G,UAAU,EAAE,eAAe,EAAE,CAAC;CACjC;AAED,kHAAkH;AAClH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,CAI3E"}
|