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
583 changes: 0 additions & 583 deletions functions/definition/models.yaml

This file was deleted.

189 changes: 189 additions & 0 deletions functions/definition/project/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

# ENUM

FbEnumProjectStatus:
model: alias
docs: Represents project status
type:
type: enum
members:
# FIXME: tutorial always has status "tutorial"
- label: "ACTIVE"
value: active
- label: "INACTIVE"
value: inactive
- label: "PRIVATE_INACTIVE"
value: private_inactive
- label: "PRIVATE_ACTIVE"
value: private_active
- label: "FINISHED"
value: finished

FbEnumProjectType:
model: alias
docs: Represents project type
type:
type: enum
members:
- label: 'FIND'
value: 1
- label: 'VALIDATE'
value: 2
- label: 'VALIDATE_IMAGE'
value: 10
- label: 'COMPARE'
value: 3
- label: 'COMPLETENESS'
value: 4

FbProjectReadonlyType:
model: alias
docs: Represents project fields that cannot be updated from backend
type:
type: object
fields:
contributorCount:
type: int
progress:
type: int
resultCount:
type: int

FbProjectUpdateInput:
model: alias
docs: Represents project fields that are valid while updating a project
type:
type: object
fields:
image:
type: string
optional: true
isFeatured:
type: boolean
lookFor:
optional: true
type: string
projectInstruction:
optional: true
type: string
name:
type: string
projectDetails:
type: string
projectNumber:
type: int
projectRegion:
type: string
projectTopic:
type: string
projectTopicKey:
type: string
deprecated: true
# NOTE: Name of the organisation
requestingOrganisation:
type: string
tutorialId:
type: string
language:
type: string
manualUrl:
optional: true
type: string
teamId:
optional: true
type: string
status:
type: FbEnumProjectStatus

FbProjectCreateOnlyInput:
model: alias
docs: Represents project fields that are valid while creating a project
type:
type: object
fields:
created:
type: timestamp
createdBy:
type: string
groupMaxSize:
type: int
groupSize:
type: int
maxTasksPerUser:
optional: true
type: int
projectId:
type: string
projectType:
type: FbEnumProjectType
# project_type:
# type: FbEnumProjectType
requiredResults:
type: int
verificationNumber:
type: int

FbMappingGroupReadonlyType:
model: alias
docs: Represents mapping group fields that cannot be updated from backend
type:
type: object
fields:
finishedCount:
type: int
progress:
type: int

FbMappingGroupCreateOnlyInput:
model: alias
docs: Represents mapping group fields that are valid while creating a mapping group
type:
type: object
fields:
projectId:
type: string
numberOfTasks:
type: int
requiredCount:
type: int

FbMappingTaskCreateOnlyInput:
model: alias
# path: tasks/{projectId}/{groupId}/{index}
docs: Represents mapping task fields that are valid while creating a task
type:
type: object
fields:
projectId:
type: string

FbMappingResult:
model: alias
# path: results/{projectId}/{groupId}/{userId}
docs: Represents a mapswipe project
type:
type: object
fields:
appVersion:
type: string
clientType:
# FIXME: this is an enum
type: string
optional: true
endTime:
type: timestamp
startTime:
type: timestamp
results:
optional: true
type:
# NOTE: The key is taskId
type: map
valueType: int
usergroups:
optional: true
type:
# NOTE: The key is usergroupId
type: map
valueType: boolean
35 changes: 35 additions & 0 deletions functions/definition/project/customOptions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbBaseObjCustomSubOption:
model: alias
docs: Represents a custom sub-option
type:
type: object
fields:
value:
type: int
description:
type: string

FbObjCustomOption:
model: alias
docs: Represents a custom option
type:
type: object
fields:
value:
type: int
title:
type: string
description:
type: string
# FIXME: Do we add enum here?
icon:
type: string
iconColor:
type: string
subOptions:
optional: true
type:
type: list
elementType: FbBaseObjCustomSubOption
37 changes: 37 additions & 0 deletions functions/definition/project/project_types/compare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbProjectCompareCreateOnlyInput:
model: alias
docs: Represents COMPARE project fields that are valid while creating a project
type:
type: object
fields:
zoomLevel:
type: int
tileServer:
type: FbObjRasterTileServer
tileServerB:
type: FbObjRasterTileServer

FbMappingTaskCompareCreateOnlyInput:
model: alias
docs: Represents COMPARE mapping task fields that are valid while creating a task
type:
type: object
fields:
groupId:
type: string
taskId:
type: string
taskX:
type: int
optional: true
taskY:
type: int
optional: true
url:
type: string
optional: true
urlB:
type: string
optional: true
41 changes: 41 additions & 0 deletions functions/definition/project/project_types/completeness.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbEnumOverlayTileServerType:
model: alias
type:
type: enum
members:
- label: 'RASTER'
value: 'raster'
- label: 'VECTOR'
value: 'vector'

FbObjUnifiedOverlayTileServer:
model: alias
docs: Represents an overlay layer
type:
type: object
fields:
type:
type: FbEnumOverlayTileServerType
raster:
optional: true
type: FbObjRasterTileServerOverlay
vector:
optional: true
type: FbObjVectorTileServerOverlay

FbProjectCompletenessCreateOnlyInput:
model: alias
docs: Represents COMPLETNESS project fields that are valid while creating a project
type:
type: object
fields:
zoomLevel:
type: int
tileServer:
type: FbObjRasterTileServer
tileServerB:
type: FbObjRasterTileServer
overlayTileServer:
type: FbObjUnifiedOverlayTileServer
12 changes: 12 additions & 0 deletions functions/definition/project/project_types/find.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbProjectFindCreateOnlyInput:
model: alias
docs: Represents FIND project fields that are valid while creating a project
type:
type: object
fields:
zoomLevel:
type: int
tileServer:
type: FbObjRasterTileServer
18 changes: 18 additions & 0 deletions functions/definition/project/project_types/tileMapService.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbMappingGroupTileMapServiceCreateOnlyInput:
model: alias
docs: Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group
type:
type: object
fields:
groupId:
type: string
xMax:
type: int
xMin:
type: int
yMax:
type: int
yMin:
type: int
61 changes: 61 additions & 0 deletions functions/definition/project/project_types/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbEnumValidateInputType:
model: alias
type:
type: enum
members:
- label: 'AOI_FILE'
value: 'aoi_file'
- label: 'LINK'
value: 'link'
- label: 'TMID'
value: 'TMId'

FbProjectValidateCreateOnlyInput:
model: alias
docs: Represents VALIDATE project fields that are valid while creating a project
type:
type: object
fields:
customOptions:
optional: true
type:
type: list
elementType: FbObjCustomOption
tileServer:
type: FbObjRasterTileServer
inputType:
type: FbEnumValidateInputType

# NOTE: available for aoi_file and TMId
filter:
type: string
optional: true
# NOTE: available for TMId
TMId:
type: string
optional: true

FbMappingGroupValidateCreateOnlyInput:
model: alias
docs: Represents VALIDATE mapping group fields that are valid while creating a mapping group
type:
type: object
fields:
groupId:
type: string

FbMappingTaskValidateCreateOnlyInput:
model: alias
docs: Represents VALIDATE mapping task fields that are valid while creating a task
type:
type: object
fields:
taskId:
type: string
geojson:
# NOTE: This is not optional
type:
type: map
valueType: any
Loading