Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tmdb-ts

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmdb-ts - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

dist/utils/parseOptions.d.ts

11

dist/endpoints/changes.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChangeEndpoint = void 0;
const querystring_1 = __importDefault(require("querystring"));
const base_1 = require("./base");
const utils_1 = require("../utils");
class ChangeEndpoint extends base_1.BaseEndpoint {

@@ -15,11 +12,11 @@ constructor(accessToken) {

async movies(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`/movie/changes?${params}`);
}
async tvShows(options) {
const params = querystring_1.default.stringify(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`/tv/changes?${params}`);
}
async person(options) {
const params = querystring_1.default.stringify(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`/person/changes${params}`);

@@ -26,0 +23,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollectionsEndpoint = void 0;
const utils_1 = require("../utils");
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const BASE_COLLECTION = '/collection';

@@ -16,11 +13,11 @@ class CollectionsEndpoint extends base_1.BaseEndpoint {

async details(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_COLLECTION}/${id}?${params}`);
}
async images(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_COLLECTION}/${id}/images?${params}`);
}
async translations(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_COLLECTION}/${id}/translations?${params}`);

@@ -27,0 +24,0 @@ }

@@ -1,6 +0,4 @@

/// <reference types="node" />
import { MovieDiscoverResult, SortOption, TvShowDiscoverResult } from '../types';
import { BaseEndpoint } from './base';
import { ParsedUrlQueryInput } from 'querystring';
interface DiscoverQueryOptions extends ParsedUrlQueryInput {
interface DiscoverQueryOptions {
language?: string;

@@ -7,0 +5,0 @@ sort_by?: SortOption;

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiscoverEndpoint = void 0;
const utils_1 = require("../utils");
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const BASE_DISCOVER = '/discover';

@@ -15,7 +12,7 @@ class DiscoverEndpoint extends base_1.BaseEndpoint {

async movie(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_DISCOVER}/movie?${params}`);
}
async tvShow(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_DISCOVER}/tv?${params}`);

@@ -22,0 +19,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FindEndpoint = void 0;
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const utils_1 = require("../utils");
class FindEndpoint extends base_1.BaseEndpoint {

@@ -14,3 +11,3 @@ constructor(accessToken) {

async byId(externalId, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`/find/${externalId}?${params}`);

@@ -17,0 +14,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeywordsEndpoint = void 0;
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const utils_1 = require("../utils");
const BASE_Keyword = '/keyword';

@@ -18,3 +15,3 @@ class KeywordsEndpoint extends base_1.BaseEndpoint {

async belongingMovies(keywordId, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_Keyword}/${keywordId}/movies?${params}`);

@@ -21,0 +18,0 @@ }

