init
This commit is contained in:
commit
98131c3b78
29 changed files with 2003 additions and 0 deletions
42
src/libs/apis/tmdb/schemas.ts
Normal file
42
src/libs/apis/tmdb/schemas.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Schema } from "effect";
|
||||
|
||||
export class TmdbMovieSearchQueryParams extends Schema.Class<TmdbMovieSearchQueryParams>("TmdbMovieSearchArgs")({
|
||||
include_adult: Schema.Boolean.pipe(
|
||||
Schema.propertySignature,
|
||||
Schema.withConstructorDefault(() => false),
|
||||
),
|
||||
language: Schema.NonEmptyString.pipe(
|
||||
Schema.propertySignature,
|
||||
Schema.withConstructorDefault(() => "en-US"),
|
||||
),
|
||||
page: Schema.NonNegativeInt.pipe(
|
||||
Schema.propertySignature,
|
||||
Schema.withConstructorDefault(() => 1),
|
||||
),
|
||||
primary_release_year: Schema.NonEmptyString.pipe(Schema.length(4), Schema.optional),
|
||||
query: Schema.NonEmptyString,
|
||||
region: Schema.NonEmptyString.pipe(Schema.propertySignature, Schema.withConstructorDefault(() => "fr")),
|
||||
year: Schema.NonEmptyString.pipe(Schema.length(4), Schema.optional),
|
||||
}) {}
|
||||
|
||||
export class TmdbMovieSearchResponse extends Schema.Class<TmdbMovieSearchResponse>("TmdbMovieSearchResponse")({
|
||||
page: Schema.NonNegativeInt,
|
||||
results: Schema.Array(Schema.Struct({
|
||||
adult: Schema.Boolean,
|
||||
backdrop_path: Schema.Union(Schema.String, Schema.Null),
|
||||
genre_ids: Schema.Array(Schema.NonNegativeInt),
|
||||
id: Schema.NonNegativeInt,
|
||||
original_language: Schema.String,
|
||||
original_title: Schema.String,
|
||||
overview: Schema.String,
|
||||
popularity: Schema.Number,
|
||||
poster_path: Schema.Union(Schema.String, Schema.Null),
|
||||
release_date: Schema.NonEmptyString.pipe(Schema.length(10)),
|
||||
title: Schema.String,
|
||||
video: Schema.Boolean,
|
||||
vote_average: Schema.Number,
|
||||
vote_count: Schema.NonNegativeInt,
|
||||
})),
|
||||
total_pages: Schema.NonNegativeInt,
|
||||
total_results: Schema.NonNegativeInt,
|
||||
}) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue