@freqhole/api-client 0.2.14 → 0.3.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/package.json +7 -5
- package/src/CharnelLocalTransport.ts +70 -35
- package/src/CharnelTransport.ts +391 -106
- package/src/FreqholeClient.ts +46 -83
- package/src/WasmTransport.ts +265 -219
- package/src/blobCachePolicy.test.ts +199 -0
- package/src/codegen/routes.ts +75 -13
- package/src/codegen/schema.ts +1436 -225
- package/src/domains/entities.ts +304 -0
- package/src/domains/favorites.types.ts +13 -3
- package/src/domains/music.ts +74 -126
- package/src/domains/upload.ts +54 -53
- package/src/domains/video.ts +463 -0
- package/src/errors.ts +142 -0
- package/src/index.ts +47 -10
- package/src/permissions.ts +18 -36
- package/src/tauriRuntime.ts +22 -0
- package/src/test/fixtures.ts +13 -23
- package/src/test/integration.ts +15 -28
- package/src/test/stateful.ts +11 -29
- package/src/transport.ts +72 -39
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// entities domain methods for FreqholeClient
|
|
2
|
+
//
|
|
3
|
+
// domain-neutral routes for entity_taxonz/playlist_itemz - any TaggableEntity
|
|
4
|
+
// (video today; other domains reuse the same routes as they're added, see
|
|
5
|
+
// docs/video-domain-plan.md's "add a domain" recipe).
|
|
6
|
+
|
|
7
|
+
import { routes } from "../codegen/routes.js";
|
|
8
|
+
import type * as s from "../codegen/schema.js";
|
|
9
|
+
import type { CallFn } from "./types.js";
|
|
10
|
+
|
|
11
|
+
export function createEntitiesMethods(call: CallFn) {
|
|
12
|
+
return {
|
|
13
|
+
// taxon links
|
|
14
|
+
getEntityTaxons: (params: s.GetEntityTaxonsRequest) => {
|
|
15
|
+
return call(
|
|
16
|
+
"entities",
|
|
17
|
+
"get_entity_taxons",
|
|
18
|
+
routes.entities.get_entity_taxons.resp,
|
|
19
|
+
routes.entities.get_entity_taxons.req,
|
|
20
|
+
routes.entities.get_entity_taxons.method,
|
|
21
|
+
routes.entities.get_entity_taxons.path,
|
|
22
|
+
params,
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
addEntityTaxon: (params: s.AddEntityTaxonRequest) => {
|
|
27
|
+
return call(
|
|
28
|
+
"entities",
|
|
29
|
+
"add_entity_taxon",
|
|
30
|
+
routes.entities.add_entity_taxon.resp,
|
|
31
|
+
routes.entities.add_entity_taxon.req,
|
|
32
|
+
routes.entities.add_entity_taxon.method,
|
|
33
|
+
routes.entities.add_entity_taxon.path,
|
|
34
|
+
params,
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
removeEntityTaxon: (params: s.RemoveEntityTaxonRequest) => {
|
|
39
|
+
return call(
|
|
40
|
+
"entities",
|
|
41
|
+
"remove_entity_taxon",
|
|
42
|
+
routes.entities.remove_entity_taxon.resp,
|
|
43
|
+
routes.entities.remove_entity_taxon.req,
|
|
44
|
+
routes.entities.remove_entity_taxon.method,
|
|
45
|
+
routes.entities.remove_entity_taxon.path,
|
|
46
|
+
params,
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// entity urls
|
|
51
|
+
getEntityUrls: (params: s.GetEntityUrlsRequest) => {
|
|
52
|
+
return call(
|
|
53
|
+
"entities",
|
|
54
|
+
"get_entity_urls",
|
|
55
|
+
routes.entities.get_entity_urls.resp,
|
|
56
|
+
routes.entities.get_entity_urls.req,
|
|
57
|
+
routes.entities.get_entity_urls.method,
|
|
58
|
+
routes.entities.get_entity_urls.path,
|
|
59
|
+
params,
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
addEntityUrl: (params: s.AddEntityUrlRequest) => {
|
|
64
|
+
return call(
|
|
65
|
+
"entities",
|
|
66
|
+
"add_entity_url",
|
|
67
|
+
routes.entities.add_entity_url.resp,
|
|
68
|
+
routes.entities.add_entity_url.req,
|
|
69
|
+
routes.entities.add_entity_url.method,
|
|
70
|
+
routes.entities.add_entity_url.path,
|
|
71
|
+
params,
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
removeEntityUrl: (params: s.RemoveEntityUrlRequest) => {
|
|
76
|
+
return call(
|
|
77
|
+
"entities",
|
|
78
|
+
"remove_entity_url",
|
|
79
|
+
routes.entities.remove_entity_url.resp,
|
|
80
|
+
routes.entities.remove_entity_url.req,
|
|
81
|
+
routes.entities.remove_entity_url.method,
|
|
82
|
+
routes.entities.remove_entity_url.path,
|
|
83
|
+
params,
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
// entity images
|
|
88
|
+
getEntityImages: (params: s.GetEntityImagesRequest) => {
|
|
89
|
+
return call(
|
|
90
|
+
"entities",
|
|
91
|
+
"get_entity_images",
|
|
92
|
+
routes.entities.get_entity_images.resp,
|
|
93
|
+
routes.entities.get_entity_images.req,
|
|
94
|
+
routes.entities.get_entity_images.method,
|
|
95
|
+
routes.entities.get_entity_images.path,
|
|
96
|
+
params,
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// entity tags (bulk-first; a single-entity call is just a 1-element
|
|
101
|
+
// entity_ids array)
|
|
102
|
+
getEntitiesTags: (params: s.GetEntitiesTagsRequest) => {
|
|
103
|
+
return call(
|
|
104
|
+
"entities",
|
|
105
|
+
"get_entities_tags",
|
|
106
|
+
routes.entities.get_entities_tags.resp,
|
|
107
|
+
routes.entities.get_entities_tags.req,
|
|
108
|
+
routes.entities.get_entities_tags.method,
|
|
109
|
+
routes.entities.get_entities_tags.path,
|
|
110
|
+
params,
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// every tag used by at least one entity of a given type (unlike
|
|
115
|
+
// getEntitiesTags, not scoped to a specific set of entity ids) —
|
|
116
|
+
// used to drive per-domain tag filter pickers without showing tags
|
|
117
|
+
// that belong to a different domain / have zero matching entities.
|
|
118
|
+
listEntityTypeTags: (params: s.ListEntityTypeTagsRequest) => {
|
|
119
|
+
return call(
|
|
120
|
+
"entities",
|
|
121
|
+
"list_entity_type_tags",
|
|
122
|
+
routes.entities.list_entity_type_tags.resp,
|
|
123
|
+
routes.entities.list_entity_type_tags.req,
|
|
124
|
+
routes.entities.list_entity_type_tags.method,
|
|
125
|
+
routes.entities.list_entity_type_tags.path,
|
|
126
|
+
params,
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
addEntitiesTags: (params: s.AddEntitiesTagsRequest) => {
|
|
131
|
+
return call(
|
|
132
|
+
"entities",
|
|
133
|
+
"add_entities_tags",
|
|
134
|
+
routes.entities.add_entities_tags.resp,
|
|
135
|
+
routes.entities.add_entities_tags.req,
|
|
136
|
+
routes.entities.add_entities_tags.method,
|
|
137
|
+
routes.entities.add_entities_tags.path,
|
|
138
|
+
params,
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
removeEntitiesTags: (params: s.RemoveEntitiesTagsRequest) => {
|
|
143
|
+
return call(
|
|
144
|
+
"entities",
|
|
145
|
+
"remove_entities_tags",
|
|
146
|
+
routes.entities.remove_entities_tags.resp,
|
|
147
|
+
routes.entities.remove_entities_tags.req,
|
|
148
|
+
routes.entities.remove_entities_tags.method,
|
|
149
|
+
routes.entities.remove_entities_tags.path,
|
|
150
|
+
params,
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
// playlist items
|
|
155
|
+
listPlaylistItems: (params: s.ListPlaylistItemsRequest) => {
|
|
156
|
+
return call(
|
|
157
|
+
"entities",
|
|
158
|
+
"list_playlist_items",
|
|
159
|
+
routes.entities.list_playlist_items.resp,
|
|
160
|
+
routes.entities.list_playlist_items.req,
|
|
161
|
+
routes.entities.list_playlist_items.method,
|
|
162
|
+
routes.entities.list_playlist_items.path,
|
|
163
|
+
params,
|
|
164
|
+
);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
addPlaylistItem: (params: s.AddPlaylistItemRequest) => {
|
|
168
|
+
return call(
|
|
169
|
+
"entities",
|
|
170
|
+
"add_playlist_item",
|
|
171
|
+
routes.entities.add_playlist_item.resp,
|
|
172
|
+
routes.entities.add_playlist_item.req,
|
|
173
|
+
routes.entities.add_playlist_item.method,
|
|
174
|
+
routes.entities.add_playlist_item.path,
|
|
175
|
+
params,
|
|
176
|
+
);
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
removePlaylistItem: (params: s.RemovePlaylistItemRequest) => {
|
|
180
|
+
return call(
|
|
181
|
+
"entities",
|
|
182
|
+
"remove_playlist_item",
|
|
183
|
+
routes.entities.remove_playlist_item.resp,
|
|
184
|
+
routes.entities.remove_playlist_item.req,
|
|
185
|
+
routes.entities.remove_playlist_item.method,
|
|
186
|
+
routes.entities.remove_playlist_item.path,
|
|
187
|
+
params,
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
reorderPlaylistItems: (params: s.ReorderPlaylistItemsRequest) => {
|
|
192
|
+
return call(
|
|
193
|
+
"entities",
|
|
194
|
+
"reorder_playlist_items",
|
|
195
|
+
routes.entities.reorder_playlist_items.resp,
|
|
196
|
+
routes.entities.reorder_playlist_items.req,
|
|
197
|
+
routes.entities.reorder_playlist_items.method,
|
|
198
|
+
routes.entities.reorder_playlist_items.path,
|
|
199
|
+
params,
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
addPlaylistItems: (params: s.AddPlaylistItemsRequest) => {
|
|
204
|
+
return call(
|
|
205
|
+
"entities",
|
|
206
|
+
"add_playlist_items",
|
|
207
|
+
routes.entities.add_playlist_items.resp,
|
|
208
|
+
routes.entities.add_playlist_items.req,
|
|
209
|
+
routes.entities.add_playlist_items.method,
|
|
210
|
+
routes.entities.add_playlist_items.path,
|
|
211
|
+
params,
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
removePlaylistItems: (params: s.RemovePlaylistItemsRequest) => {
|
|
216
|
+
return call(
|
|
217
|
+
"entities",
|
|
218
|
+
"remove_playlist_items",
|
|
219
|
+
routes.entities.remove_playlist_items.resp,
|
|
220
|
+
routes.entities.remove_playlist_items.req,
|
|
221
|
+
routes.entities.remove_playlist_items.method,
|
|
222
|
+
routes.entities.remove_playlist_items.path,
|
|
223
|
+
params,
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
// favorites (domain-agnostic set/status-check; rich music-specific
|
|
228
|
+
// listing endpoints live on client.music - see listFavorites/listBeloved)
|
|
229
|
+
setFavorite: (params: s.SetFavoriteRequest) => {
|
|
230
|
+
return call(
|
|
231
|
+
"entities",
|
|
232
|
+
"set_favorite",
|
|
233
|
+
routes.entities.set_favorite.resp,
|
|
234
|
+
routes.entities.set_favorite.req,
|
|
235
|
+
routes.entities.set_favorite.method,
|
|
236
|
+
routes.entities.set_favorite.path,
|
|
237
|
+
params,
|
|
238
|
+
);
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
getFavoriteStatusBulk: (params: s.GetFavoriteStatusBulkRequest) => {
|
|
242
|
+
return call(
|
|
243
|
+
"entities",
|
|
244
|
+
"get_favorite_status_bulk",
|
|
245
|
+
routes.entities.get_favorite_status_bulk.resp,
|
|
246
|
+
routes.entities.get_favorite_status_bulk.req,
|
|
247
|
+
routes.entities.get_favorite_status_bulk.method,
|
|
248
|
+
routes.entities.get_favorite_status_bulk.path,
|
|
249
|
+
params,
|
|
250
|
+
);
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
// ratings (domain-agnostic)
|
|
254
|
+
setRating: (params: s.SetRatingRequest) => {
|
|
255
|
+
return call(
|
|
256
|
+
"entities",
|
|
257
|
+
"set_rating",
|
|
258
|
+
routes.entities.set_rating.resp,
|
|
259
|
+
routes.entities.set_rating.req,
|
|
260
|
+
routes.entities.set_rating.method,
|
|
261
|
+
routes.entities.set_rating.path,
|
|
262
|
+
params,
|
|
263
|
+
);
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
removeRating: (params: s.RemoveRatingRequest) => {
|
|
267
|
+
return call(
|
|
268
|
+
"entities",
|
|
269
|
+
"remove_rating",
|
|
270
|
+
routes.entities.remove_rating.resp,
|
|
271
|
+
routes.entities.remove_rating.req,
|
|
272
|
+
routes.entities.remove_rating.method,
|
|
273
|
+
routes.entities.remove_rating.path,
|
|
274
|
+
params,
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
getRatingStats: (params: s.GetRatingStatsRequest) => {
|
|
279
|
+
return call(
|
|
280
|
+
"entities",
|
|
281
|
+
"get_rating_stats",
|
|
282
|
+
routes.entities.get_rating_stats.resp,
|
|
283
|
+
routes.entities.get_rating_stats.req,
|
|
284
|
+
routes.entities.get_rating_stats.method,
|
|
285
|
+
routes.entities.get_rating_stats.path,
|
|
286
|
+
params,
|
|
287
|
+
);
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
getRatingStatusBulk: (params: s.GetRatingStatusBulkRequest) => {
|
|
291
|
+
return call(
|
|
292
|
+
"entities",
|
|
293
|
+
"get_rating_status_bulk",
|
|
294
|
+
routes.entities.get_rating_status_bulk.resp,
|
|
295
|
+
routes.entities.get_rating_status_bulk.req,
|
|
296
|
+
routes.entities.get_rating_status_bulk.method,
|
|
297
|
+
routes.entities.get_rating_status_bulk.path,
|
|
298
|
+
params,
|
|
299
|
+
);
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export type EntitiesMethods = ReturnType<typeof createEntitiesMethods>;
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
AlbumQueryResultSchema,
|
|
7
7
|
ArtistQueryResultSchema,
|
|
8
8
|
PlaylistQueryResultSchema,
|
|
9
|
+
VideoSchema,
|
|
10
|
+
VideoSeriesSchema,
|
|
9
11
|
} from "../codegen/schema.js";
|
|
10
12
|
|
|
11
13
|
// discriminated union for favorite items
|
|
@@ -31,6 +33,16 @@ const FavoriteItemSchema = z.discriminatedUnion("type", [
|
|
|
31
33
|
favorited_at: z.number(),
|
|
32
34
|
playlist: PlaylistQueryResultSchema,
|
|
33
35
|
}),
|
|
36
|
+
z.object({
|
|
37
|
+
type: z.literal("video"),
|
|
38
|
+
favorited_at: z.number(),
|
|
39
|
+
video: VideoSchema,
|
|
40
|
+
}),
|
|
41
|
+
z.object({
|
|
42
|
+
type: z.literal("video_series"),
|
|
43
|
+
favorited_at: z.number(),
|
|
44
|
+
series: VideoSeriesSchema,
|
|
45
|
+
}),
|
|
34
46
|
]);
|
|
35
47
|
|
|
36
48
|
export type FavoriteItem = z.infer<typeof FavoriteItemSchema>;
|
|
@@ -44,9 +56,7 @@ const ListFavoritesResponseSchema = z.object({
|
|
|
44
56
|
limit: z.number(),
|
|
45
57
|
});
|
|
46
58
|
|
|
47
|
-
export type ListFavoritesResponse = z.infer<
|
|
48
|
-
typeof ListFavoritesResponseSchema
|
|
49
|
-
>;
|
|
59
|
+
export type ListFavoritesResponse = z.infer<typeof ListFavoritesResponseSchema>;
|
|
50
60
|
|
|
51
61
|
// export schemas for runtime validation if needed
|
|
52
62
|
export { FavoriteItemSchema, ListFavoritesResponseSchema };
|
package/src/domains/music.ts
CHANGED
|
@@ -11,12 +11,15 @@ import { ListFavoritesResponseSchema } from "./favorites.types.js";
|
|
|
11
11
|
import type { CallFn } from "./types.js";
|
|
12
12
|
|
|
13
13
|
// partial schemas for update operations
|
|
14
|
-
const UpdateSongsRequestPartialSchema =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const UpdateSongsRequestPartialSchema = UpdateSongsRequestSchema.partial().required({
|
|
15
|
+
song_ids: true,
|
|
16
|
+
});
|
|
17
|
+
const UpdateArtistRequestPartialSchema = UpdateArtistRequestSchema.partial().required({
|
|
18
|
+
artist_id: true,
|
|
19
|
+
});
|
|
20
|
+
const UpdateAlbumRequestPartialSchema = UpdateAlbumRequestSchema.partial().required({
|
|
21
|
+
album_id: true,
|
|
22
|
+
});
|
|
20
23
|
|
|
21
24
|
export function createMusicMethods(call: CallFn) {
|
|
22
25
|
return {
|
|
@@ -70,9 +73,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
70
73
|
);
|
|
71
74
|
},
|
|
72
75
|
|
|
73
|
-
updateSongs: (
|
|
74
|
-
params: Partial<s.UpdateSongsRequest> & { song_ids: string[] },
|
|
75
|
-
) => {
|
|
76
|
+
updateSongs: (params: Partial<s.UpdateSongsRequest> & { song_ids: string[] }) => {
|
|
76
77
|
return call(
|
|
77
78
|
"music",
|
|
78
79
|
"update_songs",
|
|
@@ -157,9 +158,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
157
158
|
);
|
|
158
159
|
},
|
|
159
160
|
|
|
160
|
-
updateAlbum: (
|
|
161
|
-
params: Partial<s.UpdateAlbumRequest> & { album_id: string },
|
|
162
|
-
) => {
|
|
161
|
+
updateAlbum: (params: Partial<s.UpdateAlbumRequest> & { album_id: string }) => {
|
|
163
162
|
return call(
|
|
164
163
|
"music",
|
|
165
164
|
"update_album",
|
|
@@ -344,9 +343,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
344
343
|
);
|
|
345
344
|
},
|
|
346
345
|
|
|
347
|
-
updateArtist: (
|
|
348
|
-
params: Partial<s.UpdateArtistRequest> & { artist_id: string },
|
|
349
|
-
) => {
|
|
346
|
+
updateArtist: (params: Partial<s.UpdateArtistRequest> & { artist_id: string }) => {
|
|
350
347
|
return call(
|
|
351
348
|
"music",
|
|
352
349
|
"update_artist",
|
|
@@ -412,10 +409,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
412
409
|
},
|
|
413
410
|
|
|
414
411
|
getPlaylistEtag: (params: s.GetPlaylistRequest) => {
|
|
415
|
-
const path = routes.music.get_playlist_etag.path.replace(
|
|
416
|
-
"{id}",
|
|
417
|
-
params.id,
|
|
418
|
-
);
|
|
412
|
+
const path = routes.music.get_playlist_etag.path.replace("{id}", params.id);
|
|
419
413
|
return call(
|
|
420
414
|
"music",
|
|
421
415
|
"get_playlist_etag",
|
|
@@ -619,44 +613,8 @@ export function createMusicMethods(call: CallFn) {
|
|
|
619
613
|
);
|
|
620
614
|
},
|
|
621
615
|
|
|
622
|
-
//
|
|
623
|
-
|
|
624
|
-
return call(
|
|
625
|
-
"music",
|
|
626
|
-
"set_rating",
|
|
627
|
-
routes.music.set_rating.resp,
|
|
628
|
-
routes.music.set_rating.req,
|
|
629
|
-
routes.music.set_rating.method,
|
|
630
|
-
routes.music.set_rating.path,
|
|
631
|
-
params,
|
|
632
|
-
);
|
|
633
|
-
},
|
|
634
|
-
|
|
635
|
-
removeRating: (params: s.RemoveRatingRequest) => {
|
|
636
|
-
return call(
|
|
637
|
-
"music",
|
|
638
|
-
"remove_rating",
|
|
639
|
-
routes.music.remove_rating.resp,
|
|
640
|
-
routes.music.remove_rating.req,
|
|
641
|
-
routes.music.remove_rating.method,
|
|
642
|
-
routes.music.remove_rating.path,
|
|
643
|
-
params,
|
|
644
|
-
);
|
|
645
|
-
},
|
|
646
|
-
|
|
647
|
-
getRatingStats: (params: s.GetRatingStatsRequest) => {
|
|
648
|
-
return call(
|
|
649
|
-
"music",
|
|
650
|
-
"get_rating_stats",
|
|
651
|
-
routes.music.get_rating_stats.resp,
|
|
652
|
-
routes.music.get_rating_stats.req,
|
|
653
|
-
routes.music.get_rating_stats.method,
|
|
654
|
-
routes.music.get_rating_stats.path,
|
|
655
|
-
params,
|
|
656
|
-
);
|
|
657
|
-
},
|
|
658
|
-
|
|
659
|
-
// favorites
|
|
616
|
+
// favorites listing (music-specific rich shapes; generic set/status-check
|
|
617
|
+
// live on client.entities)
|
|
660
618
|
listFavorites: (params: s.ListFavoritesRequest) => {
|
|
661
619
|
return call(
|
|
662
620
|
"music",
|
|
@@ -669,18 +627,6 @@ export function createMusicMethods(call: CallFn) {
|
|
|
669
627
|
);
|
|
670
628
|
},
|
|
671
629
|
|
|
672
|
-
setFavorite: (params: s.SetFavoriteRequest) => {
|
|
673
|
-
return call(
|
|
674
|
-
"music",
|
|
675
|
-
"set_favorite",
|
|
676
|
-
routes.music.set_favorite.resp,
|
|
677
|
-
routes.music.set_favorite.req,
|
|
678
|
-
routes.music.set_favorite.method,
|
|
679
|
-
routes.music.set_favorite.path,
|
|
680
|
-
params,
|
|
681
|
-
);
|
|
682
|
-
},
|
|
683
|
-
|
|
684
630
|
listBeloved: (params: s.ListBelovedRequest = {}) => {
|
|
685
631
|
return call(
|
|
686
632
|
"music",
|
|
@@ -706,6 +652,18 @@ export function createMusicMethods(call: CallFn) {
|
|
|
706
652
|
);
|
|
707
653
|
},
|
|
708
654
|
|
|
655
|
+
recordVideoPlay: (params: s.RecordVideoPlayRequest) => {
|
|
656
|
+
return call(
|
|
657
|
+
"music",
|
|
658
|
+
"record_video_play",
|
|
659
|
+
routes.music.record_video_play.resp,
|
|
660
|
+
routes.music.record_video_play.req,
|
|
661
|
+
routes.music.record_video_play.method,
|
|
662
|
+
routes.music.record_video_play.path,
|
|
663
|
+
params,
|
|
664
|
+
);
|
|
665
|
+
},
|
|
666
|
+
|
|
709
667
|
activityFeed: (params: s.FeedRequest) => {
|
|
710
668
|
return call(
|
|
711
669
|
"music",
|
|
@@ -778,39 +736,40 @@ export function createMusicMethods(call: CallFn) {
|
|
|
778
736
|
);
|
|
779
737
|
},
|
|
780
738
|
|
|
781
|
-
//
|
|
782
|
-
|
|
739
|
+
// playback sessions
|
|
740
|
+
createPlaybackSession: (params: s.CreatePlaybackSessionRequest) => {
|
|
783
741
|
return call(
|
|
784
742
|
"music",
|
|
785
|
-
"
|
|
786
|
-
routes.music.
|
|
787
|
-
routes.music.
|
|
788
|
-
routes.music.
|
|
789
|
-
routes.music.
|
|
743
|
+
"create_playback_session",
|
|
744
|
+
routes.music.create_playback_session.resp,
|
|
745
|
+
routes.music.create_playback_session.req,
|
|
746
|
+
routes.music.create_playback_session.method,
|
|
747
|
+
routes.music.create_playback_session.path,
|
|
790
748
|
params,
|
|
791
749
|
);
|
|
792
750
|
},
|
|
793
751
|
|
|
794
|
-
|
|
795
|
-
const path = routes.music.
|
|
752
|
+
getPlaybackSession: (id: string) => {
|
|
753
|
+
const path = routes.music.get_playback_session.path.replace("{id}", id);
|
|
796
754
|
return call(
|
|
797
755
|
"music",
|
|
798
|
-
"
|
|
799
|
-
routes.music.
|
|
800
|
-
routes.music.
|
|
801
|
-
routes.music.
|
|
756
|
+
"get_playback_session",
|
|
757
|
+
routes.music.get_playback_session.resp,
|
|
758
|
+
routes.music.get_playback_session.req,
|
|
759
|
+
routes.music.get_playback_session.method,
|
|
802
760
|
path,
|
|
761
|
+
{ id },
|
|
803
762
|
);
|
|
804
763
|
},
|
|
805
764
|
|
|
806
|
-
|
|
765
|
+
deletePlaybackSession: (id: string) => {
|
|
807
766
|
return call(
|
|
808
767
|
"music",
|
|
809
|
-
"
|
|
810
|
-
routes.music.
|
|
811
|
-
routes.music.
|
|
812
|
-
routes.music.
|
|
813
|
-
routes.music.
|
|
768
|
+
"delete_playback_session",
|
|
769
|
+
routes.music.delete_playback_session.resp,
|
|
770
|
+
routes.music.delete_playback_session.req,
|
|
771
|
+
routes.music.delete_playback_session.method,
|
|
772
|
+
routes.music.delete_playback_session.path,
|
|
814
773
|
{ id },
|
|
815
774
|
);
|
|
816
775
|
},
|
|
@@ -839,66 +798,55 @@ export function createMusicMethods(call: CallFn) {
|
|
|
839
798
|
);
|
|
840
799
|
},
|
|
841
800
|
|
|
842
|
-
|
|
843
|
-
id
|
|
844
|
-
params: s.UpdateListenSessionProgressRequest,
|
|
845
|
-
) => {
|
|
846
|
-
const path = routes.music.update_listen_session_progress.path.replace(
|
|
847
|
-
"{id}",
|
|
848
|
-
id,
|
|
849
|
-
);
|
|
801
|
+
updatePlaybackSessionProgress: (id: string, params: s.UpdatePlaybackSessionProgressRequest) => {
|
|
802
|
+
const path = routes.music.update_playback_session_progress.path.replace("{id}", id);
|
|
850
803
|
return call(
|
|
851
804
|
"music",
|
|
852
|
-
"
|
|
853
|
-
routes.music.
|
|
854
|
-
routes.music.
|
|
855
|
-
routes.music.
|
|
805
|
+
"update_playback_session_progress",
|
|
806
|
+
routes.music.update_playback_session_progress.resp,
|
|
807
|
+
routes.music.update_playback_session_progress.req,
|
|
808
|
+
routes.music.update_playback_session_progress.method,
|
|
856
809
|
path,
|
|
857
810
|
params,
|
|
858
811
|
);
|
|
859
812
|
},
|
|
860
813
|
|
|
861
|
-
|
|
862
|
-
const path = routes.music.
|
|
814
|
+
updatePlaybackSessionStatus: (id: string, status: string) => {
|
|
815
|
+
const path = routes.music.update_playback_session_status.path
|
|
863
816
|
.replace("{id}", id)
|
|
864
817
|
.replace("{status}", status);
|
|
865
818
|
return call(
|
|
866
819
|
"music",
|
|
867
|
-
"
|
|
868
|
-
routes.music.
|
|
869
|
-
routes.music.
|
|
870
|
-
routes.music.
|
|
820
|
+
"update_playback_session_status",
|
|
821
|
+
routes.music.update_playback_session_status.resp,
|
|
822
|
+
routes.music.update_playback_session_status.req,
|
|
823
|
+
routes.music.update_playback_session_status.method,
|
|
871
824
|
path,
|
|
825
|
+
{ id, status },
|
|
872
826
|
);
|
|
873
827
|
},
|
|
874
828
|
|
|
875
|
-
|
|
876
|
-
id
|
|
877
|
-
params: s.UpdateListenSessionSongsRequest,
|
|
878
|
-
) => {
|
|
879
|
-
const path = routes.music.update_listen_session_songs.path.replace(
|
|
880
|
-
"{id}",
|
|
881
|
-
id,
|
|
882
|
-
);
|
|
829
|
+
updatePlaybackSessionItems: (id: string, params: s.UpdatePlaybackSessionItemsRequest) => {
|
|
830
|
+
const path = routes.music.update_playback_session_items.path.replace("{id}", id);
|
|
883
831
|
return call(
|
|
884
832
|
"music",
|
|
885
|
-
"
|
|
886
|
-
routes.music.
|
|
887
|
-
routes.music.
|
|
888
|
-
routes.music.
|
|
833
|
+
"update_playback_session_items",
|
|
834
|
+
routes.music.update_playback_session_items.resp,
|
|
835
|
+
routes.music.update_playback_session_items.req,
|
|
836
|
+
routes.music.update_playback_session_items.method,
|
|
889
837
|
path,
|
|
890
838
|
params,
|
|
891
839
|
);
|
|
892
840
|
},
|
|
893
841
|
|
|
894
|
-
|
|
842
|
+
listPlaybackSessions: (params: s.ListPlaybackSessionsRequest) => {
|
|
895
843
|
return call(
|
|
896
844
|
"music",
|
|
897
|
-
"
|
|
898
|
-
routes.music.
|
|
899
|
-
routes.music.
|
|
900
|
-
routes.music.
|
|
901
|
-
routes.music.
|
|
845
|
+
"list_playback_sessions",
|
|
846
|
+
routes.music.list_playback_sessions.resp,
|
|
847
|
+
routes.music.list_playback_sessions.req,
|
|
848
|
+
routes.music.list_playback_sessions.method,
|
|
849
|
+
routes.music.list_playback_sessions.path,
|
|
902
850
|
params,
|
|
903
851
|
);
|
|
904
852
|
},
|
|
@@ -1189,7 +1137,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
1189
1137
|
// taxonomy (cross-kind labels: genre, label, mood, era, region, ...)
|
|
1190
1138
|
// ----------------------------------------------------------------------
|
|
1191
1139
|
|
|
1192
|
-
listTaxonKinds: () => {
|
|
1140
|
+
listTaxonKinds: (params?: s.ListTaxonKindsRequest) => {
|
|
1193
1141
|
return call(
|
|
1194
1142
|
"music",
|
|
1195
1143
|
"list_taxon_kinds",
|
|
@@ -1197,7 +1145,7 @@ export function createMusicMethods(call: CallFn) {
|
|
|
1197
1145
|
routes.music.list_taxon_kinds.req,
|
|
1198
1146
|
routes.music.list_taxon_kinds.method,
|
|
1199
1147
|
routes.music.list_taxon_kinds.path,
|
|
1200
|
-
|
|
1148
|
+
params,
|
|
1201
1149
|
);
|
|
1202
1150
|
},
|
|
1203
1151
|
|