import { BaseEndpoint } from './base';
import { AlternativeTitles, ChangeOptions, Credits, ExternalIds, Images, Keywords, LatestMovie, MovieChanges, MovieDetails, MovieLists, MoviesPlayingNow, PopularMovies, Recommendations, ReleaseDates, Reviews, SimilarMovies, TopRatedMovies, Translations, UpcomingMovies, Videos, WatchProviders } from '../types';
import { AlternativeTitles, ChangeOptions, Credits, ExternalIds, Images, Keywords, LanguageOption, LatestMovie, MovieChanges, MovieDetails, MovieLists, MoviesPlayingNow, PageOption, PopularMovies, Recommendations, RegionOption, ReleaseDates, Reviews, SimilarMovies, TopRatedMovies, Translations, UpcomingMovies, Videos, WatchProviders } from '../types';
export declare class MoviesEndpoint extends BaseEndpoint {

@@ -13,15 +13,7 @@ protected readonly accessToken: string;

keywords(id: number): Promise<Keywords>;
lists(id: number, options?: {
page?: number;
}): Promise<MovieLists>;
recommendations(id: number, options?: {
page?: number;
}): Promise<Recommendations>;
lists(id: number, options?: LanguageOption | PageOption): Promise<MovieLists>;
recommendations(id: number, options?: PageOption): Promise<Recommendations>;
releaseDates(id: number): Promise<ReleaseDates>;
reviews(id: number, options?: {
page?: number;
}): Promise<Reviews>;
similar(id: number, options?: {
page?: number;
}): Promise<SimilarMovies>;
reviews(id: number, options?: PageOption): Promise<Reviews>;
similar(id: number, options?: PageOption): Promise<SimilarMovies>;
translations(id: number): Promise<Translations>;

@@ -35,20 +27,6 @@ videos(id: number): Promise<Videos>;

latest(): Promise<LatestMovie>;
nowPlaying(options?: {
page?: number;
region?: string;
language?: string;
}): Promise<MoviesPlayingNow>;
popular(options?: {
page?: number;
}): Promise<PopularMovies>;
topRated(options?: {
page?: number;
region?: string;
language?: string;
}): Promise<TopRatedMovies>;
upcoming(options?: {
page?: number;
region?: string;
language?: string;
}): Promise<UpcomingMovies>;
nowPlaying(options?: PageOption & LanguageOption & RegionOption): Promise<MoviesPlayingNow>;
popular(options?: PageOption): Promise<PopularMovies>;
topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedMovies>;
upcoming(options?: PageOption & LanguageOption & RegionOption): Promise<UpcomingMovies>;
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MoviesEndpoint = void 0;
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const utils_1 = require("../utils");
const BASE_MOVIE = '/movie';

@@ -22,3 +19,3 @@ class MoviesEndpoint extends base_1.BaseEndpoint {

async changes(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/${id}/changes?${params}`);

@@ -39,7 +36,7 @@ }

async lists(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/${id}/lists?${params}`);
}
async recommendations(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/${id}/recommendations?${params}`);

@@ -51,7 +48,7 @@ }

async reviews(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/${id}/reviews?${params}`);
}
async similar(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/${id}/similar?${params}`);

@@ -76,15 +73,15 @@ }

async nowPlaying(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/now_playing?${params}`);
}
async popular(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/popular?${params}`);
}
async topRated(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/top_rated?${params}`);
}
async upcoming(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_MOVIE}/upcoming?${params}`);

@@ -91,0 +88,0 @@ }

@@ -1,2 +0,2 @@

import { ChangeOptions, ExternalIds, Image, PeopleTranslations, PersonChanges, PersonCombinedCredits, PersonDetail, PersonMovieCredit, PersonTvShowCredit, PopularPersons, TaggedImages } from '../types';
import { ChangeOptions, ExternalIds, Image, PageOption, PeopleTranslations, PersonChanges, PersonCombinedCredits, PersonDetail, PersonMovieCredit, PersonTvShowCredit, PopularPersons, TaggedImages } from '../types';
import { BaseEndpoint } from './base';

@@ -15,10 +15,6 @@ export declare class PeopleEndpoint extends BaseEndpoint {

}>;
taggedImages(id: number, options?: {
page?: number;
}): Promise<TaggedImages>;
taggedImages(id: number, options?: PageOption): Promise<TaggedImages>;
translation(id: number): Promise<PeopleTranslations>;
latest(): Promise<PersonDetail>;
popular(options?: {
page?: number;
}): Promise<PopularPersons>;
popular(options?: PageOption): Promise<PopularPersons>;
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PeopleEndpoint = void 0;
const utils_1 = require("../utils");
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const BASE_PERSON = '/person';

@@ -18,3 +15,3 @@ class PeopleEndpoint extends base_1.BaseEndpoint {

async changes(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_PERSON}/${id}/changes?${params}`);

@@ -38,3 +35,3 @@ }

async taggedImages(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_PERSON}/${id}/tagged_images?${params}`);

@@ -49,3 +46,3 @@ }

async popular(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_PERSON}/popular?${params}`);

@@ -52,0 +49,0 @@ }

@@ -1,7 +0,5 @@

/// <reference types="node" />
import { BaseEndpoint } from './base';
import { ParsedUrlQueryInput } from 'querystring';
import { Search } from '../types/search';
import { Collection, Company, Movie, Person, TV } from '../types';
export interface SearchOptions extends ParsedUrlQueryInput {
export interface SearchOptions {
query: string;

@@ -8,0 +6,0 @@ page?: number;

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchEndpoint = void 0;
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const utils_1 = require("../utils");
const BASE_SEARCH = '/search';

@@ -16,19 +13,19 @@ class SearchEndpoint extends base_1.BaseEndpoint {

async companies(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/company?${params}`);
}
async collections(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/collection?${params}`);
}
async keywords(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/keyword?${params}`);
}
async movies(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/movie?${params}`);
}
async people(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/person?${params}`);

@@ -38,3 +35,3 @@ }

async tvShows(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_SEARCH}/tv?${params}`);

@@ -41,0 +38,0 @@ }

