This release is 13 versions behind 0.1.31 — the latest version of @trakt/api. Jump to latest
The core library that implements Trakt API interactions using ts-rest and zod for type-safe communication and validation.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
17%
Published
a month ago (0.1.18)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869import { builder } from '../_internal/builder.ts'; import { extendedQuerySchemaFactory } from '../_internal/request/extendedQuerySchemaFactory.ts'; import { movieResponseSchema } from '../_internal/response/movieResponseSchema.ts'; import type { z } from '../_internal/z.ts'; import { calendarRequestParamsSchema } from './_internal/request/calendarParamsSchema.ts'; import { calendarShowListResponseSchema } from './_internal/response/calendarShowListResponseSchema.ts'; export const calendars = builder.router({ shows: { method: 'GET', path: '/:target/shows/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowListResponseSchema, }, }, newShows: { method: 'GET', path: '/:target/shows/new/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowListResponseSchema, }, }, seasonPremieres: { method: 'GET', path: '/:target/shows/premieres/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowListResponseSchema, }, }, finales: { method: 'GET', path: '/:target/shows/finales/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowListResponseSchema, }, }, movies: { method: 'GET', path: '/:target/movies/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: movieResponseSchema.array(), }, }, dvdReleases: { method: 'GET', path: '/:target/dvd/:start_date/:days', query: extendedQuerySchemaFactory<['full', 'images']>(), pathParams: calendarRequestParamsSchema, responses: { 200: movieResponseSchema.array(), }, }, }, { pathPrefix: '/calendars' }); export type CalendarParams = z.infer<typeof calendarRequestParamsSchema>; export type CalendarShowListResponse = z.infer< typeof calendarShowListResponseSchema >; export type CalendarMovieListResponse = z.infer<typeof movieResponseSchema>[];