@freedome/client 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/{discovery-DTV9yp9S.d.ts → discovery-BkrBFXwA.d.ts} +13 -2
- package/dist/{discovery-BsEQfHam.d.cts → discovery-Do_9mAzB.d.cts} +13 -2
- package/dist/index.cjs +106 -5
- package/dist/index.d.cts +73 -7
- package/dist/index.d.ts +73 -7
- package/dist/index.js +112 -11
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/testing.cjs +194 -3
- package/dist/testing.d.cts +31 -1
- package/dist/testing.d.ts +31 -1
- package/dist/testing.js +201 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 (2026-11-07)
|
|
4
|
+
|
|
5
|
+
Against contract 1.1.0, additive; works with a 1.0 server as before.
|
|
6
|
+
|
|
7
|
+
- `client.contractVersion`, `audio.supportsAudioControl`: what the server offers. Against a 1.0 server the calls below
|
|
8
|
+
reject with `UnsupportedCapabilityError` and send nothing.
|
|
9
|
+
- `audio.pauseSession`, `audio.resumeSession`, `audio.startDeviceSweep`; `roleZones` of `audio.startSession`; the `multi`
|
|
10
|
+
block of `GeneratorSession.start`, and `GeneratorSession.startMulti`.
|
|
11
|
+
- Fake (`/testing`): all of the above, `cancelCalibrationJob`, `applyCalibrationJob`; `fake.contractVersion` (set `1.0.0`
|
|
12
|
+
for a server without them, answering 404 and 422), `fake.audio.estopped`, `fake.audio.sweepPeaks`.
|
|
13
|
+
|
|
3
14
|
## 1.0.0 (2026-11-06)
|
|
4
15
|
|
|
5
16
|
- Client on contract 1.0.0: REST, WebSocket, GraphQL, socket.io, repositories, offline cache, codecs, in-memory fake.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FreedomeEvent, ApiOperation, AssetCreateRequest, AssetResource, ServerInfo } from '@freedome/protocol';
|
|
1
|
+
import { FreedomeEvent, ApiOperation, SemVer, AssetCreateRequest, AssetResource, ServerInfo } from '@freedome/protocol';
|
|
2
2
|
import { F as FreedomeError } from './errors-L_bIF-OR.js';
|
|
3
3
|
import { e as FreedomeTransport, b as FreedomeResponse, F as FreedomeEndpoint } from './transport-dvmDQyvB.js';
|
|
4
4
|
|
|
@@ -269,8 +269,19 @@ declare class RepositoryContext {
|
|
|
269
269
|
readonly positionHz: number | undefined;
|
|
270
270
|
readonly onEngineHealth: ((status: string) => void) | undefined;
|
|
271
271
|
readonly logger: FreedomeLogger | undefined;
|
|
272
|
+
/** Contract version the server reports (undefined = not known yet, or none reported). */
|
|
273
|
+
readonly contractVersion: () => SemVer | undefined;
|
|
272
274
|
readonly outboxOutcomes: Emitter<OutboxOutcome>;
|
|
273
|
-
constructor(api: ApiCaller, hub: EventHub, cache: CacheStore, outbox: OutboxStore | undefined, offline: OfflinePolicy, isOffline: () => boolean, cacheScope: () => string, realtimeUp: () => boolean, positionHz: number | undefined, onEngineHealth: ((status: string) => void) | undefined, logger: FreedomeLogger | undefined
|
|
275
|
+
constructor(api: ApiCaller, hub: EventHub, cache: CacheStore, outbox: OutboxStore | undefined, offline: OfflinePolicy, isOffline: () => boolean, cacheScope: () => string, realtimeUp: () => boolean, positionHz: number | undefined, onEngineHealth: ((status: string) => void) | undefined, logger: FreedomeLogger | undefined,
|
|
276
|
+
/** Contract version the server reports (undefined = not known yet, or none reported). */
|
|
277
|
+
contractVersion?: () => SemVer | undefined);
|
|
278
|
+
/** Whether the server reports a contract of at least [version]. False while it is not known. */
|
|
279
|
+
contractAtLeast(version: SemVer): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Whether the server reports a contract older than [version]. False while it is not known: the call is then sent,
|
|
282
|
+
* and the server's answer decides.
|
|
283
|
+
*/
|
|
284
|
+
contractBelow(version: SemVer): boolean;
|
|
274
285
|
log(level: LogLevel, message: string, error?: unknown): void;
|
|
275
286
|
/** Read through the cache: fresh when reachable, `stale` copy when not (02f §7.4). */
|
|
276
287
|
cachedRead<R>(name: string, read: () => Promise<[R, unknown]>, stale: (json: unknown, asOf: Date) => R): Promise<R>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FreedomeEvent, ApiOperation, AssetCreateRequest, AssetResource, ServerInfo } from '@freedome/protocol';
|
|
1
|
+
import { FreedomeEvent, ApiOperation, SemVer, AssetCreateRequest, AssetResource, ServerInfo } from '@freedome/protocol';
|
|
2
2
|
import { F as FreedomeError } from './errors-L_bIF-OR.cjs';
|
|
3
3
|
import { e as FreedomeTransport, b as FreedomeResponse, F as FreedomeEndpoint } from './transport-dvmDQyvB.cjs';
|
|
4
4
|
|
|
@@ -269,8 +269,19 @@ declare class RepositoryContext {
|
|
|
269
269
|
readonly positionHz: number | undefined;
|
|
270
270
|
readonly onEngineHealth: ((status: string) => void) | undefined;
|
|
271
271
|
readonly logger: FreedomeLogger | undefined;
|
|
272
|
+
/** Contract version the server reports (undefined = not known yet, or none reported). */
|
|
273
|
+
readonly contractVersion: () => SemVer | undefined;
|
|
272
274
|
readonly outboxOutcomes: Emitter<OutboxOutcome>;
|
|
273
|
-
constructor(api: ApiCaller, hub: EventHub, cache: CacheStore, outbox: OutboxStore | undefined, offline: OfflinePolicy, isOffline: () => boolean, cacheScope: () => string, realtimeUp: () => boolean, positionHz: number | undefined, onEngineHealth: ((status: string) => void) | undefined, logger: FreedomeLogger | undefined
|
|
275
|
+
constructor(api: ApiCaller, hub: EventHub, cache: CacheStore, outbox: OutboxStore | undefined, offline: OfflinePolicy, isOffline: () => boolean, cacheScope: () => string, realtimeUp: () => boolean, positionHz: number | undefined, onEngineHealth: ((status: string) => void) | undefined, logger: FreedomeLogger | undefined,
|
|
276
|
+
/** Contract version the server reports (undefined = not known yet, or none reported). */
|
|
277
|
+
contractVersion?: () => SemVer | undefined);
|
|
278
|
+
/** Whether the server reports a contract of at least [version]. False while it is not known. */
|
|
279
|
+
contractAtLeast(version: SemVer): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Whether the server reports a contract older than [version]. False while it is not known: the call is then sent,
|
|
282
|
+
* and the server's answer decides.
|
|
283
|
+
*/
|
|
284
|
+
contractBelow(version: SemVer): boolean;
|
|
274
285
|
log(level: LogLevel, message: string, error?: unknown): void;
|
|
275
286
|
/** Read through the cache: fresh when reachable, `stale` copy when not (02f §7.4). */
|
|
276
287
|
cachedRead<R>(name: string, read: () => Promise<[R, unknown]>, stale: (json: unknown, asOf: Date) => R): Promise<R>;
|
package/dist/index.cjs
CHANGED
|
@@ -70,10 +70,12 @@ __export(index_exports, {
|
|
|
70
70
|
PlayTargets: () => PlayTargets,
|
|
71
71
|
PlaybackRepository: () => PlaybackRepository,
|
|
72
72
|
PlayerHandle: () => PlayerHandle,
|
|
73
|
+
ProtocolVersions: () => import_protocol21.ProtocolVersions,
|
|
73
74
|
QueuedForReplayError: () => QueuedForReplayError,
|
|
74
75
|
RateLimitedError: () => RateLimitedError,
|
|
75
76
|
RepositoryContext: () => RepositoryContext,
|
|
76
77
|
RequestTimeoutError: () => RequestTimeoutError,
|
|
78
|
+
SemVer: () => import_protocol21.SemVer,
|
|
77
79
|
ServerError: () => ServerError,
|
|
78
80
|
Sha256: () => Sha256,
|
|
79
81
|
ShowParts: () => ShowParts,
|
|
@@ -434,6 +436,9 @@ var ApiCaller = class _ApiCaller {
|
|
|
434
436
|
"patchAudioZone",
|
|
435
437
|
"startAudioSession",
|
|
436
438
|
"stopAudioSession",
|
|
439
|
+
"pauseAudioSession",
|
|
440
|
+
"resumeAudioSession",
|
|
441
|
+
"startAudioDeviceSweep",
|
|
437
442
|
"setSourcePosition"
|
|
438
443
|
]);
|
|
439
444
|
async call(op, o = {}) {
|
|
@@ -709,7 +714,7 @@ function nextValue(e, pred = () => true, timeoutMs = 5e3) {
|
|
|
709
714
|
|
|
710
715
|
// src/context.ts
|
|
711
716
|
var RepositoryContext = class {
|
|
712
|
-
constructor(api, hub, cache, outbox, offline, isOffline, cacheScope, realtimeUp, positionHz, onEngineHealth, logger) {
|
|
717
|
+
constructor(api, hub, cache, outbox, offline, isOffline, cacheScope, realtimeUp, positionHz, onEngineHealth, logger, contractVersion = () => void 0) {
|
|
713
718
|
this.api = api;
|
|
714
719
|
this.hub = hub;
|
|
715
720
|
this.cache = cache;
|
|
@@ -721,6 +726,7 @@ var RepositoryContext = class {
|
|
|
721
726
|
this.positionHz = positionHz;
|
|
722
727
|
this.onEngineHealth = onEngineHealth;
|
|
723
728
|
this.logger = logger;
|
|
729
|
+
this.contractVersion = contractVersion;
|
|
724
730
|
}
|
|
725
731
|
api;
|
|
726
732
|
hub;
|
|
@@ -733,7 +739,21 @@ var RepositoryContext = class {
|
|
|
733
739
|
positionHz;
|
|
734
740
|
onEngineHealth;
|
|
735
741
|
logger;
|
|
742
|
+
contractVersion;
|
|
736
743
|
outboxOutcomes = new Emitter();
|
|
744
|
+
/** Whether the server reports a contract of at least [version]. False while it is not known. */
|
|
745
|
+
contractAtLeast(version) {
|
|
746
|
+
const v = this.contractVersion();
|
|
747
|
+
return v !== void 0 && v.compareTo(version) >= 0;
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Whether the server reports a contract older than [version]. False while it is not known: the call is then sent,
|
|
751
|
+
* and the server's answer decides.
|
|
752
|
+
*/
|
|
753
|
+
contractBelow(version) {
|
|
754
|
+
const v = this.contractVersion();
|
|
755
|
+
return v !== void 0 && v.compareTo(version) < 0;
|
|
756
|
+
}
|
|
737
757
|
log(level, message, error) {
|
|
738
758
|
this.logger?.({ level, message, ...error === void 0 ? {} : { error } });
|
|
739
759
|
}
|
|
@@ -1900,6 +1920,21 @@ var AudioRepository = class _AudioRepository {
|
|
|
1900
1920
|
get v() {
|
|
1901
1921
|
return { venueId: this.venueId };
|
|
1902
1922
|
}
|
|
1923
|
+
/**
|
|
1924
|
+
* Whether the server has the audio additions of contract 1.1.0: [pauseSession], [resumeSession], [startDeviceSweep],
|
|
1925
|
+
* `roleZones` of [startSession] and the `multi` block of the generator. False against a 1.0 server and while its
|
|
1926
|
+
* contract version is not known.
|
|
1927
|
+
*/
|
|
1928
|
+
get supportsAudioControl() {
|
|
1929
|
+
return this.c.contractAtLeast(import_protocol9.ProtocolVersions.audioControl);
|
|
1930
|
+
}
|
|
1931
|
+
/** @internal A 1.0 server would answer 404 or 422: says why instead. Sent as it is when the version is not known. */
|
|
1932
|
+
requireAudioControl(what) {
|
|
1933
|
+
if (this.c.contractBelow(import_protocol9.ProtocolVersions.audioControl))
|
|
1934
|
+
throw new UnsupportedCapabilityError(
|
|
1935
|
+
`${what} needs contract ${import_protocol9.ProtocolVersions.audioControl.toString()}; the server reports ${String(this.c.contractVersion())}`
|
|
1936
|
+
);
|
|
1937
|
+
}
|
|
1903
1938
|
/** The same repository for another venue. */
|
|
1904
1939
|
venue(id) {
|
|
1905
1940
|
if (id === this.venueId) return this;
|
|
@@ -2081,6 +2116,20 @@ var AudioRepository = class _AudioRepository {
|
|
|
2081
2116
|
body: patch
|
|
2082
2117
|
});
|
|
2083
2118
|
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Resonance sweep of one resonator channel of [deviceId] (scope `audio:calibrate`): answers a calibration job of kind
|
|
2121
|
+
* `audio-device-sweep`. Follow it with `client.calibration.progress`; progress is elapsed time, not measurement, and
|
|
2122
|
+
* the job's `sweep` member holds `peaks`, and with `modelHz` also `partials` and `warnings`, once it has succeeded.
|
|
2123
|
+
* There is nothing to apply. 409 while a session uses the device, another sweep runs or the device is in emergency
|
|
2124
|
+
* stop; 422 without such a resonator channel. Needs [supportsAudioControl].
|
|
2125
|
+
*/
|
|
2126
|
+
async startDeviceSweep(deviceId, sweep = {}) {
|
|
2127
|
+
this.requireAudioControl("startDeviceSweep");
|
|
2128
|
+
return this.c.api.json(import_protocol9.Operations.startAudioDeviceSweep, {
|
|
2129
|
+
params: { ...this.v, deviceId },
|
|
2130
|
+
body: sweep
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2084
2133
|
/** Ping / tone / self-test / strike of a device. */
|
|
2085
2134
|
testDevice(deviceId, test = { kind: "ping" }) {
|
|
2086
2135
|
return this.c.api.json(import_protocol9.Operations.testAudioDevice, {
|
|
@@ -2139,10 +2188,12 @@ var AudioRepository = class _AudioRepository {
|
|
|
2139
2188
|
}
|
|
2140
2189
|
// ---- sessions ----
|
|
2141
2190
|
/** Runs an installed preset (live control). */
|
|
2142
|
-
startSession(s) {
|
|
2191
|
+
async startSession(s) {
|
|
2192
|
+
if (s.roleZones !== void 0) this.requireAudioControl("roleZones");
|
|
2143
2193
|
const body = { presetId: s.presetId };
|
|
2144
2194
|
if (s.gainDb !== void 0) body.gainDb = s.gainDb;
|
|
2145
2195
|
if (s.targets !== void 0) body.targets = s.targets;
|
|
2196
|
+
if (s.roleZones !== void 0) body.roleZones = s.roleZones;
|
|
2146
2197
|
if (s.at !== void 0) body.at = s.at instanceof Date ? (0, import_protocol9.rfc3339Millis)(s.at) : s.at;
|
|
2147
2198
|
if (s.loop !== void 0) body.loop = s.loop;
|
|
2148
2199
|
return this.c.api.json(import_protocol9.Operations.startAudioSession, {
|
|
@@ -2176,6 +2227,29 @@ var AudioRepository = class _AudioRepository {
|
|
|
2176
2227
|
}
|
|
2177
2228
|
);
|
|
2178
2229
|
}
|
|
2230
|
+
/**
|
|
2231
|
+
* Pauses a session (live control, scope `audio:control`): every engine holds its position, `audioSession.state`
|
|
2232
|
+
* follows. A paused session answers as it is; 409 for one that is starting or has ended. Needs
|
|
2233
|
+
* [supportsAudioControl].
|
|
2234
|
+
*/
|
|
2235
|
+
async pauseSession(sessionId) {
|
|
2236
|
+
this.requireAudioControl("pauseSession");
|
|
2237
|
+
return this.c.api.json(import_protocol9.Operations.pauseAudioSession, {
|
|
2238
|
+
params: { ...this.v, sessionId },
|
|
2239
|
+
preferRealtime: true
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* Resumes a paused session from its position (live control, scope `audio:control`). A running session answers as it
|
|
2244
|
+
* is; 409 for one that is starting or has ended. Needs [supportsAudioControl].
|
|
2245
|
+
*/
|
|
2246
|
+
async resumeSession(sessionId) {
|
|
2247
|
+
this.requireAudioControl("resumeSession");
|
|
2248
|
+
return this.c.api.json(import_protocol9.Operations.resumeAudioSession, {
|
|
2249
|
+
params: { ...this.v, sessionId },
|
|
2250
|
+
preferRealtime: true
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2179
2253
|
/** Stops a session (live control). */
|
|
2180
2254
|
async stopSession(sessionId) {
|
|
2181
2255
|
await this.c.api.call(import_protocol9.Operations.stopAudioSession, {
|
|
@@ -2254,8 +2328,12 @@ var GeneratorSession = class {
|
|
|
2254
2328
|
this.push(s);
|
|
2255
2329
|
return s;
|
|
2256
2330
|
}
|
|
2257
|
-
/**
|
|
2331
|
+
/**
|
|
2332
|
+
* Starts the generator or replaces its settings (live control, scope `audio:control`). The `multi` block needs
|
|
2333
|
+
* [AudioRepository.supportsAudioControl].
|
|
2334
|
+
*/
|
|
2258
2335
|
async start(settings) {
|
|
2336
|
+
if (settings.multi !== void 0) this.r.requireAudioControl("generator multi");
|
|
2259
2337
|
const s = await this.r.ctx.api.json(import_protocol9.Operations.setGenerator, {
|
|
2260
2338
|
params: this.v,
|
|
2261
2339
|
body: settings,
|
|
@@ -2264,6 +2342,17 @@ var GeneratorSession = class {
|
|
|
2264
2342
|
this.push(s);
|
|
2265
2343
|
return s;
|
|
2266
2344
|
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Plays a MULTI programme: `signal: multi` with the block [multi], the same object a phone gives to `setParams`
|
|
2347
|
+
* (contract 1.1.0, `docs/audio-control.md`).
|
|
2348
|
+
*/
|
|
2349
|
+
startMulti(multi, o = {}) {
|
|
2350
|
+
return this.start({
|
|
2351
|
+
...o,
|
|
2352
|
+
signal: "multi",
|
|
2353
|
+
multi: { ...multi, compatJava: multi.compatJava ?? false }
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2267
2356
|
/** Stops the generator (live control). */
|
|
2268
2357
|
async stop() {
|
|
2269
2358
|
await this.r.ctx.api.call(import_protocol9.Operations.stopGenerator, { params: this.v, preferRealtime: true });
|
|
@@ -3825,7 +3914,7 @@ var VenuesRepository = class {
|
|
|
3825
3914
|
};
|
|
3826
3915
|
|
|
3827
3916
|
// src/client.ts
|
|
3828
|
-
var FREEDOME_CLIENT_VERSION = "1.
|
|
3917
|
+
var FREEDOME_CLIENT_VERSION = "1.1.0";
|
|
3829
3918
|
function defaultTransports() {
|
|
3830
3919
|
return { rest: (e) => new FetchTransport(e), sockets: webSocketConnector() };
|
|
3831
3920
|
}
|
|
@@ -3919,7 +4008,8 @@ var FreedomeClient = class {
|
|
|
3919
4008
|
() => this.channel !== void 0,
|
|
3920
4009
|
this.options.positionHz,
|
|
3921
4010
|
(s) => this.onEngineHealth(s),
|
|
3922
|
-
init.logger
|
|
4011
|
+
init.logger,
|
|
4012
|
+
() => this.contractVersion
|
|
3923
4013
|
);
|
|
3924
4014
|
this.graphql = new GraphqlClient(this.api);
|
|
3925
4015
|
this.venues = new VenuesRepository(this.ctx);
|
|
@@ -3942,6 +4032,15 @@ var FreedomeClient = class {
|
|
|
3942
4032
|
get server() {
|
|
3943
4033
|
return this.serverInfo;
|
|
3944
4034
|
}
|
|
4035
|
+
/**
|
|
4036
|
+
* Contract version the server reports (`contractVersion` of `GET /info`); undefined before [open], or when the server
|
|
4037
|
+
* reports none or an unreadable one. This is how an app tells what a server offers: a 1.0 server has no audio control
|
|
4038
|
+
* (`ProtocolVersions.audioControl`, `AudioRepository.supportsAudioControl`).
|
|
4039
|
+
*/
|
|
4040
|
+
get contractVersion() {
|
|
4041
|
+
const v = this.serverInfo?.contractVersion;
|
|
4042
|
+
return typeof v === "string" ? import_protocol19.SemVer.tryParse(v) ?? void 0 : void 0;
|
|
4043
|
+
}
|
|
3945
4044
|
get state() {
|
|
3946
4045
|
return this.stateValue;
|
|
3947
4046
|
}
|
|
@@ -4712,10 +4811,12 @@ var PACKAGE_NAME = "@freedome/client";
|
|
|
4712
4811
|
PlayTargets,
|
|
4713
4812
|
PlaybackRepository,
|
|
4714
4813
|
PlayerHandle,
|
|
4814
|
+
ProtocolVersions,
|
|
4715
4815
|
QueuedForReplayError,
|
|
4716
4816
|
RateLimitedError,
|
|
4717
4817
|
RepositoryContext,
|
|
4718
4818
|
RequestTimeoutError,
|
|
4819
|
+
SemVer,
|
|
4719
4820
|
ServerError,
|
|
4720
4821
|
Sha256,
|
|
4721
4822
|
ShowParts,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as ApiCaller, R as RepositoryContext, W as WatchObserver, U as Unsubscribe, V as Versioned, E as Emitter, P as Page, C as ContentSource, a as UploadTask, b as UploadPurpose, c as RealtimeTransport, O as OfflinePolicy, d as CacheStore, e as OutboxStore, F as FreedomeLogger, f as RealtimeConnector, g as OutboxOutcome, h as EventHub, i as CallOptions, j as RealtimeChannel, k as Resync, l as RealtimeClosed, m as RealtimeHello, n as RealtimeResult, o as ChannelWelcome } from './discovery-
|
|
2
|
-
export { B as BlobContentSource, p as BytesContentSource, q as CachedValue, r as CompositeDiscovery, D as DEFAULT_OFFLINE_POLICY, s as DiscoveredDome, t as Discovery, I as InMemoryCacheStore, u as InMemoryOutboxStore, L as LogLevel, v as LogRecord, M as MAX_UPLOAD_CHUNK, w as OutboxEntry, S as StaticDiscovery, x as UploadProgress, y as UploadResult, z as UploadTaskState, G as isAuthFailure, H as nextValue, J as probe, K as readAllPages, N as readPage } from './discovery-
|
|
3
|
-
import { Principal, TokenSet, ApiOperation, OperationBody, OperationResponse, CalibrationJob, CalibrationState, ClientRegistration, ClientDevice, ClientTelemetry, AssetResource, AssetCreateRequest, ImportRequest, Job, ShowResource, StorageStats, ShowSummary, ShowInput, UploadStatus, EngineStatus, DisplayResource, PlayerState, AppPayload, ActiveShowState, ParameterInfo, VenueOutput, Venue, VenueInput, ServerInfo, FreedomeEvent } from '@freedome/protocol';
|
|
4
|
-
export { ApiOperation, DomeTopics, EventKinds, FreedomeEvent, Operations } from '@freedome/protocol';
|
|
1
|
+
import { A as ApiCaller, R as RepositoryContext, W as WatchObserver, U as Unsubscribe, V as Versioned, E as Emitter, P as Page, C as ContentSource, a as UploadTask, b as UploadPurpose, c as RealtimeTransport, O as OfflinePolicy, d as CacheStore, e as OutboxStore, F as FreedomeLogger, f as RealtimeConnector, g as OutboxOutcome, h as EventHub, i as CallOptions, j as RealtimeChannel, k as Resync, l as RealtimeClosed, m as RealtimeHello, n as RealtimeResult, o as ChannelWelcome } from './discovery-Do_9mAzB.cjs';
|
|
2
|
+
export { B as BlobContentSource, p as BytesContentSource, q as CachedValue, r as CompositeDiscovery, D as DEFAULT_OFFLINE_POLICY, s as DiscoveredDome, t as Discovery, I as InMemoryCacheStore, u as InMemoryOutboxStore, L as LogLevel, v as LogRecord, M as MAX_UPLOAD_CHUNK, w as OutboxEntry, S as StaticDiscovery, x as UploadProgress, y as UploadResult, z as UploadTaskState, G as isAuthFailure, H as nextValue, J as probe, K as readAllPages, N as readPage } from './discovery-Do_9mAzB.cjs';
|
|
3
|
+
import { Principal, TokenSet, ApiOperation, OperationBody, OperationResponse, CalibrationJob, CalibrationState, ClientRegistration, ClientDevice, ClientTelemetry, AssetResource, AssetCreateRequest, ImportRequest, Job, ShowResource, StorageStats, ShowSummary, ShowInput, UploadStatus, EngineStatus, DisplayResource, PlayerState, AppPayload, ActiveShowState, ParameterInfo, VenueOutput, Venue, VenueInput, ServerInfo, SemVer, FreedomeEvent } from '@freedome/protocol';
|
|
4
|
+
export { ApiOperation, DomeTopics, EventKinds, FreedomeEvent, Operations, ProtocolVersions, SemVer } from '@freedome/protocol';
|
|
5
5
|
import { F as FreedomeEndpoint, a as FreedomeTransportFactory, b as FreedomeResponse, M as MessageSocket } from './transport-dvmDQyvB.cjs';
|
|
6
6
|
export { c as FetchTransport, d as FreedomeRequest, e as FreedomeTransport, f as MessageSocketConnector, P as PairingLink, W as WebSocketCtor, g as WebSocketLike, r as requestUrl, w as webSocketConnector } from './transport-dvmDQyvB.cjs';
|
|
7
7
|
export { C as ConflictError, a as ForbiddenError, F as FreedomeError, b as FreedomeErrorOptions, I as IncompatibleServerError, N as NetworkError, c as NotFoundError, O as OfflineError, P as PayloadTooLargeError, Q as QueuedForReplayError, R as RateLimitedError, d as RequestTimeoutError, S as ServerError, T as TlsPinMismatchError, U as UnauthorizedError, e as UnsupportedCapabilityError, f as UnsupportedFormatError, V as ValidationError, g as ValidationIssue, h as errorFromProblem, i as isUnreachable } from './errors-L_bIF-OR.cjs';
|
|
@@ -228,17 +228,30 @@ type AudioPresetSummary = OperationResponse<'listAudioPresets'>['items'][number]
|
|
|
228
228
|
type AudioSession = OperationResponse<'getAudioSession'>;
|
|
229
229
|
/** Generator settings (signal, frequencies, gain, duration, targets). */
|
|
230
230
|
type GeneratorSettings = OperationBody<'setGenerator'>;
|
|
231
|
+
/**
|
|
232
|
+
* NmSoundParams of a MULTI generator (`program`, `target`, `enviroment`, `modulation`, `multi`, `channel`, `audio`,
|
|
233
|
+
* `compatJava`), the object `multi` of an ananta/1.0 programme segment. Contract 1.1.0.
|
|
234
|
+
*/
|
|
235
|
+
type GeneratorMulti = Partial<NonNullable<GeneratorSettings['multi']>>;
|
|
231
236
|
/** Generator state (`running`, settings, startedAt). */
|
|
232
237
|
type GeneratorState = OperationResponse<'getGenerator'>;
|
|
233
238
|
/** Spherical source position (listener at the dome centre). */
|
|
234
239
|
type SourcePosition = OperationBody<'setSourcePosition'>;
|
|
235
240
|
/** Session targets (devices / zones / speakers). */
|
|
236
241
|
type AudioTargets = NonNullable<OperationBody<'startAudioSession'>['targets']>;
|
|
242
|
+
/** Preset role → the zones it plays in. Contract 1.1.0. */
|
|
243
|
+
type AudioRoleZones = NonNullable<OperationBody<'startAudioSession'>['roleZones']>;
|
|
244
|
+
/** Resonance sweep request (every member optional; the defaults are the engine's). Contract 1.1.0. */
|
|
245
|
+
type AudioDeviceSweep = Partial<NonNullable<OperationBody<'startAudioDeviceSweep'>>>;
|
|
246
|
+
/** Calibration job of kind `audio-device-sweep`; its member `sweep` holds the result. */
|
|
247
|
+
type AudioDeviceSweepJob = OperationResponse<'startAudioDeviceSweep'>;
|
|
237
248
|
/** Session start options. */
|
|
238
249
|
interface AudioSessionStart {
|
|
239
250
|
presetId: string;
|
|
240
251
|
gainDb?: number;
|
|
241
252
|
targets?: AudioTargets;
|
|
253
|
+
/** Zones per role; needs [AudioRepository.supportsAudioControl]. */
|
|
254
|
+
roleZones?: AudioRoleZones;
|
|
242
255
|
/** Server time to start at (multi-node sync). */
|
|
243
256
|
at?: Date | string;
|
|
244
257
|
loop?: boolean;
|
|
@@ -256,6 +269,14 @@ declare class AudioRepository {
|
|
|
256
269
|
/** @internal */
|
|
257
270
|
get ctx(): RepositoryContext;
|
|
258
271
|
private get v();
|
|
272
|
+
/**
|
|
273
|
+
* Whether the server has the audio additions of contract 1.1.0: [pauseSession], [resumeSession], [startDeviceSweep],
|
|
274
|
+
* `roleZones` of [startSession] and the `multi` block of the generator. False against a 1.0 server and while its
|
|
275
|
+
* contract version is not known.
|
|
276
|
+
*/
|
|
277
|
+
get supportsAudioControl(): boolean;
|
|
278
|
+
/** @internal A 1.0 server would answer 404 or 422: says why instead. Sent as it is when the version is not known. */
|
|
279
|
+
requireAudioControl(what: string): void;
|
|
259
280
|
/** The same repository for another venue. */
|
|
260
281
|
venue(id: string): AudioRepository;
|
|
261
282
|
/** Mode, master gain / mute, engine status. */
|
|
@@ -318,6 +339,14 @@ declare class AudioRepository {
|
|
|
318
339
|
device(deviceId: string): Promise<AudioDevice>;
|
|
319
340
|
/** Operator gain / mute / name / config of a device. */
|
|
320
341
|
patchDevice(deviceId: string, patch: AudioDevicePatch): Promise<AudioDevice>;
|
|
342
|
+
/**
|
|
343
|
+
* Resonance sweep of one resonator channel of [deviceId] (scope `audio:calibrate`): answers a calibration job of kind
|
|
344
|
+
* `audio-device-sweep`. Follow it with `client.calibration.progress`; progress is elapsed time, not measurement, and
|
|
345
|
+
* the job's `sweep` member holds `peaks`, and with `modelHz` also `partials` and `warnings`, once it has succeeded.
|
|
346
|
+
* There is nothing to apply. 409 while a session uses the device, another sweep runs or the device is in emergency
|
|
347
|
+
* stop; 422 without such a resonator channel. Needs [supportsAudioControl].
|
|
348
|
+
*/
|
|
349
|
+
startDeviceSweep(deviceId: string, sweep?: AudioDeviceSweep): Promise<AudioDeviceSweepJob>;
|
|
321
350
|
/** Ping / tone / self-test / strike of a device. */
|
|
322
351
|
testDevice(deviceId: string, test?: AudioDeviceTest): Promise<AudioDeviceTestResult>;
|
|
323
352
|
/** Follows a device (`audioDevice.state`, telemetry patches ≤ 1 Hz). */
|
|
@@ -349,6 +378,17 @@ declare class AudioRepository {
|
|
|
349
378
|
sessionState(sessionId: string, obs: WatchObserver<AudioSession>, o?: {
|
|
350
379
|
intervalMs?: number;
|
|
351
380
|
}): Unsubscribe;
|
|
381
|
+
/**
|
|
382
|
+
* Pauses a session (live control, scope `audio:control`): every engine holds its position, `audioSession.state`
|
|
383
|
+
* follows. A paused session answers as it is; 409 for one that is starting or has ended. Needs
|
|
384
|
+
* [supportsAudioControl].
|
|
385
|
+
*/
|
|
386
|
+
pauseSession(sessionId: string): Promise<AudioSession>;
|
|
387
|
+
/**
|
|
388
|
+
* Resumes a paused session from its position (live control, scope `audio:control`). A running session answers as it
|
|
389
|
+
* is; 409 for one that is starting or has ended. Needs [supportsAudioControl].
|
|
390
|
+
*/
|
|
391
|
+
resumeSession(sessionId: string): Promise<AudioSession>;
|
|
352
392
|
/** Stops a session (live control). */
|
|
353
393
|
stopSession(sessionId: string): Promise<void>;
|
|
354
394
|
/** The venue's test / MULTI generator (backs the dome sound engine). Close it when done. */
|
|
@@ -375,6 +415,18 @@ declare class GeneratorSession {
|
|
|
375
415
|
zones?: string[];
|
|
376
416
|
speakers?: string[];
|
|
377
417
|
};
|
|
418
|
+
multi?: {
|
|
419
|
+
program?: string;
|
|
420
|
+
target?: number;
|
|
421
|
+
enviroment?: number;
|
|
422
|
+
modulation?: number;
|
|
423
|
+
multi?: number;
|
|
424
|
+
channel?: number;
|
|
425
|
+
audio?: number;
|
|
426
|
+
compatJava: boolean;
|
|
427
|
+
} & {
|
|
428
|
+
[key: string]: unknown;
|
|
429
|
+
};
|
|
378
430
|
};
|
|
379
431
|
startedAt?: string;
|
|
380
432
|
}>;
|
|
@@ -397,8 +449,16 @@ declare class GeneratorSession {
|
|
|
397
449
|
}): Unsubscribe;
|
|
398
450
|
/** Reads the state over REST. */
|
|
399
451
|
get(): Promise<GeneratorState>;
|
|
400
|
-
/**
|
|
452
|
+
/**
|
|
453
|
+
* Starts the generator or replaces its settings (live control, scope `audio:control`). The `multi` block needs
|
|
454
|
+
* [AudioRepository.supportsAudioControl].
|
|
455
|
+
*/
|
|
401
456
|
start(settings: GeneratorSettings): Promise<GeneratorState>;
|
|
457
|
+
/**
|
|
458
|
+
* Plays a MULTI programme: `signal: multi` with the block [multi], the same object a phone gives to `setParams`
|
|
459
|
+
* (contract 1.1.0, `docs/audio-control.md`).
|
|
460
|
+
*/
|
|
461
|
+
startMulti(multi: GeneratorMulti, o?: Pick<GeneratorSettings, 'gainDb' | 'durationS' | 'targets'>): Promise<GeneratorState>;
|
|
402
462
|
/** Stops the generator (live control). */
|
|
403
463
|
stop(): Promise<void>;
|
|
404
464
|
private refreshQuietly;
|
|
@@ -817,7 +877,7 @@ declare class VenuesRepository {
|
|
|
817
877
|
}
|
|
818
878
|
|
|
819
879
|
/** SDK version (User-Agent / hello). */
|
|
820
|
-
declare const FREEDOME_CLIENT_VERSION = "1.
|
|
880
|
+
declare const FREEDOME_CLIENT_VERSION = "1.1.0";
|
|
821
881
|
/** Connection states (02f §7.1). */
|
|
822
882
|
type ConnectionState = 'idle' | 'negotiating' | 'incompatible' | 'authenticating' | 'unauthorized' | 'online' | 'degraded' | 'reconnecting' | 'resyncing' | 'offline' | 'closed';
|
|
823
883
|
/** Client options. */
|
|
@@ -900,6 +960,12 @@ declare class FreedomeClient {
|
|
|
900
960
|
get userAgent(): string;
|
|
901
961
|
get endpoint(): FreedomeEndpoint;
|
|
902
962
|
get server(): ServerInfo | undefined;
|
|
963
|
+
/**
|
|
964
|
+
* Contract version the server reports (`contractVersion` of `GET /info`); undefined before [open], or when the server
|
|
965
|
+
* reports none or an unreadable one. This is how an app tells what a server offers: a 1.0 server has no audio control
|
|
966
|
+
* (`ProtocolVersions.audioControl`, `AudioRepository.supportsAudioControl`).
|
|
967
|
+
*/
|
|
968
|
+
get contractVersion(): SemVer | undefined;
|
|
903
969
|
get state(): ConnectionState;
|
|
904
970
|
/** Reason of `degraded` / `offline` / `reconnecting`. */
|
|
905
971
|
get stateReason(): string | undefined;
|
|
@@ -1121,4 +1187,4 @@ declare function base64(bytes: Uint8Array): string;
|
|
|
1121
1187
|
*/
|
|
1122
1188
|
declare const PACKAGE_NAME = "@freedome/client";
|
|
1123
1189
|
|
|
1124
|
-
export { ApiCaller, type AudioAnalysisFrame, type AudioAnalysisSettings, type AudioAnalysisState, type AudioDevice, type AudioDeviceKind, type AudioDevicePatch, type AudioDeviceTest, type AudioDeviceTestResult, type AudioLayout, type AudioLevels, type AudioMode, type AudioOnset, type AudioPreset, type AudioPresetInput, type AudioPresetSummary, AudioReactiveRepository, type AudioReactiveScene, type AudioReactiveSceneInput, type AudioReactiveState, AudioRepository, type AudioSession, type AudioSessionStart, type AudioState, type AudioTargets, type AudioZone, type AudioZoneInput, type AudioZonePatch, BackoffPolicy, CALIBRATION_FILE_TYPES, CacheStore, CalibrationRepository, CallOptions, type CaptureFrame, ChannelWelcome, ClientsRepository, type ConnectionState, type ContentChange, type ContentQuery, ContentRepository, ContentSource, Credentials, type DisplayState, Emitter, EngineRepository, EventHub, FREEDOME_CLIENT_VERSION, FreedomeClient, type FreedomeClientInit, type FreedomeClientOptions, type FreedomeCredentials, FreedomeEndpoint, FreedomeLogger, FreedomeResponse, FreedomeTransportFactory, GRAPHQL_EVENTS_SUBSCRIPTION, GRAPHQL_OPERATION, GRAPHQL_WS_SUBPROTOCOL, type Gateway, type GatewayPatch, type GatewayTestResult, GatewaysRepository, GeneratorSession, type GeneratorSettings, type GeneratorState, GraphqlClient, GraphqlWsChannel, InMemoryTokenStore, MessageSocket, NO_SESSION, OfflinePolicy, type OscArg, type OscMessage, OscRepository, OutboxOutcome, OutboxStore, PACKAGE_NAME, Page, type PlayTarget, PlayTargets, PlaybackRepository, type PlaybackSnapshot, PlayerHandle, RealtimeChannel, RealtimeClosed, RealtimeConnector, RealtimeHello, RealtimeResult, RealtimeTransport, RepositoryContext, Resync, type Session, Sha256, ShowParts, SocketIoChannel, type SourcePosition, type StoredTokens, type TextureSource, type TokenStore, Unsubscribe, type UploadCapabilities, UploadPurpose, UploadTask, VenuesRepository, Versioned, WatchObserver, WsChannel, audioSessionEnded, base64, can, defaultTransports, multipart, oscArg, scopesOfRole, sessionFromPrincipal, sessionFromTokens, sha256Hex, storedTokensOf, uuidV7 };
|
|
1190
|
+
export { ApiCaller, type AudioAnalysisFrame, type AudioAnalysisSettings, type AudioAnalysisState, type AudioDevice, type AudioDeviceKind, type AudioDevicePatch, type AudioDeviceSweep, type AudioDeviceSweepJob, type AudioDeviceTest, type AudioDeviceTestResult, type AudioLayout, type AudioLevels, type AudioMode, type AudioOnset, type AudioPreset, type AudioPresetInput, type AudioPresetSummary, AudioReactiveRepository, type AudioReactiveScene, type AudioReactiveSceneInput, type AudioReactiveState, AudioRepository, type AudioRoleZones, type AudioSession, type AudioSessionStart, type AudioState, type AudioTargets, type AudioZone, type AudioZoneInput, type AudioZonePatch, BackoffPolicy, CALIBRATION_FILE_TYPES, CacheStore, CalibrationRepository, CallOptions, type CaptureFrame, ChannelWelcome, ClientsRepository, type ConnectionState, type ContentChange, type ContentQuery, ContentRepository, ContentSource, Credentials, type DisplayState, Emitter, EngineRepository, EventHub, FREEDOME_CLIENT_VERSION, FreedomeClient, type FreedomeClientInit, type FreedomeClientOptions, type FreedomeCredentials, FreedomeEndpoint, FreedomeLogger, FreedomeResponse, FreedomeTransportFactory, GRAPHQL_EVENTS_SUBSCRIPTION, GRAPHQL_OPERATION, GRAPHQL_WS_SUBPROTOCOL, type Gateway, type GatewayPatch, type GatewayTestResult, GatewaysRepository, type GeneratorMulti, GeneratorSession, type GeneratorSettings, type GeneratorState, GraphqlClient, GraphqlWsChannel, InMemoryTokenStore, MessageSocket, NO_SESSION, OfflinePolicy, type OscArg, type OscMessage, OscRepository, OutboxOutcome, OutboxStore, PACKAGE_NAME, Page, type PlayTarget, PlayTargets, PlaybackRepository, type PlaybackSnapshot, PlayerHandle, RealtimeChannel, RealtimeClosed, RealtimeConnector, RealtimeHello, RealtimeResult, RealtimeTransport, RepositoryContext, Resync, type Session, Sha256, ShowParts, SocketIoChannel, type SourcePosition, type StoredTokens, type TextureSource, type TokenStore, Unsubscribe, type UploadCapabilities, UploadPurpose, UploadTask, VenuesRepository, Versioned, WatchObserver, WsChannel, audioSessionEnded, base64, can, defaultTransports, multipart, oscArg, scopesOfRole, sessionFromPrincipal, sessionFromTokens, sha256Hex, storedTokensOf, uuidV7 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as ApiCaller, R as RepositoryContext, W as WatchObserver, U as Unsubscribe, V as Versioned, E as Emitter, P as Page, C as ContentSource, a as UploadTask, b as UploadPurpose, c as RealtimeTransport, O as OfflinePolicy, d as CacheStore, e as OutboxStore, F as FreedomeLogger, f as RealtimeConnector, g as OutboxOutcome, h as EventHub, i as CallOptions, j as RealtimeChannel, k as Resync, l as RealtimeClosed, m as RealtimeHello, n as RealtimeResult, o as ChannelWelcome } from './discovery-
|
|
2
|
-
export { B as BlobContentSource, p as BytesContentSource, q as CachedValue, r as CompositeDiscovery, D as DEFAULT_OFFLINE_POLICY, s as DiscoveredDome, t as Discovery, I as InMemoryCacheStore, u as InMemoryOutboxStore, L as LogLevel, v as LogRecord, M as MAX_UPLOAD_CHUNK, w as OutboxEntry, S as StaticDiscovery, x as UploadProgress, y as UploadResult, z as UploadTaskState, G as isAuthFailure, H as nextValue, J as probe, K as readAllPages, N as readPage } from './discovery-
|
|
3
|
-
import { Principal, TokenSet, ApiOperation, OperationBody, OperationResponse, CalibrationJob, CalibrationState, ClientRegistration, ClientDevice, ClientTelemetry, AssetResource, AssetCreateRequest, ImportRequest, Job, ShowResource, StorageStats, ShowSummary, ShowInput, UploadStatus, EngineStatus, DisplayResource, PlayerState, AppPayload, ActiveShowState, ParameterInfo, VenueOutput, Venue, VenueInput, ServerInfo, FreedomeEvent } from '@freedome/protocol';
|
|
4
|
-
export { ApiOperation, DomeTopics, EventKinds, FreedomeEvent, Operations } from '@freedome/protocol';
|
|
1
|
+
import { A as ApiCaller, R as RepositoryContext, W as WatchObserver, U as Unsubscribe, V as Versioned, E as Emitter, P as Page, C as ContentSource, a as UploadTask, b as UploadPurpose, c as RealtimeTransport, O as OfflinePolicy, d as CacheStore, e as OutboxStore, F as FreedomeLogger, f as RealtimeConnector, g as OutboxOutcome, h as EventHub, i as CallOptions, j as RealtimeChannel, k as Resync, l as RealtimeClosed, m as RealtimeHello, n as RealtimeResult, o as ChannelWelcome } from './discovery-BkrBFXwA.js';
|
|
2
|
+
export { B as BlobContentSource, p as BytesContentSource, q as CachedValue, r as CompositeDiscovery, D as DEFAULT_OFFLINE_POLICY, s as DiscoveredDome, t as Discovery, I as InMemoryCacheStore, u as InMemoryOutboxStore, L as LogLevel, v as LogRecord, M as MAX_UPLOAD_CHUNK, w as OutboxEntry, S as StaticDiscovery, x as UploadProgress, y as UploadResult, z as UploadTaskState, G as isAuthFailure, H as nextValue, J as probe, K as readAllPages, N as readPage } from './discovery-BkrBFXwA.js';
|
|
3
|
+
import { Principal, TokenSet, ApiOperation, OperationBody, OperationResponse, CalibrationJob, CalibrationState, ClientRegistration, ClientDevice, ClientTelemetry, AssetResource, AssetCreateRequest, ImportRequest, Job, ShowResource, StorageStats, ShowSummary, ShowInput, UploadStatus, EngineStatus, DisplayResource, PlayerState, AppPayload, ActiveShowState, ParameterInfo, VenueOutput, Venue, VenueInput, ServerInfo, SemVer, FreedomeEvent } from '@freedome/protocol';
|
|
4
|
+
export { ApiOperation, DomeTopics, EventKinds, FreedomeEvent, Operations, ProtocolVersions, SemVer } from '@freedome/protocol';
|
|
5
5
|
import { F as FreedomeEndpoint, a as FreedomeTransportFactory, b as FreedomeResponse, M as MessageSocket } from './transport-dvmDQyvB.js';
|
|
6
6
|
export { c as FetchTransport, d as FreedomeRequest, e as FreedomeTransport, f as MessageSocketConnector, P as PairingLink, W as WebSocketCtor, g as WebSocketLike, r as requestUrl, w as webSocketConnector } from './transport-dvmDQyvB.js';
|
|
7
7
|
export { C as ConflictError, a as ForbiddenError, F as FreedomeError, b as FreedomeErrorOptions, I as IncompatibleServerError, N as NetworkError, c as NotFoundError, O as OfflineError, P as PayloadTooLargeError, Q as QueuedForReplayError, R as RateLimitedError, d as RequestTimeoutError, S as ServerError, T as TlsPinMismatchError, U as UnauthorizedError, e as UnsupportedCapabilityError, f as UnsupportedFormatError, V as ValidationError, g as ValidationIssue, h as errorFromProblem, i as isUnreachable } from './errors-L_bIF-OR.js';
|
|
@@ -228,17 +228,30 @@ type AudioPresetSummary = OperationResponse<'listAudioPresets'>['items'][number]
|
|
|
228
228
|
type AudioSession = OperationResponse<'getAudioSession'>;
|
|
229
229
|
/** Generator settings (signal, frequencies, gain, duration, targets). */
|
|
230
230
|
type GeneratorSettings = OperationBody<'setGenerator'>;
|
|
231
|
+
/**
|
|
232
|
+
* NmSoundParams of a MULTI generator (`program`, `target`, `enviroment`, `modulation`, `multi`, `channel`, `audio`,
|
|
233
|
+
* `compatJava`), the object `multi` of an ananta/1.0 programme segment. Contract 1.1.0.
|
|
234
|
+
*/
|
|
235
|
+
type GeneratorMulti = Partial<NonNullable<GeneratorSettings['multi']>>;
|
|
231
236
|
/** Generator state (`running`, settings, startedAt). */
|
|
232
237
|
type GeneratorState = OperationResponse<'getGenerator'>;
|
|
233
238
|
/** Spherical source position (listener at the dome centre). */
|
|
234
239
|
type SourcePosition = OperationBody<'setSourcePosition'>;
|
|
235
240
|
/** Session targets (devices / zones / speakers). */
|
|
236
241
|
type AudioTargets = NonNullable<OperationBody<'startAudioSession'>['targets']>;
|
|
242
|
+
/** Preset role → the zones it plays in. Contract 1.1.0. */
|
|
243
|
+
type AudioRoleZones = NonNullable<OperationBody<'startAudioSession'>['roleZones']>;
|
|
244
|
+
/** Resonance sweep request (every member optional; the defaults are the engine's). Contract 1.1.0. */
|
|
245
|
+
type AudioDeviceSweep = Partial<NonNullable<OperationBody<'startAudioDeviceSweep'>>>;
|
|
246
|
+
/** Calibration job of kind `audio-device-sweep`; its member `sweep` holds the result. */
|
|
247
|
+
type AudioDeviceSweepJob = OperationResponse<'startAudioDeviceSweep'>;
|
|
237
248
|
/** Session start options. */
|
|
238
249
|
interface AudioSessionStart {
|
|
239
250
|
presetId: string;
|
|
240
251
|
gainDb?: number;
|
|
241
252
|
targets?: AudioTargets;
|
|
253
|
+
/** Zones per role; needs [AudioRepository.supportsAudioControl]. */
|
|
254
|
+
roleZones?: AudioRoleZones;
|
|
242
255
|
/** Server time to start at (multi-node sync). */
|
|
243
256
|
at?: Date | string;
|
|
244
257
|
loop?: boolean;
|
|
@@ -256,6 +269,14 @@ declare class AudioRepository {
|
|
|
256
269
|
/** @internal */
|
|
257
270
|
get ctx(): RepositoryContext;
|
|
258
271
|
private get v();
|
|
272
|
+
/**
|
|
273
|
+
* Whether the server has the audio additions of contract 1.1.0: [pauseSession], [resumeSession], [startDeviceSweep],
|
|
274
|
+
* `roleZones` of [startSession] and the `multi` block of the generator. False against a 1.0 server and while its
|
|
275
|
+
* contract version is not known.
|
|
276
|
+
*/
|
|
277
|
+
get supportsAudioControl(): boolean;
|
|
278
|
+
/** @internal A 1.0 server would answer 404 or 422: says why instead. Sent as it is when the version is not known. */
|
|
279
|
+
requireAudioControl(what: string): void;
|
|
259
280
|
/** The same repository for another venue. */
|
|
260
281
|
venue(id: string): AudioRepository;
|
|
261
282
|
/** Mode, master gain / mute, engine status. */
|
|
@@ -318,6 +339,14 @@ declare class AudioRepository {
|
|
|
318
339
|
device(deviceId: string): Promise<AudioDevice>;
|
|
319
340
|
/** Operator gain / mute / name / config of a device. */
|
|
320
341
|
patchDevice(deviceId: string, patch: AudioDevicePatch): Promise<AudioDevice>;
|
|
342
|
+
/**
|
|
343
|
+
* Resonance sweep of one resonator channel of [deviceId] (scope `audio:calibrate`): answers a calibration job of kind
|
|
344
|
+
* `audio-device-sweep`. Follow it with `client.calibration.progress`; progress is elapsed time, not measurement, and
|
|
345
|
+
* the job's `sweep` member holds `peaks`, and with `modelHz` also `partials` and `warnings`, once it has succeeded.
|
|
346
|
+
* There is nothing to apply. 409 while a session uses the device, another sweep runs or the device is in emergency
|
|
347
|
+
* stop; 422 without such a resonator channel. Needs [supportsAudioControl].
|
|
348
|
+
*/
|
|
349
|
+
startDeviceSweep(deviceId: string, sweep?: AudioDeviceSweep): Promise<AudioDeviceSweepJob>;
|
|
321
350
|
/** Ping / tone / self-test / strike of a device. */
|
|
322
351
|
testDevice(deviceId: string, test?: AudioDeviceTest): Promise<AudioDeviceTestResult>;
|
|
323
352
|
/** Follows a device (`audioDevice.state`, telemetry patches ≤ 1 Hz). */
|
|
@@ -349,6 +378,17 @@ declare class AudioRepository {
|
|
|
349
378
|
sessionState(sessionId: string, obs: WatchObserver<AudioSession>, o?: {
|
|
350
379
|
intervalMs?: number;
|
|
351
380
|
}): Unsubscribe;
|
|
381
|
+
/**
|
|
382
|
+
* Pauses a session (live control, scope `audio:control`): every engine holds its position, `audioSession.state`
|
|
383
|
+
* follows. A paused session answers as it is; 409 for one that is starting or has ended. Needs
|
|
384
|
+
* [supportsAudioControl].
|
|
385
|
+
*/
|
|
386
|
+
pauseSession(sessionId: string): Promise<AudioSession>;
|
|
387
|
+
/**
|
|
388
|
+
* Resumes a paused session from its position (live control, scope `audio:control`). A running session answers as it
|
|
389
|
+
* is; 409 for one that is starting or has ended. Needs [supportsAudioControl].
|
|
390
|
+
*/
|
|
391
|
+
resumeSession(sessionId: string): Promise<AudioSession>;
|
|
352
392
|
/** Stops a session (live control). */
|
|
353
393
|
stopSession(sessionId: string): Promise<void>;
|
|
354
394
|
/** The venue's test / MULTI generator (backs the dome sound engine). Close it when done. */
|
|
@@ -375,6 +415,18 @@ declare class GeneratorSession {
|
|
|
375
415
|
zones?: string[];
|
|
376
416
|
speakers?: string[];
|
|
377
417
|
};
|
|
418
|
+
multi?: {
|
|
419
|
+
program?: string;
|
|
420
|
+
target?: number;
|
|
421
|
+
enviroment?: number;
|
|
422
|
+
modulation?: number;
|
|
423
|
+
multi?: number;
|
|
424
|
+
channel?: number;
|
|
425
|
+
audio?: number;
|
|
426
|
+
compatJava: boolean;
|
|
427
|
+
} & {
|
|
428
|
+
[key: string]: unknown;
|
|
429
|
+
};
|
|
378
430
|
};
|
|
379
431
|
startedAt?: string;
|
|
380
432
|
}>;
|
|
@@ -397,8 +449,16 @@ declare class GeneratorSession {
|
|
|
397
449
|
}): Unsubscribe;
|
|
398
450
|
/** Reads the state over REST. */
|
|
399
451
|
get(): Promise<GeneratorState>;
|
|
400
|
-
/**
|
|
452
|
+
/**
|
|
453
|
+
* Starts the generator or replaces its settings (live control, scope `audio:control`). The `multi` block needs
|
|
454
|
+
* [AudioRepository.supportsAudioControl].
|
|
455
|
+
*/
|
|
401
456
|
start(settings: GeneratorSettings): Promise<GeneratorState>;
|
|
457
|
+
/**
|
|
458
|
+
* Plays a MULTI programme: `signal: multi` with the block [multi], the same object a phone gives to `setParams`
|
|
459
|
+
* (contract 1.1.0, `docs/audio-control.md`).
|
|
460
|
+
*/
|
|
461
|
+
startMulti(multi: GeneratorMulti, o?: Pick<GeneratorSettings, 'gainDb' | 'durationS' | 'targets'>): Promise<GeneratorState>;
|
|
402
462
|
/** Stops the generator (live control). */
|
|
403
463
|
stop(): Promise<void>;
|
|
404
464
|
private refreshQuietly;
|
|
@@ -817,7 +877,7 @@ declare class VenuesRepository {
|
|
|
817
877
|
}
|
|
818
878
|
|
|
819
879
|
/** SDK version (User-Agent / hello). */
|
|
820
|
-
declare const FREEDOME_CLIENT_VERSION = "1.
|
|
880
|
+
declare const FREEDOME_CLIENT_VERSION = "1.1.0";
|
|
821
881
|
/** Connection states (02f §7.1). */
|
|
822
882
|
type ConnectionState = 'idle' | 'negotiating' | 'incompatible' | 'authenticating' | 'unauthorized' | 'online' | 'degraded' | 'reconnecting' | 'resyncing' | 'offline' | 'closed';
|
|
823
883
|
/** Client options. */
|
|
@@ -900,6 +960,12 @@ declare class FreedomeClient {
|
|
|
900
960
|
get userAgent(): string;
|
|
901
961
|
get endpoint(): FreedomeEndpoint;
|
|
902
962
|
get server(): ServerInfo | undefined;
|
|
963
|
+
/**
|
|
964
|
+
* Contract version the server reports (`contractVersion` of `GET /info`); undefined before [open], or when the server
|
|
965
|
+
* reports none or an unreadable one. This is how an app tells what a server offers: a 1.0 server has no audio control
|
|
966
|
+
* (`ProtocolVersions.audioControl`, `AudioRepository.supportsAudioControl`).
|
|
967
|
+
*/
|
|
968
|
+
get contractVersion(): SemVer | undefined;
|
|
903
969
|
get state(): ConnectionState;
|
|
904
970
|
/** Reason of `degraded` / `offline` / `reconnecting`. */
|
|
905
971
|
get stateReason(): string | undefined;
|
|
@@ -1121,4 +1187,4 @@ declare function base64(bytes: Uint8Array): string;
|
|
|
1121
1187
|
*/
|
|
1122
1188
|
declare const PACKAGE_NAME = "@freedome/client";
|
|
1123
1189
|
|
|
1124
|
-
export { ApiCaller, type AudioAnalysisFrame, type AudioAnalysisSettings, type AudioAnalysisState, type AudioDevice, type AudioDeviceKind, type AudioDevicePatch, type AudioDeviceTest, type AudioDeviceTestResult, type AudioLayout, type AudioLevels, type AudioMode, type AudioOnset, type AudioPreset, type AudioPresetInput, type AudioPresetSummary, AudioReactiveRepository, type AudioReactiveScene, type AudioReactiveSceneInput, type AudioReactiveState, AudioRepository, type AudioSession, type AudioSessionStart, type AudioState, type AudioTargets, type AudioZone, type AudioZoneInput, type AudioZonePatch, BackoffPolicy, CALIBRATION_FILE_TYPES, CacheStore, CalibrationRepository, CallOptions, type CaptureFrame, ChannelWelcome, ClientsRepository, type ConnectionState, type ContentChange, type ContentQuery, ContentRepository, ContentSource, Credentials, type DisplayState, Emitter, EngineRepository, EventHub, FREEDOME_CLIENT_VERSION, FreedomeClient, type FreedomeClientInit, type FreedomeClientOptions, type FreedomeCredentials, FreedomeEndpoint, FreedomeLogger, FreedomeResponse, FreedomeTransportFactory, GRAPHQL_EVENTS_SUBSCRIPTION, GRAPHQL_OPERATION, GRAPHQL_WS_SUBPROTOCOL, type Gateway, type GatewayPatch, type GatewayTestResult, GatewaysRepository, GeneratorSession, type GeneratorSettings, type GeneratorState, GraphqlClient, GraphqlWsChannel, InMemoryTokenStore, MessageSocket, NO_SESSION, OfflinePolicy, type OscArg, type OscMessage, OscRepository, OutboxOutcome, OutboxStore, PACKAGE_NAME, Page, type PlayTarget, PlayTargets, PlaybackRepository, type PlaybackSnapshot, PlayerHandle, RealtimeChannel, RealtimeClosed, RealtimeConnector, RealtimeHello, RealtimeResult, RealtimeTransport, RepositoryContext, Resync, type Session, Sha256, ShowParts, SocketIoChannel, type SourcePosition, type StoredTokens, type TextureSource, type TokenStore, Unsubscribe, type UploadCapabilities, UploadPurpose, UploadTask, VenuesRepository, Versioned, WatchObserver, WsChannel, audioSessionEnded, base64, can, defaultTransports, multipart, oscArg, scopesOfRole, sessionFromPrincipal, sessionFromTokens, sha256Hex, storedTokensOf, uuidV7 };
|
|
1190
|
+
export { ApiCaller, type AudioAnalysisFrame, type AudioAnalysisSettings, type AudioAnalysisState, type AudioDevice, type AudioDeviceKind, type AudioDevicePatch, type AudioDeviceSweep, type AudioDeviceSweepJob, type AudioDeviceTest, type AudioDeviceTestResult, type AudioLayout, type AudioLevels, type AudioMode, type AudioOnset, type AudioPreset, type AudioPresetInput, type AudioPresetSummary, AudioReactiveRepository, type AudioReactiveScene, type AudioReactiveSceneInput, type AudioReactiveState, AudioRepository, type AudioRoleZones, type AudioSession, type AudioSessionStart, type AudioState, type AudioTargets, type AudioZone, type AudioZoneInput, type AudioZonePatch, BackoffPolicy, CALIBRATION_FILE_TYPES, CacheStore, CalibrationRepository, CallOptions, type CaptureFrame, ChannelWelcome, ClientsRepository, type ConnectionState, type ContentChange, type ContentQuery, ContentRepository, ContentSource, Credentials, type DisplayState, Emitter, EngineRepository, EventHub, FREEDOME_CLIENT_VERSION, FreedomeClient, type FreedomeClientInit, type FreedomeClientOptions, type FreedomeCredentials, FreedomeEndpoint, FreedomeLogger, FreedomeResponse, FreedomeTransportFactory, GRAPHQL_EVENTS_SUBSCRIPTION, GRAPHQL_OPERATION, GRAPHQL_WS_SUBPROTOCOL, type Gateway, type GatewayPatch, type GatewayTestResult, GatewaysRepository, type GeneratorMulti, GeneratorSession, type GeneratorSettings, type GeneratorState, GraphqlClient, GraphqlWsChannel, InMemoryTokenStore, MessageSocket, NO_SESSION, OfflinePolicy, type OscArg, type OscMessage, OscRepository, OutboxOutcome, OutboxStore, PACKAGE_NAME, Page, type PlayTarget, PlayTargets, PlaybackRepository, type PlaybackSnapshot, PlayerHandle, RealtimeChannel, RealtimeClosed, RealtimeConnector, RealtimeHello, RealtimeResult, RealtimeTransport, RepositoryContext, Resync, type Session, Sha256, ShowParts, SocketIoChannel, type SourcePosition, type StoredTokens, type TextureSource, type TokenStore, Unsubscribe, type UploadCapabilities, UploadPurpose, UploadTask, VenuesRepository, Versioned, WatchObserver, WsChannel, audioSessionEnded, base64, can, defaultTransports, multipart, oscArg, scopesOfRole, sessionFromPrincipal, sessionFromTokens, sha256Hex, storedTokensOf, uuidV7 };
|