@behindthemusictree/app-kit 28.0.2 → 29.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XIKMW7U4.js → chunk-WI4455RN.js} +20 -1
- package/dist/chunk-WI4455RN.js.map +1 -0
- package/dist/genre-tree/index.cjs +20 -0
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +364 -1
- package/dist/genre-tree/index.js +3 -1
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-XIKMW7U4.js.map +0 -1
|
@@ -12,6 +12,7 @@ declare const CriteriaDetailedSchema: z.ZodObject<{
|
|
|
12
12
|
uuid: z.core.$ZodBranded<z.ZodString, "GenreUuid", "out">;
|
|
13
13
|
name: z.ZodString;
|
|
14
14
|
summary: z.ZodNullable<z.ZodString>;
|
|
15
|
+
wikidataId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
16
|
parent: z.ZodNullable<z.ZodObject<{
|
|
16
17
|
uuid: z.core.$ZodBranded<z.ZodString, "GenreUuid", "out">;
|
|
17
18
|
name: z.ZodString;
|
|
@@ -130,6 +131,356 @@ declare function useListGenres(page: number | undefined, pageSize: number | stri
|
|
|
130
131
|
}>, Error>;
|
|
131
132
|
declare function useFetchGenre(scope: Scope, getBackendBaseUrl: () => string): (id: GenreUuid) => Promise<CriteriaDetailed>;
|
|
132
133
|
declare function useFetchGenreDetail<D extends CriteriaDetailed = CriteriaDetailed>(id: GenreUuid | null, scope: Scope, getBackendBaseUrl: () => string, schema?: z.ZodType<D, unknown>): _tanstack_react_query.UseQueryResult<NoInfer<D>, Error>;
|
|
134
|
+
/** The genre carrying a Wikidata item id: `undefined` while loading or disabled, `null` when the API has none. */
|
|
135
|
+
declare function useGenreByWikidataId(qid: string | null, scope: Scope, getBackendBaseUrl: () => string): {
|
|
136
|
+
data: {
|
|
137
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
138
|
+
name: string;
|
|
139
|
+
side?: "pop" | "core" | null | undefined;
|
|
140
|
+
wikidataId?: string | null | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
error: Error;
|
|
143
|
+
isError: true;
|
|
144
|
+
isPending: false;
|
|
145
|
+
isLoading: false;
|
|
146
|
+
isLoadingError: false;
|
|
147
|
+
isRefetchError: true;
|
|
148
|
+
isSuccess: false;
|
|
149
|
+
isPlaceholderData: false;
|
|
150
|
+
status: "error";
|
|
151
|
+
dataUpdatedAt: number;
|
|
152
|
+
errorUpdatedAt: number;
|
|
153
|
+
failureCount: number;
|
|
154
|
+
failureReason: Error | null;
|
|
155
|
+
errorUpdateCount: number;
|
|
156
|
+
isFetched: boolean;
|
|
157
|
+
isFetchedAfterMount: boolean;
|
|
158
|
+
isFetching: boolean;
|
|
159
|
+
isInitialLoading: boolean;
|
|
160
|
+
isPaused: boolean;
|
|
161
|
+
isRefetching: boolean;
|
|
162
|
+
isStale: boolean;
|
|
163
|
+
isEnabled: boolean;
|
|
164
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
165
|
+
overallTotal: number;
|
|
166
|
+
next: string | null;
|
|
167
|
+
previous: string | null;
|
|
168
|
+
results: {
|
|
169
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
170
|
+
name: string;
|
|
171
|
+
side?: "pop" | "core" | null | undefined;
|
|
172
|
+
wikidataId?: string | null | undefined;
|
|
173
|
+
}[];
|
|
174
|
+
page: number;
|
|
175
|
+
pageSize: number;
|
|
176
|
+
totalPages: number;
|
|
177
|
+
}>, Error>>;
|
|
178
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
179
|
+
promise: Promise<NoInfer<{
|
|
180
|
+
overallTotal: number;
|
|
181
|
+
next: string | null;
|
|
182
|
+
previous: string | null;
|
|
183
|
+
results: {
|
|
184
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
185
|
+
name: string;
|
|
186
|
+
side?: "pop" | "core" | null | undefined;
|
|
187
|
+
wikidataId?: string | null | undefined;
|
|
188
|
+
}[];
|
|
189
|
+
page: number;
|
|
190
|
+
pageSize: number;
|
|
191
|
+
totalPages: number;
|
|
192
|
+
}>>;
|
|
193
|
+
} | {
|
|
194
|
+
data: {
|
|
195
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
196
|
+
name: string;
|
|
197
|
+
side?: "pop" | "core" | null | undefined;
|
|
198
|
+
wikidataId?: string | null | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
error: null;
|
|
201
|
+
isError: false;
|
|
202
|
+
isPending: false;
|
|
203
|
+
isLoading: false;
|
|
204
|
+
isLoadingError: false;
|
|
205
|
+
isRefetchError: false;
|
|
206
|
+
isSuccess: true;
|
|
207
|
+
isPlaceholderData: false;
|
|
208
|
+
status: "success";
|
|
209
|
+
dataUpdatedAt: number;
|
|
210
|
+
errorUpdatedAt: number;
|
|
211
|
+
failureCount: number;
|
|
212
|
+
failureReason: Error | null;
|
|
213
|
+
errorUpdateCount: number;
|
|
214
|
+
isFetched: boolean;
|
|
215
|
+
isFetchedAfterMount: boolean;
|
|
216
|
+
isFetching: boolean;
|
|
217
|
+
isInitialLoading: boolean;
|
|
218
|
+
isPaused: boolean;
|
|
219
|
+
isRefetching: boolean;
|
|
220
|
+
isStale: boolean;
|
|
221
|
+
isEnabled: boolean;
|
|
222
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
223
|
+
overallTotal: number;
|
|
224
|
+
next: string | null;
|
|
225
|
+
previous: string | null;
|
|
226
|
+
results: {
|
|
227
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
228
|
+
name: string;
|
|
229
|
+
side?: "pop" | "core" | null | undefined;
|
|
230
|
+
wikidataId?: string | null | undefined;
|
|
231
|
+
}[];
|
|
232
|
+
page: number;
|
|
233
|
+
pageSize: number;
|
|
234
|
+
totalPages: number;
|
|
235
|
+
}>, Error>>;
|
|
236
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
237
|
+
promise: Promise<NoInfer<{
|
|
238
|
+
overallTotal: number;
|
|
239
|
+
next: string | null;
|
|
240
|
+
previous: string | null;
|
|
241
|
+
results: {
|
|
242
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
243
|
+
name: string;
|
|
244
|
+
side?: "pop" | "core" | null | undefined;
|
|
245
|
+
wikidataId?: string | null | undefined;
|
|
246
|
+
}[];
|
|
247
|
+
page: number;
|
|
248
|
+
pageSize: number;
|
|
249
|
+
totalPages: number;
|
|
250
|
+
}>>;
|
|
251
|
+
} | {
|
|
252
|
+
data: {
|
|
253
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
254
|
+
name: string;
|
|
255
|
+
side?: "pop" | "core" | null | undefined;
|
|
256
|
+
wikidataId?: string | null | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
error: Error;
|
|
259
|
+
isError: true;
|
|
260
|
+
isPending: false;
|
|
261
|
+
isLoading: false;
|
|
262
|
+
isLoadingError: true;
|
|
263
|
+
isRefetchError: false;
|
|
264
|
+
isSuccess: false;
|
|
265
|
+
isPlaceholderData: false;
|
|
266
|
+
status: "error";
|
|
267
|
+
dataUpdatedAt: number;
|
|
268
|
+
errorUpdatedAt: number;
|
|
269
|
+
failureCount: number;
|
|
270
|
+
failureReason: Error | null;
|
|
271
|
+
errorUpdateCount: number;
|
|
272
|
+
isFetched: boolean;
|
|
273
|
+
isFetchedAfterMount: boolean;
|
|
274
|
+
isFetching: boolean;
|
|
275
|
+
isInitialLoading: boolean;
|
|
276
|
+
isPaused: boolean;
|
|
277
|
+
isRefetching: boolean;
|
|
278
|
+
isStale: boolean;
|
|
279
|
+
isEnabled: boolean;
|
|
280
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
281
|
+
overallTotal: number;
|
|
282
|
+
next: string | null;
|
|
283
|
+
previous: string | null;
|
|
284
|
+
results: {
|
|
285
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
286
|
+
name: string;
|
|
287
|
+
side?: "pop" | "core" | null | undefined;
|
|
288
|
+
wikidataId?: string | null | undefined;
|
|
289
|
+
}[];
|
|
290
|
+
page: number;
|
|
291
|
+
pageSize: number;
|
|
292
|
+
totalPages: number;
|
|
293
|
+
}>, Error>>;
|
|
294
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
295
|
+
promise: Promise<NoInfer<{
|
|
296
|
+
overallTotal: number;
|
|
297
|
+
next: string | null;
|
|
298
|
+
previous: string | null;
|
|
299
|
+
results: {
|
|
300
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
301
|
+
name: string;
|
|
302
|
+
side?: "pop" | "core" | null | undefined;
|
|
303
|
+
wikidataId?: string | null | undefined;
|
|
304
|
+
}[];
|
|
305
|
+
page: number;
|
|
306
|
+
pageSize: number;
|
|
307
|
+
totalPages: number;
|
|
308
|
+
}>>;
|
|
309
|
+
} | {
|
|
310
|
+
data: {
|
|
311
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
312
|
+
name: string;
|
|
313
|
+
side?: "pop" | "core" | null | undefined;
|
|
314
|
+
wikidataId?: string | null | undefined;
|
|
315
|
+
} | undefined;
|
|
316
|
+
error: null;
|
|
317
|
+
isError: false;
|
|
318
|
+
isPending: true;
|
|
319
|
+
isLoading: true;
|
|
320
|
+
isLoadingError: false;
|
|
321
|
+
isRefetchError: false;
|
|
322
|
+
isSuccess: false;
|
|
323
|
+
isPlaceholderData: false;
|
|
324
|
+
status: "pending";
|
|
325
|
+
dataUpdatedAt: number;
|
|
326
|
+
errorUpdatedAt: number;
|
|
327
|
+
failureCount: number;
|
|
328
|
+
failureReason: Error | null;
|
|
329
|
+
errorUpdateCount: number;
|
|
330
|
+
isFetched: boolean;
|
|
331
|
+
isFetchedAfterMount: boolean;
|
|
332
|
+
isFetching: boolean;
|
|
333
|
+
isInitialLoading: boolean;
|
|
334
|
+
isPaused: boolean;
|
|
335
|
+
isRefetching: boolean;
|
|
336
|
+
isStale: boolean;
|
|
337
|
+
isEnabled: boolean;
|
|
338
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
339
|
+
overallTotal: number;
|
|
340
|
+
next: string | null;
|
|
341
|
+
previous: string | null;
|
|
342
|
+
results: {
|
|
343
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
344
|
+
name: string;
|
|
345
|
+
side?: "pop" | "core" | null | undefined;
|
|
346
|
+
wikidataId?: string | null | undefined;
|
|
347
|
+
}[];
|
|
348
|
+
page: number;
|
|
349
|
+
pageSize: number;
|
|
350
|
+
totalPages: number;
|
|
351
|
+
}>, Error>>;
|
|
352
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
353
|
+
promise: Promise<NoInfer<{
|
|
354
|
+
overallTotal: number;
|
|
355
|
+
next: string | null;
|
|
356
|
+
previous: string | null;
|
|
357
|
+
results: {
|
|
358
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
359
|
+
name: string;
|
|
360
|
+
side?: "pop" | "core" | null | undefined;
|
|
361
|
+
wikidataId?: string | null | undefined;
|
|
362
|
+
}[];
|
|
363
|
+
page: number;
|
|
364
|
+
pageSize: number;
|
|
365
|
+
totalPages: number;
|
|
366
|
+
}>>;
|
|
367
|
+
} | {
|
|
368
|
+
data: {
|
|
369
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
370
|
+
name: string;
|
|
371
|
+
side?: "pop" | "core" | null | undefined;
|
|
372
|
+
wikidataId?: string | null | undefined;
|
|
373
|
+
} | undefined;
|
|
374
|
+
error: null;
|
|
375
|
+
isError: false;
|
|
376
|
+
isPending: true;
|
|
377
|
+
isLoadingError: false;
|
|
378
|
+
isRefetchError: false;
|
|
379
|
+
isSuccess: false;
|
|
380
|
+
isPlaceholderData: false;
|
|
381
|
+
status: "pending";
|
|
382
|
+
dataUpdatedAt: number;
|
|
383
|
+
errorUpdatedAt: number;
|
|
384
|
+
failureCount: number;
|
|
385
|
+
failureReason: Error | null;
|
|
386
|
+
errorUpdateCount: number;
|
|
387
|
+
isFetched: boolean;
|
|
388
|
+
isFetchedAfterMount: boolean;
|
|
389
|
+
isFetching: boolean;
|
|
390
|
+
isLoading: boolean;
|
|
391
|
+
isInitialLoading: boolean;
|
|
392
|
+
isPaused: boolean;
|
|
393
|
+
isRefetching: boolean;
|
|
394
|
+
isStale: boolean;
|
|
395
|
+
isEnabled: boolean;
|
|
396
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
397
|
+
overallTotal: number;
|
|
398
|
+
next: string | null;
|
|
399
|
+
previous: string | null;
|
|
400
|
+
results: {
|
|
401
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
402
|
+
name: string;
|
|
403
|
+
side?: "pop" | "core" | null | undefined;
|
|
404
|
+
wikidataId?: string | null | undefined;
|
|
405
|
+
}[];
|
|
406
|
+
page: number;
|
|
407
|
+
pageSize: number;
|
|
408
|
+
totalPages: number;
|
|
409
|
+
}>, Error>>;
|
|
410
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
411
|
+
promise: Promise<NoInfer<{
|
|
412
|
+
overallTotal: number;
|
|
413
|
+
next: string | null;
|
|
414
|
+
previous: string | null;
|
|
415
|
+
results: {
|
|
416
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
417
|
+
name: string;
|
|
418
|
+
side?: "pop" | "core" | null | undefined;
|
|
419
|
+
wikidataId?: string | null | undefined;
|
|
420
|
+
}[];
|
|
421
|
+
page: number;
|
|
422
|
+
pageSize: number;
|
|
423
|
+
totalPages: number;
|
|
424
|
+
}>>;
|
|
425
|
+
} | {
|
|
426
|
+
data: {
|
|
427
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
428
|
+
name: string;
|
|
429
|
+
side?: "pop" | "core" | null | undefined;
|
|
430
|
+
wikidataId?: string | null | undefined;
|
|
431
|
+
} | undefined;
|
|
432
|
+
isError: false;
|
|
433
|
+
error: null;
|
|
434
|
+
isPending: false;
|
|
435
|
+
isLoading: false;
|
|
436
|
+
isLoadingError: false;
|
|
437
|
+
isRefetchError: false;
|
|
438
|
+
isSuccess: true;
|
|
439
|
+
isPlaceholderData: true;
|
|
440
|
+
status: "success";
|
|
441
|
+
dataUpdatedAt: number;
|
|
442
|
+
errorUpdatedAt: number;
|
|
443
|
+
failureCount: number;
|
|
444
|
+
failureReason: Error | null;
|
|
445
|
+
errorUpdateCount: number;
|
|
446
|
+
isFetched: boolean;
|
|
447
|
+
isFetchedAfterMount: boolean;
|
|
448
|
+
isFetching: boolean;
|
|
449
|
+
isInitialLoading: boolean;
|
|
450
|
+
isPaused: boolean;
|
|
451
|
+
isRefetching: boolean;
|
|
452
|
+
isStale: boolean;
|
|
453
|
+
isEnabled: boolean;
|
|
454
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
|
|
455
|
+
overallTotal: number;
|
|
456
|
+
next: string | null;
|
|
457
|
+
previous: string | null;
|
|
458
|
+
results: {
|
|
459
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
460
|
+
name: string;
|
|
461
|
+
side?: "pop" | "core" | null | undefined;
|
|
462
|
+
wikidataId?: string | null | undefined;
|
|
463
|
+
}[];
|
|
464
|
+
page: number;
|
|
465
|
+
pageSize: number;
|
|
466
|
+
totalPages: number;
|
|
467
|
+
}>, Error>>;
|
|
468
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
469
|
+
promise: Promise<NoInfer<{
|
|
470
|
+
overallTotal: number;
|
|
471
|
+
next: string | null;
|
|
472
|
+
previous: string | null;
|
|
473
|
+
results: {
|
|
474
|
+
uuid: string & z.core.$brand<"GenreUuid">;
|
|
475
|
+
name: string;
|
|
476
|
+
side?: "pop" | "core" | null | undefined;
|
|
477
|
+
wikidataId?: string | null | undefined;
|
|
478
|
+
}[];
|
|
479
|
+
page: number;
|
|
480
|
+
pageSize: number;
|
|
481
|
+
totalPages: number;
|
|
482
|
+
}>>;
|
|
483
|
+
};
|
|
133
484
|
declare function useFetchGenreOverview<O extends CriteriaOverview = CriteriaOverview>(id: GenreUuid | null, scope: Scope, getBackendBaseUrl: () => string, schema?: z.ZodType<O, unknown>): _tanstack_react_query.UseQueryResult<NoInfer<O>, Error>;
|
|
134
485
|
declare function usePrefetchGenreOverview<O extends CriteriaOverview = CriteriaOverview>(scope: Scope, getBackendBaseUrl: () => string, schema?: z.ZodType<O, unknown>): (id: GenreUuid) => Promise<void>;
|
|
135
486
|
declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string): {
|
|
@@ -209,6 +560,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
209
560
|
}[];
|
|
210
561
|
tracksCount: number;
|
|
211
562
|
updatedOn: string | null;
|
|
563
|
+
wikidataId?: string | null | undefined;
|
|
212
564
|
}, Error, {
|
|
213
565
|
name: string;
|
|
214
566
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -284,6 +636,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
284
636
|
}[];
|
|
285
637
|
tracksCount: number;
|
|
286
638
|
updatedOn: string | null;
|
|
639
|
+
wikidataId?: string | null | undefined;
|
|
287
640
|
}, Error, {
|
|
288
641
|
name: string;
|
|
289
642
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -370,6 +723,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
370
723
|
}[];
|
|
371
724
|
tracksCount: number;
|
|
372
725
|
updatedOn: string | null;
|
|
726
|
+
wikidataId?: string | null | undefined;
|
|
373
727
|
}, Error, {
|
|
374
728
|
name: string;
|
|
375
729
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -445,6 +799,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
445
799
|
}[];
|
|
446
800
|
tracksCount: number;
|
|
447
801
|
updatedOn: string | null;
|
|
802
|
+
wikidataId?: string | null | undefined;
|
|
448
803
|
}, Error, {
|
|
449
804
|
name: string;
|
|
450
805
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -531,6 +886,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
531
886
|
}[];
|
|
532
887
|
tracksCount: number;
|
|
533
888
|
updatedOn: string | null;
|
|
889
|
+
wikidataId?: string | null | undefined;
|
|
534
890
|
}, Error, {
|
|
535
891
|
name: string;
|
|
536
892
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -606,6 +962,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
606
962
|
}[];
|
|
607
963
|
tracksCount: number;
|
|
608
964
|
updatedOn: string | null;
|
|
965
|
+
wikidataId?: string | null | undefined;
|
|
609
966
|
}, Error, {
|
|
610
967
|
name: string;
|
|
611
968
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -680,6 +1037,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
680
1037
|
}[];
|
|
681
1038
|
tracksCount: number;
|
|
682
1039
|
updatedOn: string | null;
|
|
1040
|
+
wikidataId?: string | null | undefined;
|
|
683
1041
|
};
|
|
684
1042
|
error: null;
|
|
685
1043
|
variables: {
|
|
@@ -756,6 +1114,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
756
1114
|
}[];
|
|
757
1115
|
tracksCount: number;
|
|
758
1116
|
updatedOn: string | null;
|
|
1117
|
+
wikidataId?: string | null | undefined;
|
|
759
1118
|
}, Error, {
|
|
760
1119
|
name: string;
|
|
761
1120
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -831,6 +1190,7 @@ declare function useCreateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
831
1190
|
}[];
|
|
832
1191
|
tracksCount: number;
|
|
833
1192
|
updatedOn: string | null;
|
|
1193
|
+
wikidataId?: string | null | undefined;
|
|
834
1194
|
}, Error, {
|
|
835
1195
|
name: string;
|
|
836
1196
|
parent?: (string & z.core.$brand<"GenreUuid">) | undefined;
|
|
@@ -902,6 +1262,7 @@ declare function useUpdateGenre(scope: Scope, getBackendBaseUrl: () => string):
|
|
|
902
1262
|
}[];
|
|
903
1263
|
tracksCount: number;
|
|
904
1264
|
updatedOn: string | null;
|
|
1265
|
+
wikidataId?: string | null | undefined;
|
|
905
1266
|
}, Error, {
|
|
906
1267
|
uuid: string & z.core.$brand<"GenreUuid">;
|
|
907
1268
|
data: {
|
|
@@ -2958,12 +3319,14 @@ declare const genreQueryKeys: {
|
|
|
2958
3319
|
all: readonly ["genres"];
|
|
2959
3320
|
list: (page: number) => readonly ["genres", "list", number];
|
|
2960
3321
|
detail: (id: GenreUuid) => readonly ["genres", "detail", string & zod.$brand<"GenreUuid">];
|
|
3322
|
+
byWikidataId: (qid: string) => readonly ["genres", "byWikidataId", string];
|
|
2961
3323
|
overview: (id: GenreUuid) => readonly ["genres", "overview", string & zod.$brand<"GenreUuid">];
|
|
2962
3324
|
};
|
|
2963
3325
|
reference: {
|
|
2964
3326
|
all: readonly ["referenceGenres"];
|
|
2965
3327
|
list: (page: number) => readonly ["referenceGenres", "list", number];
|
|
2966
3328
|
detail: (id: GenreUuid) => readonly ["referenceGenres", "detail", string & zod.$brand<"GenreUuid">];
|
|
3329
|
+
byWikidataId: (qid: string) => readonly ["referenceGenres", "byWikidataId", string];
|
|
2967
3330
|
overview: (id: GenreUuid) => readonly ["referenceGenres", "overview", string & zod.$brand<"GenreUuid">];
|
|
2968
3331
|
};
|
|
2969
3332
|
};
|
|
@@ -3125,4 +3488,4 @@ type SongsPage = {
|
|
|
3125
3488
|
*/
|
|
3126
3489
|
declare function editGenreSongPages<P extends SongsPage>(data: InfiniteData<P> | undefined, edit: (tracks: P["tracks"]) => P["tracks"]): InfiniteData<P> | undefined;
|
|
3127
3490
|
|
|
3128
|
-
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, type GenrePlaylistTracksPage, GenrePlaylistUuid, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type PlayArtistOptions, type PlayGenrePlaylistOptions, type RenderArtistLink, type ReparentCandidate, type SongDetailed, SongDetailedSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, type UseArtistResult, type UseArtistSearchResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, editGenreSongPages, formatTime, genreEndpoints, genrePlaylistEndpoints, genrePlaylistQueryKeys, genreQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl, pruneGenrePlaylistsForArtist, searchGenrePlaylistsByName, songUnplayableReason, useArtist, useArtistGenreCounts, useArtistSearch, useCreateGenre, useDeleteGenre, useFetchGenre, useFetchGenreDetail, useFetchGenreOverview, useFetchGenrePlaylist, useGenreSearch, useGenreTreeViewState, useInvalidateAllGenrePlaylistQueries, useListFullGenrePlaylists, useListGenrePlaylists, useListGenres, useListTracks, usePrefetchGenreOverview, useTrackList, useTrackListSidebarVisibility, useUpdateGenre, useVisibleGenrePlaylists };
|
|
3491
|
+
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, type GenrePlaylistTracksPage, GenrePlaylistUuid, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type PlayArtistOptions, type PlayGenrePlaylistOptions, type RenderArtistLink, type ReparentCandidate, type SongDetailed, SongDetailedSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, type UseArtistResult, type UseArtistSearchResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, editGenreSongPages, formatTime, genreEndpoints, genrePlaylistEndpoints, genrePlaylistQueryKeys, genreQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl, pruneGenrePlaylistsForArtist, searchGenrePlaylistsByName, songUnplayableReason, useArtist, useArtistGenreCounts, useArtistSearch, useCreateGenre, useDeleteGenre, useFetchGenre, useFetchGenreDetail, useFetchGenreOverview, useFetchGenrePlaylist, useGenreByWikidataId, useGenreSearch, useGenreTreeViewState, useInvalidateAllGenrePlaylistQueries, useListFullGenrePlaylists, useListGenrePlaylists, useListGenres, useListTracks, usePrefetchGenreOverview, useTrackList, useTrackListSidebarVisibility, useUpdateGenre, useVisibleGenrePlaylists };
|
package/dist/genre-tree/index.js
CHANGED
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
useFetchGenreDetail,
|
|
71
71
|
useFetchGenreOverview,
|
|
72
72
|
useFetchGenrePlaylist,
|
|
73
|
+
useGenreByWikidataId,
|
|
73
74
|
useGenreSearch,
|
|
74
75
|
useGenreTreeViewState,
|
|
75
76
|
useInvalidateAllGenrePlaylistQueries,
|
|
@@ -82,7 +83,7 @@ import {
|
|
|
82
83
|
useTrackListSidebarVisibility,
|
|
83
84
|
useUpdateGenre,
|
|
84
85
|
useVisibleGenrePlaylists
|
|
85
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-WI4455RN.js";
|
|
86
87
|
import "../chunk-7EOS2K24.js";
|
|
87
88
|
import "../chunk-T5D5T52J.js";
|
|
88
89
|
import "../chunk-4MEK3CNF.js";
|
|
@@ -165,6 +166,7 @@ export {
|
|
|
165
166
|
useFetchGenreDetail,
|
|
166
167
|
useFetchGenreOverview,
|
|
167
168
|
useFetchGenrePlaylist,
|
|
169
|
+
useGenreByWikidataId,
|
|
168
170
|
useGenreSearch,
|
|
169
171
|
useGenreTreeViewState,
|
|
170
172
|
useInvalidateAllGenrePlaylistQueries,
|
package/dist/index.cjs
CHANGED
|
@@ -143,6 +143,7 @@ __export(src_exports, {
|
|
|
143
143
|
useFetchGenreOverview: () => useFetchGenreOverview,
|
|
144
144
|
useFetchGenrePlaylist: () => useFetchGenrePlaylist,
|
|
145
145
|
useFetchWrapper: () => useFetchWrapper,
|
|
146
|
+
useGenreByWikidataId: () => useGenreByWikidataId,
|
|
146
147
|
useGenreSearch: () => useGenreSearch,
|
|
147
148
|
useGenreTreeViewState: () => useGenreTreeViewState,
|
|
148
149
|
useInvalidateAllGenrePlaylistQueries: () => useInvalidateAllGenrePlaylistQueries,
|
|
@@ -2030,6 +2031,8 @@ var CriteriaDetailedSchema = import_zod16.z.object({
|
|
|
2030
2031
|
uuid: GenreUuidSchema,
|
|
2031
2032
|
name: import_zod16.z.string(),
|
|
2032
2033
|
summary: import_zod16.z.string().nullable(),
|
|
2034
|
+
// Optional until every deployed API serves it.
|
|
2035
|
+
wikidataId: import_zod16.z.string().nullable().optional(),
|
|
2033
2036
|
parent: CriteriaMinimumSchema.nullable(),
|
|
2034
2037
|
ascendants: import_zod16.z.array(CriteriaLineageRelWithoutDescendantSchema),
|
|
2035
2038
|
descendants: import_zod16.z.array(CriteriaLineageRelWithoutAscendantSchema),
|
|
@@ -2092,12 +2095,14 @@ var genreQueryKeys = {
|
|
|
2092
2095
|
all: ["genres"],
|
|
2093
2096
|
list: (page) => ["genres", "list", page],
|
|
2094
2097
|
detail: (id) => ["genres", "detail", id],
|
|
2098
|
+
byWikidataId: (qid) => ["genres", "byWikidataId", qid],
|
|
2095
2099
|
overview: (id) => ["genres", "overview", id]
|
|
2096
2100
|
},
|
|
2097
2101
|
reference: {
|
|
2098
2102
|
all: ["referenceGenres"],
|
|
2099
2103
|
list: (page) => ["referenceGenres", "list", page],
|
|
2100
2104
|
detail: (id) => ["referenceGenres", "detail", id],
|
|
2105
|
+
byWikidataId: (qid) => ["referenceGenres", "byWikidataId", qid],
|
|
2101
2106
|
overview: (id) => ["referenceGenres", "overview", id]
|
|
2102
2107
|
}
|
|
2103
2108
|
};
|
|
@@ -2154,6 +2159,20 @@ function useFetchGenreDetail(id, scope, getBackendBaseUrl, schema = CriteriaDeta
|
|
|
2154
2159
|
enabled: id !== null
|
|
2155
2160
|
});
|
|
2156
2161
|
}
|
|
2162
|
+
var GenreByWikidataIdSchema = PaginatedResponseSchema(CriteriaMinimumSchema);
|
|
2163
|
+
function useGenreByWikidataId(qid, scope, getBackendBaseUrl) {
|
|
2164
|
+
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
2165
|
+
const queryKeys = scope === "reference" ? genreQueryKeys.reference : genreQueryKeys.me;
|
|
2166
|
+
const endpoints = scope === "reference" ? genreEndpoints.reference : genreEndpoints.me;
|
|
2167
|
+
const { data, ...rest } = useQueryWithParse({
|
|
2168
|
+
queryKey: queryKeys.byWikidataId(qid ?? ""),
|
|
2169
|
+
queryFn: () => fetch2(endpoints.list(), true, scope === "me", {}, { wikidataId: qid ?? "", pageSize: 1 }),
|
|
2170
|
+
schema: GenreByWikidataIdSchema,
|
|
2171
|
+
context: "useGenreByWikidataId",
|
|
2172
|
+
enabled: qid !== null
|
|
2173
|
+
});
|
|
2174
|
+
return { ...rest, data: data === void 0 ? void 0 : data.results[0] ?? null };
|
|
2175
|
+
}
|
|
2157
2176
|
var GENRE_OVERVIEW_STALE_TIME_MS = 6e4;
|
|
2158
2177
|
function useGenreOverviewQueryOptions(scope, getBackendBaseUrl, schema) {
|
|
2159
2178
|
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
@@ -3394,6 +3413,7 @@ function editGenreSongPages(data, edit) {
|
|
|
3394
3413
|
useFetchGenreOverview,
|
|
3395
3414
|
useFetchGenrePlaylist,
|
|
3396
3415
|
useFetchWrapper,
|
|
3416
|
+
useGenreByWikidataId,
|
|
3397
3417
|
useGenreSearch,
|
|
3398
3418
|
useGenreTreeViewState,
|
|
3399
3419
|
useInvalidateAllGenrePlaylistQueries,
|