Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/api/deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@trakt/api",
"exports": "./src/index.ts",
"version": "0.4.3",
"version": "0.4.4",
"imports": {
"@anatine/zod-openapi": "npm:@anatine/zod-openapi@^2.2.6",
"@std/testing": "jsr:@std/testing@^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { imagesResponseSchema } from './imagesResponseSchema.ts';
import { mediaColorsResponseSchema } from './mediaColorsResponseSchema.ts';
import { movieCertificationResponseSchema } from './movieCertificationResponseSchema.ts';
import { movieIdsResponseSchema } from './movieIdsResponseSchema.ts';
import { socialIdsResponseSchema } from './socialIdsResponseSchema.ts';
import { statusResponseSchema } from './statusResponseSchema.ts';

export const movieResponseSchema = z.object({
Expand Down Expand Up @@ -103,6 +104,10 @@ export const movieResponseSchema = z.object({
* Available if requesting extended `colors`.
*/
colors: mediaColorsResponseSchema.nullish(),
/***
* Available if requesting extended `full`.
*/
social_ids: socialIdsResponseSchema.nullish(),
});

export const typedMovieResponseSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { imagesResponseSchema } from './imagesResponseSchema.ts';
import { mediaColorsResponseSchema } from './mediaColorsResponseSchema.ts';
import { showCertificationResponseSchema } from './showCertificationResponseSchema.ts';
import { showIdsResponseSchema } from './showIdsResponseSchema.ts';
import { socialIdsResponseSchema } from './socialIdsResponseSchema.ts';
import { statusResponseSchema } from './statusResponseSchema.ts';

export const showResponseSchema = z.object({
Expand Down Expand Up @@ -114,6 +115,10 @@ export const showResponseSchema = z.object({
* Available if requesting extended `colors`.
*/
colors: mediaColorsResponseSchema.nullish(),
/***
* Available if requesting extended `full`.
*/
social_ids: socialIdsResponseSchema.nullish(),
});

export const typedShowResponseSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { z } from '../z.ts';

export const socialIdsResponseSchema = z.object({
twitter: z.string().nullish(),
facebook: z.string().nullish(),
instagram: z.string().nullish(),
wikipedia: z.string().nullish(),
});
6 changes: 6 additions & 0 deletions projects/api/src/contracts/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { profileResponseSchema } from '../_internal/response/profileResponseSchema.ts';
import { ratingsResponseSchema } from '../_internal/response/ratingsResponseSchema.ts';
import { sentimentsResponseSchema } from '../_internal/response/sentimentsResponseSchema.ts';
import { socialIdsResponseSchema } from '../_internal/response/socialIdsResponseSchema.ts';
import { statusResponseSchema } from '../_internal/response/statusResponseSchema.ts';
import { studioResponseSchema } from '../_internal/response/studioResponseSchema.ts';
import { translationResponseSchema } from '../_internal/response/translationResponseSchema.ts';
Expand Down Expand Up @@ -111,3 +112,8 @@ export type JustWatchLinkResponse = z.infer<typeof justWatchLinkResponseSchema>;

export { videoResponseSchema };
export type VideoResponse = z.infer<typeof videoResponseSchema>;

export { socialIdsResponseSchema };
export type SocialIdsResponse = z.infer<
typeof socialIdsResponseSchema
>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { crewPositionResponseSchema } from '../../../_internal/response/crewPositionResponseSchema.ts';
import { socialIdsResponseSchema } from '../../../_internal/response/socialIdsResponseSchema.ts';
import { asString, z } from '../../../_internal/z.ts';

export const personResponseSchema = z.object({
Expand All @@ -13,12 +14,7 @@ export const personResponseSchema = z.object({
/***
* Available if requesting extended `full`.
*/
social_ids: z.object({
twitter: z.string().nullish(),
facebook: z.string().nullish(),
instagram: z.string().nullish(),
wikipedia: z.string().nullish(),
}).nullish(),
social_ids: socialIdsResponseSchema.nullish(),
/***
* Available if requesting extended `full`.
*/
Expand Down
Loading