import { BaseEndpoint } from './base';
import { AlternativeTitles, ChangeOptions, ContentRatings, Credits, EpisodeGroups, ExternalIds, Images, Keywords, LatestTvShows, OnTheAir, PopularTvShows, Recommendations, Reviews, ScreenedTheatrically, SeasonDetails, SimilarTvShows, TopRatedTvShows, Translations, TvShowChanges, TvShowDetails, TvShowsAiringToday, Videos, WatchProviders } from '../types';
import { AlternativeTitles, ChangeOptions, ContentRatings, Credits, EpisodeGroups, ExternalIds, Images, Keywords, LanguageOption, LatestTvShows, OnTheAir, PageOption, PopularTvShows, Recommendations, RegionOption, Reviews, ScreenedTheatrically, SeasonDetails, SimilarTvShows, TopRatedTvShows, Translations, TvShowChanges, TvShowDetails, TvShowsAiringToday, Videos, WatchProviders } from '../types';
export declare class TvShowsEndpoint extends BaseEndpoint {

@@ -16,12 +16,6 @@ protected readonly accessToken: string;

keywords(id: number): Promise<Keywords>;
recommendations(id: number, options?: {
page?: number;
}): Promise<Recommendations>;
reviews(id: number, options?: {
page?: number;
}): Promise<Reviews>;
recommendations(id: number, options?: PageOption): Promise<Recommendations>;
reviews(id: number, options?: PageOption): Promise<Reviews>;
screenedTheatrically(id: number): Promise<ScreenedTheatrically>;
similar(id: number, options?: {
page?: number;
}): Promise<SimilarTvShows>;
similar(id: number, options?: PageOption): Promise<SimilarTvShows>;
translations(id: number): Promise<Translations>;

@@ -36,15 +30,5 @@ videos(id: number): Promise<Videos>;

onTheAir(): Promise<OnTheAir>;
airingToday(options?: {
page?: number;
region?: string;
language?: string;
}): Promise<TvShowsAiringToday>;
popular(options?: {
page?: number;
}): Promise<PopularTvShows>;
topRated(options?: {
page?: number;
region?: string;
language?: string;
}): Promise<TopRatedTvShows>;
airingToday(options?: PageOption & LanguageOption & RegionOption): Promise<TvShowsAiringToday>;
popular(options?: PageOption & LanguageOption & RegionOption): Promise<PopularTvShows>;
topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedTvShows>;
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TvShowsEndpoint = void 0;
const base_1 = require("./base");
const querystring_1 = __importDefault(require("querystring"));
const utils_1 = require("../utils");
const BASE_TV = '/tv';

@@ -22,3 +19,3 @@ class TvShowsEndpoint extends base_1.BaseEndpoint {

async changes(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/${id}/changes?${params}`);

@@ -48,7 +45,7 @@ }

async recommendations(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/${id}/recommendations?${params}`);
}
async reviews(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/${id}/reviews?${params}`);

@@ -60,3 +57,3 @@ }

async similar(id, options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/${id}/similar?${params}`);

@@ -84,11 +81,11 @@ }

async airingToday(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/airing_today?${params}`);
}
async popular(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/popular?${params}`);
}
async topRated(options) {
const params = querystring_1.default.encode(options);
const params = (0, utils_1.parseOptions)(options);
return await this.api.get(`${BASE_TV}/top_rated?${params}`);

@@ -95,0 +92,0 @@ }

@@ -1,3 +0,1 @@

/// <reference types="node" />
import { ParsedUrlQueryInput } from 'querystring';
export interface Change {

@@ -13,3 +11,3 @@ id: number;

}
export interface ChangeOptions extends ParsedUrlQueryInput {
export interface ChangeOptions {
end_date?: string;

@@ -16,0 +14,0 @@ start_date?: string;

@@ -1,6 +0,4 @@

/// <reference types="node" />
import { ParsedUrlQueryInput } from 'querystring';
import { Episode, MediaType, Movie, Person, Season, TV } from '.';
export type ExternalSource = 'imdb_id' | 'freebase_mid' | 'freebase_id' | 'tvdb_id' | 'tvrage_id' | 'facebook_id' | 'twitter_id' | 'instagram_id';
export interface ExternalIdOptions extends ParsedUrlQueryInput {
export interface ExternalIdOptions {
external_source: ExternalSource;

@@ -7,0 +5,0 @@ language?: string;

@@ -1,5 +0,3 @@

/// <reference types="node" />
import { ParsedUrlQueryInput } from 'querystring';
import { Movie } from '.';
export interface KeywordsOptions extends ParsedUrlQueryInput {
export interface KeywordsOptions {
include_adult?: boolean;

@@ -6,0 +4,0 @@ language?: string;

@@ -1,8 +0,9 @@

/// <reference types="node" />
import { ParsedUrlQueryInput } from 'querystring';
export interface LanguageOption extends ParsedUrlQueryInput {
export interface LanguageOption {
language?: string;
}
export interface PageOption extends ParsedUrlQueryInput {
export interface RegionOption {
region?: string;
}
export interface PageOption {
page?: number;
}
export * from './getImagePath';
export * from './parseOptions';

@@ -18,2 +18,3 @@ "use strict";

__exportStar(require("./getImagePath"), exports);
__exportStar(require("./parseOptions"), exports);
//# sourceMappingURL=index.js.map
{
"name": "tmdb-ts",
"version": "0.1.6",
"version": "0.1.7",
"description": "TMDB v3 library wrapper",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc