added find endpoint and types

This commit is contained in:
DerPenz
2023-02-23 18:44:26 +01:00
parent f75321e6a6
commit 4efa4a7354
5 changed files with 47 additions and 0 deletions

14
src/endpoints/find.ts Normal file
View 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}`);
}
}

View File

@@ -13,4 +13,5 @@ export * from './discover';
export * from './people';
export * from './review';
export * from './trending';
export * from './find';