@tmdb-graphql-api/resolvers 0.0.19 → 0.0.21

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/resolvers",
3
3
  "description": "The TMDB GraphQL resolvers module.",
4
- "version": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/themoviedb-graphql-api",
package/src/main.ts CHANGED
@@ -82,44 +82,7 @@ import {
82
82
  type SearchMediaType,
83
83
  } from './types.ts';
84
84
 
85
- const movieReleaseTypeMap = {
86
- 1: 'PREMIER',
87
- 2: 'THEATRICAL_LIMITED',
88
- 3: 'THEATRICAL',
89
- 4: 'DIGITAL',
90
- 5: 'PHYSICAL',
91
- 6: 'TV',
92
- };
93
-
94
- const movieStatusMap = {
95
- Canceled: 'CANCELED',
96
- 'In Production': 'IN_PRODUCTION',
97
- Planned: 'PLANNED',
98
- 'Post Production': 'POST_PRODUCTION',
99
- Released: 'RELEASED',
100
- Rumored: 'RUMORED',
101
- };
102
-
103
- const tvStatusMap = {
104
- Canceled: 'CANCELED',
105
- Ended: 'ENDED',
106
- 'In Production': 'IN_PRODUCTION',
107
- Pilot: 'PILOT',
108
- Planned: 'PLANNED',
109
- 'Returning Series': 'RETURNING_SERIES',
110
- };
111
-
112
- const tvTypeMap = {
113
- Documentary: 'DOCUMENTARY',
114
- Miniseries: 'MINISERIES',
115
- News: 'NEWS',
116
- Reality: 'REALITY',
117
- Scripted: 'SCRIPTED',
118
- 'Talk Show': 'TALK_SHOW',
119
- Video: 'VIDEO',
120
- };
121
-
122
- export const resolvers: Record<string, FieldResolver | Record<string, FieldResolver>> = {
85
+ export const resolvers: Record<string, Record<string, string | number | FieldResolver>> = {
123
86
  Certifications: {
124
87
  CA_QC: (obj: Certifications) => obj['CA-QC' as keyof Certifications],
125
88
  },
@@ -174,8 +137,22 @@ export const resolvers: Record<string, FieldResolver | Record<string, FieldResol
174
137
  videos: resolveMovieVideos,
175
138
  watchProviders: resolveMovieWatchProviders,
176
139
  },
177
- MovieReleaseType: (type: keyof typeof movieReleaseTypeMap) => movieReleaseTypeMap[type],
178
- MovieStatus: (status: keyof typeof movieStatusMap) => movieStatusMap[status],
140
+ MovieReleaseType: {
141
+ DIGITAL: 4,
142
+ PHYSICAL: 5,
143
+ PREMIER: 1,
144
+ THEATRICAL: 3,
145
+ THEATRICAL_LIMITED: 2,
146
+ TV: 6,
147
+ },
148
+ MovieStatus: {
149
+ CANCELED: 'Canceled',
150
+ IN_PRODUCTION: 'In Production',
151
+ PLANNED: 'Planned',
152
+ POST_PRODUCTION: 'Post Production',
153
+ RELEASED: 'Released',
154
+ RUMORED: 'Rumored',
155
+ },
179
156
  Network: {
180
157
  ...makeFallbackFieldResolvers('Network', resolveNetwork),
181
158
  alternativeNames: resolveNetworkAlternativeNames,
@@ -254,8 +231,23 @@ export const resolvers: Record<string, FieldResolver | Record<string, FieldResol
254
231
  videos: resolveTvVideos,
255
232
  watchProviders: resolveTvWatchProviders,
256
233
  },
257
- TvStatus: (status: keyof typeof tvStatusMap) => tvStatusMap[status],
258
- TvType: (type: keyof typeof tvTypeMap) => tvTypeMap[type],
234
+ TvStatus: {
235
+ CANCELED: 'Canceled',
236
+ ENDED: 'Ended',
237
+ IN_PRODUCTION: 'In Production',
238
+ PILOT: 'Pilot',
239
+ PLANNED: 'Planned',
240
+ RETURNING_SERIES: 'Returning Series',
241
+ },
242
+ TvType: {
243
+ DOCUMENTARY: 'Documentary',
244
+ MINISERIES: 'Miniseries',
245
+ NEWS: 'News',
246
+ REALITY: 'Reality',
247
+ SCRIPTED: 'Scripted',
248
+ TALK_SHOW: 'Talk Show',
249
+ VIDEO: 'Video',
250
+ },
259
251
  Video: {
260
252
  type: resolveVideoType,
261
253
  },