-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from JorrinKievit/feature/bearer-in-v3
Allow the usage of a bearer token in v3 endpoints
- Loading branch information
Showing
35 changed files
with
283 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"tmdb-js-node": minor | ||
"tmdb-js-web": minor | ||
--- | ||
|
||
Allow the usage of a bearer token in v3 endpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact" | ||
], | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
} | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,5 @@ | |
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
"packageManager": "pnpm@8.7.0" | ||
"packageManager": "pnpm@9.1.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { Http, ITMDBAPI } from ".."; | ||
import { Credentials, Http, ITMDBAPI } from ".."; | ||
import { CertificationsGetMovieCertificationResponse, CertificationsGetTVCertificationResponse } from "../types/v3/certifications"; | ||
import { buildV3Url } from "../utils/api"; | ||
|
||
export const createV3CertificationsMethods = (client: Http, apiKey: string, apiUrl: string): ITMDBAPI["v3"]["certifications"] => { | ||
export const createV3CertificationsMethods = (client: Http, apiUrl: string, { apiKey, accessToken }: Credentials): ITMDBAPI["v3"]["certifications"] => { | ||
return { | ||
getMovieCertifications: async () => { | ||
const res = await client.get<CertificationsGetMovieCertificationResponse>(buildV3Url(apiKey, `${apiUrl}certification/movie/list`)); | ||
|
||
return res; | ||
return client.get<CertificationsGetMovieCertificationResponse>(buildV3Url(`${apiUrl}certification/movie/list`, apiKey), accessToken); | ||
}, | ||
getTVShowCertifications: async () => { | ||
const res = await client.get<CertificationsGetTVCertificationResponse>(buildV3Url(apiKey, `${apiUrl}certification/tv/list`)); | ||
|
||
return res; | ||
return client.get<CertificationsGetTVCertificationResponse>(buildV3Url(`${apiUrl}certification/tv/list`, apiKey), accessToken); | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import { Http, ITMDBAPI } from ".."; | ||
import { Credentials, Http, ITMDBAPI } from ".."; | ||
import { ChangesGetMovieChangeListResponse } from "../types/v3/changes/get-movie-change-list"; | ||
import { ChangesGetPersonChangeListResponse } from "../types/v3/changes/get-person-change-list"; | ||
import { ChangesGetTVChangeListResponse } from "../types/v3/changes/get-tv-change-list"; | ||
import { buildV3Url } from "../utils/api"; | ||
|
||
export const createV3ChangesMethods = (client: Http, apiKey: string, apiUrl: string): ITMDBAPI["v3"]["changes"] => { | ||
export const createV3ChangesMethods = (client: Http, apiUrl: string, { apiKey, accessToken }: Credentials): ITMDBAPI["v3"]["changes"] => { | ||
return { | ||
getMovieChangeList: async (params) => { | ||
const res = await client.get<ChangesGetMovieChangeListResponse>(buildV3Url(apiKey, `${apiUrl}movie/changes`, params)); | ||
|
||
return res; | ||
return client.get<ChangesGetMovieChangeListResponse>(buildV3Url(`${apiUrl}movie/changes`, apiKey, params), accessToken); | ||
}, | ||
getTVChangeList: async (params) => { | ||
const res = await client.get<ChangesGetTVChangeListResponse>(buildV3Url(apiKey, `${apiUrl}tv/changes`, params)); | ||
|
||
return res; | ||
return client.get<ChangesGetTVChangeListResponse>(buildV3Url(`${apiUrl}tv/changes`, apiKey, params), accessToken); | ||
}, | ||
getPersonChangeList: async (params) => { | ||
const res = await client.get<ChangesGetPersonChangeListResponse>(buildV3Url(apiKey, `${apiUrl}person/changes`, params)); | ||
|
||
return res; | ||
return client.get<ChangesGetPersonChangeListResponse>(buildV3Url(`${apiUrl}person/changes`, apiKey, params), accessToken); | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import { Http, ITMDBAPI } from ".."; | ||
import { Credentials, Http, ITMDBAPI } from ".."; | ||
import { CollectionsGetDetailsResponse } from "../types/v3/collections/get-details"; | ||
import { CollectionsGetImagesResponse } from "../types/v3/collections/get-images"; | ||
import { CollectionsGetTranslationsResponse } from "../types/v3/collections/get-translations"; | ||
import { buildV3Url } from "../utils/api"; | ||
|
||
export const createV3CollectionsMethods = (client: Http, apiKey: string, apiUrl: string): ITMDBAPI["v3"]["collections"] => { | ||
export const createV3CollectionsMethods = (client: Http, apiUrl: string, { apiKey, accessToken }: Credentials): ITMDBAPI["v3"]["collections"] => { | ||
return { | ||
getDetails: async (collectionId, params) => { | ||
const res = await client.get<CollectionsGetDetailsResponse>(buildV3Url(apiKey, `${apiUrl}collection/${collectionId}`, params)); | ||
|
||
return res; | ||
return client.get<CollectionsGetDetailsResponse>(buildV3Url(`${apiUrl}collection/${collectionId}`, apiKey, params), accessToken); | ||
}, | ||
getImages: async (collectionId, params) => { | ||
const res = await client.get<CollectionsGetImagesResponse>(buildV3Url(apiKey, `${apiUrl}collection/${collectionId}/images`, params)); | ||
|
||
return res; | ||
return client.get<CollectionsGetImagesResponse>(buildV3Url(`${apiUrl}collection/${collectionId}/images`, apiKey, params), accessToken); | ||
}, | ||
getTranslations: async (collectionId, params) => { | ||
const res = await client.get<CollectionsGetTranslationsResponse>(buildV3Url(apiKey, `${apiUrl}collection/${collectionId}/translations`, params)); | ||
|
||
return res; | ||
return client.get<CollectionsGetTranslationsResponse>(buildV3Url(`${apiUrl}collection/${collectionId}/translations`, apiKey, params), accessToken); | ||
}, | ||
}; | ||
}; |
Oops, something went wrong.