-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated GraphQL Schema / Image handling after move to google image st…
…orage
- Loading branch information
Showing
4 changed files
with
40 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,25 @@ | ||
// https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/db/MediaTypes.ts | ||
import type { Point } from '@turf/helpers'; | ||
export type ImageFormatType = 'jpeg' | 'png' | 'webp' | 'avif'; | ||
|
||
import type { AreaType } from './area-types'; | ||
import type { ClimbType } from './climb-types'; | ||
|
||
// Type for 'Media' collection schema | ||
export interface MediaType { | ||
_id?: string; | ||
mediaUuid: string; | ||
mediaUrl: string; | ||
mediaType: number; // 0: image, 1: video | ||
destinationId: string; // reference to a climb or area | ||
destType: number; // 0: climb, 1: area | ||
onModel: RefModelType; | ||
} | ||
|
||
export enum RefModelType { | ||
climbs = 'climbs', | ||
areas = 'areas' | ||
} | ||
|
||
export interface MediaListByAuthorType { | ||
export interface MediaObject { | ||
_id: string; | ||
tagList: MediaType[]; | ||
} | ||
|
||
export interface MediaInputType { | ||
mediaUuid: string; | ||
userUuid: string; | ||
mediaUrl: string; | ||
mediaType: number; | ||
destinationId: string; | ||
destType: number; | ||
width: number; | ||
height: number; | ||
format: ImageFormatType; | ||
createdAt: Date; | ||
size: number; | ||
entityTags: EntityTag[]; | ||
} | ||
|
||
interface BaseTagType { | ||
export interface EntityTag { | ||
_id: string; | ||
mediaUuid: string; | ||
mediaUrl: string; | ||
mediaType: number; | ||
destType: number; | ||
onModel: RefModelType; | ||
} | ||
|
||
export interface AreaTagType extends BaseTagType { | ||
area: AreaType; | ||
} | ||
|
||
export interface ClimbTagType extends BaseTagType { | ||
climb: ClimbType; | ||
} | ||
|
||
export type TagEntryResultType = AreaTagType | ClimbTagType; | ||
|
||
export interface DeleteTagResult { | ||
id: string; | ||
mediaUuid: string; | ||
destType: number; | ||
destinationId: string; | ||
} | ||
|
||
export interface TagsLeaderboardType { | ||
userUuid: string; | ||
total: number; | ||
targetId: string; | ||
type: number; | ||
ancestors: string; | ||
climbName?: string; | ||
areaName: string; | ||
lnglat: Point; | ||
} |