Skip to content

Commit

Permalink
Merge pull request #95 from steniowagner/development
Browse files Browse the repository at this point in the history
Merge Development > Master
  • Loading branch information
steniowagner authored Feb 17, 2024
2 parents 633a0e6 + fd158a1 commit 506a9f9
Show file tree
Hide file tree
Showing 23 changed files with 1,386 additions and 1,151 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ npm run prettier:fix
npm run lint:fix
npm run build
npm run test
rm -rf docs
mkdir docs
npx spectaql spectaql-config.yaml -t ./docs
git add -A .
# rm -rf docs
# mkdir docs
# npx spectaql spectaql-config.yaml -t ./docs
# git add -A .
2,028 changes: 888 additions & 1,140 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ const server = new ApolloServer<Context>({
},
listen: { port: parseInt(process.env.PORT! as string) },
});
console.log(`UHUL! Cine-Tasty-API is running at ${url}!`);
if (process.env.NODE_ENV !== "production") {
console.log(`UHUL! Cine-Tasty-API is running at ${url}!`);

Check warning on line 33 in src/app.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected console statement
}
})();
3 changes: 3 additions & 0 deletions src/graphql/type-defs/queries.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export default `#graphql
extend type Query {
"Returns a set of questions related to TV-Shows, Movies and Cinema in general"
quiz(input: QuizInput!): [QuizQuestion!]!
"Returns paginated articles for the specified language"
news(page: Int!, language: NewsLanguage!): NewsResult!
"Returns the info about a certain Actor/Actress"
famous(id: Int!, language: ISO6391Language): Famous!
searchFamous(input: SearchInput!): SearchFamousResult!
searchTVShows(input: SearchInput!): SearchTVShowsResult!
Expand Down
11 changes: 11 additions & 0 deletions src/graphql/type-defs/schemas/news.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@ export default `#graphql
}
type NewsArticle {
"Publication date"
publishedAt: String
"Description"
description: String
"Content"
content: String
"Source"
source: String
"Author"
author: String
"Title"
title: String
"Image"
image: String
"URL to the article source"
url: String
"Id attached to the Article"
id: ID
}
type NewsResult {
"Response array"
items: [NewsArticle!]!
"Indicates if there is more items to be fetched"
hasMore: Boolean!
}
`;
20 changes: 20 additions & 0 deletions src/graphql/type-defs/schemas/quiz.schema.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
export default `#graphql
enum QuizQuestionDifficulty {
"Only Easy questions"
EASY
"Only Medium questions"
MEDIUM
"Only Hard questions"
HARD
"Difficulty mixed (Easy and Medium and Hard questions)"
MIXED
}
enum QuizQuestionType {
"Only Mutliple-Choice questions"
MULTIPLE
"Only Boolean (True/False) questions"
BOOLEAN
"Mixed questions (Multiple-Choice and Boolean)"
MIXED
}
enum QuizQuestionCategory {
"Only questions related to Movies"
MOVIE
"Only questions related to TV-shows"
TV
"Questions related to both Movies and TV-shows"
MIXED
}
type QuizQuestion {
"Available options to be select"
options: [String!]!
"Question category - TV, Films, Cinema..."
category: String!
"Question type (same as QuizQuestionType)"
type: String!
"Question difficulty (same as QuizQuestionDifficulty)"
difficulty: String!
"Question description"
question: String!
"Question correct answer"
correctAnswer: String!
}
input QuizInput {
"Difficulty selected"
difficulty: QuizQuestionDifficulty!
"Type of the questions"
type: QuizQuestionType!
"Category of the questions"
category: QuizQuestionCategory!
"Number of questions to be returned"
numberOfQuestions: Int!
}
`;
4 changes: 4 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/ISO6391Language.schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export default `#graphql
"Describes the acceptable languages for the TheMovieDB operations"
enum ISO6391Language {
"English"
en
"Portuguese"
pt
"Spanish"
es
}
`;
60 changes: 60 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/cast.schema.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,129 @@
export default `#graphql
"Definition of the Base-type of the FamousCast"
interface BaseFamousCast {
"Backdrop image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
backdropPath: String
"Character name"
character: String
"Credit id"
creditId: String
"Cast id"
id: Int!
"TV-Show/Movie genres"
genres(language: ISO6391Language): [String!]!
"Indicates if the media is TV-Show or Movie"
mediaType: String
"TV-Show/Movie original language"
originalLanguage: String
"TV-Show/Movie overview"
overview: String
"Number indicating the popularity of the TV-Show/Movie"
popularity: Float
"Poster image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
posterPath: String
"Number indicating the average of votes for the TV-Show/Movie"
voteAverage: Float
"Number indicating how many votes the TV-Show/Movie has"
voteCount: Float
}
"Describes the Movies in which the Actor/Actress is in the cast"
type FamousCastMovie implements BaseFamousCast {
"Indicates if the movie has the 'adult' classification"
adult: Boolean
"Backdrop image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
backdropPath: String
"Movie character name"
character: String
"Movie credit id"
creditId: String
"Movie genres"
genres(language: ISO6391Language): [String!]!
"Movie id"
id: Int!
"Movie original language"
originalLanguage: String
"Movie original title"
originalTitle: String
"Number indicating the popularity of the Movie"
popularity: Float
"Movie Poster image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
posterPath: String
"For Movies, this value will always be 'movie'"
mediaType: String
"Movie overview"
overview: String
"Movie release date (MM-DD-YYYY)"
releaseDate: String
"Movie title"
title: String
"Indicates if the Movie has some video"
video: Boolean
"Number indicating the average of votes for the Movie"
voteAverage: Float
"Number indicating how many votes the Movie has"
voteCount: Float
}
"Describes the TV-Shows in which the Actor/Actress is in the cast"
type FamousCastTVShow implements BaseFamousCast {
"Backdrop image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
backdropPath: String
"TV-Show character"
character: String
"TV-Show credit id"
creditId: String
"Indicates how many episodes the TV-Show has so far"
episodeCount: Int
"TV-Show first air date (MM-DD-YYYY)"
firstAirDate: String
"TV-Show genres"
genres(language: ISO6391Language): [String!]!
"TV-Show id"
id: Int!
"For TV-Show, this value will always be 'tv-show'"
mediaType: String
"TV-Show name"
name: String
"TV-Show original language"
originalLanguage: String
"TV-Show original name"
originalName: String
"TV-Show origin countries"
originCountry: [String!]!
"TV-Show overview"
overview: String
"Number indicating the popularity of the TV-Show"
popularity: Float
"Poster image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
posterPath: String
"Number indicating the average of votes for the TV-Show"
voteAverage: Float
"Number indicating how many votes the TV-Show has"
voteCount: Float
}
"Describes the cast of a Movie or TV-Show"
type MediaCast {
"Indicates if the TV-Show/Moive has the 'adult' classification"
adult: Boolean
"TV-Shw/Moive id"
id: Int!
"Departments in which the actor/actress works (acting, directing...)"
knownForDepartment: String
"Actor/Actress name"
name: String
"TV-Shw/Moive original name"
originalName: String
"Number indicating the popularity of the TV-Show/Movie"
popularity: Float
"Actor/Actress profile image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
profilePath: String
"Actor/Actress character"
character: String
"TV-Shw/Moive original credit-id"
creditId: String
"TV-Shw/Moive original order"
order: Int
}
`;
13 changes: 13 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/famous.schema.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
export default `#graphql
type FamousCast {
"Movies in which the actor/actress is in the cast"
moviesCast: [FamousCastMovie!]!
"TV-Shows in which the actor/actress is in the cast"
tvShowsCast: [FamousCastTVShow!]!
}
type Famous {
"Biography"
biography: String
"Birthday (MM-DD-YYYY)"
birthday: String
"Deathday (MM-DD-YYYY)"
deathday: String
"Id"
id: Int!
"Images gallery"
images: [String!]!
"Departments in which the actor/actress works (acting, directing...)"
knownForDepartment: String
"Name"
name: String
"Place of Birth"
placeOfBirth: String
"Number indicating popularity"
popularity: Float
"Profile image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
profilePath: String
"Movies and TV-Shows in which the actor/actress is in the cast"
cast(language: ISO6391Language): FamousCast!
}
`;
6 changes: 6 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/media-crew.schema.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
export default `#graphql
"Describes the crew of a TV-Show/Movie"
type MediaCrew {
"Deparment in which the crew-member works (filming, acting, directing...)"
department: String
"Media crew-member id"
id: Int!
"Media crew-member job"
job: String
"Media crew-member name"
name: String
"Profile image - only the TMDB resource-id (e.g whNwkEQYWLFJA8ij0WyOOAD5xhQ.jpg)"
profilePath: String
}
`;
4 changes: 4 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/media-genres.schema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
export default `#graphql
"Describes the media-types: TV or Movie"
enum MediaType {
TV
MOVIE
}
"Describes the genre of a TV-Show/Movie"
type MediaGenre {
"Genre-id"
id: Int!
"Genre name"
name: String
}
`;
8 changes: 8 additions & 0 deletions src/graphql/type-defs/schemas/tmdb/media-video.schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default `#graphql
"Describes the possible sizes of a Thumbnail"
type Thumbnail {
"120x90"
extraSmall: String
Expand All @@ -12,12 +13,19 @@ export default `#graphql
extraLarge: String
}
"Describes the TV-Show/Media video"
type MediaVideo {
"Thumbnail data"
thumbnail: Thumbnail
"Youtube key used to access a video (e.g. https://www.youtube.com/watch?v=<key)>"
key: String
"Youtube video name"
name: String
"At the moment, the only possible value here is 'YouTube'"
site: String
"Youtube video id"
id: ID
"Type of the Youtube video"
type: String
}
`;
Loading

0 comments on commit 506a9f9

Please sign in to comment.