@freedome/client 0.0.0-stage → 1.0.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/CHANGELOG.md +5 -0
- package/LICENSE +289 -0
- package/README.md +20 -2
- package/dist/chunk-CAEBM4AN.js +180 -0
- package/dist/chunk-HYGH4JIY.js +30 -0
- package/dist/chunk-J7A5LF32.js +180 -0
- package/dist/chunk-K3G5AG65.js +211 -0
- package/dist/chunk-YB5V2MMF.js +81 -0
- package/dist/codecs.cjs +1608 -0
- package/dist/codecs.d.cts +204 -0
- package/dist/codecs.d.ts +204 -0
- package/dist/codecs.js +1364 -0
- package/dist/discovery-BsEQfHam.d.cts +419 -0
- package/dist/discovery-DTV9yp9S.d.ts +419 -0
- package/dist/errors-L_bIF-OR.d.cts +108 -0
- package/dist/errors-L_bIF-OR.d.ts +108 -0
- package/dist/index.cjs +4753 -0
- package/dist/index.d.cts +1124 -0
- package/dist/index.d.ts +1124 -0
- package/dist/index.js +4084 -0
- package/dist/input-CxW5zgc-.d.cts +27 -0
- package/dist/input-CxW5zgc-.d.ts +27 -0
- package/dist/node.cjs +465 -0
- package/dist/node.d.cts +31 -0
- package/dist/node.d.ts +31 -0
- package/dist/node.js +136 -0
- package/dist/testing.cjs +1622 -0
- package/dist/testing.d.cts +184 -0
- package/dist/testing.d.ts +184 -0
- package/dist/testing.js +1251 -0
- package/dist/transport-dvmDQyvB.d.cts +130 -0
- package/dist/transport-dvmDQyvB.d.ts +130 -0
- package/package.json +78 -3
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { b as FreedomeResponse, F as FreedomeEndpoint, d as FreedomeRequest, a as FreedomeTransportFactory, M as MessageSocket } from './transport-dvmDQyvB.cjs';
|
|
2
|
+
|
|
3
|
+
type Json$2 = any;
|
|
4
|
+
/** Publishes an event (topic relative to `venues/{v}`, e.g. `audio/zones/front`). */
|
|
5
|
+
type Publish$1 = (venueTopic: string, kind: string, data: Record<string, unknown>) => void;
|
|
6
|
+
type Problem$1 = (status: number, code: string, detail: string) => FreedomeResponse;
|
|
7
|
+
/** Audio of the fake venue (one model; every venue id addresses it). */
|
|
8
|
+
declare class FakeAudio {
|
|
9
|
+
private readonly publish;
|
|
10
|
+
private readonly problem;
|
|
11
|
+
state: Json$2;
|
|
12
|
+
layout: {
|
|
13
|
+
body: Json$2;
|
|
14
|
+
revision: number;
|
|
15
|
+
};
|
|
16
|
+
readonly zones: Map<string, any>;
|
|
17
|
+
readonly devices: Map<string, any>;
|
|
18
|
+
readonly presets: Map<string, any>;
|
|
19
|
+
readonly sessions: Map<string, any>;
|
|
20
|
+
generator: Json$2;
|
|
21
|
+
/** Last position per source id. */
|
|
22
|
+
readonly sources: Map<string, any>;
|
|
23
|
+
constructor(publish: Publish$1, problem: Problem$1);
|
|
24
|
+
/** Test hook: publishes `audio.levels` (`{meter id: dBFS}`) on `venues/{v}/audio/levels`. */
|
|
25
|
+
emitLevels(levels: Record<string, number>): void;
|
|
26
|
+
/** Test hook: advances session [id] to [positionSec] (and optionally a new [status]); publishes the state. */
|
|
27
|
+
advanceSession(id: string, positionSec: number, status?: string): Json$2;
|
|
28
|
+
private bumpState;
|
|
29
|
+
private publishZone;
|
|
30
|
+
private publishSession;
|
|
31
|
+
private publishGenerator;
|
|
32
|
+
private page;
|
|
33
|
+
/** Serves audio operation [op]; undefined = not an audio operation. */
|
|
34
|
+
handle(op: string, p: Record<string, string>, body: Json$2, h: Record<string, string>, q: Record<string, string>): FreedomeResponse | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type Json$1 = any;
|
|
38
|
+
type Publish = (topic: string, kind: string, data: Record<string, unknown>) => void;
|
|
39
|
+
type Problem = (status: number, code: string, detail: string) => FreedomeResponse;
|
|
40
|
+
/** Analysis, scenes, texture sources and gateways of the fake venue (every venue id addresses it). */
|
|
41
|
+
declare class FakeAudioReactive {
|
|
42
|
+
private readonly publishVenue;
|
|
43
|
+
private readonly publish;
|
|
44
|
+
private readonly problem;
|
|
45
|
+
analysis: Json$1;
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
activeSceneId: string | null;
|
|
48
|
+
intensity: number;
|
|
49
|
+
readonly scenes: Map<string, any>;
|
|
50
|
+
readonly textureSources: Map<string, any>;
|
|
51
|
+
readonly gateways: Map<string, any>;
|
|
52
|
+
/** The driver takes `config` at run time (the media server's 422 on `/config` otherwise). */
|
|
53
|
+
runtimeSettings: boolean;
|
|
54
|
+
/** The Resolume machine answers. */
|
|
55
|
+
reachable: boolean;
|
|
56
|
+
constructor(publishVenue: Publish, publish: Publish, problem: Problem);
|
|
57
|
+
/** Test hook: one running `resolume` gateway and the scene `vocal-aura` reading input `vocal`. */
|
|
58
|
+
seed(): void;
|
|
59
|
+
/** Test hook: publishes an analysis frame of [inputId]. */
|
|
60
|
+
publishFrame(inputId: string, frame?: Record<string, unknown>): void;
|
|
61
|
+
/** Test hook: publishes a detected attack of [inputId]. */
|
|
62
|
+
publishOnset(inputId: string, onset?: Record<string, unknown>): void;
|
|
63
|
+
/** Test hook: adds or changes a sender and publishes the change. */
|
|
64
|
+
setTextureSource(s: Json$1): void;
|
|
65
|
+
private state;
|
|
66
|
+
private publishState;
|
|
67
|
+
/** Serves operation [op]; undefined = not one of these. */
|
|
68
|
+
handle(op: string, p: Record<string, string>, body: Json$1, h: Record<string, string>): FreedomeResponse | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type Json = any;
|
|
72
|
+
interface Session {
|
|
73
|
+
token: string;
|
|
74
|
+
refresh: string;
|
|
75
|
+
user: string;
|
|
76
|
+
role: string;
|
|
77
|
+
}
|
|
78
|
+
/** In-memory media server. */
|
|
79
|
+
declare class FakeDomeServer {
|
|
80
|
+
readonly endpoint: FreedomeEndpoint;
|
|
81
|
+
/** Every REST request received (WS calls included as operationId-only records). */
|
|
82
|
+
readonly requests: FreedomeRequest[];
|
|
83
|
+
instanceId: string;
|
|
84
|
+
/** Users (password = username). */
|
|
85
|
+
readonly users: Map<string, string>;
|
|
86
|
+
/** Accepted API keys → role. */
|
|
87
|
+
readonly apiKeys: Map<string, string>;
|
|
88
|
+
networkDown: boolean;
|
|
89
|
+
realtimeAvailable: boolean;
|
|
90
|
+
accessTtlSec: number;
|
|
91
|
+
private seq;
|
|
92
|
+
private readonly history;
|
|
93
|
+
private readonly sessions;
|
|
94
|
+
private readonly refreshTokens;
|
|
95
|
+
private readonly failures;
|
|
96
|
+
private readonly sockets;
|
|
97
|
+
readonly venues: Map<string, {
|
|
98
|
+
body: Json;
|
|
99
|
+
revision: number;
|
|
100
|
+
}>;
|
|
101
|
+
activeVenue: string;
|
|
102
|
+
readonly shows: Map<string, {
|
|
103
|
+
body: Json;
|
|
104
|
+
revision: number;
|
|
105
|
+
}>;
|
|
106
|
+
readonly assets: Map<string, any>;
|
|
107
|
+
readonly assetBytes: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
108
|
+
readonly uploads: Map<string, {
|
|
109
|
+
length: number;
|
|
110
|
+
data: Uint8Array[];
|
|
111
|
+
offset: number;
|
|
112
|
+
meta: Record<string, string>;
|
|
113
|
+
status: string;
|
|
114
|
+
}>;
|
|
115
|
+
readonly jobs: Map<string, any>;
|
|
116
|
+
player: Json;
|
|
117
|
+
output: Json;
|
|
118
|
+
/** Live app payloads per app (cleared by `clearAppPayloads`). */
|
|
119
|
+
readonly appPayloads: Map<string, any[]>;
|
|
120
|
+
/** Pairing requests by id. */
|
|
121
|
+
readonly pairings: Map<string, any>;
|
|
122
|
+
/** Approve every pairing request at once (role = requested role or operator). */
|
|
123
|
+
autoApprovePairings: boolean;
|
|
124
|
+
/** Calibration jobs by id. */
|
|
125
|
+
readonly calibrationJobs: Map<string, any>;
|
|
126
|
+
/** Audio model + hooks (`emitLevels`, `advanceSession`). */
|
|
127
|
+
readonly audio: FakeAudio;
|
|
128
|
+
/** Live analysis, AudioReactive scenes, texture sources and gateways (`seed`, `publishFrame`). */
|
|
129
|
+
readonly audioReactive: FakeAudioReactive;
|
|
130
|
+
constructor();
|
|
131
|
+
addVenue(body: Json): void;
|
|
132
|
+
addShow(body: Json): void;
|
|
133
|
+
/** The next call of [operationId] answers [status] ([times] times). */
|
|
134
|
+
failNext(operationId: string, status?: number, times?: number): void;
|
|
135
|
+
/** Closes every realtime session (the client reconnects with resume). */
|
|
136
|
+
dropRealtime(code?: number): void;
|
|
137
|
+
/** Simulates a server restart: new instance id, seq space restarts, sessions survive (persistent tokens). */
|
|
138
|
+
restart(): void;
|
|
139
|
+
/** Approves (or denies) pairing [pairingId] as an administrator would on the dome; returns the pairing. */
|
|
140
|
+
approvePairing(pairingId: string, o?: {
|
|
141
|
+
approve?: boolean;
|
|
142
|
+
role?: string;
|
|
143
|
+
}): Json;
|
|
144
|
+
/** Invalidates every access token (refresh tokens stay valid). */
|
|
145
|
+
expireTokens(): void;
|
|
146
|
+
/** Publishes an event on [topic]. */
|
|
147
|
+
publish(topic: string, kind: string, data: Record<string, unknown>): void;
|
|
148
|
+
get transports(): FreedomeTransportFactory;
|
|
149
|
+
/** @internal */
|
|
150
|
+
forget(s: FakeSocketSession): void;
|
|
151
|
+
/** @internal Events after [since] matching any filter. */
|
|
152
|
+
replay(since: number): Json[];
|
|
153
|
+
/** @internal */
|
|
154
|
+
get lastSeq(): number;
|
|
155
|
+
/** @internal Bearer → session. */
|
|
156
|
+
principal(auth: string | undefined): Session | undefined;
|
|
157
|
+
private issue;
|
|
158
|
+
private venueId;
|
|
159
|
+
private etag;
|
|
160
|
+
private publishPlayer;
|
|
161
|
+
/** Handles one request (REST or a WS `call`). */
|
|
162
|
+
handle(r: FreedomeRequest): Promise<FreedomeResponse>;
|
|
163
|
+
}
|
|
164
|
+
/** One WS session of the fake (server side). */
|
|
165
|
+
declare class FakeSocketSession {
|
|
166
|
+
private readonly server;
|
|
167
|
+
private onMessage;
|
|
168
|
+
private onClose;
|
|
169
|
+
private filters;
|
|
170
|
+
private token;
|
|
171
|
+
private open;
|
|
172
|
+
readonly client: MessageSocket;
|
|
173
|
+
constructor(server: FakeDomeServer);
|
|
174
|
+
private out;
|
|
175
|
+
serverClose(code: number, reason?: string): void;
|
|
176
|
+
deliver(e: Json): void;
|
|
177
|
+
private reply;
|
|
178
|
+
private receive;
|
|
179
|
+
private pendingResume;
|
|
180
|
+
}
|
|
181
|
+
/** A fake server and its transports: `new FreedomeClient({ endpoint: fake.endpoint, transports: fake.transports })`. */
|
|
182
|
+
declare function createFakeTransport(): FakeDomeServer;
|
|
183
|
+
|
|
184
|
+
export { FakeDomeServer, createFakeTransport };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { b as FreedomeResponse, F as FreedomeEndpoint, d as FreedomeRequest, a as FreedomeTransportFactory, M as MessageSocket } from './transport-dvmDQyvB.js';
|
|
2
|
+
|
|
3
|
+
type Json$2 = any;
|
|
4
|
+
/** Publishes an event (topic relative to `venues/{v}`, e.g. `audio/zones/front`). */
|
|
5
|
+
type Publish$1 = (venueTopic: string, kind: string, data: Record<string, unknown>) => void;
|
|
6
|
+
type Problem$1 = (status: number, code: string, detail: string) => FreedomeResponse;
|
|
7
|
+
/** Audio of the fake venue (one model; every venue id addresses it). */
|
|
8
|
+
declare class FakeAudio {
|
|
9
|
+
private readonly publish;
|
|
10
|
+
private readonly problem;
|
|
11
|
+
state: Json$2;
|
|
12
|
+
layout: {
|
|
13
|
+
body: Json$2;
|
|
14
|
+
revision: number;
|
|
15
|
+
};
|
|
16
|
+
readonly zones: Map<string, any>;
|
|
17
|
+
readonly devices: Map<string, any>;
|
|
18
|
+
readonly presets: Map<string, any>;
|
|
19
|
+
readonly sessions: Map<string, any>;
|
|
20
|
+
generator: Json$2;
|
|
21
|
+
/** Last position per source id. */
|
|
22
|
+
readonly sources: Map<string, any>;
|
|
23
|
+
constructor(publish: Publish$1, problem: Problem$1);
|
|
24
|
+
/** Test hook: publishes `audio.levels` (`{meter id: dBFS}`) on `venues/{v}/audio/levels`. */
|
|
25
|
+
emitLevels(levels: Record<string, number>): void;
|
|
26
|
+
/** Test hook: advances session [id] to [positionSec] (and optionally a new [status]); publishes the state. */
|
|
27
|
+
advanceSession(id: string, positionSec: number, status?: string): Json$2;
|
|
28
|
+
private bumpState;
|
|
29
|
+
private publishZone;
|
|
30
|
+
private publishSession;
|
|
31
|
+
private publishGenerator;
|
|
32
|
+
private page;
|
|
33
|
+
/** Serves audio operation [op]; undefined = not an audio operation. */
|
|
34
|
+
handle(op: string, p: Record<string, string>, body: Json$2, h: Record<string, string>, q: Record<string, string>): FreedomeResponse | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type Json$1 = any;
|
|
38
|
+
type Publish = (topic: string, kind: string, data: Record<string, unknown>) => void;
|
|
39
|
+
type Problem = (status: number, code: string, detail: string) => FreedomeResponse;
|
|
40
|
+
/** Analysis, scenes, texture sources and gateways of the fake venue (every venue id addresses it). */
|
|
41
|
+
declare class FakeAudioReactive {
|
|
42
|
+
private readonly publishVenue;
|
|
43
|
+
private readonly publish;
|
|
44
|
+
private readonly problem;
|
|
45
|
+
analysis: Json$1;
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
activeSceneId: string | null;
|
|
48
|
+
intensity: number;
|
|
49
|
+
readonly scenes: Map<string, any>;
|
|
50
|
+
readonly textureSources: Map<string, any>;
|
|
51
|
+
readonly gateways: Map<string, any>;
|
|
52
|
+
/** The driver takes `config` at run time (the media server's 422 on `/config` otherwise). */
|
|
53
|
+
runtimeSettings: boolean;
|
|
54
|
+
/** The Resolume machine answers. */
|
|
55
|
+
reachable: boolean;
|
|
56
|
+
constructor(publishVenue: Publish, publish: Publish, problem: Problem);
|
|
57
|
+
/** Test hook: one running `resolume` gateway and the scene `vocal-aura` reading input `vocal`. */
|
|
58
|
+
seed(): void;
|
|
59
|
+
/** Test hook: publishes an analysis frame of [inputId]. */
|
|
60
|
+
publishFrame(inputId: string, frame?: Record<string, unknown>): void;
|
|
61
|
+
/** Test hook: publishes a detected attack of [inputId]. */
|
|
62
|
+
publishOnset(inputId: string, onset?: Record<string, unknown>): void;
|
|
63
|
+
/** Test hook: adds or changes a sender and publishes the change. */
|
|
64
|
+
setTextureSource(s: Json$1): void;
|
|
65
|
+
private state;
|
|
66
|
+
private publishState;
|
|
67
|
+
/** Serves operation [op]; undefined = not one of these. */
|
|
68
|
+
handle(op: string, p: Record<string, string>, body: Json$1, h: Record<string, string>): FreedomeResponse | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type Json = any;
|
|
72
|
+
interface Session {
|
|
73
|
+
token: string;
|
|
74
|
+
refresh: string;
|
|
75
|
+
user: string;
|
|
76
|
+
role: string;
|
|
77
|
+
}
|
|
78
|
+
/** In-memory media server. */
|
|
79
|
+
declare class FakeDomeServer {
|
|
80
|
+
readonly endpoint: FreedomeEndpoint;
|
|
81
|
+
/** Every REST request received (WS calls included as operationId-only records). */
|
|
82
|
+
readonly requests: FreedomeRequest[];
|
|
83
|
+
instanceId: string;
|
|
84
|
+
/** Users (password = username). */
|
|
85
|
+
readonly users: Map<string, string>;
|
|
86
|
+
/** Accepted API keys → role. */
|
|
87
|
+
readonly apiKeys: Map<string, string>;
|
|
88
|
+
networkDown: boolean;
|
|
89
|
+
realtimeAvailable: boolean;
|
|
90
|
+
accessTtlSec: number;
|
|
91
|
+
private seq;
|
|
92
|
+
private readonly history;
|
|
93
|
+
private readonly sessions;
|
|
94
|
+
private readonly refreshTokens;
|
|
95
|
+
private readonly failures;
|
|
96
|
+
private readonly sockets;
|
|
97
|
+
readonly venues: Map<string, {
|
|
98
|
+
body: Json;
|
|
99
|
+
revision: number;
|
|
100
|
+
}>;
|
|
101
|
+
activeVenue: string;
|
|
102
|
+
readonly shows: Map<string, {
|
|
103
|
+
body: Json;
|
|
104
|
+
revision: number;
|
|
105
|
+
}>;
|
|
106
|
+
readonly assets: Map<string, any>;
|
|
107
|
+
readonly assetBytes: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
108
|
+
readonly uploads: Map<string, {
|
|
109
|
+
length: number;
|
|
110
|
+
data: Uint8Array[];
|
|
111
|
+
offset: number;
|
|
112
|
+
meta: Record<string, string>;
|
|
113
|
+
status: string;
|
|
114
|
+
}>;
|
|
115
|
+
readonly jobs: Map<string, any>;
|
|
116
|
+
player: Json;
|
|
117
|
+
output: Json;
|
|
118
|
+
/** Live app payloads per app (cleared by `clearAppPayloads`). */
|
|
119
|
+
readonly appPayloads: Map<string, any[]>;
|
|
120
|
+
/** Pairing requests by id. */
|
|
121
|
+
readonly pairings: Map<string, any>;
|
|
122
|
+
/** Approve every pairing request at once (role = requested role or operator). */
|
|
123
|
+
autoApprovePairings: boolean;
|
|
124
|
+
/** Calibration jobs by id. */
|
|
125
|
+
readonly calibrationJobs: Map<string, any>;
|
|
126
|
+
/** Audio model + hooks (`emitLevels`, `advanceSession`). */
|
|
127
|
+
readonly audio: FakeAudio;
|
|
128
|
+
/** Live analysis, AudioReactive scenes, texture sources and gateways (`seed`, `publishFrame`). */
|
|
129
|
+
readonly audioReactive: FakeAudioReactive;
|
|
130
|
+
constructor();
|
|
131
|
+
addVenue(body: Json): void;
|
|
132
|
+
addShow(body: Json): void;
|
|
133
|
+
/** The next call of [operationId] answers [status] ([times] times). */
|
|
134
|
+
failNext(operationId: string, status?: number, times?: number): void;
|
|
135
|
+
/** Closes every realtime session (the client reconnects with resume). */
|
|
136
|
+
dropRealtime(code?: number): void;
|
|
137
|
+
/** Simulates a server restart: new instance id, seq space restarts, sessions survive (persistent tokens). */
|
|
138
|
+
restart(): void;
|
|
139
|
+
/** Approves (or denies) pairing [pairingId] as an administrator would on the dome; returns the pairing. */
|
|
140
|
+
approvePairing(pairingId: string, o?: {
|
|
141
|
+
approve?: boolean;
|
|
142
|
+
role?: string;
|
|
143
|
+
}): Json;
|
|
144
|
+
/** Invalidates every access token (refresh tokens stay valid). */
|
|
145
|
+
expireTokens(): void;
|
|
146
|
+
/** Publishes an event on [topic]. */
|
|
147
|
+
publish(topic: string, kind: string, data: Record<string, unknown>): void;
|
|
148
|
+
get transports(): FreedomeTransportFactory;
|
|
149
|
+
/** @internal */
|
|
150
|
+
forget(s: FakeSocketSession): void;
|
|
151
|
+
/** @internal Events after [since] matching any filter. */
|
|
152
|
+
replay(since: number): Json[];
|
|
153
|
+
/** @internal */
|
|
154
|
+
get lastSeq(): number;
|
|
155
|
+
/** @internal Bearer → session. */
|
|
156
|
+
principal(auth: string | undefined): Session | undefined;
|
|
157
|
+
private issue;
|
|
158
|
+
private venueId;
|
|
159
|
+
private etag;
|
|
160
|
+
private publishPlayer;
|
|
161
|
+
/** Handles one request (REST or a WS `call`). */
|
|
162
|
+
handle(r: FreedomeRequest): Promise<FreedomeResponse>;
|
|
163
|
+
}
|
|
164
|
+
/** One WS session of the fake (server side). */
|
|
165
|
+
declare class FakeSocketSession {
|
|
166
|
+
private readonly server;
|
|
167
|
+
private onMessage;
|
|
168
|
+
private onClose;
|
|
169
|
+
private filters;
|
|
170
|
+
private token;
|
|
171
|
+
private open;
|
|
172
|
+
readonly client: MessageSocket;
|
|
173
|
+
constructor(server: FakeDomeServer);
|
|
174
|
+
private out;
|
|
175
|
+
serverClose(code: number, reason?: string): void;
|
|
176
|
+
deliver(e: Json): void;
|
|
177
|
+
private reply;
|
|
178
|
+
private receive;
|
|
179
|
+
private pendingResume;
|
|
180
|
+
}
|
|
181
|
+
/** A fake server and its transports: `new FreedomeClient({ endpoint: fake.endpoint, transports: fake.transports })`. */
|
|
182
|
+
declare function createFakeTransport(): FakeDomeServer;
|
|
183
|
+
|
|
184
|
+
export { FakeDomeServer, createFakeTransport };
|