@deadair/sdk 0.7.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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/activity/activity.client.d.ts +12 -0
- package/dist/activity/activity.client.d.ts.map +1 -0
- package/dist/activity/types/activity.types.d.ts +60 -0
- package/dist/activity/types/activity.types.d.ts.map +1 -0
- package/dist/activity/types/index.d.ts +2 -0
- package/dist/activity/types/index.d.ts.map +1 -0
- package/dist/art/art.client.d.ts +21 -0
- package/dist/art/art.client.d.ts.map +1 -0
- package/dist/authentication/authentication.client.d.ts +33 -0
- package/dist/authentication/authentication.client.d.ts.map +1 -0
- package/dist/authentication/authentication.factor.client.d.ts +41 -0
- package/dist/authentication/authentication.factor.client.d.ts.map +1 -0
- package/dist/authentication/authentication.sessions.client.d.ts +20 -0
- package/dist/authentication/authentication.sessions.client.d.ts.map +1 -0
- package/dist/authentication/types/authentication.types.d.ts +846 -0
- package/dist/authentication/types/authentication.types.d.ts.map +1 -0
- package/dist/authentication/types/index.d.ts +3 -0
- package/dist/authentication/types/index.d.ts.map +1 -0
- package/dist/authentication/types/registration.types.d.ts +336 -0
- package/dist/authentication/types/registration.types.d.ts.map +1 -0
- package/dist/catalog/catalog.client.d.ts +96 -0
- package/dist/catalog/catalog.client.d.ts.map +1 -0
- package/dist/catalog/types/catalog.types.d.ts +593 -0
- package/dist/catalog/types/catalog.types.d.ts.map +1 -0
- package/dist/catalog/types/index.d.ts +2 -0
- package/dist/catalog/types/index.d.ts.map +1 -0
- package/dist/charts/charts.client.d.ts +17 -0
- package/dist/charts/charts.client.d.ts.map +1 -0
- package/dist/charts/types/charts.types.d.ts +54 -0
- package/dist/charts/types/charts.types.d.ts.map +1 -0
- package/dist/charts/types/index.d.ts +2 -0
- package/dist/charts/types/index.d.ts.map +1 -0
- package/dist/deadair.sdk.d.ts +49 -0
- package/dist/deadair.sdk.d.ts.map +1 -0
- package/dist/director/director.client.d.ts +98 -0
- package/dist/director/director.client.d.ts.map +1 -0
- package/dist/director/types/clock.types.d.ts +57 -0
- package/dist/director/types/clock.types.d.ts.map +1 -0
- package/dist/director/types/director.types.d.ts +212 -0
- package/dist/director/types/director.types.d.ts.map +1 -0
- package/dist/director/types/index.d.ts +3 -0
- package/dist/director/types/index.d.ts.map +1 -0
- package/dist/history/history.client.d.ts +12 -0
- package/dist/history/history.client.d.ts.map +1 -0
- package/dist/history/types/history.types.d.ts +44 -0
- package/dist/history/types/history.types.d.ts.map +1 -0
- package/dist/history/types/index.d.ts +2 -0
- package/dist/history/types/index.d.ts.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3509 -0
- package/dist/index.js.map +1 -0
- package/dist/news/news.client.d.ts +17 -0
- package/dist/news/news.client.d.ts.map +1 -0
- package/dist/news/types/index.d.ts +2 -0
- package/dist/news/types/index.d.ts.map +1 -0
- package/dist/news/types/news.types.d.ts +61 -0
- package/dist/news/types/news.types.d.ts.map +1 -0
- package/dist/nowplaying/nowplaying.client.d.ts +12 -0
- package/dist/nowplaying/nowplaying.client.d.ts.map +1 -0
- package/dist/nowplaying/types/index.d.ts +2 -0
- package/dist/nowplaying/types/index.d.ts.map +1 -0
- package/dist/nowplaying/types/nowplaying.types.d.ts +59 -0
- package/dist/nowplaying/types/nowplaying.types.d.ts.map +1 -0
- package/dist/onboarding/onboarding.client.d.ts +11 -0
- package/dist/onboarding/onboarding.client.d.ts.map +1 -0
- package/dist/onboarding/types/index.d.ts +2 -0
- package/dist/onboarding/types/index.d.ts.map +1 -0
- package/dist/onboarding/types/onboarding.types.d.ts +41 -0
- package/dist/onboarding/types/onboarding.types.d.ts.map +1 -0
- package/dist/personas/personas.client.d.ts +167 -0
- package/dist/personas/personas.client.d.ts.map +1 -0
- package/dist/personas/types/index.d.ts +2 -0
- package/dist/personas/types/index.d.ts.map +1 -0
- package/dist/personas/types/personas.types.d.ts +545 -0
- package/dist/personas/types/personas.types.d.ts.map +1 -0
- package/dist/playlists/playlists.client.d.ts +17 -0
- package/dist/playlists/playlists.client.d.ts.map +1 -0
- package/dist/playlists/types/index.d.ts +2 -0
- package/dist/playlists/types/index.d.ts.map +1 -0
- package/dist/playlists/types/playlists.types.d.ts +71 -0
- package/dist/playlists/types/playlists.types.d.ts.map +1 -0
- package/dist/playout/playout.client.d.ts +37 -0
- package/dist/playout/playout.client.d.ts.map +1 -0
- package/dist/playout/types/index.d.ts +2 -0
- package/dist/playout/types/index.d.ts.map +1 -0
- package/dist/playout/types/playout.types.d.ts +163 -0
- package/dist/playout/types/playout.types.d.ts.map +1 -0
- package/dist/plugins/plugins.client.d.ts +107 -0
- package/dist/plugins/plugins.client.d.ts.map +1 -0
- package/dist/plugins/types/index.d.ts +2 -0
- package/dist/plugins/types/index.d.ts.map +1 -0
- package/dist/plugins/types/plugins.types.d.ts +330 -0
- package/dist/plugins/types/plugins.types.d.ts.map +1 -0
- package/dist/productions/productions.client.d.ts +22 -0
- package/dist/productions/productions.client.d.ts.map +1 -0
- package/dist/productions/types/index.d.ts +2 -0
- package/dist/productions/types/index.d.ts.map +1 -0
- package/dist/productions/types/productions.types.d.ts +90 -0
- package/dist/productions/types/productions.types.d.ts.map +1 -0
- package/dist/render/render.client.d.ts +210 -0
- package/dist/render/render.client.d.ts.map +1 -0
- package/dist/render/types/index.d.ts +2 -0
- package/dist/render/types/index.d.ts.map +1 -0
- package/dist/render/types/render.types.d.ts +518 -0
- package/dist/render/types/render.types.d.ts.map +1 -0
- package/dist/schedule/schedule.client.d.ts +37 -0
- package/dist/schedule/schedule.client.d.ts.map +1 -0
- package/dist/schedule/types/index.d.ts +2 -0
- package/dist/schedule/types/index.d.ts.map +1 -0
- package/dist/schedule/types/schedule.types.d.ts +119 -0
- package/dist/schedule/types/schedule.types.d.ts.map +1 -0
- package/dist/sdk-options.d.ts +45 -0
- package/dist/sdk-options.d.ts.map +1 -0
- package/dist/settings/settings.client.d.ts +17 -0
- package/dist/settings/settings.client.d.ts.map +1 -0
- package/dist/settings/types/index.d.ts +2 -0
- package/dist/settings/types/index.d.ts.map +1 -0
- package/dist/settings/types/settings.types.d.ts +35 -0
- package/dist/settings/types/settings.types.d.ts.map +1 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/pagination.d.ts +34 -0
- package/dist/shared/types/pagination.d.ts.map +1 -0
- package/dist/station/station.client.d.ts +49 -0
- package/dist/station/station.client.d.ts.map +1 -0
- package/dist/station/types/index.d.ts +4 -0
- package/dist/station/types/index.d.ts.map +1 -0
- package/dist/station/types/logs.types.d.ts +73 -0
- package/dist/station/types/logs.types.d.ts.map +1 -0
- package/dist/station/types/station.types.d.ts +120 -0
- package/dist/station/types/station.types.d.ts.map +1 -0
- package/dist/station/types/traces.types.d.ts +91 -0
- package/dist/station/types/traces.types.d.ts.map +1 -0
- package/dist/storage/storage.client.d.ts +12 -0
- package/dist/storage/storage.client.d.ts.map +1 -0
- package/dist/storage/types/index.d.ts +2 -0
- package/dist/storage/types/index.d.ts.map +1 -0
- package/dist/storage/types/storage.types.d.ts +59 -0
- package/dist/storage/types/storage.types.d.ts.map +1 -0
- package/dist/stream/stream.client.d.ts +32 -0
- package/dist/stream/stream.client.d.ts.map +1 -0
- package/dist/stream/types/index.d.ts +2 -0
- package/dist/stream/types/index.d.ts.map +1 -0
- package/dist/stream/types/stream.types.d.ts +47 -0
- package/dist/stream/types/stream.types.d.ts.map +1 -0
- package/dist/topics/topics.client.d.ts +32 -0
- package/dist/topics/topics.client.d.ts.map +1 -0
- package/dist/topics/types/index.d.ts +2 -0
- package/dist/topics/types/index.d.ts.map +1 -0
- package/dist/topics/types/topics.types.d.ts +65 -0
- package/dist/topics/types/topics.types.d.ts.map +1 -0
- package/package.json +53 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3509 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/sdk-options.ts
|
|
5
|
+
var SdkError = class extends Error {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "SdkError");
|
|
8
|
+
}
|
|
9
|
+
status;
|
|
10
|
+
statusText;
|
|
11
|
+
body;
|
|
12
|
+
headers;
|
|
13
|
+
constructor(status, statusText, body, headers) {
|
|
14
|
+
super(`${status} ${statusText}`), this.status = status, this.statusText = statusText, this.body = body, this.headers = headers;
|
|
15
|
+
this.name = "SdkError";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var bigIntReplacer = /* @__PURE__ */ __name((_, value) => {
|
|
19
|
+
if (typeof value === "bigint") {
|
|
20
|
+
return value.toString() + "n";
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}, "bigIntReplacer");
|
|
24
|
+
var bigIntReviver = /* @__PURE__ */ __name((_, value) => {
|
|
25
|
+
if (typeof value === "string" && /^-?\d+n$/.test(value)) {
|
|
26
|
+
return BigInt(value.slice(0, -1));
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}, "bigIntReviver");
|
|
30
|
+
function readContentType(res) {
|
|
31
|
+
return res.headers.get("content-type")?.split(";")[0]?.trim() ?? "";
|
|
32
|
+
}
|
|
33
|
+
__name(readContentType, "readContentType");
|
|
34
|
+
function randomRequestId() {
|
|
35
|
+
if (typeof crypto.randomUUID === "function") return crypto.randomUUID();
|
|
36
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
37
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
38
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
39
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
40
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
41
|
+
}
|
|
42
|
+
__name(randomRequestId, "randomRequestId");
|
|
43
|
+
function createSdkFetch(options) {
|
|
44
|
+
const getRequestId = options.requestIdFactory ?? randomRequestId;
|
|
45
|
+
return async (url, init) => {
|
|
46
|
+
const baseHeaders = typeof options.headers === "function" ? await options.headers() : options.headers ?? {};
|
|
47
|
+
const res = await fetch(`${options.baseUrl}${url}`, {
|
|
48
|
+
...init,
|
|
49
|
+
headers: {
|
|
50
|
+
...baseHeaders,
|
|
51
|
+
"X-Request-ID": getRequestId(),
|
|
52
|
+
...init.headers
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if (!res.ok && !(init.expectStatuses ?? []).includes(res.status)) {
|
|
56
|
+
const text = await res.text();
|
|
57
|
+
let body;
|
|
58
|
+
try {
|
|
59
|
+
body = JSON.parse(text);
|
|
60
|
+
} catch {
|
|
61
|
+
body = text;
|
|
62
|
+
}
|
|
63
|
+
throw new SdkError(res.status, res.statusText, body, res.headers);
|
|
64
|
+
}
|
|
65
|
+
return res;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
__name(createSdkFetch, "createSdkFetch");
|
|
69
|
+
function buildQueryString(query) {
|
|
70
|
+
const searchParams = new URLSearchParams();
|
|
71
|
+
if (query) {
|
|
72
|
+
for (const [k, v] of Object.entries(query)) {
|
|
73
|
+
if (v === void 0 || v === null) continue;
|
|
74
|
+
if (Array.isArray(v)) {
|
|
75
|
+
for (const item of v) searchParams.append(k, String(item));
|
|
76
|
+
} else searchParams.set(k, String(v));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const qs = searchParams.toString();
|
|
80
|
+
return qs ? `?${qs}` : "";
|
|
81
|
+
}
|
|
82
|
+
__name(buildQueryString, "buildQueryString");
|
|
83
|
+
function buildHeaders(headers) {
|
|
84
|
+
const out = {};
|
|
85
|
+
if (headers) {
|
|
86
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
87
|
+
if (v === void 0 || v === null) continue;
|
|
88
|
+
out[k] = Array.isArray(v) ? v.map(String).join(", ") : String(v);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
__name(buildHeaders, "buildHeaders");
|
|
94
|
+
function parseBigIntHeader(name, value) {
|
|
95
|
+
if (/^-?\d+n?$/.test(value)) return BigInt(value.replace(/n$/, ""));
|
|
96
|
+
throw new Error(`Response header '${name}' is not a bigint: ${JSON.stringify(value)}`);
|
|
97
|
+
}
|
|
98
|
+
__name(parseBigIntHeader, "parseBigIntHeader");
|
|
99
|
+
async function parseJson(res) {
|
|
100
|
+
return JSON.parse(await res.text());
|
|
101
|
+
}
|
|
102
|
+
__name(parseJson, "parseJson");
|
|
103
|
+
async function parseJsonWithBigInt(res) {
|
|
104
|
+
return JSON.parse(await res.text(), bigIntReviver);
|
|
105
|
+
}
|
|
106
|
+
__name(parseJsonWithBigInt, "parseJsonWithBigInt");
|
|
107
|
+
|
|
108
|
+
// src/activity/types/activity.types.ts
|
|
109
|
+
import { Decimal } from "decimal.js";
|
|
110
|
+
import { DateTime } from "luxon";
|
|
111
|
+
Decimal.set({
|
|
112
|
+
toExpNeg: -9e15,
|
|
113
|
+
toExpPos: 9e15
|
|
114
|
+
});
|
|
115
|
+
var __dt = /* @__PURE__ */ __name((v, path) => {
|
|
116
|
+
if (typeof v !== "string") {
|
|
117
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
118
|
+
}
|
|
119
|
+
const d = DateTime.fromISO(v);
|
|
120
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
121
|
+
return d;
|
|
122
|
+
}, "__dt");
|
|
123
|
+
function reviveActivityEntry(raw) {
|
|
124
|
+
const __o0 = raw;
|
|
125
|
+
__o0["at"] = __dt(__o0["at"], "ActivityEntry.at");
|
|
126
|
+
return raw;
|
|
127
|
+
}
|
|
128
|
+
__name(reviveActivityEntry, "reviveActivityEntry");
|
|
129
|
+
function reviveActivityPage(raw) {
|
|
130
|
+
const __o0 = raw;
|
|
131
|
+
{
|
|
132
|
+
const __a1 = __o0["entries"];
|
|
133
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
134
|
+
reviveActivityEntry(__a1[__i2]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return raw;
|
|
138
|
+
}
|
|
139
|
+
__name(reviveActivityPage, "reviveActivityPage");
|
|
140
|
+
|
|
141
|
+
// src/activity/activity.client.ts
|
|
142
|
+
var ActivityClient = class {
|
|
143
|
+
static {
|
|
144
|
+
__name(this, "ActivityClient");
|
|
145
|
+
}
|
|
146
|
+
fetch;
|
|
147
|
+
constructor(fetch2) {
|
|
148
|
+
this.fetch = fetch2;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @name Read activity
|
|
152
|
+
* @description The feed, newest first, one page at a time
|
|
153
|
+
*/
|
|
154
|
+
async readActivity(query) {
|
|
155
|
+
const qs = buildQueryString(query);
|
|
156
|
+
const result = await this.fetch(`/activity${qs}`, {
|
|
157
|
+
method: "GET"
|
|
158
|
+
});
|
|
159
|
+
return reviveActivityPage(await parseJson(result));
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// src/art/art.client.ts
|
|
164
|
+
var ArtClient = class {
|
|
165
|
+
static {
|
|
166
|
+
__name(this, "ArtClient");
|
|
167
|
+
}
|
|
168
|
+
fetch;
|
|
169
|
+
constructor(fetch2) {
|
|
170
|
+
this.fetch = fetch2;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @name Get art
|
|
174
|
+
* @description The bytes of one cached image
|
|
175
|
+
*/
|
|
176
|
+
async getArt(id) {
|
|
177
|
+
const result = await this.fetch(`/art/${encodeURIComponent(id)}`, {
|
|
178
|
+
method: "GET",
|
|
179
|
+
expectStatuses: [
|
|
180
|
+
304
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
switch (result.status) {
|
|
184
|
+
case 304:
|
|
185
|
+
return {
|
|
186
|
+
status: 304
|
|
187
|
+
};
|
|
188
|
+
default:
|
|
189
|
+
return {
|
|
190
|
+
status: 200,
|
|
191
|
+
contentType: readContentType(result),
|
|
192
|
+
data: await result.blob(),
|
|
193
|
+
headers: {
|
|
194
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
195
|
+
etag: result.headers.get("etag") ?? void 0
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// src/authentication/types/authentication.types.ts
|
|
203
|
+
import { Decimal as Decimal2 } from "decimal.js";
|
|
204
|
+
import { DateTime as DateTime2 } from "luxon";
|
|
205
|
+
Decimal2.set({
|
|
206
|
+
toExpNeg: -9e15,
|
|
207
|
+
toExpPos: 9e15
|
|
208
|
+
});
|
|
209
|
+
var __dt2 = /* @__PURE__ */ __name((v, path) => {
|
|
210
|
+
if (typeof v !== "string") {
|
|
211
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
212
|
+
}
|
|
213
|
+
const d = DateTime2.fromISO(v);
|
|
214
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
215
|
+
return d;
|
|
216
|
+
}, "__dt");
|
|
217
|
+
function reviveAuthenticationRegistration(raw) {
|
|
218
|
+
const __o0 = raw;
|
|
219
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "AuthenticationRegistration.expiresAt");
|
|
220
|
+
return raw;
|
|
221
|
+
}
|
|
222
|
+
__name(reviveAuthenticationRegistration, "reviveAuthenticationRegistration");
|
|
223
|
+
function reviveOidcLoginStartResponse(raw) {
|
|
224
|
+
const __o0 = raw;
|
|
225
|
+
__o0["expires_at"] = __dt2(__o0["expires_at"], "OidcLoginStartResponse.expires_at");
|
|
226
|
+
return raw;
|
|
227
|
+
}
|
|
228
|
+
__name(reviveOidcLoginStartResponse, "reviveOidcLoginStartResponse");
|
|
229
|
+
function reviveFactorChallengePhoneStartResponse(raw) {
|
|
230
|
+
const __o0 = raw;
|
|
231
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "FactorChallengePhoneStartResponse.expiresAt");
|
|
232
|
+
return raw;
|
|
233
|
+
}
|
|
234
|
+
__name(reviveFactorChallengePhoneStartResponse, "reviveFactorChallengePhoneStartResponse");
|
|
235
|
+
function reviveFactorChallengePhoneStartResponseOutput(raw) {
|
|
236
|
+
const __o0 = raw;
|
|
237
|
+
__o0["expires_at"] = __dt2(__o0["expires_at"], "FactorChallengePhoneStartResponse.expires_at");
|
|
238
|
+
return raw;
|
|
239
|
+
}
|
|
240
|
+
__name(reviveFactorChallengePhoneStartResponseOutput, "reviveFactorChallengePhoneStartResponseOutput");
|
|
241
|
+
function reviveFactorChallengeEmailStartResponse(raw) {
|
|
242
|
+
const __o0 = raw;
|
|
243
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "FactorChallengeEmailStartResponse.expiresAt");
|
|
244
|
+
return raw;
|
|
245
|
+
}
|
|
246
|
+
__name(reviveFactorChallengeEmailStartResponse, "reviveFactorChallengeEmailStartResponse");
|
|
247
|
+
function reviveFactorChallengeEmailStartResponseOutput(raw) {
|
|
248
|
+
const __o0 = raw;
|
|
249
|
+
__o0["expires_at"] = __dt2(__o0["expires_at"], "FactorChallengeEmailStartResponse.expires_at");
|
|
250
|
+
return raw;
|
|
251
|
+
}
|
|
252
|
+
__name(reviveFactorChallengeEmailStartResponseOutput, "reviveFactorChallengeEmailStartResponseOutput");
|
|
253
|
+
function reviveSessionFactor(raw) {
|
|
254
|
+
const __o0 = raw;
|
|
255
|
+
__o0["issuedAt"] = __dt2(__o0["issuedAt"], "SessionFactor.issuedAt");
|
|
256
|
+
__o0["authenticatedAt"] = __dt2(__o0["authenticatedAt"], "SessionFactor.authenticatedAt");
|
|
257
|
+
return raw;
|
|
258
|
+
}
|
|
259
|
+
__name(reviveSessionFactor, "reviveSessionFactor");
|
|
260
|
+
function reviveLogin(raw) {
|
|
261
|
+
const __o0 = raw;
|
|
262
|
+
__o0["occurredAt"] = __dt2(__o0["occurredAt"], "Login.occurredAt");
|
|
263
|
+
return raw;
|
|
264
|
+
}
|
|
265
|
+
__name(reviveLogin, "reviveLogin");
|
|
266
|
+
function reviveBaseAuthenticationLoginStartResponse(raw) {
|
|
267
|
+
const __o0 = raw;
|
|
268
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "BaseAuthenticationLoginStartResponse.expiresAt");
|
|
269
|
+
return raw;
|
|
270
|
+
}
|
|
271
|
+
__name(reviveBaseAuthenticationLoginStartResponse, "reviveBaseAuthenticationLoginStartResponse");
|
|
272
|
+
function reviveSession(raw) {
|
|
273
|
+
const __o0 = raw;
|
|
274
|
+
__o0["issuedAt"] = __dt2(__o0["issuedAt"], "Session.issuedAt");
|
|
275
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "Session.expiresAt");
|
|
276
|
+
__o0["lastAccessedAt"] = __dt2(__o0["lastAccessedAt"], "Session.lastAccessedAt");
|
|
277
|
+
{
|
|
278
|
+
const __a1 = __o0["factors"];
|
|
279
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
280
|
+
reviveSessionFactor(__a1[__i2]);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return raw;
|
|
284
|
+
}
|
|
285
|
+
__name(reviveSession, "reviveSession");
|
|
286
|
+
function reviveCodeAuthenticationLoginStartResponse(raw) {
|
|
287
|
+
reviveBaseAuthenticationLoginStartResponse(raw);
|
|
288
|
+
return raw;
|
|
289
|
+
}
|
|
290
|
+
__name(reviveCodeAuthenticationLoginStartResponse, "reviveCodeAuthenticationLoginStartResponse");
|
|
291
|
+
function reviveLinkAuthenticationLoginStartResponse(raw) {
|
|
292
|
+
reviveBaseAuthenticationLoginStartResponse(raw);
|
|
293
|
+
return raw;
|
|
294
|
+
}
|
|
295
|
+
__name(reviveLinkAuthenticationLoginStartResponse, "reviveLinkAuthenticationLoginStartResponse");
|
|
296
|
+
function reviveOidcAuthenticationLoginStartResponse(raw) {
|
|
297
|
+
reviveBaseAuthenticationLoginStartResponse(raw);
|
|
298
|
+
return raw;
|
|
299
|
+
}
|
|
300
|
+
__name(reviveOidcAuthenticationLoginStartResponse, "reviveOidcAuthenticationLoginStartResponse");
|
|
301
|
+
function reviveMfaRequiredResponse(raw) {
|
|
302
|
+
const __o0 = raw;
|
|
303
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "MfaRequiredResponse.expiresAt");
|
|
304
|
+
return raw;
|
|
305
|
+
}
|
|
306
|
+
__name(reviveMfaRequiredResponse, "reviveMfaRequiredResponse");
|
|
307
|
+
function reviveMfaRequiredResponseOutput(raw) {
|
|
308
|
+
const __o0 = raw;
|
|
309
|
+
__o0["expires_at"] = __dt2(__o0["expires_at"], "MfaRequiredResponse.expires_at");
|
|
310
|
+
return raw;
|
|
311
|
+
}
|
|
312
|
+
__name(reviveMfaRequiredResponseOutput, "reviveMfaRequiredResponseOutput");
|
|
313
|
+
function reviveFidoAuthenticationLoginStartResponse(raw) {
|
|
314
|
+
reviveBaseAuthenticationLoginStartResponse(raw);
|
|
315
|
+
return raw;
|
|
316
|
+
}
|
|
317
|
+
__name(reviveFidoAuthenticationLoginStartResponse, "reviveFidoAuthenticationLoginStartResponse");
|
|
318
|
+
function reviveFactorChallengeFidoStartResponse(raw) {
|
|
319
|
+
const __o0 = raw;
|
|
320
|
+
__o0["expiresAt"] = __dt2(__o0["expiresAt"], "FactorChallengeFidoStartResponse.expiresAt");
|
|
321
|
+
return raw;
|
|
322
|
+
}
|
|
323
|
+
__name(reviveFactorChallengeFidoStartResponse, "reviveFactorChallengeFidoStartResponse");
|
|
324
|
+
function reviveFactorChallengeFidoStartResponseOutput(raw) {
|
|
325
|
+
const __o0 = raw;
|
|
326
|
+
__o0["expires_at"] = __dt2(__o0["expires_at"], "FactorChallengeFidoStartResponse.expires_at");
|
|
327
|
+
return raw;
|
|
328
|
+
}
|
|
329
|
+
__name(reviveFactorChallengeFidoStartResponseOutput, "reviveFactorChallengeFidoStartResponseOutput");
|
|
330
|
+
function reviveStepUpStartResponse(raw) {
|
|
331
|
+
const __v = [
|
|
332
|
+
raw
|
|
333
|
+
];
|
|
334
|
+
{
|
|
335
|
+
const __d0 = __v[0]["result"];
|
|
336
|
+
if (__d0 === "mfa_required") {
|
|
337
|
+
reviveMfaRequiredResponse(__v[0]);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return __v[0];
|
|
341
|
+
}
|
|
342
|
+
__name(reviveStepUpStartResponse, "reviveStepUpStartResponse");
|
|
343
|
+
function reviveStepUpStartResponseOutput(raw) {
|
|
344
|
+
const __v = [
|
|
345
|
+
raw
|
|
346
|
+
];
|
|
347
|
+
{
|
|
348
|
+
const __d0 = __v[0]["result"];
|
|
349
|
+
if (__d0 === "mfa_required") {
|
|
350
|
+
reviveMfaRequiredResponseOutput(__v[0]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return __v[0];
|
|
354
|
+
}
|
|
355
|
+
__name(reviveStepUpStartResponseOutput, "reviveStepUpStartResponseOutput");
|
|
356
|
+
function reviveAuthenticationTokenResponse(raw) {
|
|
357
|
+
const __v = [
|
|
358
|
+
raw
|
|
359
|
+
];
|
|
360
|
+
{
|
|
361
|
+
const __d0 = __v[0]["result"];
|
|
362
|
+
if (__d0 === "mfa_required") {
|
|
363
|
+
reviveMfaRequiredResponse(__v[0]);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return __v[0];
|
|
367
|
+
}
|
|
368
|
+
__name(reviveAuthenticationTokenResponse, "reviveAuthenticationTokenResponse");
|
|
369
|
+
function reviveAuthenticationTokenResponseOutput(raw) {
|
|
370
|
+
const __v = [
|
|
371
|
+
raw
|
|
372
|
+
];
|
|
373
|
+
{
|
|
374
|
+
const __d0 = __v[0]["result"];
|
|
375
|
+
if (__d0 === "mfa_required") {
|
|
376
|
+
reviveMfaRequiredResponseOutput(__v[0]);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return __v[0];
|
|
380
|
+
}
|
|
381
|
+
__name(reviveAuthenticationTokenResponseOutput, "reviveAuthenticationTokenResponseOutput");
|
|
382
|
+
function reviveAuthenticationLoginStartResponse(raw) {
|
|
383
|
+
const __v = [
|
|
384
|
+
raw
|
|
385
|
+
];
|
|
386
|
+
{
|
|
387
|
+
const __d0 = __v[0]["grant_type"];
|
|
388
|
+
if (__d0 === "code") {
|
|
389
|
+
reviveCodeAuthenticationLoginStartResponse(__v[0]);
|
|
390
|
+
}
|
|
391
|
+
if (__d0 === "link") {
|
|
392
|
+
reviveLinkAuthenticationLoginStartResponse(__v[0]);
|
|
393
|
+
}
|
|
394
|
+
if (__d0 === "fido") {
|
|
395
|
+
reviveFidoAuthenticationLoginStartResponse(__v[0]);
|
|
396
|
+
}
|
|
397
|
+
if (__d0 === "oidc") {
|
|
398
|
+
reviveOidcAuthenticationLoginStartResponse(__v[0]);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return __v[0];
|
|
402
|
+
}
|
|
403
|
+
__name(reviveAuthenticationLoginStartResponse, "reviveAuthenticationLoginStartResponse");
|
|
404
|
+
function reviveFactorChallengeStartResponse(raw) {
|
|
405
|
+
const __v = [
|
|
406
|
+
raw
|
|
407
|
+
];
|
|
408
|
+
{
|
|
409
|
+
const __d0 = __v[0]["method"];
|
|
410
|
+
if (__d0 === "phone") {
|
|
411
|
+
reviveFactorChallengePhoneStartResponse(__v[0]);
|
|
412
|
+
}
|
|
413
|
+
if (__d0 === "fido") {
|
|
414
|
+
reviveFactorChallengeFidoStartResponse(__v[0]);
|
|
415
|
+
}
|
|
416
|
+
if (__d0 === "email") {
|
|
417
|
+
reviveFactorChallengeEmailStartResponse(__v[0]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return __v[0];
|
|
421
|
+
}
|
|
422
|
+
__name(reviveFactorChallengeStartResponse, "reviveFactorChallengeStartResponse");
|
|
423
|
+
function reviveFactorChallengeStartResponseOutput(raw) {
|
|
424
|
+
const __v = [
|
|
425
|
+
raw
|
|
426
|
+
];
|
|
427
|
+
{
|
|
428
|
+
const __d0 = __v[0]["method"];
|
|
429
|
+
if (__d0 === "phone") {
|
|
430
|
+
reviveFactorChallengePhoneStartResponseOutput(__v[0]);
|
|
431
|
+
}
|
|
432
|
+
if (__d0 === "fido") {
|
|
433
|
+
reviveFactorChallengeFidoStartResponseOutput(__v[0]);
|
|
434
|
+
}
|
|
435
|
+
if (__d0 === "email") {
|
|
436
|
+
reviveFactorChallengeEmailStartResponseOutput(__v[0]);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return __v[0];
|
|
440
|
+
}
|
|
441
|
+
__name(reviveFactorChallengeStartResponseOutput, "reviveFactorChallengeStartResponseOutput");
|
|
442
|
+
|
|
443
|
+
// src/authentication/types/registration.types.ts
|
|
444
|
+
import { Decimal as Decimal3 } from "decimal.js";
|
|
445
|
+
import { DateTime as DateTime3 } from "luxon";
|
|
446
|
+
Decimal3.set({
|
|
447
|
+
toExpNeg: -9e15,
|
|
448
|
+
toExpPos: 9e15
|
|
449
|
+
});
|
|
450
|
+
var __dt3 = /* @__PURE__ */ __name((v, path) => {
|
|
451
|
+
if (typeof v !== "string") {
|
|
452
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
453
|
+
}
|
|
454
|
+
const d = DateTime3.fromISO(v);
|
|
455
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
456
|
+
return d;
|
|
457
|
+
}, "__dt");
|
|
458
|
+
function revivePhoneFactorRegistrationResponse(raw) {
|
|
459
|
+
const __o0 = raw;
|
|
460
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "PhoneFactorRegistrationResponse.expiresAt");
|
|
461
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "PhoneFactorRegistrationResponse.issuedAt");
|
|
462
|
+
return raw;
|
|
463
|
+
}
|
|
464
|
+
__name(revivePhoneFactorRegistrationResponse, "revivePhoneFactorRegistrationResponse");
|
|
465
|
+
function reviveEmailFactorRegistrationResponse(raw) {
|
|
466
|
+
const __o0 = raw;
|
|
467
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "EmailFactorRegistrationResponse.expiresAt");
|
|
468
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "EmailFactorRegistrationResponse.issuedAt");
|
|
469
|
+
return raw;
|
|
470
|
+
}
|
|
471
|
+
__name(reviveEmailFactorRegistrationResponse, "reviveEmailFactorRegistrationResponse");
|
|
472
|
+
function reviveAuthenticatorFactorRegistrationResponse(raw) {
|
|
473
|
+
const __o0 = raw;
|
|
474
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "AuthenticatorFactorRegistrationResponse.expiresAt");
|
|
475
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "AuthenticatorFactorRegistrationResponse.issuedAt");
|
|
476
|
+
return raw;
|
|
477
|
+
}
|
|
478
|
+
__name(reviveAuthenticatorFactorRegistrationResponse, "reviveAuthenticatorFactorRegistrationResponse");
|
|
479
|
+
function reviveMfaEnrollPhoneStartResponse(raw) {
|
|
480
|
+
const __o0 = raw;
|
|
481
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "MfaEnrollPhoneStartResponse.expiresAt");
|
|
482
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "MfaEnrollPhoneStartResponse.issuedAt");
|
|
483
|
+
return raw;
|
|
484
|
+
}
|
|
485
|
+
__name(reviveMfaEnrollPhoneStartResponse, "reviveMfaEnrollPhoneStartResponse");
|
|
486
|
+
function reviveFidoFactorRegistrationResponse(raw) {
|
|
487
|
+
const __o0 = raw;
|
|
488
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "FidoFactorRegistrationResponse.expiresAt");
|
|
489
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "FidoFactorRegistrationResponse.issuedAt");
|
|
490
|
+
return raw;
|
|
491
|
+
}
|
|
492
|
+
__name(reviveFidoFactorRegistrationResponse, "reviveFidoFactorRegistrationResponse");
|
|
493
|
+
function reviveMfaEnrollFidoStartResponse(raw) {
|
|
494
|
+
const __o0 = raw;
|
|
495
|
+
__o0["expiresAt"] = __dt3(__o0["expiresAt"], "MfaEnrollFidoStartResponse.expiresAt");
|
|
496
|
+
__o0["issuedAt"] = __dt3(__o0["issuedAt"], "MfaEnrollFidoStartResponse.issuedAt");
|
|
497
|
+
return raw;
|
|
498
|
+
}
|
|
499
|
+
__name(reviveMfaEnrollFidoStartResponse, "reviveMfaEnrollFidoStartResponse");
|
|
500
|
+
function reviveAuthenticationFactorRegistrationResponse(raw) {
|
|
501
|
+
const __v = [
|
|
502
|
+
raw
|
|
503
|
+
];
|
|
504
|
+
{
|
|
505
|
+
const __d0 = __v[0]["method"];
|
|
506
|
+
if (__d0 === "phone") {
|
|
507
|
+
revivePhoneFactorRegistrationResponse(__v[0]);
|
|
508
|
+
}
|
|
509
|
+
if (__d0 === "email") {
|
|
510
|
+
reviveEmailFactorRegistrationResponse(__v[0]);
|
|
511
|
+
}
|
|
512
|
+
if (__d0 === "authenticator") {
|
|
513
|
+
reviveAuthenticatorFactorRegistrationResponse(__v[0]);
|
|
514
|
+
}
|
|
515
|
+
if (__d0 === "fido") {
|
|
516
|
+
reviveFidoFactorRegistrationResponse(__v[0]);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return __v[0];
|
|
520
|
+
}
|
|
521
|
+
__name(reviveAuthenticationFactorRegistrationResponse, "reviveAuthenticationFactorRegistrationResponse");
|
|
522
|
+
|
|
523
|
+
// src/authentication/authentication.factor.client.ts
|
|
524
|
+
var AuthenticationFactorsClient = class {
|
|
525
|
+
static {
|
|
526
|
+
__name(this, "AuthenticationFactorsClient");
|
|
527
|
+
}
|
|
528
|
+
fetch;
|
|
529
|
+
constructor(fetch2) {
|
|
530
|
+
this.fetch = fetch2;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* @name List factors
|
|
534
|
+
* @description List authentication factors
|
|
535
|
+
*/
|
|
536
|
+
async listFactors() {
|
|
537
|
+
const result = await this.fetch(`/auth/factors`, {
|
|
538
|
+
method: "GET"
|
|
539
|
+
});
|
|
540
|
+
return await parseJson(result);
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* @name Register factor
|
|
544
|
+
* @description Register an authentication factor
|
|
545
|
+
*/
|
|
546
|
+
async registerFactor(body) {
|
|
547
|
+
const result = await this.fetch(`/auth/factors/register`, {
|
|
548
|
+
method: "POST",
|
|
549
|
+
headers: {
|
|
550
|
+
"Content-Type": "application/json"
|
|
551
|
+
},
|
|
552
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
553
|
+
});
|
|
554
|
+
return reviveAuthenticationFactorRegistrationResponse(await parseJson(result));
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* @name Verify factor registration
|
|
558
|
+
* @description Verify an authentication factor registration
|
|
559
|
+
*/
|
|
560
|
+
async verifyFactorRegistration(body) {
|
|
561
|
+
const result = await this.fetch(`/auth/factors/verify`, {
|
|
562
|
+
method: "POST",
|
|
563
|
+
headers: {
|
|
564
|
+
"Content-Type": "application/json"
|
|
565
|
+
},
|
|
566
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
567
|
+
});
|
|
568
|
+
return await parseJson(result);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* @name Start factor challenge
|
|
572
|
+
* @description Issue a factor verification challenge for a pending MFA round. Authenticated via the short-lived `mfa_challenge_id` in the body, not by session — this is the only /auth/factors/* route that does not require an authenticated session.
|
|
573
|
+
*/
|
|
574
|
+
async startFactorChallenge(body) {
|
|
575
|
+
const result = await this.fetch(`/auth/factors/start`, {
|
|
576
|
+
method: "POST",
|
|
577
|
+
headers: {
|
|
578
|
+
"Content-Type": "application/json"
|
|
579
|
+
},
|
|
580
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
581
|
+
});
|
|
582
|
+
return reviveFactorChallengeStartResponseOutput(await parseJson(result));
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* @name Start MFA challenge
|
|
586
|
+
* @description Mint a fresh MFA challenge for the *current* authenticated session so the SPA can satisfy a `step_up_required` denial. Optionally filters eligible factors against an inbound `StepUpRequirement` hint. Returns `enrollment_required` when no enrolled factor matches the requirement so the SPA can route the user into enrollment instead of getting stuck.
|
|
587
|
+
*/
|
|
588
|
+
async startMFAChallenge(body) {
|
|
589
|
+
const result = await this.fetch(`/auth/mfa/start`, {
|
|
590
|
+
method: "POST",
|
|
591
|
+
headers: {
|
|
592
|
+
"Content-Type": "application/json"
|
|
593
|
+
},
|
|
594
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
595
|
+
});
|
|
596
|
+
return reviveStepUpStartResponseOutput(await parseJson(result));
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* @name Remove factor
|
|
600
|
+
* @description Remove one of the caller's own factors. Answered only for `authenticator` today, and only after a recent strong-factor verification: the same gate enrolment sits behind once a strong factor exists, so a stolen session cannot quietly switch the second factor off. Removing the last authenticator turns the sign-in challenge off for that account.
|
|
601
|
+
*/
|
|
602
|
+
async removeFactor(method, methodId) {
|
|
603
|
+
await this.fetch(`/auth/factors/${encodeURIComponent(method)}/${encodeURIComponent(methodId)}`, {
|
|
604
|
+
method: "DELETE"
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
// src/authentication/authentication.sessions.client.ts
|
|
610
|
+
var AuthenticationSessionsClient = class {
|
|
611
|
+
static {
|
|
612
|
+
__name(this, "AuthenticationSessionsClient");
|
|
613
|
+
}
|
|
614
|
+
fetch;
|
|
615
|
+
constructor(fetch2) {
|
|
616
|
+
this.fetch = fetch2;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @name Logout
|
|
620
|
+
* @description revoke the caller's current session (self sign-out). Deliberately carries no policy gate: signing out must always clear the browser's httpOnly refresh cookie, including for a caller whose access token has already expired. A 401 here would leave a 30-day refresh cookie behind that silently signs the user back in on the next page load. SessionsService revokes the session only when the caller is actually authenticated; an anonymous caller still gets 204 and a cleared cookie.
|
|
621
|
+
*/
|
|
622
|
+
async logout() {
|
|
623
|
+
await this.fetch(`/auth/logout`, {
|
|
624
|
+
method: "POST"
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @name Read session
|
|
629
|
+
* @description Who the caller is and which platform roles they hold
|
|
630
|
+
*/
|
|
631
|
+
async readSession() {
|
|
632
|
+
const result = await this.fetch(`/auth/session`, {
|
|
633
|
+
method: "GET"
|
|
634
|
+
});
|
|
635
|
+
return await parseJson(result);
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
// src/authentication/authentication.client.ts
|
|
640
|
+
var AuthenticationClient = class {
|
|
641
|
+
static {
|
|
642
|
+
__name(this, "AuthenticationClient");
|
|
643
|
+
}
|
|
644
|
+
fetch;
|
|
645
|
+
factors;
|
|
646
|
+
sessions;
|
|
647
|
+
constructor(fetch2) {
|
|
648
|
+
this.fetch = fetch2;
|
|
649
|
+
this.factors = new AuthenticationFactorsClient(fetch2);
|
|
650
|
+
this.sessions = new AuthenticationSessionsClient(fetch2);
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* @name Request token
|
|
654
|
+
* @description Request authenticated token
|
|
655
|
+
*/
|
|
656
|
+
async requestToken(body, options) {
|
|
657
|
+
const __contentType = options?.contentType ?? "application/x-www-form-urlencoded";
|
|
658
|
+
const __serialized = __contentType === "application/x-www-form-urlencoded" ? new URLSearchParams(body).toString() : JSON.stringify(body, bigIntReplacer);
|
|
659
|
+
const result = await this.fetch(`/auth/token`, {
|
|
660
|
+
method: "POST",
|
|
661
|
+
headers: {
|
|
662
|
+
"Content-Type": __contentType
|
|
663
|
+
},
|
|
664
|
+
body: __serialized
|
|
665
|
+
});
|
|
666
|
+
return reviveAuthenticationTokenResponseOutput(await parseJson(result));
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* @name Register login
|
|
670
|
+
* @description Register a new login
|
|
671
|
+
*/
|
|
672
|
+
async registerLogin(body) {
|
|
673
|
+
const result = await this.fetch(`/auth/login/register`, {
|
|
674
|
+
method: "POST",
|
|
675
|
+
headers: {
|
|
676
|
+
"Content-Type": "application/json"
|
|
677
|
+
},
|
|
678
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
679
|
+
});
|
|
680
|
+
return reviveAuthenticationRegistration(await parseJson(result));
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* @name Verify login registration
|
|
684
|
+
* @description Verify a login registration
|
|
685
|
+
*/
|
|
686
|
+
async verifyLoginRegistration(body) {
|
|
687
|
+
const result = await this.fetch(`/auth/login/verify`, {
|
|
688
|
+
method: "POST",
|
|
689
|
+
headers: {
|
|
690
|
+
"Content-Type": "application/json"
|
|
691
|
+
},
|
|
692
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
693
|
+
});
|
|
694
|
+
return await parseJson(result);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* @name Start login
|
|
698
|
+
* @description Start a password-less login process
|
|
699
|
+
*/
|
|
700
|
+
async startLogin(body) {
|
|
701
|
+
const result = await this.fetch(`/auth/login/start`, {
|
|
702
|
+
method: "POST",
|
|
703
|
+
headers: {
|
|
704
|
+
"Content-Type": "application/json"
|
|
705
|
+
},
|
|
706
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
707
|
+
});
|
|
708
|
+
return reviveAuthenticationLoginStartResponse(await parseJson(result));
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
// src/catalog/types/catalog.types.ts
|
|
713
|
+
import { Decimal as Decimal4 } from "decimal.js";
|
|
714
|
+
import { DateTime as DateTime4 } from "luxon";
|
|
715
|
+
Decimal4.set({
|
|
716
|
+
toExpNeg: -9e15,
|
|
717
|
+
toExpPos: 9e15
|
|
718
|
+
});
|
|
719
|
+
var __dt4 = /* @__PURE__ */ __name((v, path) => {
|
|
720
|
+
if (typeof v !== "string") {
|
|
721
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
722
|
+
}
|
|
723
|
+
const d = DateTime4.fromISO(v);
|
|
724
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
725
|
+
return d;
|
|
726
|
+
}, "__dt");
|
|
727
|
+
function reviveTrackBinding(raw) {
|
|
728
|
+
const __o0 = raw;
|
|
729
|
+
if (__o0["missingAt"] != null) {
|
|
730
|
+
__o0["missingAt"] = __dt4(__o0["missingAt"], "TrackBinding.missingAt");
|
|
731
|
+
}
|
|
732
|
+
if (__o0["lastSeenAt"] != null) {
|
|
733
|
+
__o0["lastSeenAt"] = __dt4(__o0["lastSeenAt"], "TrackBinding.lastSeenAt");
|
|
734
|
+
}
|
|
735
|
+
if (__o0["fetchedAt"] != null) {
|
|
736
|
+
__o0["fetchedAt"] = __dt4(__o0["fetchedAt"], "TrackBinding.fetchedAt");
|
|
737
|
+
}
|
|
738
|
+
if (__o0["lastServedAt"] != null) {
|
|
739
|
+
__o0["lastServedAt"] = __dt4(__o0["lastServedAt"], "TrackBinding.lastServedAt");
|
|
740
|
+
}
|
|
741
|
+
if (__o0["nextAttemptAt"] != null) {
|
|
742
|
+
__o0["nextAttemptAt"] = __dt4(__o0["nextAttemptAt"], "TrackBinding.nextAttemptAt");
|
|
743
|
+
}
|
|
744
|
+
return raw;
|
|
745
|
+
}
|
|
746
|
+
__name(reviveTrackBinding, "reviveTrackBinding");
|
|
747
|
+
function reviveTrackAnalysis(raw) {
|
|
748
|
+
const __o0 = raw;
|
|
749
|
+
if (__o0["analyzedAt"] != null) {
|
|
750
|
+
__o0["analyzedAt"] = __dt4(__o0["analyzedAt"], "TrackAnalysis.analyzedAt");
|
|
751
|
+
}
|
|
752
|
+
if (__o0["failedAt"] != null) {
|
|
753
|
+
__o0["failedAt"] = __dt4(__o0["failedAt"], "TrackAnalysis.failedAt");
|
|
754
|
+
}
|
|
755
|
+
return raw;
|
|
756
|
+
}
|
|
757
|
+
__name(reviveTrackAnalysis, "reviveTrackAnalysis");
|
|
758
|
+
function reviveTrackPlay(raw) {
|
|
759
|
+
const __o0 = raw;
|
|
760
|
+
__o0["airedAt"] = __dt4(__o0["airedAt"], "TrackPlay.airedAt");
|
|
761
|
+
return raw;
|
|
762
|
+
}
|
|
763
|
+
__name(reviveTrackPlay, "reviveTrackPlay");
|
|
764
|
+
function reviveFactClaim(raw) {
|
|
765
|
+
const __o0 = raw;
|
|
766
|
+
if (__o0["lastUsedAt"] != null) {
|
|
767
|
+
__o0["lastUsedAt"] = __dt4(__o0["lastUsedAt"], "FactClaim.lastUsedAt");
|
|
768
|
+
}
|
|
769
|
+
return raw;
|
|
770
|
+
}
|
|
771
|
+
__name(reviveFactClaim, "reviveFactClaim");
|
|
772
|
+
function reviveTrackDetail(raw) {
|
|
773
|
+
const __o0 = raw;
|
|
774
|
+
{
|
|
775
|
+
const __a1 = __o0["bindings"];
|
|
776
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
777
|
+
reviveTrackBinding(__a1[__i2]);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
if (__o0["analysis"] != null) {
|
|
781
|
+
reviveTrackAnalysis(__o0["analysis"]);
|
|
782
|
+
}
|
|
783
|
+
{
|
|
784
|
+
const __a3 = __o0["plays"];
|
|
785
|
+
for (let __i4 = 0; __i4 < __a3.length; __i4++) {
|
|
786
|
+
reviveTrackPlay(__a3[__i4]);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return raw;
|
|
790
|
+
}
|
|
791
|
+
__name(reviveTrackDetail, "reviveTrackDetail");
|
|
792
|
+
function reviveTrackEnrichmentSource(raw) {
|
|
793
|
+
const __o0 = raw;
|
|
794
|
+
__o0["fetchedAt"] = __dt4(__o0["fetchedAt"], "TrackEnrichmentSource.fetchedAt");
|
|
795
|
+
if (__o0["expiresAt"] != null) {
|
|
796
|
+
__o0["expiresAt"] = __dt4(__o0["expiresAt"], "TrackEnrichmentSource.expiresAt");
|
|
797
|
+
}
|
|
798
|
+
return raw;
|
|
799
|
+
}
|
|
800
|
+
__name(reviveTrackEnrichmentSource, "reviveTrackEnrichmentSource");
|
|
801
|
+
function reviveArtistEnrichmentSource(raw) {
|
|
802
|
+
const __o0 = raw;
|
|
803
|
+
__o0["fetchedAt"] = __dt4(__o0["fetchedAt"], "ArtistEnrichmentSource.fetchedAt");
|
|
804
|
+
if (__o0["expiresAt"] != null) {
|
|
805
|
+
__o0["expiresAt"] = __dt4(__o0["expiresAt"], "ArtistEnrichmentSource.expiresAt");
|
|
806
|
+
}
|
|
807
|
+
return raw;
|
|
808
|
+
}
|
|
809
|
+
__name(reviveArtistEnrichmentSource, "reviveArtistEnrichmentSource");
|
|
810
|
+
function reviveAlbumEnrichmentSource(raw) {
|
|
811
|
+
const __o0 = raw;
|
|
812
|
+
__o0["fetchedAt"] = __dt4(__o0["fetchedAt"], "AlbumEnrichmentSource.fetchedAt");
|
|
813
|
+
if (__o0["expiresAt"] != null) {
|
|
814
|
+
__o0["expiresAt"] = __dt4(__o0["expiresAt"], "AlbumEnrichmentSource.expiresAt");
|
|
815
|
+
}
|
|
816
|
+
return raw;
|
|
817
|
+
}
|
|
818
|
+
__name(reviveAlbumEnrichmentSource, "reviveAlbumEnrichmentSource");
|
|
819
|
+
function reviveTrackEnrichmentDetail(raw) {
|
|
820
|
+
const __o0 = raw;
|
|
821
|
+
{
|
|
822
|
+
const __a1 = __o0["sources"];
|
|
823
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
824
|
+
reviveTrackEnrichmentSource(__a1[__i2]);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
{
|
|
828
|
+
const __a3 = __o0["claims"];
|
|
829
|
+
for (let __i4 = 0; __i4 < __a3.length; __i4++) {
|
|
830
|
+
reviveFactClaim(__a3[__i4]);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return raw;
|
|
834
|
+
}
|
|
835
|
+
__name(reviveTrackEnrichmentDetail, "reviveTrackEnrichmentDetail");
|
|
836
|
+
function reviveArtistEnrichmentDetail(raw) {
|
|
837
|
+
const __o0 = raw;
|
|
838
|
+
{
|
|
839
|
+
const __a1 = __o0["sources"];
|
|
840
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
841
|
+
reviveArtistEnrichmentSource(__a1[__i2]);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
{
|
|
845
|
+
const __a3 = __o0["claims"];
|
|
846
|
+
for (let __i4 = 0; __i4 < __a3.length; __i4++) {
|
|
847
|
+
reviveFactClaim(__a3[__i4]);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return raw;
|
|
851
|
+
}
|
|
852
|
+
__name(reviveArtistEnrichmentDetail, "reviveArtistEnrichmentDetail");
|
|
853
|
+
function reviveAlbumEnrichmentDetail(raw) {
|
|
854
|
+
const __o0 = raw;
|
|
855
|
+
{
|
|
856
|
+
const __a1 = __o0["sources"];
|
|
857
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
858
|
+
reviveAlbumEnrichmentSource(__a1[__i2]);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
{
|
|
862
|
+
const __a3 = __o0["claims"];
|
|
863
|
+
for (let __i4 = 0; __i4 < __a3.length; __i4++) {
|
|
864
|
+
reviveFactClaim(__a3[__i4]);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return raw;
|
|
868
|
+
}
|
|
869
|
+
__name(reviveAlbumEnrichmentDetail, "reviveAlbumEnrichmentDetail");
|
|
870
|
+
|
|
871
|
+
// src/catalog/catalog.client.ts
|
|
872
|
+
var CatalogClient = class {
|
|
873
|
+
static {
|
|
874
|
+
__name(this, "CatalogClient");
|
|
875
|
+
}
|
|
876
|
+
fetch;
|
|
877
|
+
constructor(fetch2) {
|
|
878
|
+
this.fetch = fetch2;
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* @name List artists
|
|
882
|
+
* @description Every artist the station has ingested, ordered by name
|
|
883
|
+
*/
|
|
884
|
+
async listArtists(query) {
|
|
885
|
+
const qs = buildQueryString(query);
|
|
886
|
+
const result = await this.fetch(`/catalog/artists${qs}`, {
|
|
887
|
+
method: "GET"
|
|
888
|
+
});
|
|
889
|
+
return await parseJson(result);
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* @name Get artist
|
|
893
|
+
* @description One artist. 404s on an id that was merged away, since reads never return merged rows
|
|
894
|
+
*/
|
|
895
|
+
async getArtist(id) {
|
|
896
|
+
const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}`, {
|
|
897
|
+
method: "GET"
|
|
898
|
+
});
|
|
899
|
+
return await parseJson(result);
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* @name Get artist enrichment
|
|
903
|
+
* @description What every enrichment provider said about this artist, and when each of them said it
|
|
904
|
+
*/
|
|
905
|
+
async getArtistEnrichment(id) {
|
|
906
|
+
const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/enrichment`, {
|
|
907
|
+
method: "GET"
|
|
908
|
+
});
|
|
909
|
+
return reviveArtistEnrichmentDetail(await parseJson(result));
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* @name List artist albums
|
|
913
|
+
* @description The albums credited to one artist
|
|
914
|
+
*/
|
|
915
|
+
async listArtistAlbums(id, query) {
|
|
916
|
+
const qs = buildQueryString(query);
|
|
917
|
+
const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/albums${qs}`, {
|
|
918
|
+
method: "GET"
|
|
919
|
+
});
|
|
920
|
+
return await parseJson(result);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @name Rate artist
|
|
924
|
+
* @description What the station thinks of this artist. A dislike here excludes every record they are credited on
|
|
925
|
+
*/
|
|
926
|
+
async rateArtist(id, body) {
|
|
927
|
+
const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/rating`, {
|
|
928
|
+
method: "PUT",
|
|
929
|
+
headers: {
|
|
930
|
+
"Content-Type": "application/json"
|
|
931
|
+
},
|
|
932
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
933
|
+
});
|
|
934
|
+
return await parseJson(result);
|
|
935
|
+
}
|
|
936
|
+
/** @name List albums */
|
|
937
|
+
async listAlbums(query) {
|
|
938
|
+
const qs = buildQueryString(query);
|
|
939
|
+
const result = await this.fetch(`/catalog/albums${qs}`, {
|
|
940
|
+
method: "GET"
|
|
941
|
+
});
|
|
942
|
+
return await parseJson(result);
|
|
943
|
+
}
|
|
944
|
+
/** @name Get album */
|
|
945
|
+
async getAlbum(id) {
|
|
946
|
+
const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}`, {
|
|
947
|
+
method: "GET"
|
|
948
|
+
});
|
|
949
|
+
return await parseJson(result);
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* @name Get album enrichment
|
|
953
|
+
* @description The record's own enrichment: the label, pressing and cover belong to the release, not to a track on it
|
|
954
|
+
*/
|
|
955
|
+
async getAlbumEnrichment(id) {
|
|
956
|
+
const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/enrichment`, {
|
|
957
|
+
method: "GET"
|
|
958
|
+
});
|
|
959
|
+
return reviveAlbumEnrichmentDetail(await parseJson(result));
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* @name List album tracks
|
|
963
|
+
* @description One album's tracks
|
|
964
|
+
*/
|
|
965
|
+
async listAlbumTracks(id, query) {
|
|
966
|
+
const qs = buildQueryString(query);
|
|
967
|
+
const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/tracks${qs}`, {
|
|
968
|
+
method: "GET"
|
|
969
|
+
});
|
|
970
|
+
return await parseJson(result);
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* @name Rate album
|
|
974
|
+
* @description What the station thinks of this record. A dislike here excludes every track on it
|
|
975
|
+
*/
|
|
976
|
+
async rateAlbum(id, body) {
|
|
977
|
+
const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/rating`, {
|
|
978
|
+
method: "PUT",
|
|
979
|
+
headers: {
|
|
980
|
+
"Content-Type": "application/json"
|
|
981
|
+
},
|
|
982
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
983
|
+
});
|
|
984
|
+
return await parseJson(result);
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* @name Get track
|
|
988
|
+
* @description One record and everything it has accumulated: its copies, its bytes, its measurement, what it has aired
|
|
989
|
+
*/
|
|
990
|
+
async getTrack(id) {
|
|
991
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}`, {
|
|
992
|
+
method: "GET"
|
|
993
|
+
});
|
|
994
|
+
return reviveTrackDetail(await parseJson(result));
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* @name Clear track audio
|
|
998
|
+
* @description Drop the station's own copies of this record. The next play fetches them again
|
|
999
|
+
*/
|
|
1000
|
+
async clearTrackAudio(id) {
|
|
1001
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/audio`, {
|
|
1002
|
+
method: "DELETE"
|
|
1003
|
+
});
|
|
1004
|
+
return await parseJson(result);
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* @name Clear track analysis
|
|
1008
|
+
* @description Forget the measurement, so the walk takes it again
|
|
1009
|
+
*/
|
|
1010
|
+
async clearTrackAnalysis(id) {
|
|
1011
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/analysis`, {
|
|
1012
|
+
method: "DELETE"
|
|
1013
|
+
});
|
|
1014
|
+
return await parseJson(result);
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* @name Retry track audio
|
|
1018
|
+
* @description Try this record's copies again now, rather than when the backoff says
|
|
1019
|
+
*/
|
|
1020
|
+
async retryTrackAudio(id) {
|
|
1021
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/retry`, {
|
|
1022
|
+
method: "POST"
|
|
1023
|
+
});
|
|
1024
|
+
return await parseJson(result);
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* @name Offer track copies again
|
|
1028
|
+
* @description Put copies a provider refused back on offer, and clear their backoff so they are tried now
|
|
1029
|
+
*/
|
|
1030
|
+
async offerTrackCopiesAgain(id) {
|
|
1031
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/offer`, {
|
|
1032
|
+
method: "POST"
|
|
1033
|
+
});
|
|
1034
|
+
return await parseJson(result);
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* @name Get track enrichment
|
|
1038
|
+
* @description What the providers said about one recording, including everything no canonical column holds
|
|
1039
|
+
*/
|
|
1040
|
+
async getTrackEnrichment(id) {
|
|
1041
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment`, {
|
|
1042
|
+
method: "GET"
|
|
1043
|
+
});
|
|
1044
|
+
return reviveTrackEnrichmentDetail(await parseJson(result));
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* @name Clear track enrichment
|
|
1048
|
+
* @description Forget what the providers said, so the enrichment pass asks again
|
|
1049
|
+
*/
|
|
1050
|
+
async clearTrackEnrichment(id, query) {
|
|
1051
|
+
const qs = buildQueryString(query);
|
|
1052
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment${qs}`, {
|
|
1053
|
+
method: "DELETE"
|
|
1054
|
+
});
|
|
1055
|
+
return await parseJson(result);
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* @name List tracks
|
|
1059
|
+
* @description Every track, flat. The only way to answer "do we have this song?" without knowing its artist
|
|
1060
|
+
*/
|
|
1061
|
+
async listTracks(query) {
|
|
1062
|
+
const qs = buildQueryString(query);
|
|
1063
|
+
const result = await this.fetch(`/catalog/tracks${qs}`, {
|
|
1064
|
+
method: "GET"
|
|
1065
|
+
});
|
|
1066
|
+
return await parseJson(result);
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* @name Rate track
|
|
1070
|
+
* @description What the station thinks of this song, which is the narrowest thing an opinion can be about
|
|
1071
|
+
*/
|
|
1072
|
+
async rateTrack(id, body) {
|
|
1073
|
+
const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/rating`, {
|
|
1074
|
+
method: "PUT",
|
|
1075
|
+
headers: {
|
|
1076
|
+
"Content-Type": "application/json"
|
|
1077
|
+
},
|
|
1078
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1079
|
+
});
|
|
1080
|
+
return await parseJson(result);
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
// src/charts/charts.client.ts
|
|
1085
|
+
var ChartsClient = class {
|
|
1086
|
+
static {
|
|
1087
|
+
__name(this, "ChartsClient");
|
|
1088
|
+
}
|
|
1089
|
+
fetch;
|
|
1090
|
+
constructor(fetch2) {
|
|
1091
|
+
this.fetch = fetch2;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* @name List charts
|
|
1095
|
+
* @description Every chart every installed chart plugin currently offers
|
|
1096
|
+
*/
|
|
1097
|
+
async listCharts() {
|
|
1098
|
+
const result = await this.fetch(`/charts`, {
|
|
1099
|
+
method: "GET"
|
|
1100
|
+
});
|
|
1101
|
+
return await parseJson(result);
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* @name Read chart
|
|
1105
|
+
* @description One chart's records, ranked
|
|
1106
|
+
*/
|
|
1107
|
+
async readChart(id, query) {
|
|
1108
|
+
const qs = buildQueryString(query);
|
|
1109
|
+
const result = await this.fetch(`/charts/${encodeURIComponent(id)}${qs}`, {
|
|
1110
|
+
method: "GET"
|
|
1111
|
+
});
|
|
1112
|
+
return await parseJson(result);
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
// src/director/director.client.ts
|
|
1117
|
+
var DirectorClient = class {
|
|
1118
|
+
static {
|
|
1119
|
+
__name(this, "DirectorClient");
|
|
1120
|
+
}
|
|
1121
|
+
fetch;
|
|
1122
|
+
constructor(fetch2) {
|
|
1123
|
+
this.fetch = fetch2;
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* @name List clock bands
|
|
1127
|
+
* @description Every band on this station's clock, including the ones switched off, in the operator's own order
|
|
1128
|
+
*/
|
|
1129
|
+
async listClockBands() {
|
|
1130
|
+
const result = await this.fetch(`/clock/bands`, {
|
|
1131
|
+
method: "GET"
|
|
1132
|
+
});
|
|
1133
|
+
return await parseJson(result);
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* @name Create clock band
|
|
1137
|
+
* @description Adds a band. It claims its first boundary on the next commit pass
|
|
1138
|
+
*/
|
|
1139
|
+
async createClockBand(body) {
|
|
1140
|
+
const result = await this.fetch(`/clock/bands`, {
|
|
1141
|
+
method: "POST",
|
|
1142
|
+
headers: {
|
|
1143
|
+
"Content-Type": "application/json"
|
|
1144
|
+
},
|
|
1145
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1146
|
+
});
|
|
1147
|
+
return await parseJson(result);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* @name Update clock band
|
|
1151
|
+
* @description Rewrites one band. Breaks it has already planted stay where they are: the running order is the memory
|
|
1152
|
+
*/
|
|
1153
|
+
async updateClockBand(id, body) {
|
|
1154
|
+
const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, {
|
|
1155
|
+
method: "PUT",
|
|
1156
|
+
headers: {
|
|
1157
|
+
"Content-Type": "application/json"
|
|
1158
|
+
},
|
|
1159
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1160
|
+
});
|
|
1161
|
+
return await parseJson(result);
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* @name Delete clock band
|
|
1165
|
+
* @description Removes a band, which costs it the boundaries it had not claimed yet and nothing else
|
|
1166
|
+
*/
|
|
1167
|
+
async deleteClockBand(id) {
|
|
1168
|
+
const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, {
|
|
1169
|
+
method: "DELETE"
|
|
1170
|
+
});
|
|
1171
|
+
return await parseJson(result);
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* @name Get station air
|
|
1175
|
+
* @description What the station is airing, and whether it is driving at all
|
|
1176
|
+
*/
|
|
1177
|
+
async getStationAir() {
|
|
1178
|
+
const result = await this.fetch(`/director/air`, {
|
|
1179
|
+
method: "GET"
|
|
1180
|
+
});
|
|
1181
|
+
return await parseJson(result);
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* @name Put the station on air
|
|
1185
|
+
* @description Puts the station on air, building the running order from a playlist read at this moment. What is playing finishes: changing the programming is not a reason to cut a listener off mid-track
|
|
1186
|
+
*/
|
|
1187
|
+
async putTheStationOnAir(body) {
|
|
1188
|
+
const result = await this.fetch(`/director/air`, {
|
|
1189
|
+
method: "POST",
|
|
1190
|
+
headers: {
|
|
1191
|
+
"Content-Type": "application/json"
|
|
1192
|
+
},
|
|
1193
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1194
|
+
});
|
|
1195
|
+
return await parseJson(result);
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* @name Set the air mode
|
|
1199
|
+
* @description Changes what puts the station on air: only while somebody is listening, or whenever there is a programme. Takes effect at once rather than at the next boundary
|
|
1200
|
+
*/
|
|
1201
|
+
async setTheAirMode(body) {
|
|
1202
|
+
const result = await this.fetch(`/director/air`, {
|
|
1203
|
+
method: "PATCH",
|
|
1204
|
+
headers: {
|
|
1205
|
+
"Content-Type": "application/json"
|
|
1206
|
+
},
|
|
1207
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1208
|
+
});
|
|
1209
|
+
return await parseJson(result);
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* @name Get the running order
|
|
1213
|
+
* @description The live running order, item by item, each saying where it has got to
|
|
1214
|
+
*/
|
|
1215
|
+
async getTheRunningOrder() {
|
|
1216
|
+
const result = await this.fetch(`/director/air/order`, {
|
|
1217
|
+
method: "GET"
|
|
1218
|
+
});
|
|
1219
|
+
return await parseJson(result);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* @name Recast the broadcast
|
|
1223
|
+
* @description Changes who is presenting this broadcast. Breaks already written for it in the outgoing character are written again in the new one
|
|
1224
|
+
*/
|
|
1225
|
+
async recastTheBroadcast(body) {
|
|
1226
|
+
const result = await this.fetch(`/director/air/persona`, {
|
|
1227
|
+
method: "PUT",
|
|
1228
|
+
headers: {
|
|
1229
|
+
"Content-Type": "application/json"
|
|
1230
|
+
},
|
|
1231
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1232
|
+
});
|
|
1233
|
+
return await parseJson(result);
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1236
|
+
* @name Extend the running order
|
|
1237
|
+
* @description Queues a refill and returns at once. Generating a set walks the catalog, and an operator pressing a button should not be held open through it
|
|
1238
|
+
*/
|
|
1239
|
+
async extendTheRunningOrder(body) {
|
|
1240
|
+
await this.fetch(`/director/air/extend`, {
|
|
1241
|
+
method: "POST",
|
|
1242
|
+
headers: {
|
|
1243
|
+
"Content-Type": "application/json"
|
|
1244
|
+
},
|
|
1245
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* @name Replan the running order
|
|
1250
|
+
* @description Queues a fresh set for everything the player is not already holding, and swaps it in once it exists. The old tail keeps playing until then, because emptying the running order first would take the station off air while the model was still choosing
|
|
1251
|
+
*/
|
|
1252
|
+
async replanTheRunningOrder(body) {
|
|
1253
|
+
await this.fetch(`/director/air/replan`, {
|
|
1254
|
+
method: "POST",
|
|
1255
|
+
headers: {
|
|
1256
|
+
"Content-Type": "application/json"
|
|
1257
|
+
},
|
|
1258
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* @name Hold the station against the schedule
|
|
1263
|
+
* @description Holds the running order against the schedule, so a block boundary does not take back what an operator put on. A takeover is otherwise stamped with whichever slot was in force and is replaced when that block ends, which is correct and gives nobody any warning
|
|
1264
|
+
*/
|
|
1265
|
+
async holdTheStationAgainstTheSchedule(body) {
|
|
1266
|
+
const result = await this.fetch(`/director/air/hold`, {
|
|
1267
|
+
method: "PATCH",
|
|
1268
|
+
headers: {
|
|
1269
|
+
"Content-Type": "application/json"
|
|
1270
|
+
},
|
|
1271
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1272
|
+
});
|
|
1273
|
+
return await parseJson(result);
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* @name Release the station to the schedule
|
|
1277
|
+
* @description Releases a hold, so the next block boundary changes the station over as it ordinarily would. A station with no hold is unchanged rather than refused
|
|
1278
|
+
*/
|
|
1279
|
+
async releaseTheStationToTheSchedule() {
|
|
1280
|
+
const result = await this.fetch(`/director/air/hold`, {
|
|
1281
|
+
method: "DELETE"
|
|
1282
|
+
});
|
|
1283
|
+
return await parseJson(result);
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* @name Shuffle the running order
|
|
1287
|
+
* @description Shuffles the records not yet handed to the player, and plants the breaks again around the new sequence. The head is already in the player's hands and is left alone
|
|
1288
|
+
*/
|
|
1289
|
+
async shuffleTheRunningOrder() {
|
|
1290
|
+
const result = await this.fetch(`/director/air/shuffle`, {
|
|
1291
|
+
method: "POST"
|
|
1292
|
+
});
|
|
1293
|
+
return await parseJson(result);
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* @name Add a segment to the running order
|
|
1297
|
+
* @description Puts something the station says into the running order. A segment with no audio yet is refused here rather than accepted and skipped when it comes round, so an operator is told why it cannot play
|
|
1298
|
+
*/
|
|
1299
|
+
async addASegmentToTheRunningOrder(body) {
|
|
1300
|
+
const result = await this.fetch(`/director/air/segments`, {
|
|
1301
|
+
method: "POST",
|
|
1302
|
+
headers: {
|
|
1303
|
+
"Content-Type": "application/json"
|
|
1304
|
+
},
|
|
1305
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1306
|
+
});
|
|
1307
|
+
return await parseJson(result);
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* @name Add a record to the running order
|
|
1311
|
+
* @description Puts a catalog record into the running order. A record whose audio is not local yet is refused here rather than accepted and held or skipped when its slot comes round, so an operator asking for a specific one is told why it cannot play. What makes this worth having on its own is undo: dropping an item only ever marks a segment, but a track is spliced out of the order entirely, so nothing could put one back until this existed
|
|
1312
|
+
*/
|
|
1313
|
+
async addARecordToTheRunningOrder(body) {
|
|
1314
|
+
const result = await this.fetch(`/director/air/tracks`, {
|
|
1315
|
+
method: "POST",
|
|
1316
|
+
headers: {
|
|
1317
|
+
"Content-Type": "application/json"
|
|
1318
|
+
},
|
|
1319
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1320
|
+
});
|
|
1321
|
+
return await parseJson(result);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* @name Move a running order item
|
|
1325
|
+
* @description Moves an item. A position already handed to the player is refused rather than clamped
|
|
1326
|
+
*/
|
|
1327
|
+
async moveARunningOrderItem(itemId, body) {
|
|
1328
|
+
const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, {
|
|
1329
|
+
method: "PATCH",
|
|
1330
|
+
headers: {
|
|
1331
|
+
"Content-Type": "application/json"
|
|
1332
|
+
},
|
|
1333
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1334
|
+
});
|
|
1335
|
+
return await parseJson(result);
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* @name Remove a running order item
|
|
1339
|
+
* @description Drops an item that has not been handed to the player yet
|
|
1340
|
+
*/
|
|
1341
|
+
async removeARunningOrderItem(itemId) {
|
|
1342
|
+
const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, {
|
|
1343
|
+
method: "DELETE"
|
|
1344
|
+
});
|
|
1345
|
+
return await parseJson(result);
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
// src/history/types/history.types.ts
|
|
1350
|
+
import { Decimal as Decimal5 } from "decimal.js";
|
|
1351
|
+
import { DateTime as DateTime5 } from "luxon";
|
|
1352
|
+
Decimal5.set({
|
|
1353
|
+
toExpNeg: -9e15,
|
|
1354
|
+
toExpPos: 9e15
|
|
1355
|
+
});
|
|
1356
|
+
var __dt5 = /* @__PURE__ */ __name((v, path) => {
|
|
1357
|
+
if (typeof v !== "string") {
|
|
1358
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
1359
|
+
}
|
|
1360
|
+
const d = DateTime5.fromISO(v);
|
|
1361
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
1362
|
+
return d;
|
|
1363
|
+
}, "__dt");
|
|
1364
|
+
function reviveHistoryEntry(raw) {
|
|
1365
|
+
const __o0 = raw;
|
|
1366
|
+
__o0["airedAt"] = __dt5(__o0["airedAt"], "HistoryEntry.airedAt");
|
|
1367
|
+
return raw;
|
|
1368
|
+
}
|
|
1369
|
+
__name(reviveHistoryEntry, "reviveHistoryEntry");
|
|
1370
|
+
function reviveHistoryPage(raw) {
|
|
1371
|
+
const __o0 = raw;
|
|
1372
|
+
{
|
|
1373
|
+
const __a1 = __o0["entries"];
|
|
1374
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
1375
|
+
reviveHistoryEntry(__a1[__i2]);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return raw;
|
|
1379
|
+
}
|
|
1380
|
+
__name(reviveHistoryPage, "reviveHistoryPage");
|
|
1381
|
+
|
|
1382
|
+
// src/history/history.client.ts
|
|
1383
|
+
var HistoryClient = class {
|
|
1384
|
+
static {
|
|
1385
|
+
__name(this, "HistoryClient");
|
|
1386
|
+
}
|
|
1387
|
+
fetch;
|
|
1388
|
+
constructor(fetch2) {
|
|
1389
|
+
this.fetch = fetch2;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* @name Read history
|
|
1393
|
+
* @description What the station played, newest first, one page at a time
|
|
1394
|
+
*/
|
|
1395
|
+
async readHistory(query) {
|
|
1396
|
+
const qs = buildQueryString(query);
|
|
1397
|
+
const result = await this.fetch(`/history${qs}`, {
|
|
1398
|
+
method: "GET"
|
|
1399
|
+
});
|
|
1400
|
+
return reviveHistoryPage(await parseJson(result));
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
// src/news/news.client.ts
|
|
1405
|
+
var NewsClient = class {
|
|
1406
|
+
static {
|
|
1407
|
+
__name(this, "NewsClient");
|
|
1408
|
+
}
|
|
1409
|
+
fetch;
|
|
1410
|
+
constructor(fetch2) {
|
|
1411
|
+
this.fetch = fetch2;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* @name List feeds
|
|
1415
|
+
* @description Every feed every installed news plugin currently offers
|
|
1416
|
+
*/
|
|
1417
|
+
async listFeeds() {
|
|
1418
|
+
const result = await this.fetch(`/news/feeds`, {
|
|
1419
|
+
method: "GET"
|
|
1420
|
+
});
|
|
1421
|
+
return await parseJson(result);
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* @name Read news
|
|
1425
|
+
* @description Published entries, newest first
|
|
1426
|
+
*/
|
|
1427
|
+
async readNews(query) {
|
|
1428
|
+
const qs = buildQueryString(query);
|
|
1429
|
+
const result = await this.fetch(`/news${qs}`, {
|
|
1430
|
+
method: "GET"
|
|
1431
|
+
});
|
|
1432
|
+
return await parseJson(result);
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
// src/nowplaying/nowplaying.client.ts
|
|
1437
|
+
var NowplayingClient = class {
|
|
1438
|
+
static {
|
|
1439
|
+
__name(this, "NowplayingClient");
|
|
1440
|
+
}
|
|
1441
|
+
fetch;
|
|
1442
|
+
constructor(fetch2) {
|
|
1443
|
+
this.fetch = fetch2;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* @name Get now playing
|
|
1447
|
+
* @description What is on air right now. Answers 200 with `onAir: false` when the station is quiet, so a device polling this treats silence as an answer rather than an error
|
|
1448
|
+
*/
|
|
1449
|
+
async getNowPlaying() {
|
|
1450
|
+
const result = await this.fetch(`/nowplaying`, {
|
|
1451
|
+
method: "GET"
|
|
1452
|
+
});
|
|
1453
|
+
return await parseJson(result);
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
// src/onboarding/onboarding.client.ts
|
|
1458
|
+
var OnboardingClient = class {
|
|
1459
|
+
static {
|
|
1460
|
+
__name(this, "OnboardingClient");
|
|
1461
|
+
}
|
|
1462
|
+
fetch;
|
|
1463
|
+
constructor(fetch2) {
|
|
1464
|
+
this.fetch = fetch2;
|
|
1465
|
+
}
|
|
1466
|
+
/** @name Get Onboarding Requirements */
|
|
1467
|
+
async getOnboardingRequirements() {
|
|
1468
|
+
const result = await this.fetch(`/onboarding`, {
|
|
1469
|
+
method: "GET"
|
|
1470
|
+
});
|
|
1471
|
+
return await parseJson(result);
|
|
1472
|
+
}
|
|
1473
|
+
/** @name Submit Onboarding Requirement */
|
|
1474
|
+
async submitOnboardingRequirement(body) {
|
|
1475
|
+
const result = await this.fetch(`/onboarding`, {
|
|
1476
|
+
method: "POST",
|
|
1477
|
+
headers: {
|
|
1478
|
+
"Content-Type": "application/json"
|
|
1479
|
+
},
|
|
1480
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1481
|
+
});
|
|
1482
|
+
return await parseJson(result);
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
|
|
1486
|
+
// src/personas/personas.client.ts
|
|
1487
|
+
var PersonasClient = class {
|
|
1488
|
+
static {
|
|
1489
|
+
__name(this, "PersonasClient");
|
|
1490
|
+
}
|
|
1491
|
+
fetch;
|
|
1492
|
+
constructor(fetch2) {
|
|
1493
|
+
this.fetch = fetch2;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* @name List persona auditions
|
|
1497
|
+
* @description Every audition of this character, newest first, without their breaks
|
|
1498
|
+
*/
|
|
1499
|
+
async listPersonaAuditions(id) {
|
|
1500
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, {
|
|
1501
|
+
method: "GET"
|
|
1502
|
+
});
|
|
1503
|
+
return await parseJson(result);
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* @name Start persona audition
|
|
1507
|
+
* @description Asks the station to put this character through a playlist. It is queued, not written
|
|
1508
|
+
*/
|
|
1509
|
+
async startPersonaAudition(id, body) {
|
|
1510
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, {
|
|
1511
|
+
method: "POST",
|
|
1512
|
+
headers: {
|
|
1513
|
+
"Content-Type": "application/json"
|
|
1514
|
+
},
|
|
1515
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1516
|
+
});
|
|
1517
|
+
return await parseJson(result);
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* @name Get persona audition
|
|
1521
|
+
* @description One audition with every break it has written so far, in order
|
|
1522
|
+
*/
|
|
1523
|
+
async getPersonaAudition(id, auditionId) {
|
|
1524
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}`, {
|
|
1525
|
+
method: "GET"
|
|
1526
|
+
});
|
|
1527
|
+
return await parseJson(result);
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* @name Cancel persona audition
|
|
1531
|
+
* @description Stops an audition where it stands, keeping the breaks it has already written
|
|
1532
|
+
*/
|
|
1533
|
+
async cancelPersonaAudition(id, auditionId) {
|
|
1534
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}/cancel`, {
|
|
1535
|
+
method: "POST"
|
|
1536
|
+
});
|
|
1537
|
+
return await parseJson(result);
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* @name List personas
|
|
1541
|
+
* @description Every persona this station has, oldest first
|
|
1542
|
+
*/
|
|
1543
|
+
async listPersonas() {
|
|
1544
|
+
const result = await this.fetch(`/personas`, {
|
|
1545
|
+
method: "GET"
|
|
1546
|
+
});
|
|
1547
|
+
return await parseJson(result);
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* @name Create persona
|
|
1551
|
+
* @description Writes a new persona. It is not put on air by creating it
|
|
1552
|
+
*/
|
|
1553
|
+
async createPersona(body) {
|
|
1554
|
+
const result = await this.fetch(`/personas`, {
|
|
1555
|
+
method: "POST",
|
|
1556
|
+
headers: {
|
|
1557
|
+
"Content-Type": "application/json"
|
|
1558
|
+
},
|
|
1559
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1560
|
+
});
|
|
1561
|
+
return await parseJson(result);
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* @name Generate persona
|
|
1565
|
+
* @description Turns a description of a character into a whole persona, checked against its own sample lines and handed back unsaved
|
|
1566
|
+
*/
|
|
1567
|
+
async generatePersona(body) {
|
|
1568
|
+
const result = await this.fetch(`/personas/generate`, {
|
|
1569
|
+
method: "POST",
|
|
1570
|
+
headers: {
|
|
1571
|
+
"Content-Type": "application/json"
|
|
1572
|
+
},
|
|
1573
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1574
|
+
});
|
|
1575
|
+
return await parseJson(result);
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* @name Restore station personas
|
|
1579
|
+
* @description Writes back whichever of the station's own personas this station is missing, touching nothing it already has and putting nothing on air
|
|
1580
|
+
*/
|
|
1581
|
+
async restoreStationPersonas() {
|
|
1582
|
+
const result = await this.fetch(`/personas/restore`, {
|
|
1583
|
+
method: "POST"
|
|
1584
|
+
});
|
|
1585
|
+
return await parseJson(result);
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* @name Export personas
|
|
1589
|
+
* @description Every character this station holds, as one file
|
|
1590
|
+
*/
|
|
1591
|
+
async exportPersonas() {
|
|
1592
|
+
const result = await this.fetch(`/personas/export`, {
|
|
1593
|
+
method: "GET"
|
|
1594
|
+
});
|
|
1595
|
+
const data = await parseJson(result);
|
|
1596
|
+
return {
|
|
1597
|
+
data,
|
|
1598
|
+
headers: {
|
|
1599
|
+
contentDisposition: result.headers.get("Content-Disposition") ?? void 0
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @name Export persona
|
|
1605
|
+
* @description One character, its sheet and its stories, as a file
|
|
1606
|
+
*/
|
|
1607
|
+
async exportPersona(id) {
|
|
1608
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/export`, {
|
|
1609
|
+
method: "GET"
|
|
1610
|
+
});
|
|
1611
|
+
const data = await parseJson(result);
|
|
1612
|
+
return {
|
|
1613
|
+
data,
|
|
1614
|
+
headers: {
|
|
1615
|
+
contentDisposition: result.headers.get("Content-Disposition") ?? void 0
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* @name Preview persona import
|
|
1621
|
+
* @description Reads a file and reports what importing it would create, rewrite and skip. Writes nothing
|
|
1622
|
+
*/
|
|
1623
|
+
async previewPersonaImport(body) {
|
|
1624
|
+
const result = await this.fetch(`/personas/import/preview`, {
|
|
1625
|
+
method: "POST",
|
|
1626
|
+
headers: {
|
|
1627
|
+
"Content-Type": "application/json"
|
|
1628
|
+
},
|
|
1629
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1630
|
+
});
|
|
1631
|
+
return await parseJson(result);
|
|
1632
|
+
}
|
|
1633
|
+
/**
|
|
1634
|
+
* @name Import personas
|
|
1635
|
+
* @description Writes a file into this station, merging by key, and answers with what it did
|
|
1636
|
+
*/
|
|
1637
|
+
async importPersonas(body) {
|
|
1638
|
+
const result = await this.fetch(`/personas/import`, {
|
|
1639
|
+
method: "POST",
|
|
1640
|
+
headers: {
|
|
1641
|
+
"Content-Type": "application/json"
|
|
1642
|
+
},
|
|
1643
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1644
|
+
});
|
|
1645
|
+
return await parseJson(result);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* @name Update persona
|
|
1649
|
+
* @description Rewrites one persona. An edit to the one on air is heard on the next break
|
|
1650
|
+
*/
|
|
1651
|
+
async updatePersona(id, body) {
|
|
1652
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, {
|
|
1653
|
+
method: "PUT",
|
|
1654
|
+
headers: {
|
|
1655
|
+
"Content-Type": "application/json"
|
|
1656
|
+
},
|
|
1657
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1658
|
+
});
|
|
1659
|
+
return await parseJson(result);
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* @name Delete persona
|
|
1663
|
+
* @description Removes a persona, including the one on air, which leaves the station with none
|
|
1664
|
+
*/
|
|
1665
|
+
async deletePersona(id) {
|
|
1666
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, {
|
|
1667
|
+
method: "DELETE"
|
|
1668
|
+
});
|
|
1669
|
+
return await parseJson(result);
|
|
1670
|
+
}
|
|
1671
|
+
/**
|
|
1672
|
+
* @name Put persona on air
|
|
1673
|
+
* @description Puts this persona on air and takes the previous one off
|
|
1674
|
+
*/
|
|
1675
|
+
async putPersonaOnAir(id) {
|
|
1676
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/active`, {
|
|
1677
|
+
method: "PUT"
|
|
1678
|
+
});
|
|
1679
|
+
return await parseJson(result);
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* @name List persona notes
|
|
1683
|
+
* @description Everything this character has accumulated, oldest first, in every state
|
|
1684
|
+
*/
|
|
1685
|
+
async listPersonaNotes(id) {
|
|
1686
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, {
|
|
1687
|
+
method: "GET"
|
|
1688
|
+
});
|
|
1689
|
+
return await parseJson(result);
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* @name Write persona note
|
|
1693
|
+
* @description Writes a note by hand. An operator's own note is active from the moment it exists; only the distil pass proposes
|
|
1694
|
+
*/
|
|
1695
|
+
async writePersonaNote(id, body) {
|
|
1696
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, {
|
|
1697
|
+
method: "POST",
|
|
1698
|
+
headers: {
|
|
1699
|
+
"Content-Type": "application/json"
|
|
1700
|
+
},
|
|
1701
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1702
|
+
});
|
|
1703
|
+
return await parseJson(result);
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* @name Update persona note
|
|
1707
|
+
* @description Rewrites one note's words, whoever wrote it. Editing what the station proposed is most of the point of the panel
|
|
1708
|
+
*/
|
|
1709
|
+
async updatePersonaNote(id, noteId, body) {
|
|
1710
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, {
|
|
1711
|
+
method: "PUT",
|
|
1712
|
+
headers: {
|
|
1713
|
+
"Content-Type": "application/json"
|
|
1714
|
+
},
|
|
1715
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1716
|
+
});
|
|
1717
|
+
return await parseJson(result);
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* @name Delete persona note
|
|
1721
|
+
* @description Removes a note outright. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again
|
|
1722
|
+
*/
|
|
1723
|
+
async deletePersonaNote(id, noteId) {
|
|
1724
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, {
|
|
1725
|
+
method: "DELETE"
|
|
1726
|
+
});
|
|
1727
|
+
return await parseJson(result);
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* @name Set persona note state
|
|
1731
|
+
* @description Accepts a proposal, turns one down, or rests an active note. Mirrors the lexicon's own state route
|
|
1732
|
+
*/
|
|
1733
|
+
async setPersonaNoteState(id, noteId, body) {
|
|
1734
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}/state`, {
|
|
1735
|
+
method: "PUT",
|
|
1736
|
+
headers: {
|
|
1737
|
+
"Content-Type": "application/json"
|
|
1738
|
+
},
|
|
1739
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1740
|
+
});
|
|
1741
|
+
return await parseJson(result);
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* @name List persona stories
|
|
1745
|
+
* @description Every story this character holds, oldest first, in every state
|
|
1746
|
+
*/
|
|
1747
|
+
async listPersonaStories(id) {
|
|
1748
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, {
|
|
1749
|
+
method: "GET"
|
|
1750
|
+
});
|
|
1751
|
+
return await parseJson(result);
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* @name Write persona story
|
|
1755
|
+
* @description Writes a story by hand. An operator's own is tellable from the moment it exists; only the enrichment pass proposes
|
|
1756
|
+
*/
|
|
1757
|
+
async writePersonaStory(id, body) {
|
|
1758
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, {
|
|
1759
|
+
method: "POST",
|
|
1760
|
+
headers: {
|
|
1761
|
+
"Content-Type": "application/json"
|
|
1762
|
+
},
|
|
1763
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1764
|
+
});
|
|
1765
|
+
return await parseJson(result);
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* @name Update persona story
|
|
1769
|
+
* @description Rewrites one story's handle and telling, whoever wrote it
|
|
1770
|
+
*/
|
|
1771
|
+
async updatePersonaStory(id, storyId, body) {
|
|
1772
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, {
|
|
1773
|
+
method: "PUT",
|
|
1774
|
+
headers: {
|
|
1775
|
+
"Content-Type": "application/json"
|
|
1776
|
+
},
|
|
1777
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1778
|
+
});
|
|
1779
|
+
return await parseJson(result);
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* @name Delete persona story
|
|
1783
|
+
* @description Removes a story outright, details and all. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again
|
|
1784
|
+
*/
|
|
1785
|
+
async deletePersonaStory(id, storyId) {
|
|
1786
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, {
|
|
1787
|
+
method: "DELETE"
|
|
1788
|
+
});
|
|
1789
|
+
return await parseJson(result);
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* @name Set persona story state
|
|
1793
|
+
* @description Accepts a proposal, turns one down, or takes a story out of the rotation without losing it
|
|
1794
|
+
*/
|
|
1795
|
+
async setPersonaStoryState(id, storyId, body) {
|
|
1796
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/state`, {
|
|
1797
|
+
method: "PUT",
|
|
1798
|
+
headers: {
|
|
1799
|
+
"Content-Type": "application/json"
|
|
1800
|
+
},
|
|
1801
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1802
|
+
});
|
|
1803
|
+
return await parseJson(result);
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* @name Add persona story detail
|
|
1807
|
+
* @description Adds one thing to a story that already exists
|
|
1808
|
+
*/
|
|
1809
|
+
async addPersonaStoryDetail(id, storyId, body) {
|
|
1810
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details`, {
|
|
1811
|
+
method: "POST",
|
|
1812
|
+
headers: {
|
|
1813
|
+
"Content-Type": "application/json"
|
|
1814
|
+
},
|
|
1815
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1816
|
+
});
|
|
1817
|
+
return await parseJson(result);
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* @name Update persona story detail
|
|
1821
|
+
* @description Rewrites one detail's words
|
|
1822
|
+
*/
|
|
1823
|
+
async updatePersonaStoryDetail(id, storyId, detailId, body) {
|
|
1824
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`, {
|
|
1825
|
+
method: "PUT",
|
|
1826
|
+
headers: {
|
|
1827
|
+
"Content-Type": "application/json"
|
|
1828
|
+
},
|
|
1829
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1830
|
+
});
|
|
1831
|
+
return await parseJson(result);
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* @name Delete persona story detail
|
|
1835
|
+
* @description Removes one detail, leaving the story it was hung on alone
|
|
1836
|
+
*/
|
|
1837
|
+
async deletePersonaStoryDetail(id, storyId, detailId) {
|
|
1838
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`, {
|
|
1839
|
+
method: "DELETE"
|
|
1840
|
+
});
|
|
1841
|
+
return await parseJson(result);
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* @name Set persona story detail state
|
|
1845
|
+
* @description Accepts a proposed detail or turns it down, which has to outlive the pass that proposed it
|
|
1846
|
+
*/
|
|
1847
|
+
async setPersonaStoryDetailState(id, storyId, detailId, body) {
|
|
1848
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}/state`, {
|
|
1849
|
+
method: "PUT",
|
|
1850
|
+
headers: {
|
|
1851
|
+
"Content-Type": "application/json"
|
|
1852
|
+
},
|
|
1853
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1854
|
+
});
|
|
1855
|
+
return await parseJson(result);
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* @name Rehearse persona
|
|
1859
|
+
* @description Writes a talk break under this persona against two fixed invented records, and answers with every writer that was asked
|
|
1860
|
+
*/
|
|
1861
|
+
async rehearsePersona(id) {
|
|
1862
|
+
const result = await this.fetch(`/personas/${encodeURIComponent(id)}/rehearse`, {
|
|
1863
|
+
method: "POST"
|
|
1864
|
+
});
|
|
1865
|
+
return await parseJson(result);
|
|
1866
|
+
}
|
|
1867
|
+
};
|
|
1868
|
+
|
|
1869
|
+
// src/playlists/playlists.client.ts
|
|
1870
|
+
var PlaylistsClient = class {
|
|
1871
|
+
static {
|
|
1872
|
+
__name(this, "PlaylistsClient");
|
|
1873
|
+
}
|
|
1874
|
+
fetch;
|
|
1875
|
+
constructor(fetch2) {
|
|
1876
|
+
this.fetch = fetch2;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* @name List importable playlists
|
|
1880
|
+
* @description Fans out across every installed plugin that declares AND implements the `catalog` capability
|
|
1881
|
+
*/
|
|
1882
|
+
async listImportablePlaylists() {
|
|
1883
|
+
const result = await this.fetch(`/playlists`, {
|
|
1884
|
+
method: "GET"
|
|
1885
|
+
});
|
|
1886
|
+
return await parseJson(result);
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* @name Get playlist tracks
|
|
1890
|
+
* @description One playlist's tracks from one plugin
|
|
1891
|
+
*/
|
|
1892
|
+
async getPlaylistTracks(pluginId, playlistId) {
|
|
1893
|
+
const result = await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/tracks`, {
|
|
1894
|
+
method: "GET"
|
|
1895
|
+
});
|
|
1896
|
+
return await parseJson(result);
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1900
|
+
// src/playout/playout.client.ts
|
|
1901
|
+
var PlayoutClient = class {
|
|
1902
|
+
static {
|
|
1903
|
+
__name(this, "PlayoutClient");
|
|
1904
|
+
}
|
|
1905
|
+
fetch;
|
|
1906
|
+
constructor(fetch2) {
|
|
1907
|
+
this.fetch = fetch2;
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* @name Get playout status
|
|
1911
|
+
* @description What the station is playing and what is queued behind it. The console polls this
|
|
1912
|
+
*/
|
|
1913
|
+
async getPlayoutStatus() {
|
|
1914
|
+
const result = await this.fetch(`/playout/status`, {
|
|
1915
|
+
method: "GET"
|
|
1916
|
+
});
|
|
1917
|
+
return await parseJson(result);
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* @name Play a playlist
|
|
1921
|
+
* @description Loads a plugin playlist into the running order and starts handing it to the player. Replaces whatever was queued; what is on air finishes rather than being cut off
|
|
1922
|
+
*/
|
|
1923
|
+
async playAPlaylist(body) {
|
|
1924
|
+
const result = await this.fetch(`/playout/playlist`, {
|
|
1925
|
+
method: "POST",
|
|
1926
|
+
headers: {
|
|
1927
|
+
"Content-Type": "application/json"
|
|
1928
|
+
},
|
|
1929
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1930
|
+
});
|
|
1931
|
+
return await parseJson(result);
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* @name Play a chart
|
|
1935
|
+
* @description Builds the running order from a published chart and starts handing it to the player. The same replacement a playlist makes, from a document somebody else ranked
|
|
1936
|
+
*/
|
|
1937
|
+
async playAChart(body) {
|
|
1938
|
+
const result = await this.fetch(`/playout/chart`, {
|
|
1939
|
+
method: "POST",
|
|
1940
|
+
headers: {
|
|
1941
|
+
"Content-Type": "application/json"
|
|
1942
|
+
},
|
|
1943
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
1944
|
+
});
|
|
1945
|
+
return await parseJson(result);
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* @name Skip the current item
|
|
1949
|
+
* @description Ends the item on air so the next one starts immediately. The station owns the decoder, so this lands at once rather than waiting out audio already committed to a player
|
|
1950
|
+
*/
|
|
1951
|
+
async skipTheCurrentItem() {
|
|
1952
|
+
const result = await this.fetch(`/playout/skip`, {
|
|
1953
|
+
method: "POST"
|
|
1954
|
+
});
|
|
1955
|
+
return await parseJson(result);
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* @name Start playout
|
|
1959
|
+
* @description Puts the station back on air with the running order it already has, picking it up where Stop left it. Distinct from putting a playlist on air, which builds a new broadcast and throws away what was there. Refused when there is nothing left to resume
|
|
1960
|
+
*/
|
|
1961
|
+
async startPlayout() {
|
|
1962
|
+
const result = await this.fetch(`/playout/start`, {
|
|
1963
|
+
method: "POST"
|
|
1964
|
+
});
|
|
1965
|
+
return await parseJson(result);
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* @name Stop playout
|
|
1969
|
+
* @description Stands the station down: stops what is on air at once and hands the mount back. The running order is LEFT as it is, so `/playout/start` can pick it up where this stopped it. deadair holds the mount on a lease it renews while it has something to play, so stopping goes quiet rather than falling through to a bed nobody programmed
|
|
1970
|
+
*/
|
|
1971
|
+
async stopPlayout() {
|
|
1972
|
+
const result = await this.fetch(`/playout/stop`, {
|
|
1973
|
+
method: "POST"
|
|
1974
|
+
});
|
|
1975
|
+
return await parseJson(result);
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
// src/plugins/types/plugins.types.ts
|
|
1980
|
+
import { Decimal as Decimal6 } from "decimal.js";
|
|
1981
|
+
import { DateTime as DateTime6 } from "luxon";
|
|
1982
|
+
Decimal6.set({
|
|
1983
|
+
toExpNeg: -9e15,
|
|
1984
|
+
toExpPos: 9e15
|
|
1985
|
+
});
|
|
1986
|
+
var __dt6 = /* @__PURE__ */ __name((v, path) => {
|
|
1987
|
+
if (typeof v !== "string") {
|
|
1988
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
1989
|
+
}
|
|
1990
|
+
const d = DateTime6.fromISO(v);
|
|
1991
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
1992
|
+
return d;
|
|
1993
|
+
}, "__dt");
|
|
1994
|
+
function revivePluginSummary(raw) {
|
|
1995
|
+
const __o0 = raw;
|
|
1996
|
+
if (__o0["firstEnabledAt"] != null) {
|
|
1997
|
+
__o0["firstEnabledAt"] = __dt6(__o0["firstEnabledAt"], "PluginSummary.firstEnabledAt");
|
|
1998
|
+
}
|
|
1999
|
+
if (__o0["nextProbeAt"] != null) {
|
|
2000
|
+
__o0["nextProbeAt"] = __dt6(__o0["nextProbeAt"], "PluginSummary.nextProbeAt");
|
|
2001
|
+
}
|
|
2002
|
+
return raw;
|
|
2003
|
+
}
|
|
2004
|
+
__name(revivePluginSummary, "revivePluginSummary");
|
|
2005
|
+
function revivePluginImportResult(raw) {
|
|
2006
|
+
const __o0 = raw;
|
|
2007
|
+
{
|
|
2008
|
+
const __a1 = __o0["plugins"];
|
|
2009
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2010
|
+
revivePluginSummary(__a1[__i2]);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
return raw;
|
|
2014
|
+
}
|
|
2015
|
+
__name(revivePluginImportResult, "revivePluginImportResult");
|
|
2016
|
+
function revivePluginDetail(raw) {
|
|
2017
|
+
revivePluginSummary(raw);
|
|
2018
|
+
return raw;
|
|
2019
|
+
}
|
|
2020
|
+
__name(revivePluginDetail, "revivePluginDetail");
|
|
2021
|
+
|
|
2022
|
+
// src/plugins/plugins.client.ts
|
|
2023
|
+
var PluginsClient = class {
|
|
2024
|
+
static {
|
|
2025
|
+
__name(this, "PluginsClient");
|
|
2026
|
+
}
|
|
2027
|
+
fetch;
|
|
2028
|
+
constructor(fetch2) {
|
|
2029
|
+
this.fetch = fetch2;
|
|
2030
|
+
}
|
|
2031
|
+
/**
|
|
2032
|
+
* @name List plugins
|
|
2033
|
+
* @description Lists every plugin the host knows about
|
|
2034
|
+
*/
|
|
2035
|
+
async listPlugins() {
|
|
2036
|
+
const result = await this.fetch(`/plugins`, {
|
|
2037
|
+
method: "GET"
|
|
2038
|
+
});
|
|
2039
|
+
return (await parseJson(result)).map(revivePluginSummary);
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* @name List plugin grants
|
|
2043
|
+
* @description Every capability an installed plugin is asking the operator for, with the answer so far
|
|
2044
|
+
*/
|
|
2045
|
+
async listPluginGrants() {
|
|
2046
|
+
const result = await this.fetch(`/plugins/grants`, {
|
|
2047
|
+
method: "GET"
|
|
2048
|
+
});
|
|
2049
|
+
return await parseJson(result);
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* @name Rescan plugins
|
|
2053
|
+
* @description Rescans the mounted plugin directory: registers new plugins, unloads removed ones
|
|
2054
|
+
*/
|
|
2055
|
+
async rescanPlugins() {
|
|
2056
|
+
const result = await this.fetch(`/plugins/rescan`, {
|
|
2057
|
+
method: "POST"
|
|
2058
|
+
});
|
|
2059
|
+
return (await parseJson(result)).map(revivePluginSummary);
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* @name Import plugin
|
|
2063
|
+
* @description Takes a plugin in from the browser as the tarball npm pack writes and puts it in the plugins directory. It lands disabled, and a newer version of an installed plugin replaces the older one
|
|
2064
|
+
*/
|
|
2065
|
+
async importPlugin(body) {
|
|
2066
|
+
const result = await this.fetch(`/plugins/import`, {
|
|
2067
|
+
method: "POST",
|
|
2068
|
+
body
|
|
2069
|
+
});
|
|
2070
|
+
return revivePluginImportResult(await parseJson(result));
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* @name Get plugin
|
|
2074
|
+
* @description One plugin, including its stored non-secret configuration and last error
|
|
2075
|
+
*/
|
|
2076
|
+
async getPlugin(id) {
|
|
2077
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, {
|
|
2078
|
+
method: "GET"
|
|
2079
|
+
});
|
|
2080
|
+
return revivePluginDetail(await parseJson(result));
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* @name Remove plugin
|
|
2084
|
+
* @description Removes a plugin the operator installed: stops it and deletes its folder. Its settings are kept, so importing it again brings them back. A bundled plugin is refused
|
|
2085
|
+
*/
|
|
2086
|
+
async removePlugin(id) {
|
|
2087
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, {
|
|
2088
|
+
method: "DELETE"
|
|
2089
|
+
});
|
|
2090
|
+
return (await parseJson(result)).map(revivePluginSummary);
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* @name Update plugin configuration
|
|
2094
|
+
* @description Validates against the plugin's own config schema, encrypts secrets, persists, and reinitializes
|
|
2095
|
+
*/
|
|
2096
|
+
async updatePluginConfiguration(id, body) {
|
|
2097
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config`, {
|
|
2098
|
+
method: "PUT",
|
|
2099
|
+
headers: {
|
|
2100
|
+
"Content-Type": "application/json"
|
|
2101
|
+
},
|
|
2102
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2103
|
+
});
|
|
2104
|
+
return revivePluginDetail(await parseJson(result));
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* @name Enable plugin
|
|
2108
|
+
* @description Enables a plugin without resubmitting its configuration
|
|
2109
|
+
*/
|
|
2110
|
+
async enablePlugin(id) {
|
|
2111
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/enable`, {
|
|
2112
|
+
method: "POST"
|
|
2113
|
+
});
|
|
2114
|
+
return revivePluginDetail(await parseJson(result));
|
|
2115
|
+
}
|
|
2116
|
+
/**
|
|
2117
|
+
* @name Disable plugin
|
|
2118
|
+
* @description Disables a plugin and tears its instance down, keeping its configuration
|
|
2119
|
+
*/
|
|
2120
|
+
async disablePlugin(id) {
|
|
2121
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/disable`, {
|
|
2122
|
+
method: "POST"
|
|
2123
|
+
});
|
|
2124
|
+
return revivePluginDetail(await parseJson(result));
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* @name Decide plugin grant
|
|
2128
|
+
* @description Answers one capability this plugin asked for. Takes effect on the next fetch, with no reload
|
|
2129
|
+
*/
|
|
2130
|
+
async decidePluginGrant(id, body) {
|
|
2131
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/grants`, {
|
|
2132
|
+
method: "PUT",
|
|
2133
|
+
headers: {
|
|
2134
|
+
"Content-Type": "application/json"
|
|
2135
|
+
},
|
|
2136
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2137
|
+
});
|
|
2138
|
+
return await parseJson(result);
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* @name Reload plugin
|
|
2142
|
+
* @description Reapplies the plugin's stored configuration: disposes the running instance and initializes it again
|
|
2143
|
+
*/
|
|
2144
|
+
async reloadPlugin(id) {
|
|
2145
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/reload`, {
|
|
2146
|
+
method: "POST"
|
|
2147
|
+
});
|
|
2148
|
+
return revivePluginDetail(await parseJson(result));
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* @name Test plugin connection
|
|
2152
|
+
* @description Runs the plugin's own `testConnection()` through the invoker
|
|
2153
|
+
*/
|
|
2154
|
+
async testPluginConnection(id) {
|
|
2155
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/test`, {
|
|
2156
|
+
method: "POST"
|
|
2157
|
+
});
|
|
2158
|
+
return await parseJson(result);
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* @name Suggest plugin config options
|
|
2162
|
+
* @description Asks the plugin what to offer for its config fields right now, through the invoker
|
|
2163
|
+
*/
|
|
2164
|
+
async suggestPluginConfigOptions(id) {
|
|
2165
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config/suggestions`, {
|
|
2166
|
+
method: "POST"
|
|
2167
|
+
});
|
|
2168
|
+
return await parseJson(result);
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* @name Get plugin logs
|
|
2172
|
+
* @description Returns the plugin's buffered log lines at or above the current log level
|
|
2173
|
+
*/
|
|
2174
|
+
async getPluginLogs(id, query) {
|
|
2175
|
+
const qs = buildQueryString(query);
|
|
2176
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs${qs}`, {
|
|
2177
|
+
method: "GET"
|
|
2178
|
+
});
|
|
2179
|
+
return await parseJson(result);
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* @name Download plugin logs
|
|
2183
|
+
* @description Streams the plugin's full retained log as a plain-text attachment
|
|
2184
|
+
*/
|
|
2185
|
+
async downloadPluginLogs(id) {
|
|
2186
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/download`, {
|
|
2187
|
+
method: "GET"
|
|
2188
|
+
});
|
|
2189
|
+
const data = await result.text();
|
|
2190
|
+
return {
|
|
2191
|
+
data,
|
|
2192
|
+
headers: {
|
|
2193
|
+
contentDisposition: result.headers.get("Content-Disposition") ?? void 0
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* @name Set plugin log level
|
|
2199
|
+
* @description Sets the minimum severity the plugin's log store retains going forward
|
|
2200
|
+
*/
|
|
2201
|
+
async setPluginLogLevel(id, body) {
|
|
2202
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/level`, {
|
|
2203
|
+
method: "PUT",
|
|
2204
|
+
headers: {
|
|
2205
|
+
"Content-Type": "application/json"
|
|
2206
|
+
},
|
|
2207
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2208
|
+
});
|
|
2209
|
+
return revivePluginDetail(await parseJson(result));
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* @name Start plugin OAuth authorization
|
|
2213
|
+
* @description Reports where to send the operator for the provider's consent screen
|
|
2214
|
+
*/
|
|
2215
|
+
async startPluginOAuthAuthorization(id) {
|
|
2216
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/authorize`, {
|
|
2217
|
+
method: "GET"
|
|
2218
|
+
});
|
|
2219
|
+
return await parseJson(result);
|
|
2220
|
+
}
|
|
2221
|
+
/**
|
|
2222
|
+
* @name Disconnect plugin OAuth
|
|
2223
|
+
* @description Forgets the plugin's stored OAuth tokens and reinitializes it
|
|
2224
|
+
*/
|
|
2225
|
+
async disconnectPluginOAuth(id) {
|
|
2226
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth`, {
|
|
2227
|
+
method: "DELETE"
|
|
2228
|
+
});
|
|
2229
|
+
return revivePluginDetail(await parseJson(result));
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* @name Complete plugin OAuth authorization
|
|
2233
|
+
* @description Completes the flow. Anonymous: the provider redirects the browser here with no session of ours
|
|
2234
|
+
*/
|
|
2235
|
+
async completePluginOAuthAuthorization(id, query) {
|
|
2236
|
+
const qs = buildQueryString(query);
|
|
2237
|
+
const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/callback${qs}`, {
|
|
2238
|
+
method: "GET"
|
|
2239
|
+
});
|
|
2240
|
+
return await parseJson(result);
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
// src/productions/types/productions.types.ts
|
|
2245
|
+
import { Decimal as Decimal7 } from "decimal.js";
|
|
2246
|
+
import { DateTime as DateTime7 } from "luxon";
|
|
2247
|
+
Decimal7.set({
|
|
2248
|
+
toExpNeg: -9e15,
|
|
2249
|
+
toExpPos: 9e15
|
|
2250
|
+
});
|
|
2251
|
+
var __dt7 = /* @__PURE__ */ __name((v, path) => {
|
|
2252
|
+
if (typeof v !== "string") {
|
|
2253
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2254
|
+
}
|
|
2255
|
+
const d = DateTime7.fromISO(v);
|
|
2256
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2257
|
+
return d;
|
|
2258
|
+
}, "__dt");
|
|
2259
|
+
function reviveProductionRequest(raw) {
|
|
2260
|
+
const __o0 = raw;
|
|
2261
|
+
if (__o0["scheduledFor"] != null) {
|
|
2262
|
+
__o0["scheduledFor"] = __dt7(__o0["scheduledFor"], "ProductionRequest.scheduledFor");
|
|
2263
|
+
}
|
|
2264
|
+
return raw;
|
|
2265
|
+
}
|
|
2266
|
+
__name(reviveProductionRequest, "reviveProductionRequest");
|
|
2267
|
+
function reviveProduction(raw) {
|
|
2268
|
+
const __o0 = raw;
|
|
2269
|
+
if (__o0["scheduledFor"] != null) {
|
|
2270
|
+
__o0["scheduledFor"] = __dt7(__o0["scheduledFor"], "Production.scheduledFor");
|
|
2271
|
+
}
|
|
2272
|
+
if (__o0["cancelledAt"] != null) {
|
|
2273
|
+
__o0["cancelledAt"] = __dt7(__o0["cancelledAt"], "Production.cancelledAt");
|
|
2274
|
+
}
|
|
2275
|
+
__o0["createdAt"] = __dt7(__o0["createdAt"], "Production.createdAt");
|
|
2276
|
+
return raw;
|
|
2277
|
+
}
|
|
2278
|
+
__name(reviveProduction, "reviveProduction");
|
|
2279
|
+
function reviveProductionList(raw) {
|
|
2280
|
+
const __o0 = raw;
|
|
2281
|
+
{
|
|
2282
|
+
const __a1 = __o0["productions"];
|
|
2283
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2284
|
+
reviveProduction(__a1[__i2]);
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
return raw;
|
|
2288
|
+
}
|
|
2289
|
+
__name(reviveProductionList, "reviveProductionList");
|
|
2290
|
+
|
|
2291
|
+
// src/productions/productions.client.ts
|
|
2292
|
+
var ProductionsClient = class {
|
|
2293
|
+
static {
|
|
2294
|
+
__name(this, "ProductionsClient");
|
|
2295
|
+
}
|
|
2296
|
+
fetch;
|
|
2297
|
+
constructor(fetch2) {
|
|
2298
|
+
this.fetch = fetch2;
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* @name List productions
|
|
2302
|
+
* @description Everything the station has made or is making, newest first
|
|
2303
|
+
*/
|
|
2304
|
+
async listProductions() {
|
|
2305
|
+
const result = await this.fetch(`/productions`, {
|
|
2306
|
+
method: "GET"
|
|
2307
|
+
});
|
|
2308
|
+
return reviveProductionList(await parseJson(result));
|
|
2309
|
+
}
|
|
2310
|
+
/**
|
|
2311
|
+
* @name Request production
|
|
2312
|
+
* @description Asks the station to make one. It is queued, not started
|
|
2313
|
+
*/
|
|
2314
|
+
async requestProduction(body) {
|
|
2315
|
+
const result = await this.fetch(`/productions`, {
|
|
2316
|
+
method: "POST",
|
|
2317
|
+
headers: {
|
|
2318
|
+
"Content-Type": "application/json"
|
|
2319
|
+
},
|
|
2320
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2321
|
+
});
|
|
2322
|
+
return reviveProduction(await parseJson(result));
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* @name Cancel production
|
|
2326
|
+
* @description Stops a production being made, for good
|
|
2327
|
+
*/
|
|
2328
|
+
async cancelProduction(id) {
|
|
2329
|
+
const result = await this.fetch(`/productions/${encodeURIComponent(id)}/cancel`, {
|
|
2330
|
+
method: "POST"
|
|
2331
|
+
});
|
|
2332
|
+
return reviveProduction(await parseJson(result));
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
|
|
2336
|
+
// src/render/types/render.types.ts
|
|
2337
|
+
import { Decimal as Decimal8 } from "decimal.js";
|
|
2338
|
+
import { DateTime as DateTime8 } from "luxon";
|
|
2339
|
+
Decimal8.set({
|
|
2340
|
+
toExpNeg: -9e15,
|
|
2341
|
+
toExpPos: 9e15
|
|
2342
|
+
});
|
|
2343
|
+
var __dt8 = /* @__PURE__ */ __name((v, path) => {
|
|
2344
|
+
if (typeof v !== "string") {
|
|
2345
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2346
|
+
}
|
|
2347
|
+
const d = DateTime8.fromISO(v);
|
|
2348
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2349
|
+
return d;
|
|
2350
|
+
}, "__dt");
|
|
2351
|
+
function revivePad(raw) {
|
|
2352
|
+
const __o0 = raw;
|
|
2353
|
+
if (__o0["lastUsedAt"] != null) {
|
|
2354
|
+
__o0["lastUsedAt"] = __dt8(__o0["lastUsedAt"], "Pad.lastUsedAt");
|
|
2355
|
+
}
|
|
2356
|
+
return raw;
|
|
2357
|
+
}
|
|
2358
|
+
__name(revivePad, "revivePad");
|
|
2359
|
+
function reviveScriptAttempt(raw) {
|
|
2360
|
+
const __o0 = raw;
|
|
2361
|
+
__o0["at"] = __dt8(__o0["at"], "ScriptAttempt.at");
|
|
2362
|
+
return raw;
|
|
2363
|
+
}
|
|
2364
|
+
__name(reviveScriptAttempt, "reviveScriptAttempt");
|
|
2365
|
+
function revivePadList(raw) {
|
|
2366
|
+
const __o0 = raw;
|
|
2367
|
+
{
|
|
2368
|
+
const __a1 = __o0["pads"];
|
|
2369
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2370
|
+
revivePad(__a1[__i2]);
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
return raw;
|
|
2374
|
+
}
|
|
2375
|
+
__name(revivePadList, "revivePadList");
|
|
2376
|
+
function reviveScriptHistoryPage(raw) {
|
|
2377
|
+
const __o0 = raw;
|
|
2378
|
+
{
|
|
2379
|
+
const __a1 = __o0["attempts"];
|
|
2380
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2381
|
+
reviveScriptAttempt(__a1[__i2]);
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
return raw;
|
|
2385
|
+
}
|
|
2386
|
+
__name(reviveScriptHistoryPage, "reviveScriptHistoryPage");
|
|
2387
|
+
|
|
2388
|
+
// src/render/render.client.ts
|
|
2389
|
+
var RenderClient = class {
|
|
2390
|
+
static {
|
|
2391
|
+
__name(this, "RenderClient");
|
|
2392
|
+
}
|
|
2393
|
+
fetch;
|
|
2394
|
+
constructor(fetch2) {
|
|
2395
|
+
this.fetch = fetch2;
|
|
2396
|
+
}
|
|
2397
|
+
/**
|
|
2398
|
+
* @name List segments
|
|
2399
|
+
* @description Everything the station can play that is not a record
|
|
2400
|
+
*/
|
|
2401
|
+
async listSegments() {
|
|
2402
|
+
const result = await this.fetch(`/segments`, {
|
|
2403
|
+
method: "GET"
|
|
2404
|
+
});
|
|
2405
|
+
return await parseJson(result);
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* @name Create segment
|
|
2409
|
+
* @description Plans something for the station to say, and starts rendering it
|
|
2410
|
+
*/
|
|
2411
|
+
async createSegment(body) {
|
|
2412
|
+
const result = await this.fetch(`/segments`, {
|
|
2413
|
+
method: "POST",
|
|
2414
|
+
headers: {
|
|
2415
|
+
"Content-Type": "application/json"
|
|
2416
|
+
},
|
|
2417
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2418
|
+
});
|
|
2419
|
+
return await parseJson(result);
|
|
2420
|
+
}
|
|
2421
|
+
/**
|
|
2422
|
+
* @name Upload segment
|
|
2423
|
+
* @description Takes a recording in from the browser and puts it in the library, ready to air
|
|
2424
|
+
*/
|
|
2425
|
+
async uploadSegment(body) {
|
|
2426
|
+
const result = await this.fetch(`/segments/upload`, {
|
|
2427
|
+
method: "POST",
|
|
2428
|
+
body
|
|
2429
|
+
});
|
|
2430
|
+
return await parseJson(result);
|
|
2431
|
+
}
|
|
2432
|
+
/**
|
|
2433
|
+
* @name Scan the segment inbox
|
|
2434
|
+
* @description Takes whatever audio is sitting in the inbox directory into the library. Safe to repeat: a segment is identified by its audio, so the same recording arriving twice is one segment
|
|
2435
|
+
*/
|
|
2436
|
+
async scanTheSegmentInbox() {
|
|
2437
|
+
const result = await this.fetch(`/segments/scan`, {
|
|
2438
|
+
method: "POST"
|
|
2439
|
+
});
|
|
2440
|
+
return await parseJson(result);
|
|
2441
|
+
}
|
|
2442
|
+
/**
|
|
2443
|
+
* @name Read script history
|
|
2444
|
+
* @description What the station has written lately, newest first, one page at a time
|
|
2445
|
+
*/
|
|
2446
|
+
async readScriptHistory(query) {
|
|
2447
|
+
const qs = buildQueryString(query);
|
|
2448
|
+
const result = await this.fetch(`/scripts${qs}`, {
|
|
2449
|
+
method: "GET"
|
|
2450
|
+
});
|
|
2451
|
+
return reviveScriptHistoryPage(await parseJson(result));
|
|
2452
|
+
}
|
|
2453
|
+
/**
|
|
2454
|
+
* @name Rate script
|
|
2455
|
+
* @description What the operator thought of this attempt. Nothing acts on it automatically
|
|
2456
|
+
*/
|
|
2457
|
+
async rateScript(id, body) {
|
|
2458
|
+
const result = await this.fetch(`/scripts/${encodeURIComponent(id)}/rating`, {
|
|
2459
|
+
method: "PUT",
|
|
2460
|
+
headers: {
|
|
2461
|
+
"Content-Type": "application/json"
|
|
2462
|
+
},
|
|
2463
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2464
|
+
});
|
|
2465
|
+
return reviveScriptAttempt(await parseJson(result));
|
|
2466
|
+
}
|
|
2467
|
+
/**
|
|
2468
|
+
* @name Read script summary
|
|
2469
|
+
* @description Write attempts by outcome, per presenter, over a recent window
|
|
2470
|
+
*/
|
|
2471
|
+
async readScriptSummary(query) {
|
|
2472
|
+
const qs = buildQueryString(query);
|
|
2473
|
+
const result = await this.fetch(`/scripts/summary${qs}`, {
|
|
2474
|
+
method: "GET"
|
|
2475
|
+
});
|
|
2476
|
+
return await parseJson(result);
|
|
2477
|
+
}
|
|
2478
|
+
/**
|
|
2479
|
+
* @name List voices
|
|
2480
|
+
* @description The voices the station can be asked to speak in
|
|
2481
|
+
*/
|
|
2482
|
+
async listVoices() {
|
|
2483
|
+
const result = await this.fetch(`/voices`, {
|
|
2484
|
+
method: "GET"
|
|
2485
|
+
});
|
|
2486
|
+
return await parseJson(result);
|
|
2487
|
+
}
|
|
2488
|
+
/**
|
|
2489
|
+
* @name Get default voice sample
|
|
2490
|
+
* @description A short line spoken in whichever voice the plugin falls back to
|
|
2491
|
+
*/
|
|
2492
|
+
async getDefaultVoiceSample() {
|
|
2493
|
+
const result = await this.fetch(`/voices/sample`, {
|
|
2494
|
+
method: "GET",
|
|
2495
|
+
expectStatuses: [
|
|
2496
|
+
304
|
|
2497
|
+
]
|
|
2498
|
+
});
|
|
2499
|
+
switch (result.status) {
|
|
2500
|
+
case 304:
|
|
2501
|
+
return {
|
|
2502
|
+
status: 304
|
|
2503
|
+
};
|
|
2504
|
+
default:
|
|
2505
|
+
return {
|
|
2506
|
+
status: 200,
|
|
2507
|
+
contentType: readContentType(result),
|
|
2508
|
+
data: await result.blob(),
|
|
2509
|
+
headers: {
|
|
2510
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
2511
|
+
etag: result.headers.get("etag") ?? void 0
|
|
2512
|
+
}
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* @name Get voice sample
|
|
2518
|
+
* @description A short line spoken in one voice, so an operator can hear it before choosing it
|
|
2519
|
+
*/
|
|
2520
|
+
async getVoiceSample(voiceId) {
|
|
2521
|
+
const result = await this.fetch(`/voices/${encodeURIComponent(voiceId)}/sample`, {
|
|
2522
|
+
method: "GET",
|
|
2523
|
+
expectStatuses: [
|
|
2524
|
+
304
|
|
2525
|
+
]
|
|
2526
|
+
});
|
|
2527
|
+
switch (result.status) {
|
|
2528
|
+
case 304:
|
|
2529
|
+
return {
|
|
2530
|
+
status: 304
|
|
2531
|
+
};
|
|
2532
|
+
default:
|
|
2533
|
+
return {
|
|
2534
|
+
status: 200,
|
|
2535
|
+
contentType: readContentType(result),
|
|
2536
|
+
data: await result.blob(),
|
|
2537
|
+
headers: {
|
|
2538
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
2539
|
+
etag: result.headers.get("etag") ?? void 0
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* @name Preview speech
|
|
2546
|
+
* @description Speaks the caller's words in one voice, so a break can be heard before it is written for air
|
|
2547
|
+
*/
|
|
2548
|
+
async previewSpeech(body) {
|
|
2549
|
+
const result = await this.fetch(`/voices/preview`, {
|
|
2550
|
+
method: "POST",
|
|
2551
|
+
headers: {
|
|
2552
|
+
"Content-Type": "application/json"
|
|
2553
|
+
},
|
|
2554
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2555
|
+
});
|
|
2556
|
+
return {
|
|
2557
|
+
contentType: readContentType(result),
|
|
2558
|
+
data: await result.blob()
|
|
2559
|
+
};
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* @name Delete segment
|
|
2563
|
+
* @description Removes a recording and the inbox file behind it, so the next scan does not read it back in
|
|
2564
|
+
*/
|
|
2565
|
+
async deleteSegment(id) {
|
|
2566
|
+
const result = await this.fetch(`/segments/${encodeURIComponent(id)}`, {
|
|
2567
|
+
method: "DELETE"
|
|
2568
|
+
});
|
|
2569
|
+
return await parseJson(result);
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* @name Get segment audio
|
|
2573
|
+
* @description The audio of one segment
|
|
2574
|
+
*/
|
|
2575
|
+
async getSegmentAudio(id) {
|
|
2576
|
+
const result = await this.fetch(`/segments/${encodeURIComponent(id)}/audio`, {
|
|
2577
|
+
method: "GET",
|
|
2578
|
+
expectStatuses: [
|
|
2579
|
+
304
|
|
2580
|
+
]
|
|
2581
|
+
});
|
|
2582
|
+
switch (result.status) {
|
|
2583
|
+
case 304:
|
|
2584
|
+
return {
|
|
2585
|
+
status: 304
|
|
2586
|
+
};
|
|
2587
|
+
default:
|
|
2588
|
+
return {
|
|
2589
|
+
status: 200,
|
|
2590
|
+
contentType: readContentType(result),
|
|
2591
|
+
data: await result.blob(),
|
|
2592
|
+
headers: {
|
|
2593
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
2594
|
+
etag: result.headers.get("etag") ?? void 0
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
/**
|
|
2600
|
+
* @name Get stored audio
|
|
2601
|
+
* @description Audio out of the segment store, addressed by content rather than by row
|
|
2602
|
+
*/
|
|
2603
|
+
async getStoredAudio(checksum, ext) {
|
|
2604
|
+
const result = await this.fetch(`/audio/${encodeURIComponent(checksum)}/${encodeURIComponent(ext)}`, {
|
|
2605
|
+
method: "GET",
|
|
2606
|
+
expectStatuses: [
|
|
2607
|
+
304
|
|
2608
|
+
]
|
|
2609
|
+
});
|
|
2610
|
+
switch (result.status) {
|
|
2611
|
+
case 304:
|
|
2612
|
+
return {
|
|
2613
|
+
status: 304
|
|
2614
|
+
};
|
|
2615
|
+
default:
|
|
2616
|
+
return {
|
|
2617
|
+
status: 200,
|
|
2618
|
+
contentType: readContentType(result),
|
|
2619
|
+
data: await result.blob(),
|
|
2620
|
+
headers: {
|
|
2621
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
2622
|
+
etag: result.headers.get("etag") ?? void 0
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
/**
|
|
2628
|
+
* @name List pronunciations
|
|
2629
|
+
* @description The station's lexicon: what it says, what has been proposed to it, and what it has turned down
|
|
2630
|
+
*/
|
|
2631
|
+
async listPronunciations(query) {
|
|
2632
|
+
const qs = buildQueryString(query);
|
|
2633
|
+
const result = await this.fetch(`/pronunciations${qs}`, {
|
|
2634
|
+
method: "GET"
|
|
2635
|
+
});
|
|
2636
|
+
return await parseJson(result);
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* @name Create pronunciation
|
|
2640
|
+
* @description Adds one the operator typed. It is said from the next render on
|
|
2641
|
+
*/
|
|
2642
|
+
async createPronunciation(body) {
|
|
2643
|
+
const result = await this.fetch(`/pronunciations`, {
|
|
2644
|
+
method: "POST",
|
|
2645
|
+
headers: {
|
|
2646
|
+
"Content-Type": "application/json"
|
|
2647
|
+
},
|
|
2648
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2649
|
+
});
|
|
2650
|
+
return await parseJson(result);
|
|
2651
|
+
}
|
|
2652
|
+
/**
|
|
2653
|
+
* @name Update pronunciation
|
|
2654
|
+
* @description Rewrites one entry's words, whoever proposed it
|
|
2655
|
+
*/
|
|
2656
|
+
async updatePronunciation(id, body) {
|
|
2657
|
+
const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, {
|
|
2658
|
+
method: "PUT",
|
|
2659
|
+
headers: {
|
|
2660
|
+
"Content-Type": "application/json"
|
|
2661
|
+
},
|
|
2662
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2663
|
+
});
|
|
2664
|
+
return await parseJson(result);
|
|
2665
|
+
}
|
|
2666
|
+
/**
|
|
2667
|
+
* @name Delete pronunciation
|
|
2668
|
+
* @description Removes an entry outright. Turning a PROPOSAL down is a state rather than a deletion, because a deleted one comes back on the next pass
|
|
2669
|
+
*/
|
|
2670
|
+
async deletePronunciation(id) {
|
|
2671
|
+
const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, {
|
|
2672
|
+
method: "DELETE"
|
|
2673
|
+
});
|
|
2674
|
+
return await parseJson(result);
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* @name Set pronunciation state
|
|
2678
|
+
* @description Accepts a proposal, turns one down, or takes an entry out of use without losing what it said
|
|
2679
|
+
*/
|
|
2680
|
+
async setPronunciationState(id, body) {
|
|
2681
|
+
const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}/state`, {
|
|
2682
|
+
method: "PUT",
|
|
2683
|
+
headers: {
|
|
2684
|
+
"Content-Type": "application/json"
|
|
2685
|
+
},
|
|
2686
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2687
|
+
});
|
|
2688
|
+
return await parseJson(result);
|
|
2689
|
+
}
|
|
2690
|
+
/**
|
|
2691
|
+
* @name List pads
|
|
2692
|
+
* @description Every sound the station holds, board by board
|
|
2693
|
+
*/
|
|
2694
|
+
async listPads() {
|
|
2695
|
+
const result = await this.fetch(`/pads`, {
|
|
2696
|
+
method: "GET"
|
|
2697
|
+
});
|
|
2698
|
+
return revivePadList(await parseJson(result));
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* @name Upload pad
|
|
2702
|
+
* @description Takes a sound in from the browser and puts it on a board. The file lands in the pad library on disk, so it survives a rebuild and an archive carries it
|
|
2703
|
+
*/
|
|
2704
|
+
async uploadPad(body) {
|
|
2705
|
+
const result = await this.fetch(`/pads`, {
|
|
2706
|
+
method: "POST",
|
|
2707
|
+
body
|
|
2708
|
+
});
|
|
2709
|
+
return revivePadList(await parseJson(result));
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* @name Scan the pad library
|
|
2713
|
+
* @description Takes whatever audio is sitting in the pad library directory onto its board. Safe to repeat: a file nobody has touched is seen and left alone
|
|
2714
|
+
*/
|
|
2715
|
+
async scanThePadLibrary() {
|
|
2716
|
+
const result = await this.fetch(`/pads/scan`, {
|
|
2717
|
+
method: "POST"
|
|
2718
|
+
});
|
|
2719
|
+
return await parseJson(result);
|
|
2720
|
+
}
|
|
2721
|
+
/**
|
|
2722
|
+
* @name Fetch pad
|
|
2723
|
+
* @description Fetches a sound from an address and puts it on a board. The operator names the address, so this is them choosing a file exactly as dropping one in the library is
|
|
2724
|
+
*/
|
|
2725
|
+
async fetchPad(body) {
|
|
2726
|
+
const result = await this.fetch(`/pads/fetch`, {
|
|
2727
|
+
method: "POST",
|
|
2728
|
+
headers: {
|
|
2729
|
+
"Content-Type": "application/json"
|
|
2730
|
+
},
|
|
2731
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2732
|
+
});
|
|
2733
|
+
return revivePadList(await parseJson(result));
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* @name Delete pad
|
|
2737
|
+
* @description Removes a sound the console put there, and the file it wrote for it
|
|
2738
|
+
*/
|
|
2739
|
+
async deletePad(id) {
|
|
2740
|
+
const result = await this.fetch(`/pads/${encodeURIComponent(id)}`, {
|
|
2741
|
+
method: "DELETE"
|
|
2742
|
+
});
|
|
2743
|
+
return revivePadList(await parseJson(result));
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* @name Set pad state
|
|
2747
|
+
* @description Turns a sound down, or puts one back. Answers the whole rack, since one pad changing state is one row moving between two sections of the same page
|
|
2748
|
+
*/
|
|
2749
|
+
async setPadState(id, body) {
|
|
2750
|
+
const result = await this.fetch(`/pads/${encodeURIComponent(id)}/state`, {
|
|
2751
|
+
method: "PUT",
|
|
2752
|
+
headers: {
|
|
2753
|
+
"Content-Type": "application/json"
|
|
2754
|
+
},
|
|
2755
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2756
|
+
});
|
|
2757
|
+
return revivePadList(await parseJson(result));
|
|
2758
|
+
}
|
|
2759
|
+
/**
|
|
2760
|
+
* @name Get pad audio
|
|
2761
|
+
* @description The sound itself, so an operator can hear what they dropped in
|
|
2762
|
+
*/
|
|
2763
|
+
async getPadAudio(id) {
|
|
2764
|
+
const result = await this.fetch(`/pads/${encodeURIComponent(id)}/audio`, {
|
|
2765
|
+
method: "GET",
|
|
2766
|
+
expectStatuses: [
|
|
2767
|
+
304
|
|
2768
|
+
]
|
|
2769
|
+
});
|
|
2770
|
+
switch (result.status) {
|
|
2771
|
+
case 304:
|
|
2772
|
+
return {
|
|
2773
|
+
status: 304
|
|
2774
|
+
};
|
|
2775
|
+
default:
|
|
2776
|
+
return {
|
|
2777
|
+
status: 200,
|
|
2778
|
+
contentType: readContentType(result),
|
|
2779
|
+
data: await result.blob(),
|
|
2780
|
+
headers: {
|
|
2781
|
+
cacheControl: result.headers.get("cache-control") ?? void 0,
|
|
2782
|
+
etag: result.headers.get("etag") ?? void 0
|
|
2783
|
+
}
|
|
2784
|
+
};
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* @name Create pad set
|
|
2789
|
+
* @description Names a new set, or answers the one already under that key
|
|
2790
|
+
*/
|
|
2791
|
+
async createPadSet(body) {
|
|
2792
|
+
const result = await this.fetch(`/pads/sets`, {
|
|
2793
|
+
method: "POST",
|
|
2794
|
+
headers: {
|
|
2795
|
+
"Content-Type": "application/json"
|
|
2796
|
+
},
|
|
2797
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2798
|
+
});
|
|
2799
|
+
return revivePadList(await parseJson(result));
|
|
2800
|
+
}
|
|
2801
|
+
/**
|
|
2802
|
+
* @name Update pad set
|
|
2803
|
+
* @description Renames a set. The KEY moves with it, so every persona naming the old one stops finding it
|
|
2804
|
+
*/
|
|
2805
|
+
async updatePadSet(id, body) {
|
|
2806
|
+
const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, {
|
|
2807
|
+
method: "PUT",
|
|
2808
|
+
headers: {
|
|
2809
|
+
"Content-Type": "application/json"
|
|
2810
|
+
},
|
|
2811
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2812
|
+
});
|
|
2813
|
+
return revivePadList(await parseJson(result));
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* @name Delete pad set
|
|
2817
|
+
* @description Removes a set and its memberships, and no pads at all
|
|
2818
|
+
*/
|
|
2819
|
+
async deletePadSet(id) {
|
|
2820
|
+
const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, {
|
|
2821
|
+
method: "DELETE"
|
|
2822
|
+
});
|
|
2823
|
+
return revivePadList(await parseJson(result));
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* @name Set pad membership
|
|
2827
|
+
* @description Puts a pad on a set or takes it off. Refused where the set already answers to that name, because a script writes a name
|
|
2828
|
+
*/
|
|
2829
|
+
async setPadMembership(id, body) {
|
|
2830
|
+
const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}/pads`, {
|
|
2831
|
+
method: "PUT",
|
|
2832
|
+
headers: {
|
|
2833
|
+
"Content-Type": "application/json"
|
|
2834
|
+
},
|
|
2835
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2836
|
+
});
|
|
2837
|
+
return revivePadList(await parseJson(result));
|
|
2838
|
+
}
|
|
2839
|
+
};
|
|
2840
|
+
|
|
2841
|
+
// src/schedule/schedule.client.ts
|
|
2842
|
+
var ScheduleClient = class {
|
|
2843
|
+
static {
|
|
2844
|
+
__name(this, "ScheduleClient");
|
|
2845
|
+
}
|
|
2846
|
+
fetch;
|
|
2847
|
+
constructor(fetch2) {
|
|
2848
|
+
this.fetch = fetch2;
|
|
2849
|
+
}
|
|
2850
|
+
/**
|
|
2851
|
+
* @name List schedule
|
|
2852
|
+
* @description Every slot in this station's schedule, earliest in the day first
|
|
2853
|
+
*/
|
|
2854
|
+
async listSchedule() {
|
|
2855
|
+
const result = await this.fetch(`/schedule`, {
|
|
2856
|
+
method: "GET"
|
|
2857
|
+
});
|
|
2858
|
+
return await parseJson(result);
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* @name Create schedule slot
|
|
2862
|
+
* @description Adds a slot. The station does not change over until its start time comes round
|
|
2863
|
+
*/
|
|
2864
|
+
async createScheduleSlot(body) {
|
|
2865
|
+
const result = await this.fetch(`/schedule`, {
|
|
2866
|
+
method: "POST",
|
|
2867
|
+
headers: {
|
|
2868
|
+
"Content-Type": "application/json"
|
|
2869
|
+
},
|
|
2870
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2871
|
+
});
|
|
2872
|
+
return await parseJson(result);
|
|
2873
|
+
}
|
|
2874
|
+
/**
|
|
2875
|
+
* @name Read current slot
|
|
2876
|
+
* @description Which slot the clock says should be on, and which one the station is actually airing
|
|
2877
|
+
*/
|
|
2878
|
+
async readCurrentSlot() {
|
|
2879
|
+
const result = await this.fetch(`/schedule/current`, {
|
|
2880
|
+
method: "GET"
|
|
2881
|
+
});
|
|
2882
|
+
return await parseJson(result);
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* @name Read timetable
|
|
2886
|
+
* @description The station's day as blocks, contiguous and gapless, for drawing
|
|
2887
|
+
*/
|
|
2888
|
+
async readTimetable(query) {
|
|
2889
|
+
const qs = buildQueryString(query);
|
|
2890
|
+
const result = await this.fetch(`/schedule/timetable${qs}`, {
|
|
2891
|
+
method: "GET"
|
|
2892
|
+
});
|
|
2893
|
+
return await parseJson(result);
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* @name Update schedule slot
|
|
2897
|
+
* @description Rewrites a slot. Takes effect at its next boundary rather than immediately
|
|
2898
|
+
*/
|
|
2899
|
+
async updateScheduleSlot(id, body) {
|
|
2900
|
+
const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, {
|
|
2901
|
+
method: "PUT",
|
|
2902
|
+
headers: {
|
|
2903
|
+
"Content-Type": "application/json"
|
|
2904
|
+
},
|
|
2905
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2906
|
+
});
|
|
2907
|
+
return await parseJson(result);
|
|
2908
|
+
}
|
|
2909
|
+
/**
|
|
2910
|
+
* @name Delete schedule slot
|
|
2911
|
+
* @description Removes a slot. Whatever is on air stays on until the next slot begins
|
|
2912
|
+
*/
|
|
2913
|
+
async deleteScheduleSlot(id) {
|
|
2914
|
+
const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, {
|
|
2915
|
+
method: "DELETE"
|
|
2916
|
+
});
|
|
2917
|
+
return await parseJson(result);
|
|
2918
|
+
}
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2921
|
+
// src/settings/settings.client.ts
|
|
2922
|
+
var SettingsClient = class {
|
|
2923
|
+
static {
|
|
2924
|
+
__name(this, "SettingsClient");
|
|
2925
|
+
}
|
|
2926
|
+
fetch;
|
|
2927
|
+
constructor(fetch2) {
|
|
2928
|
+
this.fetch = fetch2;
|
|
2929
|
+
}
|
|
2930
|
+
/**
|
|
2931
|
+
* @name Get settings
|
|
2932
|
+
* @description Every station setting, its descriptor and its current value
|
|
2933
|
+
*/
|
|
2934
|
+
async getSettings() {
|
|
2935
|
+
const result = await this.fetch(`/settings`, {
|
|
2936
|
+
method: "GET"
|
|
2937
|
+
});
|
|
2938
|
+
return await parseJson(result);
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* @name Update settings
|
|
2942
|
+
* @description Applies a submitted settings form and answers with the settings as they now stand
|
|
2943
|
+
*/
|
|
2944
|
+
async updateSettings(body) {
|
|
2945
|
+
const result = await this.fetch(`/settings`, {
|
|
2946
|
+
method: "PUT",
|
|
2947
|
+
headers: {
|
|
2948
|
+
"Content-Type": "application/json"
|
|
2949
|
+
},
|
|
2950
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
2951
|
+
});
|
|
2952
|
+
return await parseJson(result);
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
|
|
2956
|
+
// src/station/types/logs.types.ts
|
|
2957
|
+
import { Decimal as Decimal9 } from "decimal.js";
|
|
2958
|
+
import { DateTime as DateTime9 } from "luxon";
|
|
2959
|
+
Decimal9.set({
|
|
2960
|
+
toExpNeg: -9e15,
|
|
2961
|
+
toExpPos: 9e15
|
|
2962
|
+
});
|
|
2963
|
+
var __dt9 = /* @__PURE__ */ __name((v, path) => {
|
|
2964
|
+
if (typeof v !== "string") {
|
|
2965
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
2966
|
+
}
|
|
2967
|
+
const d = DateTime9.fromISO(v);
|
|
2968
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
2969
|
+
return d;
|
|
2970
|
+
}, "__dt");
|
|
2971
|
+
function reviveLogSource(raw) {
|
|
2972
|
+
const __o0 = raw;
|
|
2973
|
+
if (__o0["lastWriteAt"] != null) {
|
|
2974
|
+
__o0["lastWriteAt"] = __dt9(__o0["lastWriteAt"], "LogSource.lastWriteAt");
|
|
2975
|
+
}
|
|
2976
|
+
return raw;
|
|
2977
|
+
}
|
|
2978
|
+
__name(reviveLogSource, "reviveLogSource");
|
|
2979
|
+
function reviveLogSourceList(raw) {
|
|
2980
|
+
const __o0 = raw;
|
|
2981
|
+
{
|
|
2982
|
+
const __a1 = __o0["sources"];
|
|
2983
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
2984
|
+
reviveLogSource(__a1[__i2]);
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
return raw;
|
|
2988
|
+
}
|
|
2989
|
+
__name(reviveLogSourceList, "reviveLogSourceList");
|
|
2990
|
+
|
|
2991
|
+
// src/station/types/station.types.ts
|
|
2992
|
+
import { Decimal as Decimal10 } from "decimal.js";
|
|
2993
|
+
import { DateTime as DateTime10 } from "luxon";
|
|
2994
|
+
Decimal10.set({
|
|
2995
|
+
toExpNeg: -9e15,
|
|
2996
|
+
toExpPos: 9e15
|
|
2997
|
+
});
|
|
2998
|
+
var __dt10 = /* @__PURE__ */ __name((v, path) => {
|
|
2999
|
+
if (typeof v !== "string") {
|
|
3000
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3001
|
+
}
|
|
3002
|
+
const d = DateTime10.fromISO(v);
|
|
3003
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3004
|
+
return d;
|
|
3005
|
+
}, "__dt");
|
|
3006
|
+
function reviveStationHeartbeat(raw) {
|
|
3007
|
+
const __o0 = raw;
|
|
3008
|
+
__o0["startedAt"] = __dt10(__o0["startedAt"], "StationHeartbeat.startedAt");
|
|
3009
|
+
if (__o0["lastBeat"] != null) {
|
|
3010
|
+
__o0["lastBeat"] = __dt10(__o0["lastBeat"], "StationHeartbeat.lastBeat");
|
|
3011
|
+
}
|
|
3012
|
+
return raw;
|
|
3013
|
+
}
|
|
3014
|
+
__name(reviveStationHeartbeat, "reviveStationHeartbeat");
|
|
3015
|
+
function reviveStationCheckup(raw) {
|
|
3016
|
+
const __o0 = raw;
|
|
3017
|
+
__o0["readAt"] = __dt10(__o0["readAt"], "StationCheckup.readAt");
|
|
3018
|
+
if (__o0["heartbeats"] != null) {
|
|
3019
|
+
{
|
|
3020
|
+
const __a1 = __o0["heartbeats"];
|
|
3021
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
3022
|
+
reviveStationHeartbeat(__a1[__i2]);
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
return raw;
|
|
3027
|
+
}
|
|
3028
|
+
__name(reviveStationCheckup, "reviveStationCheckup");
|
|
3029
|
+
|
|
3030
|
+
// src/station/types/traces.types.ts
|
|
3031
|
+
import { Decimal as Decimal11 } from "decimal.js";
|
|
3032
|
+
import { DateTime as DateTime11 } from "luxon";
|
|
3033
|
+
Decimal11.set({
|
|
3034
|
+
toExpNeg: -9e15,
|
|
3035
|
+
toExpPos: 9e15
|
|
3036
|
+
});
|
|
3037
|
+
var __dt11 = /* @__PURE__ */ __name((v, path) => {
|
|
3038
|
+
if (typeof v !== "string") {
|
|
3039
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3040
|
+
}
|
|
3041
|
+
const d = DateTime11.fromISO(v);
|
|
3042
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3043
|
+
return d;
|
|
3044
|
+
}, "__dt");
|
|
3045
|
+
function reviveTraceDecision(raw) {
|
|
3046
|
+
const __o0 = raw;
|
|
3047
|
+
__o0["at"] = __dt11(__o0["at"], "TraceDecision.at");
|
|
3048
|
+
return raw;
|
|
3049
|
+
}
|
|
3050
|
+
__name(reviveTraceDecision, "reviveTraceDecision");
|
|
3051
|
+
function reviveTraceSpan(raw) {
|
|
3052
|
+
const __o0 = raw;
|
|
3053
|
+
__o0["at"] = __dt11(__o0["at"], "TraceSpan.at");
|
|
3054
|
+
return raw;
|
|
3055
|
+
}
|
|
3056
|
+
__name(reviveTraceSpan, "reviveTraceSpan");
|
|
3057
|
+
function reviveTracesPage(raw) {
|
|
3058
|
+
const __o0 = raw;
|
|
3059
|
+
{
|
|
3060
|
+
const __a1 = __o0["decisions"];
|
|
3061
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
3062
|
+
reviveTraceDecision(__a1[__i2]);
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
return raw;
|
|
3066
|
+
}
|
|
3067
|
+
__name(reviveTracesPage, "reviveTracesPage");
|
|
3068
|
+
function reviveTraceDetail(raw) {
|
|
3069
|
+
const __o0 = raw;
|
|
3070
|
+
reviveTraceDecision(__o0["decision"]);
|
|
3071
|
+
{
|
|
3072
|
+
const __a1 = __o0["spans"];
|
|
3073
|
+
for (let __i2 = 0; __i2 < __a1.length; __i2++) {
|
|
3074
|
+
reviveTraceSpan(__a1[__i2]);
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
if (__o0["parent"] != null) {
|
|
3078
|
+
reviveTraceDecision(__o0["parent"]);
|
|
3079
|
+
}
|
|
3080
|
+
{
|
|
3081
|
+
const __a3 = __o0["caused"];
|
|
3082
|
+
for (let __i4 = 0; __i4 < __a3.length; __i4++) {
|
|
3083
|
+
reviveTraceDecision(__a3[__i4]);
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
return raw;
|
|
3087
|
+
}
|
|
3088
|
+
__name(reviveTraceDetail, "reviveTraceDetail");
|
|
3089
|
+
|
|
3090
|
+
// src/station/station.client.ts
|
|
3091
|
+
var StationClient = class {
|
|
3092
|
+
static {
|
|
3093
|
+
__name(this, "StationClient");
|
|
3094
|
+
}
|
|
3095
|
+
fetch;
|
|
3096
|
+
constructor(fetch2) {
|
|
3097
|
+
this.fetch = fetch2;
|
|
3098
|
+
}
|
|
3099
|
+
/**
|
|
3100
|
+
* @name List logs
|
|
3101
|
+
* @description Every log this install has, present or not, with its size and when it was last written
|
|
3102
|
+
*/
|
|
3103
|
+
async listLogs() {
|
|
3104
|
+
const result = await this.fetch(`/logs`, {
|
|
3105
|
+
method: "GET"
|
|
3106
|
+
});
|
|
3107
|
+
return reviveLogSourceList(await parseJson(result));
|
|
3108
|
+
}
|
|
3109
|
+
/**
|
|
3110
|
+
* @name Read log
|
|
3111
|
+
* @description A tail of one log, newest first
|
|
3112
|
+
*/
|
|
3113
|
+
async readLog(id, query) {
|
|
3114
|
+
const qs = buildQueryString(query);
|
|
3115
|
+
const result = await this.fetch(`/logs/${encodeURIComponent(id)}${qs}`, {
|
|
3116
|
+
method: "GET"
|
|
3117
|
+
});
|
|
3118
|
+
return await parseJson(result);
|
|
3119
|
+
}
|
|
3120
|
+
/**
|
|
3121
|
+
* @name Download log
|
|
3122
|
+
* @description The retained log as a plain-text attachment, oldest first, as the file is written
|
|
3123
|
+
*/
|
|
3124
|
+
async downloadLog(id) {
|
|
3125
|
+
const result = await this.fetch(`/logs/${encodeURIComponent(id)}/download`, {
|
|
3126
|
+
method: "GET"
|
|
3127
|
+
});
|
|
3128
|
+
const data = await result.text();
|
|
3129
|
+
return {
|
|
3130
|
+
data,
|
|
3131
|
+
headers: {
|
|
3132
|
+
contentDisposition: result.headers.get("Content-Disposition") ?? void 0
|
|
3133
|
+
}
|
|
3134
|
+
};
|
|
3135
|
+
}
|
|
3136
|
+
/**
|
|
3137
|
+
* @name Read station attention
|
|
3138
|
+
* @description Everything wrong or waiting, worst first, each with the console page that can act on it
|
|
3139
|
+
*/
|
|
3140
|
+
async readStationAttention() {
|
|
3141
|
+
const result = await this.fetch(`/station/attention`, {
|
|
3142
|
+
method: "GET"
|
|
3143
|
+
});
|
|
3144
|
+
return await parseJson(result);
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* @name Read station checkup
|
|
3148
|
+
* @description The loops the station runs and how much of the library it has looked at
|
|
3149
|
+
*/
|
|
3150
|
+
async readStationCheckup() {
|
|
3151
|
+
const result = await this.fetch(`/station/checkup`, {
|
|
3152
|
+
method: "GET"
|
|
3153
|
+
});
|
|
3154
|
+
return reviveStationCheckup(await parseJson(result));
|
|
3155
|
+
}
|
|
3156
|
+
/**
|
|
3157
|
+
* @name Read traces
|
|
3158
|
+
* @description Recent decisions, newest first, folded to one row each
|
|
3159
|
+
*/
|
|
3160
|
+
async readTraces(query) {
|
|
3161
|
+
const qs = buildQueryString(query);
|
|
3162
|
+
const result = await this.fetch(`/traces${qs}`, {
|
|
3163
|
+
method: "GET"
|
|
3164
|
+
});
|
|
3165
|
+
return reviveTracesPage(await parseJson(result));
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* @name Read trace
|
|
3169
|
+
* @description One decision: every call it made, and the decisions on either side of it
|
|
3170
|
+
*/
|
|
3171
|
+
async readTrace(id) {
|
|
3172
|
+
const result = await this.fetch(`/traces/${encodeURIComponent(id)}`, {
|
|
3173
|
+
method: "GET"
|
|
3174
|
+
});
|
|
3175
|
+
return reviveTraceDetail(await parseJson(result));
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3178
|
+
|
|
3179
|
+
// src/storage/types/storage.types.ts
|
|
3180
|
+
import { Decimal as Decimal12 } from "decimal.js";
|
|
3181
|
+
import { DateTime as DateTime12 } from "luxon";
|
|
3182
|
+
Decimal12.set({
|
|
3183
|
+
toExpNeg: -9e15,
|
|
3184
|
+
toExpPos: 9e15
|
|
3185
|
+
});
|
|
3186
|
+
var __dt12 = /* @__PURE__ */ __name((v, path) => {
|
|
3187
|
+
if (typeof v !== "string") {
|
|
3188
|
+
throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);
|
|
3189
|
+
}
|
|
3190
|
+
const d = DateTime12.fromISO(v);
|
|
3191
|
+
if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);
|
|
3192
|
+
return d;
|
|
3193
|
+
}, "__dt");
|
|
3194
|
+
function reviveStorageReport(raw) {
|
|
3195
|
+
const __o0 = raw;
|
|
3196
|
+
__o0["readAt"] = __dt12(__o0["readAt"], "StorageReport.readAt");
|
|
3197
|
+
return raw;
|
|
3198
|
+
}
|
|
3199
|
+
__name(reviveStorageReport, "reviveStorageReport");
|
|
3200
|
+
|
|
3201
|
+
// src/storage/storage.client.ts
|
|
3202
|
+
var StorageClient = class {
|
|
3203
|
+
static {
|
|
3204
|
+
__name(this, "StorageClient");
|
|
3205
|
+
}
|
|
3206
|
+
fetch;
|
|
3207
|
+
constructor(fetch2) {
|
|
3208
|
+
this.fetch = fetch2;
|
|
3209
|
+
}
|
|
3210
|
+
/**
|
|
3211
|
+
* @name Read storage
|
|
3212
|
+
* @description What is on disk, per store, against what the database says should be
|
|
3213
|
+
*/
|
|
3214
|
+
async readStorage() {
|
|
3215
|
+
const result = await this.fetch(`/storage`, {
|
|
3216
|
+
method: "GET"
|
|
3217
|
+
});
|
|
3218
|
+
return reviveStorageReport(await parseJson(result));
|
|
3219
|
+
}
|
|
3220
|
+
};
|
|
3221
|
+
|
|
3222
|
+
// src/stream/stream.client.ts
|
|
3223
|
+
var StreamClient = class {
|
|
3224
|
+
static {
|
|
3225
|
+
__name(this, "StreamClient");
|
|
3226
|
+
}
|
|
3227
|
+
fetch;
|
|
3228
|
+
constructor(fetch2) {
|
|
3229
|
+
this.fetch = fetch2;
|
|
3230
|
+
}
|
|
3231
|
+
/**
|
|
3232
|
+
* @name Get HLS playlist
|
|
3233
|
+
* @description One HLS playlist, and the tick that says somebody is still listening to it
|
|
3234
|
+
*/
|
|
3235
|
+
async getHLSPlaylist(name) {
|
|
3236
|
+
const result = await this.fetch(`/hls/${encodeURIComponent(name)}`, {
|
|
3237
|
+
method: "GET"
|
|
3238
|
+
});
|
|
3239
|
+
const data = await result.blob();
|
|
3240
|
+
return {
|
|
3241
|
+
data,
|
|
3242
|
+
headers: {
|
|
3243
|
+
cacheControl: result.headers.get("cache-control") ?? void 0
|
|
3244
|
+
}
|
|
3245
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
/**
|
|
3248
|
+
* @name Read fetcher authorization
|
|
3249
|
+
* @description What the track fetcher holds by way of a Spotify login, and whether an authorization is already waiting to be finished
|
|
3250
|
+
*/
|
|
3251
|
+
async readFetcherAuthorization() {
|
|
3252
|
+
const result = await this.fetch(`/stream/authorization`, {
|
|
3253
|
+
method: "GET"
|
|
3254
|
+
});
|
|
3255
|
+
return await parseJson(result);
|
|
3256
|
+
}
|
|
3257
|
+
/**
|
|
3258
|
+
* @name Start fetcher authorization
|
|
3259
|
+
* @description Starts the fetcher's one-time authorization and answers with the URL to open. Starting another replaces whichever was pending
|
|
3260
|
+
*/
|
|
3261
|
+
async startFetcherAuthorization() {
|
|
3262
|
+
const result = await this.fetch(`/stream/authorization`, {
|
|
3263
|
+
method: "POST"
|
|
3264
|
+
});
|
|
3265
|
+
return await parseJson(result);
|
|
3266
|
+
}
|
|
3267
|
+
/**
|
|
3268
|
+
* @name Finish fetcher authorization
|
|
3269
|
+
* @description Finishes an authorization from the address the operator's browser ended up at
|
|
3270
|
+
*/
|
|
3271
|
+
async finishFetcherAuthorization(body) {
|
|
3272
|
+
const result = await this.fetch(`/stream/authorization/complete`, {
|
|
3273
|
+
method: "POST",
|
|
3274
|
+
headers: {
|
|
3275
|
+
"Content-Type": "application/json"
|
|
3276
|
+
},
|
|
3277
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
3278
|
+
});
|
|
3279
|
+
return await parseJson(result);
|
|
3280
|
+
}
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
// src/topics/topics.client.ts
|
|
3284
|
+
var TopicsClient = class {
|
|
3285
|
+
static {
|
|
3286
|
+
__name(this, "TopicsClient");
|
|
3287
|
+
}
|
|
3288
|
+
fetch;
|
|
3289
|
+
constructor(fetch2) {
|
|
3290
|
+
this.fetch = fetch2;
|
|
3291
|
+
}
|
|
3292
|
+
/**
|
|
3293
|
+
* @name List topics
|
|
3294
|
+
* @description Every subject this station has named, for one sort of break or for all of them
|
|
3295
|
+
*/
|
|
3296
|
+
async listTopics(query) {
|
|
3297
|
+
const qs = buildQueryString(query);
|
|
3298
|
+
const result = await this.fetch(`/topics${qs}`, {
|
|
3299
|
+
method: "GET"
|
|
3300
|
+
});
|
|
3301
|
+
return await parseJson(result);
|
|
3302
|
+
}
|
|
3303
|
+
/**
|
|
3304
|
+
* @name Create topic
|
|
3305
|
+
* @description Names a new subject. Nothing uses it until something points at it
|
|
3306
|
+
*/
|
|
3307
|
+
async createTopic(body) {
|
|
3308
|
+
const result = await this.fetch(`/topics`, {
|
|
3309
|
+
method: "POST",
|
|
3310
|
+
headers: {
|
|
3311
|
+
"Content-Type": "application/json"
|
|
3312
|
+
},
|
|
3313
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
3314
|
+
});
|
|
3315
|
+
return await parseJson(result);
|
|
3316
|
+
}
|
|
3317
|
+
/**
|
|
3318
|
+
* @name List topic kinds
|
|
3319
|
+
* @description Which sorts of break have subjects, and the form each one's settings are edited with
|
|
3320
|
+
*/
|
|
3321
|
+
async listTopicKinds() {
|
|
3322
|
+
const result = await this.fetch(`/topics/kinds`, {
|
|
3323
|
+
method: "GET"
|
|
3324
|
+
});
|
|
3325
|
+
return await parseJson(result);
|
|
3326
|
+
}
|
|
3327
|
+
/**
|
|
3328
|
+
* @name Update topic
|
|
3329
|
+
* @description Rewrites one subject. A break already written keeps the words it was given
|
|
3330
|
+
*/
|
|
3331
|
+
async updateTopic(id, body) {
|
|
3332
|
+
const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, {
|
|
3333
|
+
method: "PUT",
|
|
3334
|
+
headers: {
|
|
3335
|
+
"Content-Type": "application/json"
|
|
3336
|
+
},
|
|
3337
|
+
body: JSON.stringify(body, bigIntReplacer)
|
|
3338
|
+
});
|
|
3339
|
+
return await parseJson(result);
|
|
3340
|
+
}
|
|
3341
|
+
/**
|
|
3342
|
+
* @name Delete topic
|
|
3343
|
+
* @description Removes a subject, and any band on the format clock that asked for it
|
|
3344
|
+
*/
|
|
3345
|
+
async deleteTopic(id) {
|
|
3346
|
+
const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, {
|
|
3347
|
+
method: "DELETE"
|
|
3348
|
+
});
|
|
3349
|
+
return await parseJson(result);
|
|
3350
|
+
}
|
|
3351
|
+
};
|
|
3352
|
+
|
|
3353
|
+
// src/deadair.sdk.ts
|
|
3354
|
+
var DeadairSdk = class {
|
|
3355
|
+
static {
|
|
3356
|
+
__name(this, "DeadairSdk");
|
|
3357
|
+
}
|
|
3358
|
+
activity;
|
|
3359
|
+
art;
|
|
3360
|
+
authentication;
|
|
3361
|
+
catalog;
|
|
3362
|
+
charts;
|
|
3363
|
+
director;
|
|
3364
|
+
history;
|
|
3365
|
+
news;
|
|
3366
|
+
nowplaying;
|
|
3367
|
+
onboarding;
|
|
3368
|
+
personas;
|
|
3369
|
+
playlists;
|
|
3370
|
+
playout;
|
|
3371
|
+
plugins;
|
|
3372
|
+
productions;
|
|
3373
|
+
render;
|
|
3374
|
+
schedule;
|
|
3375
|
+
settings;
|
|
3376
|
+
station;
|
|
3377
|
+
storage;
|
|
3378
|
+
stream;
|
|
3379
|
+
topics;
|
|
3380
|
+
constructor(options) {
|
|
3381
|
+
const sdkFetch = options.fetch ?? createSdkFetch(options);
|
|
3382
|
+
this.activity = new ActivityClient(sdkFetch);
|
|
3383
|
+
this.art = new ArtClient(sdkFetch);
|
|
3384
|
+
this.authentication = new AuthenticationClient(sdkFetch);
|
|
3385
|
+
this.catalog = new CatalogClient(sdkFetch);
|
|
3386
|
+
this.charts = new ChartsClient(sdkFetch);
|
|
3387
|
+
this.director = new DirectorClient(sdkFetch);
|
|
3388
|
+
this.history = new HistoryClient(sdkFetch);
|
|
3389
|
+
this.news = new NewsClient(sdkFetch);
|
|
3390
|
+
this.nowplaying = new NowplayingClient(sdkFetch);
|
|
3391
|
+
this.onboarding = new OnboardingClient(sdkFetch);
|
|
3392
|
+
this.personas = new PersonasClient(sdkFetch);
|
|
3393
|
+
this.playlists = new PlaylistsClient(sdkFetch);
|
|
3394
|
+
this.playout = new PlayoutClient(sdkFetch);
|
|
3395
|
+
this.plugins = new PluginsClient(sdkFetch);
|
|
3396
|
+
this.productions = new ProductionsClient(sdkFetch);
|
|
3397
|
+
this.render = new RenderClient(sdkFetch);
|
|
3398
|
+
this.schedule = new ScheduleClient(sdkFetch);
|
|
3399
|
+
this.settings = new SettingsClient(sdkFetch);
|
|
3400
|
+
this.station = new StationClient(sdkFetch);
|
|
3401
|
+
this.storage = new StorageClient(sdkFetch);
|
|
3402
|
+
this.stream = new StreamClient(sdkFetch);
|
|
3403
|
+
this.topics = new TopicsClient(sdkFetch);
|
|
3404
|
+
}
|
|
3405
|
+
};
|
|
3406
|
+
export {
|
|
3407
|
+
ActivityClient,
|
|
3408
|
+
ArtClient,
|
|
3409
|
+
AuthenticationClient,
|
|
3410
|
+
AuthenticationFactorsClient,
|
|
3411
|
+
AuthenticationSessionsClient,
|
|
3412
|
+
CatalogClient,
|
|
3413
|
+
ChartsClient,
|
|
3414
|
+
DeadairSdk,
|
|
3415
|
+
DirectorClient,
|
|
3416
|
+
HistoryClient,
|
|
3417
|
+
NewsClient,
|
|
3418
|
+
NowplayingClient,
|
|
3419
|
+
OnboardingClient,
|
|
3420
|
+
PersonasClient,
|
|
3421
|
+
PlaylistsClient,
|
|
3422
|
+
PlayoutClient,
|
|
3423
|
+
PluginsClient,
|
|
3424
|
+
ProductionsClient,
|
|
3425
|
+
RenderClient,
|
|
3426
|
+
ScheduleClient,
|
|
3427
|
+
SdkError,
|
|
3428
|
+
SettingsClient,
|
|
3429
|
+
StationClient,
|
|
3430
|
+
StorageClient,
|
|
3431
|
+
StreamClient,
|
|
3432
|
+
TopicsClient,
|
|
3433
|
+
bigIntReplacer,
|
|
3434
|
+
bigIntReviver,
|
|
3435
|
+
buildHeaders,
|
|
3436
|
+
buildQueryString,
|
|
3437
|
+
createSdkFetch,
|
|
3438
|
+
parseBigIntHeader,
|
|
3439
|
+
parseJson,
|
|
3440
|
+
parseJsonWithBigInt,
|
|
3441
|
+
readContentType,
|
|
3442
|
+
reviveActivityEntry,
|
|
3443
|
+
reviveActivityPage,
|
|
3444
|
+
reviveAlbumEnrichmentDetail,
|
|
3445
|
+
reviveAlbumEnrichmentSource,
|
|
3446
|
+
reviveArtistEnrichmentDetail,
|
|
3447
|
+
reviveArtistEnrichmentSource,
|
|
3448
|
+
reviveAuthenticationFactorRegistrationResponse,
|
|
3449
|
+
reviveAuthenticationLoginStartResponse,
|
|
3450
|
+
reviveAuthenticationRegistration,
|
|
3451
|
+
reviveAuthenticationTokenResponse,
|
|
3452
|
+
reviveAuthenticationTokenResponseOutput,
|
|
3453
|
+
reviveAuthenticatorFactorRegistrationResponse,
|
|
3454
|
+
reviveBaseAuthenticationLoginStartResponse,
|
|
3455
|
+
reviveCodeAuthenticationLoginStartResponse,
|
|
3456
|
+
reviveEmailFactorRegistrationResponse,
|
|
3457
|
+
reviveFactClaim,
|
|
3458
|
+
reviveFactorChallengeEmailStartResponse,
|
|
3459
|
+
reviveFactorChallengeEmailStartResponseOutput,
|
|
3460
|
+
reviveFactorChallengeFidoStartResponse,
|
|
3461
|
+
reviveFactorChallengeFidoStartResponseOutput,
|
|
3462
|
+
reviveFactorChallengePhoneStartResponse,
|
|
3463
|
+
reviveFactorChallengePhoneStartResponseOutput,
|
|
3464
|
+
reviveFactorChallengeStartResponse,
|
|
3465
|
+
reviveFactorChallengeStartResponseOutput,
|
|
3466
|
+
reviveFidoAuthenticationLoginStartResponse,
|
|
3467
|
+
reviveFidoFactorRegistrationResponse,
|
|
3468
|
+
reviveHistoryEntry,
|
|
3469
|
+
reviveHistoryPage,
|
|
3470
|
+
reviveLinkAuthenticationLoginStartResponse,
|
|
3471
|
+
reviveLogSource,
|
|
3472
|
+
reviveLogSourceList,
|
|
3473
|
+
reviveLogin,
|
|
3474
|
+
reviveMfaEnrollFidoStartResponse,
|
|
3475
|
+
reviveMfaEnrollPhoneStartResponse,
|
|
3476
|
+
reviveMfaRequiredResponse,
|
|
3477
|
+
reviveMfaRequiredResponseOutput,
|
|
3478
|
+
reviveOidcAuthenticationLoginStartResponse,
|
|
3479
|
+
reviveOidcLoginStartResponse,
|
|
3480
|
+
revivePad,
|
|
3481
|
+
revivePadList,
|
|
3482
|
+
revivePhoneFactorRegistrationResponse,
|
|
3483
|
+
revivePluginDetail,
|
|
3484
|
+
revivePluginImportResult,
|
|
3485
|
+
revivePluginSummary,
|
|
3486
|
+
reviveProduction,
|
|
3487
|
+
reviveProductionList,
|
|
3488
|
+
reviveProductionRequest,
|
|
3489
|
+
reviveScriptAttempt,
|
|
3490
|
+
reviveScriptHistoryPage,
|
|
3491
|
+
reviveSession,
|
|
3492
|
+
reviveSessionFactor,
|
|
3493
|
+
reviveStationCheckup,
|
|
3494
|
+
reviveStationHeartbeat,
|
|
3495
|
+
reviveStepUpStartResponse,
|
|
3496
|
+
reviveStepUpStartResponseOutput,
|
|
3497
|
+
reviveStorageReport,
|
|
3498
|
+
reviveTraceDecision,
|
|
3499
|
+
reviveTraceDetail,
|
|
3500
|
+
reviveTraceSpan,
|
|
3501
|
+
reviveTracesPage,
|
|
3502
|
+
reviveTrackAnalysis,
|
|
3503
|
+
reviveTrackBinding,
|
|
3504
|
+
reviveTrackDetail,
|
|
3505
|
+
reviveTrackEnrichmentDetail,
|
|
3506
|
+
reviveTrackEnrichmentSource,
|
|
3507
|
+
reviveTrackPlay
|
|
3508
|
+
};
|
|
3509
|
+
//# sourceMappingURL=index.js.map
|