@@ -23,7 +23,7 @@ import { Step } from '@shared/models/Step';
2323import { ListMetadataQuery } from '@yttrex/shared/endpoints/v2/metadata.endpoints' ;
2424
2525export interface SearchRequestInput {
26- Params : any ;
26+ Params : { publicKey : string } ;
2727 Query : SearchQuery ;
2828}
2929
@@ -37,20 +37,27 @@ export interface Results<T> {
3737 content : T [ ] ;
3838}
3939
40- type EndpointQuery < C > = CachedQuery < SearchRequestInput , APIError , Results < C > > ;
40+ export type EndpointQuery < Q extends { } , C > = CachedQuery <
41+ Q ,
42+ APIError ,
43+ Results < C >
44+ > ;
4145
4246export interface TabouleQueries {
43- YCAIccRelatedUsers : EndpointQuery < ChannelRelated > ;
44- youtubeGetExperimentById : EndpointQuery < Step > ;
45- youtubeGetExperimentList : EndpointQuery < GuardoniExperiment > ;
46- youtubePersonalSearches : EndpointQuery < SearchMetadata > ;
47- youtubePersonalAds : EndpointQuery < any > ;
48- youtubePersonalHomes : EndpointQuery < HomeMetadata > ;
49- youtubePersonalVideos : EndpointQuery < VideoMetadata > ;
47+ YCAIccRelatedUsers : EndpointQuery < any , ChannelRelated > ;
48+ youtubeGetExperimentById : EndpointQuery < any , Step > ;
49+ youtubeGetExperimentList : EndpointQuery <
50+ SearchRequestInput ,
51+ GuardoniExperiment
52+ > ;
53+ youtubePersonalSearches : EndpointQuery < SearchRequestInput , SearchMetadata > ;
54+ youtubePersonalAds : EndpointQuery < SearchRequestInput , any > ;
55+ youtubePersonalHomes : EndpointQuery < SearchRequestInput , HomeMetadata > ;
56+ youtubePersonalVideos : EndpointQuery < SearchRequestInput , VideoMetadata > ;
5057 // tik tok
51- tikTokPersonalHTMLSummary : EndpointQuery < SummaryHTMLMetadata > ;
52- tikTokPersonalSearch : EndpointQuery < TikTokPSearchMetadata > ;
53- tikTokSearches : EndpointQuery < TKSearchMetadata > ;
58+ tikTokPersonalHTMLSummary : EndpointQuery < any , SummaryHTMLMetadata > ;
59+ tikTokPersonalSearch : EndpointQuery < any , TikTokPSearchMetadata > ;
60+ tikTokSearches : EndpointQuery < any , TKSearchMetadata > ;
5461}
5562
5663interface GetTabouleQueriesProps {
@@ -153,7 +160,6 @@ export const GetTabouleQueries = ({
153160 researchTag : undefined ,
154161 format : 'json' ,
155162 nature : 'home' ,
156- publicKey : 'H7AsuUszehN4qKTj2GYYwNNzkJVqUQBRo2wgKevzeUwx' ,
157163 } ,
158164 } ) ,
159165 TE . map ( ( content ) => {
@@ -193,14 +199,14 @@ export const GetTabouleQueries = ({
193199 pipe (
194200 YTAPI . v2 . Metadata . ListMetadata ( {
195201 Query : {
202+ ...input . Params ,
196203 ...input . Query ,
197204 amount : '20' as any ,
198205 skip : '0' as any ,
199206 experimentId : undefined ,
200207 researchTag : undefined ,
201208 format : 'json' ,
202209 nature : 'video' ,
203- publicKey : 'H7AsuUszehN4qKTj2GYYwNNzkJVqUQBRo2wgKevzeUwx' ,
204210 } ,
205211 } ) ,
206212 TE . map ( ( content ) => {
@@ -231,12 +237,13 @@ export const GetTabouleQueries = ({
231237 researchTag : undefined ,
232238 format : 'json' ,
233239 nature : 'search' ,
234- publicKey : 'H7AsuUszehN4qKTj2GYYwNNzkJVqUQBRo2wgKevzeUwx' ,
235240 } ,
236241 } ) ,
237242 TE . map ( ( content ) => {
238- const x = content . filter ( ( c ) => c . type === 'search' ) ;
239- return x as any [ ] as SearchMetadata [ ] ;
243+ const x = content . filter (
244+ ( c ) => c . type === 'search'
245+ ) as any [ ] as SearchMetadata [ ] ;
246+ return x ;
240247 } ) ,
241248 TE . map ( ( content ) => ( {
242249 total : content . length ?? 0 ,
@@ -263,16 +270,21 @@ export const GetTabouleQueries = ({
263270 ) ;
264271
265272 const tikTokPersonalSearch = queryStrict <
266- SearchRequestInput ,
273+ SearchRequestInput & { Params : { publicKey : string } } ,
267274 APIError ,
268275 Results < TikTokPSearchMetadata >
269276 > (
270277 ( input ) =>
271278 pipe (
272- YTAPI . v1 . Public . GetPersonalSearchByPublicKey ( input ) ,
279+ TK_API . v2 . Personal . GetPersonalJSON ( {
280+ Params : {
281+ ...input . Params ,
282+ what : 'search' ,
283+ } ,
284+ } ) ,
273285 TE . map ( ( content ) => ( {
274- total : content . metadata . length ,
275- content : content . metadata ,
286+ total : content . total ,
287+ content : content . content as any [ ] ,
276288 } ) )
277289 ) ,
278290 available
0 commit comments