@tmdb-graphql-api/rest-client 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmdb-graphql-api/rest-client",
3
3
  "description": "The TMDB GraphQL rest client module.",
4
- "version": "0.0.16",
4
+ "version": "0.0.18",
5
5
  "author": "miami-man",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/themoviedb-graphql-api",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@cachemap/core": "^5.2.7",
33
33
  "@graphql-box/core": "^5.4.11",
34
- "getta": "^1.0.19",
34
+ "getta": "^1.0.20",
35
35
  "type-fest": "^4.37.0",
36
36
  "winston": "^3.17.0"
37
37
  },
package/src/main.test.ts CHANGED
@@ -23,7 +23,7 @@ describe('createRestClient >', () => {
23
23
  "_conditionalRequestsEnabled": true,
24
24
  "_fetchTimeout": 5000,
25
25
  "_headers": {
26
- "authorization": "Authorization: Bearer 12345",
26
+ "authorization": "Bearer 12345",
27
27
  "content-type": "application/json",
28
28
  },
29
29
  "_log": [Function],
package/src/main.ts CHANGED
@@ -58,7 +58,7 @@ export const createRestClient = ({ apiKey, cache, headers = {}, logger, queryPar
58
58
  fetchTimeout: NODE_ENV === 'development' ? 999_999 : undefined,
59
59
  headers: {
60
60
  ...headers,
61
- authorization: `Authorization: Bearer ${apiKey}`,
61
+ authorization: `Bearer ${apiKey}`,
62
62
  },
63
63
  log: (message, { context, stats }) => {
64
64
  const { args, fieldPath } = context as ExecutionContextValueData & {
package/src/types.ts CHANGED
@@ -31,5 +31,7 @@ export interface CreateRestClientParams {
31
31
  cache?: Core;
32
32
  headers?: Record<string, string>;
33
33
  logger?: Logger;
34
- queryParams?: Record<string, string> & { language?: string };
34
+ queryParams?:
35
+ | (Record<string, string> & { language?: string })
36
+ | ((endpoint: string) => Record<string, string> & { language?: string });
35
37
  }