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.2.49",
"version": "0.2.50",
"imports": {
"@anatine/zod-openapi": "npm:@anatine/zod-openapi@^2.2.6",
"@std/testing": "jsr:@std/testing@^1.0.5",
Expand Down
14 changes: 14 additions & 0 deletions projects/api/src/contracts/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { profileParamsSchema } from './schema/request/profileParamsSchema.ts';
import { settingsRequestSchema } from './schema/request/settingsRequestSchema.ts';
import { socialActivityParamsSchema } from './schema/request/socialActivityParamsSchema.ts';
import { sortEnumSchema } from './schema/request/sortParamsSchema.ts';
import { yearInReviewParamsSchema } from './schema/request/yearInReviewParamsSchema.ts';
import { followerResponseSchema } from './schema/response/followerResponseSchema.ts';
import { followResponseSchema } from './schema/response/followResponseSchema.ts';
import { friendResponseSchema } from './schema/response/friendResponseSchema.ts';
Expand All @@ -32,6 +33,7 @@ import { userCommentResponseSchema } from './schema/response/userCommentResponse
import { userStatsResponseSchema } from './schema/response/userStatsResponseSchema.ts';
import { watchActionSchema } from './schema/response/watchActionSchema.ts';
import { watchingResponseSchema } from './schema/response/watchingResponseSchema.ts';
import { yearInReviewResponseSchema } from './schema/response/yearInReviewResponseSchema.ts';
import { favorites } from './subroutes/favorites.ts';
import { filters } from './subroutes/filters.ts';
import { hidden } from './subroutes/hidden.ts';
Expand Down Expand Up @@ -219,6 +221,16 @@ const ENTITY_LEVEL = builder.router({
200: monthInReviewResponseSchema,
},
},
year_in_review: {
path: '/yir/:year',
pathParams: profileParamsSchema
.merge(yearInReviewParamsSchema),
query: extendedMediaQuerySchema,
method: 'GET',
responses: {
200: yearInReviewResponseSchema,
},
},
}, {
pathPrefix: '/:id',
});
Expand Down Expand Up @@ -310,6 +322,8 @@ export type SettingsRequest = z.infer<typeof settingsRequestSchema>;

export type MonthInReviewParams = z.infer<typeof monthInReviewParamsSchema>;
export type MonthInReviewResponse = z.infer<typeof monthInReviewResponseSchema>;
export type YearInReviewParams = z.infer<typeof yearInReviewParamsSchema>;
export type YearInReviewResponse = z.infer<typeof yearInReviewResponseSchema>;

export type ReactedCommentResponse = z.infer<
typeof reactedCommentResponseSchema
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { z } from '../../../_internal/z.ts';

export const yearInReviewParamsSchema = z.object({
year: z.number().int(),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { monthInReviewResponseSchema } from './monthInReviewResponseSchema.ts';

export const yearInReviewResponseSchema = monthInReviewResponseSchema;
Loading