added find endpoint and types
This commit is contained in:
14
src/endpoints/find.ts
Normal file
14
src/endpoints/find.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring from 'querystring';
|
||||
import { ExternalIdOptions, FindResult } from '../types';
|
||||
|
||||
export class FindEndpoint extends BaseEndpoint {
|
||||
constructor(accessToken: string) {
|
||||
super(accessToken);
|
||||
}
|
||||
|
||||
async byId(externalId: string, options: ExternalIdOptions): Promise<FindResult> {
|
||||
const params = querystring.encode(options);
|
||||
return await this.api.get<FindResult>(`/find/${externalId}?${params}`);
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,5 @@ export * from './discover';
|
||||
export * from './people';
|
||||
export * from './review';
|
||||
export * from './trending';
|
||||
export * from './find';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user