Skip to content

Commit d0f3628

Browse files
Merge pull request #774 from inplayer-org/fix-missing-type-declarations
fix: added missing type declarations
2 parents 12830e9 + ca8ed9a commit d0f3628

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
# [3.13.3] - 06-12-2022
6+
7+
### Added
8+
9+
- Added missing type declarations
10+
511
# [3.13.2] - 06-12-2022
612

713
### Added

index.d.ts

+37
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ export declare interface ExternalAccount {
173173
token: string;
174174
}
175175

176+
export interface WatchlistHistory {
177+
media_id: string;
178+
progress: number;
179+
created_at: number;
180+
updated_at: number;
181+
}
182+
export interface FavoritesData {
183+
media_id: string;
184+
created_at: number;
185+
}
186+
187+
export interface CollectionWithCursor<T> {
188+
collection: T[];
189+
cursor?: string;
190+
}
191+
export interface CollectionWithCursorArgs {
192+
filter?: 'all' | 'watched' | 'currently_watching';
193+
cursor?: string;
194+
}
195+
176196
export declare class Account {
177197
constructor(config: Record<string, unknown>);
178198

@@ -225,6 +245,23 @@ export declare class Account {
225245
integration: string,
226246
body: Record<string, string | number>
227247
): Promise<AxiosResponse<CommonResponse>>;
248+
getFavorites(): Promise<AxiosResponse<CollectionWithCursor<FavoritesData>>>;
249+
getFavorite(mediaId: string): Promise<AxiosResponse<FavoritesData>>;
250+
addToFavorites(mediaId: string): Promise<AxiosResponse<FavoritesData>>;
251+
deleteFromFavorites(mediaId: string): Promise<AxiosResponse<CommonResponse>>;
252+
getWatchHistory(
253+
args: CollectionWithCursorArgs
254+
): Promise<AxiosResponse<CollectionWithCursor<WatchlistHistory>>>;
255+
getWatchHistoryForItem(
256+
mediaId: string
257+
): Promise<AxiosResponse<WatchlistHistory>>;
258+
updateWatchHistory(
259+
mediaId: string,
260+
progress: number
261+
): Promise<AxiosResponse<WatchlistHistory>>;
262+
deleteWatchHistoryForItem(
263+
mediaId: string
264+
): Promise<AxiosResponse<CommonResponse>>;
228265
}
229266

230267
// Items

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inplayer-org/inplayer.js",
3-
"version": "3.13.2",
3+
"version": "3.13.3",
44
"author": "InPlayer",
55
"license": "MIT",
66
"description": "A Javascript SDK for Inplayer's RESTful API",

0 commit comments

Comments
 (0)