@magritte/api 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2014 @@
1
+ import * as e from "zod";
2
+ //#region src/openapi/core/bodySerializer.gen.ts
3
+ var t = (e, t, n) => {
4
+ typeof n == "string" || n instanceof Blob ? e.append(t, n) : n instanceof Date ? e.append(t, n.toISOString()) : e.append(t, JSON.stringify(n));
5
+ }, n = (e, t, n) => {
6
+ typeof n == "string" ? e.append(t, n) : e.append(t, JSON.stringify(n));
7
+ }, r = { bodySerializer: (e) => {
8
+ let n = new FormData();
9
+ return Object.entries(e).forEach(([e, r]) => {
10
+ r != null && (Array.isArray(r) ? r.forEach((r) => t(n, e, r)) : t(n, e, r));
11
+ }), n;
12
+ } }, i = { bodySerializer: (e) => JSON.stringify(e, (e, t) => typeof t == "bigint" ? t.toString() : t) }, a = { bodySerializer: (e) => {
13
+ let t = new URLSearchParams();
14
+ return Object.entries(e).forEach(([e, r]) => {
15
+ r != null && (Array.isArray(r) ? r.forEach((r) => n(t, e, r)) : n(t, e, r));
16
+ }), t.toString();
17
+ } };
18
+ Object.entries({
19
+ $body_: "body",
20
+ $headers_: "headers",
21
+ $path_: "path",
22
+ $query_: "query"
23
+ });
24
+ //#endregion
25
+ //#region src/openapi/core/serverSentEvents.gen.ts
26
+ function o({ onRequest: e, onSseError: t, onSseEvent: n, responseTransformer: r, responseValidator: i, sseDefaultRetryDelay: a, sseMaxRetryAttempts: o, sseMaxRetryDelay: s, sseSleepFn: c, url: l, ...u }) {
27
+ let d, f = c ?? ((e) => new Promise((t) => setTimeout(t, e)));
28
+ return { stream: async function* () {
29
+ let c = a ?? 3e3, p = 0, m = u.signal ?? new AbortController().signal;
30
+ for (; !m.aborted;) {
31
+ p++;
32
+ let a = u.headers instanceof Headers ? u.headers : new Headers(u.headers);
33
+ d !== void 0 && a.set("Last-Event-ID", d);
34
+ try {
35
+ let t = {
36
+ redirect: "follow",
37
+ ...u,
38
+ body: u.serializedBody,
39
+ headers: a,
40
+ signal: m
41
+ }, o = new Request(l, t);
42
+ e && (o = await e(l, t));
43
+ let s = await (u.fetch ?? globalThis.fetch)(o);
44
+ if (!s.ok) throw Error(`SSE failed: ${s.status} ${s.statusText}`);
45
+ if (!s.body) throw Error("No body in SSE response");
46
+ let f = s.body.pipeThrough(new TextDecoderStream()).getReader(), p = "", h = () => {
47
+ try {
48
+ f.cancel();
49
+ } catch {}
50
+ };
51
+ m.addEventListener("abort", h);
52
+ try {
53
+ for (;;) {
54
+ let { done: e, value: t } = await f.read();
55
+ if (e) break;
56
+ p += t, p = p.replace(/\r\n?/g, "\n");
57
+ let a = p.split("\n\n");
58
+ p = a.pop() ?? "";
59
+ for (let e of a) {
60
+ let t = e.split("\n"), a = [], o;
61
+ for (let e of t) if (e.startsWith("data:")) a.push(e.replace(/^data:\s*/, ""));
62
+ else if (e.startsWith("event:")) o = e.replace(/^event:\s*/, "");
63
+ else if (e.startsWith("id:")) d = e.replace(/^id:\s*/, "");
64
+ else if (e.startsWith("retry:")) {
65
+ let t = Number.parseInt(e.replace(/^retry:\s*/, ""), 10);
66
+ Number.isNaN(t) || (c = t);
67
+ }
68
+ let s, l = !1;
69
+ if (a.length) {
70
+ let e = a.join("\n");
71
+ try {
72
+ s = JSON.parse(e), l = !0;
73
+ } catch {
74
+ s = e;
75
+ }
76
+ }
77
+ l && (i && await i(s), r && (s = await r(s))), n?.({
78
+ data: s,
79
+ event: o,
80
+ id: d,
81
+ retry: c
82
+ }), a.length && (yield s);
83
+ }
84
+ }
85
+ } finally {
86
+ m.removeEventListener("abort", h), f.releaseLock();
87
+ }
88
+ break;
89
+ } catch (e) {
90
+ if (t?.(e), o !== void 0 && p >= o) break;
91
+ let n = Math.min(c * 2 ** (p - 1), s ?? 3e4);
92
+ await f(n);
93
+ }
94
+ }
95
+ }() };
96
+ }
97
+ //#endregion
98
+ //#region src/openapi/core/pathSerializer.gen.ts
99
+ var s = (e) => {
100
+ switch (e) {
101
+ case "label": return ".";
102
+ case "matrix": return ";";
103
+ case "simple": return ",";
104
+ default: return "&";
105
+ }
106
+ }, c = (e) => {
107
+ switch (e) {
108
+ case "form": return ",";
109
+ case "pipeDelimited": return "|";
110
+ case "spaceDelimited": return "%20";
111
+ default: return ",";
112
+ }
113
+ }, l = (e) => {
114
+ switch (e) {
115
+ case "label": return ".";
116
+ case "matrix": return ";";
117
+ case "simple": return ",";
118
+ default: return "&";
119
+ }
120
+ }, u = ({ allowReserved: e, explode: t, name: n, style: r, value: i }) => {
121
+ if (!t) {
122
+ let t = (e ? i : i.map((e) => encodeURIComponent(e))).join(c(r));
123
+ switch (r) {
124
+ case "label": return `.${t}`;
125
+ case "matrix": return `;${n}=${t}`;
126
+ case "simple": return t;
127
+ default: return `${n}=${t}`;
128
+ }
129
+ }
130
+ let a = s(r), o = i.map((t) => r === "label" || r === "simple" ? e ? t : encodeURIComponent(t) : d({
131
+ allowReserved: e,
132
+ name: n,
133
+ value: t
134
+ })).join(a);
135
+ return r === "label" || r === "matrix" ? a + o : o;
136
+ }, d = ({ allowReserved: e, name: t, value: n }) => {
137
+ if (n == null) return "";
138
+ if (typeof n == "object") throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
139
+ return `${t}=${e ? n : encodeURIComponent(n)}`;
140
+ }, f = ({ allowReserved: e, explode: t, name: n, style: r, value: i, valueOnly: a }) => {
141
+ if (i instanceof Date) return a ? i.toISOString() : `${n}=${i.toISOString()}`;
142
+ if (r !== "deepObject" && !t) {
143
+ let t = [];
144
+ Object.entries(i).forEach(([n, r]) => {
145
+ t = [
146
+ ...t,
147
+ n,
148
+ e ? r : encodeURIComponent(r)
149
+ ];
150
+ });
151
+ let a = t.join(",");
152
+ switch (r) {
153
+ case "form": return `${n}=${a}`;
154
+ case "label": return `.${a}`;
155
+ case "matrix": return `;${n}=${a}`;
156
+ default: return a;
157
+ }
158
+ }
159
+ let o = l(r), s = Object.entries(i).map(([t, i]) => d({
160
+ allowReserved: e,
161
+ name: r === "deepObject" ? `${n}[${t}]` : t,
162
+ value: i
163
+ })).join(o);
164
+ return r === "label" || r === "matrix" ? o + s : s;
165
+ }, p = /\{[^{}]+\}/g, m = ({ path: e, url: t }) => {
166
+ let n = t, r = t.match(p);
167
+ if (r) for (let t of r) {
168
+ let r = !1, i = t.substring(1, t.length - 1), a = "simple";
169
+ i.endsWith("*") && (r = !0, i = i.substring(0, i.length - 1)), i.startsWith(".") ? (i = i.substring(1), a = "label") : i.startsWith(";") && (i = i.substring(1), a = "matrix");
170
+ let o = e[i];
171
+ if (o == null) continue;
172
+ if (Array.isArray(o)) {
173
+ n = n.replace(t, u({
174
+ explode: r,
175
+ name: i,
176
+ style: a,
177
+ value: o
178
+ }));
179
+ continue;
180
+ }
181
+ if (typeof o == "object") {
182
+ n = n.replace(t, f({
183
+ explode: r,
184
+ name: i,
185
+ style: a,
186
+ value: o,
187
+ valueOnly: !0
188
+ }));
189
+ continue;
190
+ }
191
+ if (a === "matrix") {
192
+ n = n.replace(t, `;${d({
193
+ name: i,
194
+ value: o
195
+ })}`);
196
+ continue;
197
+ }
198
+ let s = encodeURIComponent(a === "label" ? `.${o}` : o);
199
+ n = n.replace(t, s);
200
+ }
201
+ return n;
202
+ }, h = ({ baseUrl: e, path: t, query: n, querySerializer: r, url: i }) => {
203
+ let a = i.startsWith("/") ? i : `/${i}`, o = (e ?? "") + a;
204
+ t && (o = m({
205
+ path: t,
206
+ url: o
207
+ }));
208
+ let s = n ? r(n) : "";
209
+ return s.startsWith("?") && (s = s.substring(1)), s && (o += `?${s}`), o;
210
+ };
211
+ function g(e) {
212
+ let t = e.body !== void 0;
213
+ if (t && e.bodySerializer) return "serializedBody" in e ? e.serializedBody !== void 0 && e.serializedBody !== "" ? e.serializedBody : null : e.body === "" ? null : e.body;
214
+ if (t) return e.body;
215
+ }
216
+ //#endregion
217
+ //#region src/openapi/core/auth.gen.ts
218
+ var ee = async (e, t) => {
219
+ let n = typeof t == "function" ? await t(e) : t;
220
+ if (n) return e.scheme === "bearer" ? `Bearer ${n}` : e.scheme === "basic" ? `Basic ${btoa(n)}` : n;
221
+ }, _ = ({ parameters: e = {}, ...t } = {}) => (n) => {
222
+ let r = [];
223
+ if (n && typeof n == "object") for (let i in n) {
224
+ let a = n[i];
225
+ if (a == null) continue;
226
+ let o = e[i] || t;
227
+ if (Array.isArray(a)) {
228
+ let e = u({
229
+ allowReserved: o.allowReserved,
230
+ explode: !0,
231
+ name: i,
232
+ style: "form",
233
+ value: a,
234
+ ...o.array
235
+ });
236
+ e && r.push(e);
237
+ } else if (typeof a == "object") {
238
+ let e = f({
239
+ allowReserved: o.allowReserved,
240
+ explode: !0,
241
+ name: i,
242
+ style: "deepObject",
243
+ value: a,
244
+ ...o.object
245
+ });
246
+ e && r.push(e);
247
+ } else {
248
+ let e = d({
249
+ allowReserved: o.allowReserved,
250
+ name: i,
251
+ value: a
252
+ });
253
+ e && r.push(e);
254
+ }
255
+ }
256
+ return r.join("&");
257
+ }, te = (e) => {
258
+ if (!e) return "stream";
259
+ let t = e.split(";")[0]?.trim();
260
+ if (t) {
261
+ if (t.startsWith("application/json") || t.endsWith("+json")) return "json";
262
+ if (t === "multipart/form-data") return "formData";
263
+ if ([
264
+ "application/",
265
+ "audio/",
266
+ "image/",
267
+ "video/"
268
+ ].some((e) => t.startsWith(e))) return "blob";
269
+ if (t.startsWith("text/")) return "text";
270
+ }
271
+ }, ne = (e, t) => t ? !!(e.headers.has(t) || e.query?.[t] || e.headers.get("Cookie")?.includes(`${t}=`)) : !1;
272
+ async function re(e) {
273
+ for (let t of e.security ?? []) {
274
+ if (ne(e, t.name)) continue;
275
+ let n = await ee(t, e.auth);
276
+ if (!n) continue;
277
+ let r = t.name ?? "Authorization";
278
+ switch (t.in) {
279
+ case "query":
280
+ e.query ||= {}, e.query[r] = n;
281
+ break;
282
+ case "cookie":
283
+ e.headers.append("Cookie", `${r}=${n}`);
284
+ break;
285
+ default: e.headers.set(r, n);
286
+ }
287
+ }
288
+ }
289
+ var v = (e) => h({
290
+ baseUrl: e.baseUrl,
291
+ path: e.path,
292
+ query: e.query,
293
+ querySerializer: typeof e.querySerializer == "function" ? e.querySerializer : _(e.querySerializer),
294
+ url: e.url
295
+ }), y = (e, t) => {
296
+ let n = {
297
+ ...e,
298
+ ...t
299
+ };
300
+ return n.baseUrl?.endsWith("/") && (n.baseUrl = n.baseUrl.substring(0, n.baseUrl.length - 1)), n.headers = b(e.headers, t.headers), n;
301
+ }, ie = (e) => {
302
+ let t = [];
303
+ return e.forEach((e, n) => {
304
+ t.push([n, e]);
305
+ }), t;
306
+ }, b = (...e) => {
307
+ let t = new Headers();
308
+ for (let n of e) {
309
+ if (!n) continue;
310
+ let e = n instanceof Headers ? ie(n) : Object.entries(n);
311
+ for (let [n, r] of e) if (r === null) t.delete(n);
312
+ else if (Array.isArray(r)) for (let e of r) t.append(n, e);
313
+ else r !== void 0 && t.set(n, typeof r == "object" ? JSON.stringify(r) : r);
314
+ }
315
+ return t;
316
+ }, x = class {
317
+ fns = [];
318
+ clear() {
319
+ this.fns = [];
320
+ }
321
+ eject(e) {
322
+ let t = this.getInterceptorIndex(e);
323
+ this.fns[t] && (this.fns[t] = null);
324
+ }
325
+ exists(e) {
326
+ let t = this.getInterceptorIndex(e);
327
+ return !!this.fns[t];
328
+ }
329
+ getInterceptorIndex(e) {
330
+ return typeof e == "number" ? this.fns[e] ? e : -1 : this.fns.indexOf(e);
331
+ }
332
+ update(e, t) {
333
+ let n = this.getInterceptorIndex(e);
334
+ return this.fns[n] ? (this.fns[n] = t, e) : !1;
335
+ }
336
+ use(e) {
337
+ return this.fns.push(e), this.fns.length - 1;
338
+ }
339
+ }, ae = () => ({
340
+ error: new x(),
341
+ request: new x(),
342
+ response: new x()
343
+ }), oe = _({
344
+ allowReserved: !1,
345
+ array: {
346
+ explode: !0,
347
+ style: "form"
348
+ },
349
+ object: {
350
+ explode: !0,
351
+ style: "deepObject"
352
+ }
353
+ }), se = { "Content-Type": "application/json" }, S = (e = {}) => ({
354
+ ...i,
355
+ headers: se,
356
+ parseAs: "auto",
357
+ querySerializer: oe,
358
+ ...e
359
+ }), C = (e = {}) => {
360
+ let t = y(S(), e), n = () => ({ ...t }), r = (e) => (t = y(t, e), n()), i = ae(), a = async (e) => {
361
+ let n = {
362
+ ...t,
363
+ ...e,
364
+ fetch: e.fetch ?? t.fetch ?? globalThis.fetch,
365
+ headers: b(t.headers, e.headers),
366
+ serializedBody: void 0
367
+ };
368
+ n.security && await re(n), n.requestValidator && await n.requestValidator(n), n.body !== void 0 && n.bodySerializer && (n.serializedBody = n.bodySerializer(n.body)), (n.body === void 0 || n.serializedBody === "") && n.headers.delete("Content-Type");
369
+ let r = n;
370
+ return {
371
+ opts: r,
372
+ url: v(r)
373
+ };
374
+ }, s = async (e) => {
375
+ let n = e.throwOnError ?? t.throwOnError, r = e.responseStyle ?? t.responseStyle, o, s;
376
+ try {
377
+ let { opts: t, url: n } = await a(e), r = {
378
+ redirect: "follow",
379
+ ...t,
380
+ body: g(t)
381
+ };
382
+ o = new Request(n, r);
383
+ for (let e of i.request.fns) e && (o = await e(o, t));
384
+ let c = t.fetch;
385
+ s = await c(o);
386
+ for (let e of i.response.fns) e && (s = await e(s, o, t));
387
+ let l = {
388
+ request: o,
389
+ response: s
390
+ };
391
+ if (s.ok) {
392
+ let e = (t.parseAs === "auto" ? te(s.headers.get("Content-Type")) : t.parseAs) ?? "json";
393
+ if (s.status === 204 || s.headers.get("Content-Length") === "0") {
394
+ let n;
395
+ switch (e) {
396
+ case "arrayBuffer":
397
+ case "blob":
398
+ case "text":
399
+ n = await s[e]();
400
+ break;
401
+ case "formData":
402
+ n = new FormData();
403
+ break;
404
+ case "stream":
405
+ n = s.body;
406
+ break;
407
+ default: n = {};
408
+ }
409
+ return t.responseStyle === "data" ? n : {
410
+ data: n,
411
+ ...l
412
+ };
413
+ }
414
+ let n;
415
+ switch (e) {
416
+ case "arrayBuffer":
417
+ case "blob":
418
+ case "formData":
419
+ case "text":
420
+ n = await s[e]();
421
+ break;
422
+ case "json": {
423
+ let e = await s.text();
424
+ n = e ? JSON.parse(e) : {};
425
+ break;
426
+ }
427
+ case "stream": return t.responseStyle === "data" ? s.body : {
428
+ data: s.body,
429
+ ...l
430
+ };
431
+ }
432
+ return e === "json" && (t.responseValidator && await t.responseValidator(n), t.responseTransformer && (n = await t.responseTransformer(n))), t.responseStyle === "data" ? n : {
433
+ data: n,
434
+ ...l
435
+ };
436
+ }
437
+ let u = await s.text(), d;
438
+ try {
439
+ d = JSON.parse(u);
440
+ } catch {}
441
+ throw d ?? u;
442
+ } catch (t) {
443
+ let a = t;
444
+ for (let t of i.error.fns) t && (a = await t(a, s, o, e));
445
+ if (a ||= {}, n) throw a;
446
+ return r === "data" ? void 0 : {
447
+ error: a,
448
+ request: o,
449
+ response: s
450
+ };
451
+ }
452
+ }, c = (e) => (t) => s({
453
+ ...t,
454
+ method: e
455
+ }), l = (e) => async (t) => {
456
+ let { opts: n, url: r } = await a(t);
457
+ return o({
458
+ ...n,
459
+ body: n.body,
460
+ method: e,
461
+ onRequest: async (e, t) => {
462
+ let r = new Request(e, t);
463
+ for (let e of i.request.fns) e && (r = await e(r, n));
464
+ return r;
465
+ },
466
+ serializedBody: g(n),
467
+ url: r
468
+ });
469
+ };
470
+ return {
471
+ buildUrl: (e) => v({
472
+ ...t,
473
+ ...e
474
+ }),
475
+ connect: c("CONNECT"),
476
+ delete: c("DELETE"),
477
+ get: c("GET"),
478
+ getConfig: n,
479
+ head: c("HEAD"),
480
+ interceptors: i,
481
+ options: c("OPTIONS"),
482
+ patch: c("PATCH"),
483
+ post: c("POST"),
484
+ put: c("PUT"),
485
+ request: s,
486
+ setConfig: r,
487
+ sse: {
488
+ connect: l("CONNECT"),
489
+ delete: l("DELETE"),
490
+ get: l("GET"),
491
+ head: l("HEAD"),
492
+ options: l("OPTIONS"),
493
+ patch: l("PATCH"),
494
+ post: l("POST"),
495
+ put: l("PUT"),
496
+ trace: l("TRACE")
497
+ },
498
+ trace: c("TRACE")
499
+ };
500
+ }, w = C(S()), ce = (e) => (e.client ?? w).post({
501
+ responseStyle: "data",
502
+ security: [{
503
+ scheme: "bearer",
504
+ type: "http"
505
+ }],
506
+ url: "/artworks/create",
507
+ ...e,
508
+ headers: {
509
+ "Content-Type": "application/json",
510
+ ...e.headers
511
+ }
512
+ }), le = (e) => (e.client ?? w).delete({
513
+ responseStyle: "data",
514
+ security: [{
515
+ scheme: "bearer",
516
+ type: "http"
517
+ }],
518
+ url: "/artworks/{artwork_id}",
519
+ ...e
520
+ }), ue = (e) => (e.client ?? w).patch({
521
+ responseStyle: "data",
522
+ security: [{
523
+ scheme: "bearer",
524
+ type: "http"
525
+ }],
526
+ url: "/artworks/{artwork_id}",
527
+ ...e,
528
+ headers: {
529
+ "Content-Type": "application/json",
530
+ ...e.headers
531
+ }
532
+ }), de = (e) => (e?.client ?? w).get({
533
+ responseStyle: "data",
534
+ url: "/status",
535
+ ...e
536
+ }), fe = (e) => (e.client ?? w).post({
537
+ responseStyle: "data",
538
+ url: "/sign-up",
539
+ ...e,
540
+ headers: {
541
+ "Content-Type": "application/json",
542
+ ...e.headers
543
+ }
544
+ }), pe = (e) => (e.client ?? w).post({
545
+ ...a,
546
+ responseStyle: "data",
547
+ url: "/sign-in",
548
+ ...e,
549
+ headers: {
550
+ "Content-Type": "application/x-www-form-urlencoded",
551
+ ...e.headers
552
+ }
553
+ }), me = (e) => (e.client ?? w).post({
554
+ responseStyle: "data",
555
+ url: "/verify-email",
556
+ ...e
557
+ }), he = (e) => (e.client ?? w).post({
558
+ responseStyle: "data",
559
+ url: "/reset-password",
560
+ ...e,
561
+ headers: {
562
+ "Content-Type": "application/json",
563
+ ...e.headers
564
+ }
565
+ }), ge = (e) => (e.client ?? w).post({
566
+ responseStyle: "data",
567
+ url: "/reset-password/complete",
568
+ ...e,
569
+ headers: {
570
+ "Content-Type": "application/json",
571
+ ...e.headers
572
+ }
573
+ }), _e = (e) => (e.client ?? w).post({
574
+ responseStyle: "data",
575
+ security: [{
576
+ scheme: "bearer",
577
+ type: "http"
578
+ }],
579
+ url: "/extensions/available/import",
580
+ ...e,
581
+ headers: {
582
+ "Content-Type": "application/json",
583
+ ...e.headers
584
+ }
585
+ }), ve = (e) => (e.client ?? w).post({
586
+ responseStyle: "data",
587
+ security: [{
588
+ scheme: "bearer",
589
+ type: "http"
590
+ }],
591
+ url: "/extensions/available/{extension_id}/update",
592
+ ...e
593
+ }), ye = (e) => (e.client ?? w).delete({
594
+ responseStyle: "data",
595
+ security: [{
596
+ scheme: "bearer",
597
+ type: "http"
598
+ }],
599
+ url: "/extensions/available/{extension_id}",
600
+ ...e
601
+ }), be = (e) => (e?.client ?? w).get({
602
+ responseStyle: "data",
603
+ security: [{
604
+ scheme: "bearer",
605
+ type: "http"
606
+ }],
607
+ url: "/extensions/available",
608
+ ...e
609
+ }), xe = (e) => (e.client ?? w).post({
610
+ responseStyle: "data",
611
+ security: [{
612
+ scheme: "bearer",
613
+ type: "http"
614
+ }],
615
+ url: "/extensions/available/{extension_id}/install",
616
+ ...e
617
+ }), Se = (e) => (e.client ?? w).delete({
618
+ responseStyle: "data",
619
+ security: [{
620
+ scheme: "bearer",
621
+ type: "http"
622
+ }],
623
+ url: "/extensions/installed/{extension_id}",
624
+ ...e
625
+ }), Ce = (e) => (e?.client ?? w).get({
626
+ responseStyle: "data",
627
+ security: [{
628
+ scheme: "bearer",
629
+ type: "http"
630
+ }],
631
+ url: "/extensions/installed",
632
+ ...e
633
+ }), we = (e) => (e.client ?? w).delete({
634
+ responseStyle: "data",
635
+ security: [{
636
+ scheme: "bearer",
637
+ type: "http"
638
+ }],
639
+ url: "/libraries/{library_id}/albums/{album_id}",
640
+ ...e
641
+ }), Te = (e) => (e.client ?? w).get({
642
+ responseStyle: "data",
643
+ security: [{
644
+ scheme: "bearer",
645
+ type: "http"
646
+ }],
647
+ url: "/libraries/{library_id}/albums/{album_id}",
648
+ ...e
649
+ }), Ee = (e) => (e.client ?? w).patch({
650
+ responseStyle: "data",
651
+ security: [{
652
+ scheme: "bearer",
653
+ type: "http"
654
+ }],
655
+ url: "/libraries/{library_id}/albums/{album_id}",
656
+ ...e,
657
+ headers: {
658
+ "Content-Type": "application/json",
659
+ ...e.headers
660
+ }
661
+ }), De = (e) => (e.client ?? w).get({
662
+ responseStyle: "data",
663
+ security: [{
664
+ scheme: "bearer",
665
+ type: "http"
666
+ }],
667
+ url: "/libraries/{library_id}/albums",
668
+ ...e
669
+ }), Oe = (e) => (e.client ?? w).delete({
670
+ responseStyle: "data",
671
+ security: [{
672
+ scheme: "bearer",
673
+ type: "http"
674
+ }],
675
+ url: "/libraries/{library_id}/artists/{artist_id}",
676
+ ...e
677
+ }), T = (e) => (e.client ?? w).get({
678
+ responseStyle: "data",
679
+ security: [{
680
+ scheme: "bearer",
681
+ type: "http"
682
+ }],
683
+ url: "/libraries/{library_id}/artists/{artist_id}",
684
+ ...e
685
+ }), ke = (e) => (e.client ?? w).patch({
686
+ responseStyle: "data",
687
+ security: [{
688
+ scheme: "bearer",
689
+ type: "http"
690
+ }],
691
+ url: "/libraries/{library_id}/artists/{artist_id}",
692
+ ...e,
693
+ headers: {
694
+ "Content-Type": "application/json",
695
+ ...e.headers
696
+ }
697
+ }), Ae = (e) => (e.client ?? w).get({
698
+ responseStyle: "data",
699
+ security: [{
700
+ scheme: "bearer",
701
+ type: "http"
702
+ }],
703
+ url: "/libraries/{library_id}/artists",
704
+ ...e
705
+ }), je = (e) => (e.client ?? w).post({
706
+ ...r,
707
+ responseStyle: "data",
708
+ security: [{
709
+ scheme: "bearer",
710
+ type: "http"
711
+ }],
712
+ url: "/libraries/{library_id}/ingest/files",
713
+ ...e,
714
+ headers: {
715
+ "Content-Type": null,
716
+ ...e.headers
717
+ }
718
+ }), Me = (e) => (e.client ?? w).post({
719
+ responseStyle: "data",
720
+ security: [{
721
+ scheme: "bearer",
722
+ type: "http"
723
+ }],
724
+ url: "/libraries/{library_id}/ingest/songs",
725
+ ...e,
726
+ headers: {
727
+ "Content-Type": "application/json",
728
+ ...e.headers
729
+ }
730
+ }), Ne = (e) => (e.client ?? w).post({
731
+ responseStyle: "data",
732
+ security: [{
733
+ scheme: "bearer",
734
+ type: "http"
735
+ }],
736
+ url: "/libraries/{library_id}/sync",
737
+ ...e
738
+ }), Pe = (e) => (e?.client ?? w).get({
739
+ responseStyle: "data",
740
+ security: [{
741
+ scheme: "bearer",
742
+ type: "http"
743
+ }],
744
+ url: "/libraries/",
745
+ ...e
746
+ }), Fe = (e) => (e.client ?? w).get({
747
+ responseStyle: "data",
748
+ security: [{
749
+ scheme: "bearer",
750
+ type: "http"
751
+ }],
752
+ url: "/libraries/home-subpaths",
753
+ ...e
754
+ }), Ie = (e) => (e.client ?? w).post({
755
+ responseStyle: "data",
756
+ security: [{
757
+ scheme: "bearer",
758
+ type: "http"
759
+ }],
760
+ url: "/libraries/create",
761
+ ...e,
762
+ headers: {
763
+ "Content-Type": "application/json",
764
+ ...e.headers
765
+ }
766
+ }), Le = (e) => (e.client ?? w).get({
767
+ responseStyle: "data",
768
+ security: [{
769
+ scheme: "bearer",
770
+ type: "http"
771
+ }],
772
+ url: "/libraries/{library_id}",
773
+ ...e
774
+ }), Re = (e) => (e.client ?? w).patch({
775
+ responseStyle: "data",
776
+ security: [{
777
+ scheme: "bearer",
778
+ type: "http"
779
+ }],
780
+ url: "/libraries/{library_id}",
781
+ ...e,
782
+ headers: {
783
+ "Content-Type": "application/json",
784
+ ...e.headers
785
+ }
786
+ }), ze = (e) => (e.client ?? w).get({
787
+ responseStyle: "data",
788
+ security: [{
789
+ scheme: "bearer",
790
+ type: "http"
791
+ }],
792
+ url: "/libraries/{library_id}/permissions",
793
+ ...e
794
+ }), Be = (e) => (e.client ?? w).post({
795
+ responseStyle: "data",
796
+ security: [{
797
+ scheme: "bearer",
798
+ type: "http"
799
+ }],
800
+ url: "/libraries/{library_id}/permission/create",
801
+ ...e,
802
+ headers: {
803
+ "Content-Type": "application/json",
804
+ ...e.headers
805
+ }
806
+ }), Ve = (e) => (e.client ?? w).delete({
807
+ responseStyle: "data",
808
+ security: [{
809
+ scheme: "bearer",
810
+ type: "http"
811
+ }],
812
+ url: "/libraries/{library_id}/permission/{user_id}",
813
+ ...e
814
+ }), He = (e) => (e.client ?? w).patch({
815
+ responseStyle: "data",
816
+ security: [{
817
+ scheme: "bearer",
818
+ type: "http"
819
+ }],
820
+ url: "/libraries/{library_id}/permission/{user_id}",
821
+ ...e,
822
+ headers: {
823
+ "Content-Type": "application/json",
824
+ ...e.headers
825
+ }
826
+ }), Ue = (e) => (e.client ?? w).get({
827
+ responseStyle: "data",
828
+ security: [{
829
+ scheme: "bearer",
830
+ type: "http"
831
+ }],
832
+ url: "/libraries/{library_id}/ignored",
833
+ ...e
834
+ }), We = (e) => (e.client ?? w).delete({
835
+ responseStyle: "data",
836
+ security: [{
837
+ scheme: "bearer",
838
+ type: "http"
839
+ }],
840
+ url: "/libraries/{library_id}/ignored/{ignored_resource_id}",
841
+ ...e
842
+ }), Ge = (e) => (e.client ?? w).delete({
843
+ responseStyle: "data",
844
+ security: [{
845
+ scheme: "bearer",
846
+ type: "http"
847
+ }],
848
+ url: "/libraries/{library_id}/songs/{song_id}",
849
+ ...e
850
+ }), Ke = (e) => (e.client ?? w).get({
851
+ responseStyle: "data",
852
+ security: [{
853
+ scheme: "bearer",
854
+ type: "http"
855
+ }],
856
+ url: "/libraries/{library_id}/songs/{song_id}",
857
+ ...e
858
+ }), qe = (e) => (e.client ?? w).patch({
859
+ responseStyle: "data",
860
+ security: [{
861
+ scheme: "bearer",
862
+ type: "http"
863
+ }],
864
+ url: "/libraries/{library_id}/songs/{song_id}",
865
+ ...e,
866
+ headers: {
867
+ "Content-Type": "application/json",
868
+ ...e.headers
869
+ }
870
+ }), Je = (e) => (e.client ?? w).get({
871
+ responseStyle: "data",
872
+ security: [{
873
+ scheme: "bearer",
874
+ type: "http"
875
+ }],
876
+ url: "/libraries/{library_id}/songs",
877
+ ...e
878
+ }), Ye = (e) => (e.client ?? w).post({
879
+ responseStyle: "data",
880
+ security: [{
881
+ scheme: "bearer",
882
+ type: "http"
883
+ }],
884
+ url: "/playback-events/ingest",
885
+ ...e,
886
+ headers: {
887
+ "Content-Type": "application/json",
888
+ ...e.headers
889
+ }
890
+ }), Xe = (e) => (e?.client ?? w).get({
891
+ responseStyle: "data",
892
+ security: [{
893
+ scheme: "bearer",
894
+ type: "http"
895
+ }],
896
+ url: "/sources/all",
897
+ ...e
898
+ }), Ze = (e) => (e.client ?? w).post({
899
+ responseStyle: "data",
900
+ security: [{
901
+ scheme: "bearer",
902
+ type: "http"
903
+ }],
904
+ url: "/sources/create",
905
+ ...e,
906
+ headers: {
907
+ "Content-Type": "application/json",
908
+ ...e.headers
909
+ }
910
+ }), Qe = (e) => (e.client ?? w).delete({
911
+ responseStyle: "data",
912
+ security: [{
913
+ scheme: "bearer",
914
+ type: "http"
915
+ }],
916
+ url: "/sources/{source_id}",
917
+ ...e
918
+ }), $e = (e) => (e.client ?? w).patch({
919
+ responseStyle: "data",
920
+ security: [{
921
+ scheme: "bearer",
922
+ type: "http"
923
+ }],
924
+ url: "/sources/{source_id}",
925
+ ...e,
926
+ headers: {
927
+ "Content-Type": "application/json",
928
+ ...e.headers
929
+ }
930
+ }), et = (e) => (e.client ?? w).get({
931
+ responseStyle: "data",
932
+ security: [{
933
+ scheme: "bearer",
934
+ type: "http"
935
+ }],
936
+ url: "/sources/changes",
937
+ ...e
938
+ }), tt = (e) => (e?.client ?? w).get({
939
+ responseStyle: "data",
940
+ security: [{
941
+ scheme: "bearer",
942
+ type: "http"
943
+ }],
944
+ url: "/users/me",
945
+ ...e
946
+ }), nt = (e) => (e.client ?? w).post({
947
+ responseStyle: "data",
948
+ security: [{
949
+ scheme: "bearer",
950
+ type: "http"
951
+ }],
952
+ url: "/users/me",
953
+ ...e,
954
+ headers: {
955
+ "Content-Type": "application/json",
956
+ ...e.headers
957
+ }
958
+ }), rt = (e) => (e?.client ?? w).get({
959
+ responseStyle: "data",
960
+ security: [{
961
+ scheme: "bearer",
962
+ type: "http"
963
+ }],
964
+ url: "/users/notifications",
965
+ ...e
966
+ }), it = (e) => (e.client ?? w).delete({
967
+ responseStyle: "data",
968
+ security: [{
969
+ scheme: "bearer",
970
+ type: "http"
971
+ }],
972
+ url: "/users/notifications/{notification_id}",
973
+ ...e
974
+ }), at = (e) => (e.client ?? w).get({
975
+ responseStyle: "data",
976
+ security: [{
977
+ scheme: "bearer",
978
+ type: "http"
979
+ }],
980
+ url: "/users/notifications/{notification_id}",
981
+ ...e
982
+ }), ot = (e) => (e.client ?? w).patch({
983
+ responseStyle: "data",
984
+ security: [{
985
+ scheme: "bearer",
986
+ type: "http"
987
+ }],
988
+ url: "/users/notifications/{notification_id}",
989
+ ...e,
990
+ headers: {
991
+ "Content-Type": "application/json",
992
+ ...e.headers
993
+ }
994
+ }), st = (e) => (e?.client ?? w).post({
995
+ responseStyle: "data",
996
+ security: [{
997
+ scheme: "bearer",
998
+ type: "http"
999
+ }],
1000
+ url: "/users/notifications/mark-all-read",
1001
+ ...e
1002
+ }), ct = (e) => (e?.client ?? w).post({
1003
+ responseStyle: "data",
1004
+ security: [{
1005
+ scheme: "bearer",
1006
+ type: "http"
1007
+ }],
1008
+ url: "/users/events/preflight",
1009
+ ...e
1010
+ }), lt = (e) => (e?.client ?? w).get({
1011
+ responseStyle: "data",
1012
+ security: [{
1013
+ scheme: "bearer",
1014
+ type: "http"
1015
+ }],
1016
+ url: "/users/all",
1017
+ ...e
1018
+ }), ut = (e) => (e.client ?? w).get({
1019
+ responseStyle: "data",
1020
+ security: [{
1021
+ scheme: "bearer",
1022
+ type: "http"
1023
+ }],
1024
+ url: "/users/all/{id_or_username}",
1025
+ ...e
1026
+ }), dt = (e) => (e?.client ?? w).get({
1027
+ responseStyle: "data",
1028
+ security: [{
1029
+ scheme: "bearer",
1030
+ type: "http"
1031
+ }],
1032
+ url: "/users/admin/all",
1033
+ ...e
1034
+ }), ft = (e) => (e.client ?? w).get({
1035
+ responseStyle: "data",
1036
+ security: [{
1037
+ scheme: "bearer",
1038
+ type: "http"
1039
+ }],
1040
+ url: "/users/admin/all/{id_or_username}",
1041
+ ...e
1042
+ }), pt = (e) => (e.client ?? w).delete({
1043
+ responseStyle: "data",
1044
+ security: [{
1045
+ scheme: "bearer",
1046
+ type: "http"
1047
+ }],
1048
+ url: "/users/admin/all/{user_id}",
1049
+ ...e
1050
+ }), mt = (e) => (e.client ?? w).patch({
1051
+ responseStyle: "data",
1052
+ security: [{
1053
+ scheme: "bearer",
1054
+ type: "http"
1055
+ }],
1056
+ url: "/users/admin/all/{user_id}",
1057
+ ...e,
1058
+ headers: {
1059
+ "Content-Type": "application/json",
1060
+ ...e.headers
1061
+ }
1062
+ }), ht = (e) => (e?.client ?? w).post({
1063
+ responseStyle: "data",
1064
+ security: [{
1065
+ scheme: "bearer",
1066
+ type: "http"
1067
+ }],
1068
+ url: "/users/files/preflight",
1069
+ ...e
1070
+ }), E = class {
1071
+ options;
1072
+ subscribers;
1073
+ constructor({ baseUrl: e, userSessionManager: t }) {
1074
+ let n = C({
1075
+ baseUrl: e,
1076
+ auth: () => t.session?.accessToken
1077
+ }), r = [];
1078
+ n.interceptors.response.use(async (e) => {
1079
+ if (!e.ok) {
1080
+ if (e.status === 401) {
1081
+ t.replaceSession(null);
1082
+ for (let e of this.subscribers.slice()) try {
1083
+ e({ type: "unauthorized" });
1084
+ } catch (e) {
1085
+ console.error("*** Unhandled error in API client event subscriber", e);
1086
+ }
1087
+ }
1088
+ let n = `${e.status}: ${e.statusText}`;
1089
+ try {
1090
+ let t = (await e.json()).detail;
1091
+ n += ": ", n += Array.isArray(t) ? t.filter((e) => typeof e == "object" && !!e && "msg" in e).map((e) => String(e.msg)).join("\n") : String(t);
1092
+ } catch (e) {
1093
+ console.warn(`Could not include detail for error response, reason: ${String(e)}`);
1094
+ }
1095
+ throw Error(n);
1096
+ }
1097
+ return e;
1098
+ }), this.options = {
1099
+ throwOnError: !0,
1100
+ client: n
1101
+ }, this.subscribers = r;
1102
+ }
1103
+ subscribe(e) {
1104
+ return this.subscribers.push(e), () => {
1105
+ let t = this.subscribers.indexOf(e);
1106
+ t !== -1 && this.subscribers.splice(t, 1);
1107
+ };
1108
+ }
1109
+ async instanceStatus() {
1110
+ return await de(this.options);
1111
+ }
1112
+ async signUp(e) {
1113
+ return await fe({
1114
+ ...this.options,
1115
+ body: e
1116
+ });
1117
+ }
1118
+ async signIn(e) {
1119
+ return await pe({
1120
+ ...this.options,
1121
+ body: e
1122
+ });
1123
+ }
1124
+ async verifyEmail(e) {
1125
+ return await me({
1126
+ ...this.options,
1127
+ query: { token: e }
1128
+ });
1129
+ }
1130
+ async resetPassword(e) {
1131
+ return await he({
1132
+ ...this.options,
1133
+ body: e
1134
+ });
1135
+ }
1136
+ async resetPasswordComplete(e) {
1137
+ return await ge({
1138
+ ...this.options,
1139
+ body: e
1140
+ });
1141
+ }
1142
+ async readMe() {
1143
+ return await tt(this.options);
1144
+ }
1145
+ async updateMe(e) {
1146
+ return await nt({
1147
+ ...this.options,
1148
+ body: e
1149
+ });
1150
+ }
1151
+ async readNotifications(e) {
1152
+ return await rt({
1153
+ ...this.options,
1154
+ query: e
1155
+ });
1156
+ }
1157
+ async readNotification(e) {
1158
+ return await at({
1159
+ ...this.options,
1160
+ path: { notification_id: e }
1161
+ });
1162
+ }
1163
+ async updateNotification(e, t) {
1164
+ return await ot({
1165
+ ...this.options,
1166
+ path: { notification_id: e },
1167
+ body: t
1168
+ });
1169
+ }
1170
+ async deleteNotification(e) {
1171
+ return await it({
1172
+ ...this.options,
1173
+ path: { notification_id: e }
1174
+ });
1175
+ }
1176
+ async markAllNotificationsRead() {
1177
+ return await st(this.options);
1178
+ }
1179
+ async streamUserEventsPreflight() {
1180
+ return await ct(this.options);
1181
+ }
1182
+ async readUser(e) {
1183
+ return await ut({
1184
+ ...this.options,
1185
+ path: { id_or_username: String(e) }
1186
+ });
1187
+ }
1188
+ async readAllUsers(e) {
1189
+ return await lt({
1190
+ ...this.options,
1191
+ query: e
1192
+ });
1193
+ }
1194
+ async readUserAdmin(e) {
1195
+ return await ft({
1196
+ ...this.options,
1197
+ path: { id_or_username: String(e) }
1198
+ });
1199
+ }
1200
+ async readAllUsersAdmin(e) {
1201
+ return await dt({
1202
+ ...this.options,
1203
+ query: e
1204
+ });
1205
+ }
1206
+ async updateUserAdmin(e, t) {
1207
+ return await mt({
1208
+ ...this.options,
1209
+ path: { user_id: e },
1210
+ body: t
1211
+ });
1212
+ }
1213
+ async deleteUserAdmin(e) {
1214
+ return await pt({
1215
+ ...this.options,
1216
+ path: { user_id: e }
1217
+ });
1218
+ }
1219
+ async readFilesPreflight() {
1220
+ return await ht(this.options);
1221
+ }
1222
+ async readLibraries() {
1223
+ return await Pe(this.options);
1224
+ }
1225
+ async readLibraryHomeSubpaths(e) {
1226
+ return await Fe({
1227
+ ...this.options,
1228
+ query: e
1229
+ });
1230
+ }
1231
+ async createLibrary(e) {
1232
+ return await Ie({
1233
+ ...this.options,
1234
+ body: e
1235
+ });
1236
+ }
1237
+ async updateLibrary(e, t) {
1238
+ return await Re({
1239
+ ...this.options,
1240
+ path: { library_id: e },
1241
+ body: t
1242
+ });
1243
+ }
1244
+ async readLibrary(e) {
1245
+ return await Le({
1246
+ ...this.options,
1247
+ path: { library_id: e }
1248
+ });
1249
+ }
1250
+ async readLibraryPermissions(e) {
1251
+ return await ze({
1252
+ ...this.options,
1253
+ path: { library_id: e }
1254
+ });
1255
+ }
1256
+ async createLibraryPermission(e, t) {
1257
+ return await Be({
1258
+ ...this.options,
1259
+ path: { library_id: e },
1260
+ body: t
1261
+ });
1262
+ }
1263
+ async updateLibraryPermission(e, t, n) {
1264
+ return await He({
1265
+ ...this.options,
1266
+ path: {
1267
+ library_id: e,
1268
+ user_id: t
1269
+ },
1270
+ body: n
1271
+ });
1272
+ }
1273
+ async deleteLibraryPermission(e, t) {
1274
+ return await Ve({
1275
+ ...this.options,
1276
+ path: {
1277
+ library_id: e,
1278
+ user_id: t
1279
+ }
1280
+ });
1281
+ }
1282
+ async readLibraryIgnoredResources(e, t) {
1283
+ return await Ue({
1284
+ ...this.options,
1285
+ path: { library_id: e },
1286
+ query: t
1287
+ });
1288
+ }
1289
+ async deleteLibraryIgnoredResource(e, t) {
1290
+ return await We({
1291
+ ...this.options,
1292
+ path: {
1293
+ library_id: e,
1294
+ ignored_resource_id: t
1295
+ }
1296
+ });
1297
+ }
1298
+ async updateLibraryAlbum(e, t, n) {
1299
+ return await Ee({
1300
+ ...this.options,
1301
+ path: {
1302
+ library_id: e,
1303
+ album_id: t
1304
+ },
1305
+ body: n
1306
+ });
1307
+ }
1308
+ async deleteLibraryAlbum(e, t) {
1309
+ await we({
1310
+ ...this.options,
1311
+ path: {
1312
+ library_id: e,
1313
+ album_id: t
1314
+ }
1315
+ });
1316
+ }
1317
+ async readLibraryAlbum(e, t) {
1318
+ return await Te({
1319
+ ...this.options,
1320
+ path: {
1321
+ library_id: e,
1322
+ album_id: t
1323
+ }
1324
+ });
1325
+ }
1326
+ async readLibraryAlbums(e, t) {
1327
+ return await De({
1328
+ ...this.options,
1329
+ path: { library_id: e },
1330
+ query: t
1331
+ });
1332
+ }
1333
+ async updateLibraryArtist(e, t, n) {
1334
+ return await ke({
1335
+ ...this.options,
1336
+ path: {
1337
+ library_id: e,
1338
+ artist_id: t
1339
+ },
1340
+ body: n
1341
+ });
1342
+ }
1343
+ async deleteLibraryArtist(e, t) {
1344
+ await Oe({
1345
+ ...this.options,
1346
+ path: {
1347
+ library_id: e,
1348
+ artist_id: t
1349
+ }
1350
+ });
1351
+ }
1352
+ async readLibraryArtist(e, t) {
1353
+ return await T({
1354
+ ...this.options,
1355
+ path: {
1356
+ library_id: e,
1357
+ artist_id: t
1358
+ }
1359
+ });
1360
+ }
1361
+ async readLibraryArtists(e, t) {
1362
+ return await Ae({
1363
+ ...this.options,
1364
+ path: { library_id: e },
1365
+ query: t
1366
+ });
1367
+ }
1368
+ async updateLibrarySong(e, t, n) {
1369
+ return await qe({
1370
+ ...this.options,
1371
+ path: {
1372
+ library_id: e,
1373
+ song_id: t
1374
+ },
1375
+ body: n
1376
+ });
1377
+ }
1378
+ async deleteLibrarySong(e, t, n) {
1379
+ await Ge({
1380
+ ...this.options,
1381
+ path: {
1382
+ library_id: e,
1383
+ song_id: t
1384
+ },
1385
+ query: n
1386
+ });
1387
+ }
1388
+ async readLibrarySong(e, t) {
1389
+ return await Ke({
1390
+ ...this.options,
1391
+ path: {
1392
+ library_id: e,
1393
+ song_id: t
1394
+ }
1395
+ });
1396
+ }
1397
+ async readLibrarySongs(e, t) {
1398
+ return await Je({
1399
+ ...this.options,
1400
+ path: { library_id: e },
1401
+ query: t
1402
+ });
1403
+ }
1404
+ async createArtwork(e) {
1405
+ return await ce({
1406
+ ...this.options,
1407
+ body: e
1408
+ });
1409
+ }
1410
+ async updateArtwork(e, t) {
1411
+ return await ue({
1412
+ ...this.options,
1413
+ path: { artwork_id: e },
1414
+ body: t
1415
+ });
1416
+ }
1417
+ async deleteArtwork(e) {
1418
+ await le({
1419
+ ...this.options,
1420
+ path: { artwork_id: e }
1421
+ });
1422
+ }
1423
+ async readAllSources(e) {
1424
+ return await Xe({
1425
+ ...this.options,
1426
+ query: e
1427
+ });
1428
+ }
1429
+ async createSource(e) {
1430
+ return await Ze({
1431
+ ...this.options,
1432
+ body: e
1433
+ });
1434
+ }
1435
+ async updateSource(e, t) {
1436
+ return await $e({
1437
+ ...this.options,
1438
+ path: { source_id: e },
1439
+ body: t
1440
+ });
1441
+ }
1442
+ async deleteSource(e) {
1443
+ await Qe({
1444
+ ...this.options,
1445
+ path: { source_id: e }
1446
+ });
1447
+ }
1448
+ async readSourceChanges(e) {
1449
+ return await et({
1450
+ ...this.options,
1451
+ query: e
1452
+ });
1453
+ }
1454
+ async ingestPlaybackEvents(e) {
1455
+ return await Ye({
1456
+ ...this.options,
1457
+ body: e
1458
+ });
1459
+ }
1460
+ async ingestFiles(e, t) {
1461
+ return await je({
1462
+ ...this.options,
1463
+ path: { library_id: e },
1464
+ body: { files: t }
1465
+ });
1466
+ }
1467
+ async ingestSongs(e, t) {
1468
+ return await Me({
1469
+ ...this.options,
1470
+ path: { library_id: e },
1471
+ body: t
1472
+ });
1473
+ }
1474
+ async requestSyncLibrary(e) {
1475
+ return await Ne({
1476
+ ...this.options,
1477
+ path: { library_id: e }
1478
+ });
1479
+ }
1480
+ async importExtension(e) {
1481
+ return await _e({
1482
+ ...this.options,
1483
+ body: e
1484
+ });
1485
+ }
1486
+ async updateExtension(e) {
1487
+ return await ve({
1488
+ ...this.options,
1489
+ path: { extension_id: e }
1490
+ });
1491
+ }
1492
+ async deleteExtension(e) {
1493
+ return await ye({
1494
+ ...this.options,
1495
+ path: { extension_id: e }
1496
+ });
1497
+ }
1498
+ async readAvailableExtensions(e) {
1499
+ return await be({
1500
+ ...this.options,
1501
+ query: e
1502
+ });
1503
+ }
1504
+ async installExtension(e) {
1505
+ return await xe({
1506
+ ...this.options,
1507
+ path: { extension_id: e }
1508
+ });
1509
+ }
1510
+ async uninstallExtension(e) {
1511
+ return await Se({
1512
+ ...this.options,
1513
+ path: { extension_id: e }
1514
+ });
1515
+ }
1516
+ async readInstalledExtensions(e) {
1517
+ return await Ce({
1518
+ ...this.options,
1519
+ query: e
1520
+ });
1521
+ }
1522
+ };
1523
+ //#endregion
1524
+ //#region src/fileAccess.ts
1525
+ function D(e, t) {
1526
+ return e === null || t === null || /* @__PURE__ */ new Date() > new Date(t) ? null : e;
1527
+ }
1528
+ var O = class {
1529
+ client;
1530
+ _token;
1531
+ _expiresAt;
1532
+ _pending;
1533
+ constructor(e) {
1534
+ this.client = e, this._token = null, this._expiresAt = null, this._pending = null, this.token({ refresh: !0 }).catch(() => void 0);
1535
+ }
1536
+ get hasValidToken() {
1537
+ return D(this._token, this._expiresAt) !== null;
1538
+ }
1539
+ async token(e = {}) {
1540
+ if (this._pending) return await this._pending;
1541
+ let t = D(this._token, this._expiresAt);
1542
+ return t === null || e.refresh ? (this._pending = (async () => {
1543
+ try {
1544
+ let e = await this.client.readFilesPreflight();
1545
+ return this._token = e.token, this._expiresAt = e.expires_at, e.token;
1546
+ } catch (e) {
1547
+ throw this._token = null, this._expiresAt = null, console.error("Failed to fetch file access token:", e), e;
1548
+ } finally {
1549
+ this._pending = null;
1550
+ }
1551
+ })(), await this._pending) : t;
1552
+ }
1553
+ }, k = class {
1554
+ baseUrl;
1555
+ client;
1556
+ userSessionManager;
1557
+ subscribers;
1558
+ state;
1559
+ constructor(e, t, n) {
1560
+ this.baseUrl = e, this.client = t, this.userSessionManager = n, this.subscribers = [], this.state = { type: "notConnected" }, n.subscribe((e) => {
1561
+ e.type === "currentChanged" && this._syncWithUserSession();
1562
+ }), this._syncWithUserSession();
1563
+ }
1564
+ async _syncWithUserSession() {
1565
+ this.userSessionManager.session === null ? this.state.type !== "notConnected" && this._disconnect() : (this.state.type !== "notConnected" && this._disconnect(), await this._connect());
1566
+ }
1567
+ async _connect() {
1568
+ this.state = { type: "connecting" };
1569
+ let { token: e } = await this.client.streamUserEventsPreflight(), t = new WebSocket(`${this.baseUrl}/users/events?token=${encodeURIComponent(e)}`);
1570
+ t.addEventListener("open", (e) => this._onOpen(t, e)), t.addEventListener("error", (e) => this._onError(t, e)), t.addEventListener("message", (e) => this._onMessage(t, e)), t.addEventListener("close", (e) => this._onClose(t, e)), console.debug("UserEvents connecting");
1571
+ }
1572
+ _disconnect() {
1573
+ this.state.type === "connected" && this.state.websocket.close();
1574
+ }
1575
+ _onOpen(e, t) {
1576
+ this.state.type === "connecting" && (console.debug("UserEvents connected", t), this.state = {
1577
+ type: "connected",
1578
+ websocket: e
1579
+ });
1580
+ }
1581
+ _onError(e, t) {
1582
+ this.state.type === "connected" && this.state.websocket === e && console.error("UserEvents error", t);
1583
+ }
1584
+ _onMessage(e, t) {
1585
+ if (this.state.type === "connected" && this.state.websocket === e && (console.debug("UserEvents message", t.data), typeof t.data == "string")) {
1586
+ let e = JSON.parse(t.data);
1587
+ for (let t of this.subscribers) t(e);
1588
+ }
1589
+ }
1590
+ _onClose(e, t) {
1591
+ this.state.type === "connected" && this.state.websocket === e && (console.debug("UserEvents closed", t), this.state = { type: "notConnected" });
1592
+ }
1593
+ subscribe(e) {
1594
+ return this.subscribers.push(e), () => {
1595
+ let t = this.subscribers.indexOf(e);
1596
+ t !== -1 && this.subscribers.splice(t, 1);
1597
+ };
1598
+ }
1599
+ };
1600
+ //#endregion
1601
+ //#region src/userSession.ts
1602
+ function gt(e) {
1603
+ let t = e.getItem("userSession.accessToken");
1604
+ return t === null ? null : {
1605
+ accessToken: t,
1606
+ scopes: (e.getItem("userSession.scope") ?? "").split(" ")
1607
+ };
1608
+ }
1609
+ function _t(e, t) {
1610
+ t == null ? (e.removeItem("userSession.accessToken"), e.removeItem("userSession.scope")) : (e.setItem("userSession.accessToken", t.accessToken), e.setItem("userSession.scope", t.scopes.join(" ")));
1611
+ }
1612
+ var A = class e {
1613
+ static _local;
1614
+ static get local() {
1615
+ return e._local ??= new e(globalThis.localStorage), e._local;
1616
+ }
1617
+ constructor(e) {
1618
+ this.storage = e, this.subscribers = [], this._current = gt(e);
1619
+ }
1620
+ storage;
1621
+ subscribers;
1622
+ _current;
1623
+ get session() {
1624
+ return this._current;
1625
+ }
1626
+ get isSignedIn() {
1627
+ return this._current !== null;
1628
+ }
1629
+ replaceSession(e) {
1630
+ this._current = e, _t(this.storage, e);
1631
+ for (let e of this.subscribers.slice()) try {
1632
+ e({ type: "currentChanged" });
1633
+ } catch (e) {
1634
+ console.error("*** Unhandled error in API client event subscriber", e);
1635
+ }
1636
+ }
1637
+ hasScope(e) {
1638
+ let t = this.session;
1639
+ return t !== null && t.scopes.includes(e);
1640
+ }
1641
+ subscribe(e) {
1642
+ return this.subscribers.push(e), () => {
1643
+ let t = this.subscribers.indexOf(e);
1644
+ t !== -1 && this.subscribers.splice(t, 1);
1645
+ };
1646
+ }
1647
+ };
1648
+ //#endregion
1649
+ //#region src/api.ts
1650
+ function vt({ baseUrl: e, userSessionManager: t = A.local }) {
1651
+ let n = new E({
1652
+ baseUrl: e,
1653
+ userSessionManager: t
1654
+ });
1655
+ return {
1656
+ client: n,
1657
+ fileAccess: new O(n),
1658
+ userEventsManager: new k(e, n, t),
1659
+ userSessionManager: t
1660
+ };
1661
+ }
1662
+ //#endregion
1663
+ //#region src/limits.ts
1664
+ var yt = 1e3, bt = 5e3, xt = 2e3, St = 8e3, Ct = 250, wt = 50, Tt = e.object({
1665
+ title: e.string().max(1e3).nullish(),
1666
+ artist_id: e.int().nullish()
1667
+ }), Et = e.object({ name: e.string().max(1e3).nullish() }), j = e.enum(["front_cover"]), Dt = e.object({
1668
+ kind: j,
1669
+ image_url: e.string().max(8e3),
1670
+ background_color: e.string().max(1e3).nullable(),
1671
+ primary_color: e.string().max(1e3).nullable(),
1672
+ secondary_color: e.string().max(1e3).nullable(),
1673
+ tertiary_color: e.string().max(1e3).nullable()
1674
+ }), M = e.object({
1675
+ id: e.int(),
1676
+ kind: j,
1677
+ image_url: e.string(),
1678
+ background_color: e.string().nullable(),
1679
+ primary_color: e.string().nullable(),
1680
+ secondary_color: e.string().nullable(),
1681
+ tertiary_color: e.string().nullable()
1682
+ }), N = e.object({
1683
+ id: e.int(),
1684
+ title: e.string(),
1685
+ artist_id: e.int().nullable(),
1686
+ artworks: e.array(M).optional()
1687
+ }), P = e.object({
1688
+ id: e.int(),
1689
+ name: e.string(),
1690
+ artworks: e.array(M).optional()
1691
+ }), Ot = e.object({
1692
+ kind: j.nullish(),
1693
+ image_url: e.string().max(8e3).nullish(),
1694
+ background_color: e.string().max(1e3).nullish(),
1695
+ primary_color: e.string().max(1e3).nullish(),
1696
+ secondary_color: e.string().max(1e3).nullish(),
1697
+ tertiary_color: e.string().max(1e3).nullish()
1698
+ }), kt = e.object({ files: e.array(e.string()) }), At = e.object({
1699
+ grant_type: e.string().regex(/^password$/).nullish(),
1700
+ username: e.string(),
1701
+ password: e.string(),
1702
+ scope: e.string().optional(),
1703
+ client_id: e.string().nullish(),
1704
+ client_secret: e.string().nullish()
1705
+ }), jt = e.object({
1706
+ email: e.email(),
1707
+ token: e.string(),
1708
+ new_password: e.string().min(8).max(100)
1709
+ }), F = e.object({
1710
+ id: e.string(),
1711
+ searchTerms: e.string(),
1712
+ requiredInputKinds: e.array(e.string()),
1713
+ highlightAvailability: e.boolean().optional()
1714
+ }), Mt = e.object({ manifest_url: e.url().min(1).max(8e3) }), I = e.enum([
1715
+ "run:background",
1716
+ "run:eager",
1717
+ "commands:input:read",
1718
+ "commands:input:add",
1719
+ "commands:query",
1720
+ "commands:run",
1721
+ "libraries:read",
1722
+ "libraries:write",
1723
+ "playback:read",
1724
+ "playback:control"
1725
+ ]), L = e.object({ requiredInputKinds: e.array(e.string()) }), R = e.object({
1726
+ name: e.string().max(255),
1727
+ id: e.string().max(255),
1728
+ version: e.string().max(100),
1729
+ description: e.string().max(1e3).nullish(),
1730
+ url: e.string(),
1731
+ icon_url: e.string().nullish(),
1732
+ preferredWidth: e.string().nullish(),
1733
+ preferredHeight: e.string().nullish(),
1734
+ permissions: e.array(e.union([I, e.string()])).nullish(),
1735
+ sourceSchemes: e.array(e.string()).nullish(),
1736
+ commands: e.array(F).nullish(),
1737
+ searchCommand: L.nullish()
1738
+ }), z = e.object({
1739
+ id: e.int(),
1740
+ manifest: R
1741
+ }), B = e.object({
1742
+ kind: j,
1743
+ image_url: e.string().max(8e3),
1744
+ background_color: e.string().max(1e3).nullable(),
1745
+ primary_color: e.string().max(1e3).nullable(),
1746
+ secondary_color: e.string().max(1e3).nullable(),
1747
+ tertiary_color: e.string().max(1e3).nullable()
1748
+ }), V = e.object({
1749
+ url: e.string().max(8e3),
1750
+ mime_type: e.string().max(1e3).nullable(),
1751
+ extension_manifest_id: e.string().max(1e3).nullable(),
1752
+ extension_tag: e.string().max(1e3).nullable()
1753
+ }), H = e.object({
1754
+ artist_name: e.string().max(1e3).nullable(),
1755
+ album_title: e.string().max(1e3).nullable(),
1756
+ artworks: e.array(B),
1757
+ sources: e.array(V),
1758
+ start_time: e.number(),
1759
+ end_time: e.number(),
1760
+ title: e.string().max(1e3).nullable(),
1761
+ album_artist: e.string().max(1e3).nullable(),
1762
+ composer: e.string().max(1e3).nullable(),
1763
+ genre: e.string().max(1e3).nullable(),
1764
+ release_date: e.string().max(1e3).nullable(),
1765
+ track_number: e.int().nullable(),
1766
+ track_total: e.int().nullable(),
1767
+ disc_number: e.int().nullable(),
1768
+ disc_total: e.int().nullable(),
1769
+ lyrics: e.string().max(5e3).nullable(),
1770
+ rating: e.number().nullable(),
1771
+ bpm: e.int().nullable(),
1772
+ comment: e.string().max(5e3).nullable(),
1773
+ grouping: e.string().max(1e3).nullable(),
1774
+ mcn: e.string().max(1e3).nullable(),
1775
+ isrc: e.string().max(1e3).nullable(),
1776
+ music_brainz_release_id: e.string().max(1e3).nullable(),
1777
+ music_brainz_recording_id: e.string().max(1e3).nullable()
1778
+ }), Nt = e.object({ songs: e.array(H).max(50) }), Pt = e.object({
1779
+ env: e.enum([
1780
+ "dev",
1781
+ "ci",
1782
+ "prod"
1783
+ ]),
1784
+ version: e.string(),
1785
+ uploads_enabled: e.boolean(),
1786
+ email_enabled: e.boolean(),
1787
+ first_setup_complete: e.boolean()
1788
+ }), Ft = e.object({
1789
+ name: e.string().max(1e3),
1790
+ home_path: e.string().max(2e3).nullable(),
1791
+ uploads_enabled: e.boolean(),
1792
+ cover_artwork: M.nullable()
1793
+ }), It = e.object({
1794
+ relative_to: e.string(),
1795
+ subpaths: e.array(e.string())
1796
+ }), U = e.object({
1797
+ id: e.int(),
1798
+ url: e.string()
1799
+ }), Lt = e.object({
1800
+ items: e.array(N),
1801
+ offset: e.int(),
1802
+ limit: e.int(),
1803
+ total: e.int()
1804
+ }), Rt = e.object({
1805
+ items: e.array(P),
1806
+ offset: e.int(),
1807
+ limit: e.int(),
1808
+ total: e.int()
1809
+ }), zt = e.object({
1810
+ items: e.array(z),
1811
+ offset: e.int(),
1812
+ limit: e.int(),
1813
+ total: e.int()
1814
+ }), Bt = e.object({
1815
+ items: e.array(U),
1816
+ offset: e.int(),
1817
+ limit: e.int(),
1818
+ total: e.int()
1819
+ }), Vt = e.object({
1820
+ user_id: e.int(),
1821
+ can_add: e.boolean(),
1822
+ can_edit: e.boolean(),
1823
+ can_remove: e.boolean()
1824
+ }), Ht = e.object({
1825
+ user_id: e.int(),
1826
+ username: e.string(),
1827
+ can_add: e.boolean(),
1828
+ can_edit: e.boolean(),
1829
+ can_remove: e.boolean()
1830
+ }), Ut = e.object({
1831
+ can_add: e.boolean().nullish(),
1832
+ can_edit: e.boolean().nullish(),
1833
+ can_remove: e.boolean().nullish()
1834
+ }), Wt = e.object({
1835
+ id: e.int(),
1836
+ name: e.string(),
1837
+ home_path: e.string().nullable(),
1838
+ uploads_enabled: e.boolean(),
1839
+ cover_artwork: M.nullable()
1840
+ }), Gt = e.object({
1841
+ name: e.string().max(1e3).nullish(),
1842
+ uploads_enabled: e.boolean().nullish(),
1843
+ cover_artwork: M.nullish()
1844
+ }), W = e.object({
1845
+ id: e.int(),
1846
+ title: e.string(),
1847
+ description: e.string().nullable(),
1848
+ progress: e.number().nullable(),
1849
+ is_read: e.boolean()
1850
+ }), Kt = e.object({ is_read: e.boolean().nullish() }), qt = e.object({
1851
+ items: e.array(W),
1852
+ offset: e.int(),
1853
+ limit: e.int(),
1854
+ total: e.int()
1855
+ }), G = e.enum([
1856
+ "profile",
1857
+ "library:read",
1858
+ "library:write",
1859
+ "admin"
1860
+ ]), Jt = e.object({
1861
+ message: e.string(),
1862
+ row_count: e.int().nullish()
1863
+ }), K = e.enum([
1864
+ "play",
1865
+ "pause",
1866
+ "stop",
1867
+ "fast_forward",
1868
+ "rewind"
1869
+ ]), q = e.object({
1870
+ recorded_at: e.iso.datetime(),
1871
+ kind: K,
1872
+ song_id: e.int(),
1873
+ start_time: e.int(),
1874
+ end_time: e.int()
1875
+ }), Yt = e.object({
1876
+ accepted_count: e.int(),
1877
+ rejected_events: e.array(q)
1878
+ }), Xt = e.object({ email: e.email() }), Zt = e.object({
1879
+ email: e.email().nullish(),
1880
+ username: e.string().max(255),
1881
+ password: e.string().min(8).max(100)
1882
+ }), Qt = e.object({
1883
+ artist_id: e.int().nullish(),
1884
+ album_id: e.int().nullish(),
1885
+ artwork_ids: e.array(e.int()).nullish(),
1886
+ source_ids: e.array(e.int()).nullish(),
1887
+ start_time: e.number().nullish(),
1888
+ end_time: e.number().nullish(),
1889
+ title: e.string().max(1e3).nullish(),
1890
+ album_artist: e.string().max(1e3).nullish(),
1891
+ composer: e.string().max(1e3).nullish(),
1892
+ genre: e.string().max(1e3).nullish(),
1893
+ release_date: e.string().max(1e3).nullish(),
1894
+ track_number: e.int().nullish(),
1895
+ track_total: e.int().nullish(),
1896
+ disc_number: e.int().nullish(),
1897
+ disc_total: e.int().nullish(),
1898
+ lyrics: e.string().max(5e3).nullish(),
1899
+ rating: e.number().nullish(),
1900
+ bpm: e.int().nullish(),
1901
+ comment: e.string().max(5e3).nullish(),
1902
+ grouping: e.string().max(1e3).nullish(),
1903
+ mcn: e.string().max(1e3).nullish(),
1904
+ isrc: e.string().max(1e3).nullish(),
1905
+ music_brainz_release_id: e.string().max(1e3).nullish(),
1906
+ music_brainz_recording_id: e.string().max(1e3).nullish()
1907
+ }), $t = e.object({
1908
+ since: e.iso.datetime(),
1909
+ ids: e.array(e.int())
1910
+ }), en = e.object({
1911
+ url: e.string().max(8e3),
1912
+ mime_type: e.string().max(1e3).nullable(),
1913
+ extension_manifest_id: e.string().max(1e3).nullable(),
1914
+ extension_tag: e.string().max(1e3).nullable()
1915
+ }), J = e.object({
1916
+ id: e.int(),
1917
+ url: e.string(),
1918
+ mime_type: e.string().nullable(),
1919
+ is_invalid: e.boolean(),
1920
+ extension_manifest_id: e.string().nullable(),
1921
+ extension_tag: e.string().nullable()
1922
+ }), tn = e.object({
1923
+ items: e.array(J),
1924
+ offset: e.int(),
1925
+ limit: e.int(),
1926
+ total: e.int()
1927
+ }), Y = e.object({
1928
+ id: e.int(),
1929
+ artist_id: e.int().nullish(),
1930
+ artist_name: e.string().nullish(),
1931
+ album_id: e.int().nullish(),
1932
+ album_title: e.string().nullish(),
1933
+ artworks: e.array(M).optional(),
1934
+ sources: e.array(J).optional(),
1935
+ start_time: e.number().optional(),
1936
+ end_time: e.number(),
1937
+ title: e.string().nullish(),
1938
+ album_artist: e.string().nullish(),
1939
+ composer: e.string().nullish(),
1940
+ genre: e.string().nullish(),
1941
+ release_date: e.string().nullish(),
1942
+ track_number: e.int().gte(0).nullish(),
1943
+ track_total: e.int().gte(0).nullish(),
1944
+ disc_number: e.int().gte(0).nullish(),
1945
+ disc_total: e.int().gte(0).nullish(),
1946
+ lyrics: e.string().nullish(),
1947
+ rating: e.number().gte(0).lte(1).nullish(),
1948
+ bpm: e.int().gte(0).nullish(),
1949
+ comment: e.string().nullish(),
1950
+ grouping: e.string().nullish(),
1951
+ mcn: e.string().nullish(),
1952
+ isrc: e.string().nullish(),
1953
+ music_brainz_release_id: e.string().nullish(),
1954
+ music_brainz_recording_id: e.string().nullish()
1955
+ }), nn = e.object({
1956
+ items: e.array(Y),
1957
+ offset: e.int(),
1958
+ limit: e.int(),
1959
+ total: e.int()
1960
+ }), X = e.object({
1961
+ url: e.string().max(8e3).nullish(),
1962
+ mime_type: e.string().max(1e3).nullish(),
1963
+ is_invalid: e.boolean().nullish(),
1964
+ extension_manifest_id: e.string().max(1e3).nullish(),
1965
+ extension_tag: e.string().max(1e3).nullish()
1966
+ }), rn = e.object({
1967
+ scopes: e.array(G),
1968
+ access_token: e.string(),
1969
+ token_type: e.literal("bearer")
1970
+ }), Z = e.object({
1971
+ id: e.int(),
1972
+ username: e.string(),
1973
+ preferred_name: e.string().nullable(),
1974
+ scopes: e.array(G)
1975
+ }), an = e.object({
1976
+ preferred_name: e.string().max(1e3).nullish(),
1977
+ scopes: e.array(G).min(1).nullish()
1978
+ }), on = e.object({
1979
+ users: e.array(Z),
1980
+ offset: e.int(),
1981
+ limit: e.int(),
1982
+ total: e.int()
1983
+ }), sn = e.object({ token: e.string() }), cn = e.object({
1984
+ token: e.string(),
1985
+ expires_at: e.iso.datetime()
1986
+ }), ln = e.object({
1987
+ id: e.int(),
1988
+ username: e.string(),
1989
+ preferred_name: e.string().nullable(),
1990
+ email: e.string().nullable(),
1991
+ is_email_verified: e.boolean(),
1992
+ enable_playback_events: e.boolean()
1993
+ }), un = e.object({
1994
+ email: e.email().nullable(),
1995
+ preferred_name: e.string().max(1e3).nullable(),
1996
+ enable_playback_events: e.boolean()
1997
+ }), Q = e.object({
1998
+ id: e.int(),
1999
+ username: e.string(),
2000
+ preferred_name: e.string().nullable()
2001
+ }), dn = e.object({
2002
+ users: e.array(Q),
2003
+ offset: e.int(),
2004
+ limit: e.int(),
2005
+ total: e.int()
2006
+ }), $ = e.object({
2007
+ loc: e.array(e.union([e.string(), e.int()])),
2008
+ msg: e.string(),
2009
+ type: e.string(),
2010
+ input: e.unknown().optional(),
2011
+ ctx: e.record(e.string(), e.unknown()).optional()
2012
+ }), fn = e.object({ detail: e.array($).optional() });
2013
+ //#endregion
2014
+ export { E as APIClient, N as AlbumReadSchema, Tt as AlbumUpdateSchema, P as ArtistReadSchema, Et as ArtistUpdateSchema, Dt as ArtworkCreateSchema, j as ArtworkKindSchema, M as ArtworkReadSchema, Ot as ArtworkUpdateSchema, kt as BodyIngestFilesLibrariesLibraryIdIngestFilesPostSchema, At as BodySignInSignInPostSchema, Nt as BulkIngestSongsSchema, jt as CompleteResetPasswordSchema, bt as EMBEDDED_TEXT_MAX_LENGTH, F as ExtensionCommandSchema, Mt as ExtensionImportAdminSchema, R as ExtensionManifestSchema, I as ExtensionPermissionsSchema, z as ExtensionReadSchema, L as ExtensionSearchCommandSchema, O as FileAccess, fn as HttpValidationErrorSchema, wt as INGEST_BATCH_MAX_SIZE, B as IngestArtworkSchema, q as IngestPlaybackEventSchema, H as IngestSongSchema, V as IngestSourceSchema, Pt as InstanceStatusReadSchema, Ct as LIMIT_MAX, Ft as LibraryCreateSchema, It as LibraryHomePathReadSchema, U as LibraryIgnoredResourceReadSchema, Lt as LibraryMediaReadAlbumReadSchema, Rt as LibraryMediaReadArtistReadSchema, zt as LibraryMediaReadExtensionReadSchema, Bt as LibraryMediaReadLibraryIgnoredResourceReadSchema, nn as LibraryMediaReadSongReadSchema, tn as LibraryMediaReadSourceReadSchema, Vt as LibraryPermissionCreateSchema, Ht as LibraryPermissionReadSchema, Ut as LibraryPermissionUpdateSchema, Wt as LibraryReadSchema, Gt as LibraryUpdateSchema, W as NotificationReadSchema, Kt as NotificationUpdateSchema, qt as NotificationsReadSchema, G as OAuth2ScopeSchema, Jt as OperationResultSchema, xt as PATH_MAX_LENGTH, Yt as PlaybackEventIngestResultSchema, K as PlaybackEventKindSchema, Xt as ResetPasswordSchema, Zt as SignUpSchema, Y as SongReadSchema, Qt as SongUpdateSchema, $t as SourceChangesReadSchema, en as SourceCreateSchema, J as SourceReadSchema, X as SourceUpdateSchema, A as StorageUserSessionManager, yt as TAG_MAX_LENGTH, rn as TokenSchema, St as URL_MAX_LENGTH, Z as UserAdminReadSchema, an as UserAdminUpdateSchema, on as UserAdminsReadSchema, sn as UserEventPreflightSchema, k as UserEventsManager, cn as UserFileAccessPreflightSchema, ln as UserProfileMeReadSchema, un as UserProfileMeUpdateSchema, Q as UserProfileReadSchema, dn as UserProfilesReadSchema, $ as ValidationErrorSchema, vt as createAPI };