Skip to content

Commit 3e9f23a

Browse files
authored
Merge pull request #35 from mapswipe/chore/separate-yaml-for-project
2 parents 957b3b3 + 28a3398 commit 3e9f23a

File tree

19 files changed

+859
-854
lines changed

19 files changed

+859
-854
lines changed

functions/definition/models.yaml

Lines changed: 0 additions & 583 deletions
This file was deleted.
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
# ENUM
4+
5+
FbEnumProjectStatus:
6+
model: alias
7+
docs: Represents project status
8+
type:
9+
type: enum
10+
members:
11+
# FIXME: tutorial always has status "tutorial"
12+
- label: "ACTIVE"
13+
value: active
14+
- label: "INACTIVE"
15+
value: inactive
16+
- label: "PRIVATE_INACTIVE"
17+
value: private_inactive
18+
- label: "PRIVATE_ACTIVE"
19+
value: private_active
20+
- label: "FINISHED"
21+
value: finished
22+
23+
FbEnumProjectType:
24+
model: alias
25+
docs: Represents project type
26+
type:
27+
type: enum
28+
members:
29+
- label: 'FIND'
30+
value: 1
31+
- label: 'VALIDATE'
32+
value: 2
33+
- label: 'VALIDATE_IMAGE'
34+
value: 10
35+
- label: 'COMPARE'
36+
value: 3
37+
- label: 'COMPLETENESS'
38+
value: 4
39+
40+
FbProjectReadonlyType:
41+
model: alias
42+
docs: Represents project fields that cannot be updated from backend
43+
type:
44+
type: object
45+
fields:
46+
contributorCount:
47+
type: int
48+
progress:
49+
type: int
50+
resultCount:
51+
type: int
52+
53+
FbProjectUpdateInput:
54+
model: alias
55+
docs: Represents project fields that are valid while updating a project
56+
type:
57+
type: object
58+
fields:
59+
image:
60+
type: string
61+
optional: true
62+
isFeatured:
63+
type: boolean
64+
lookFor:
65+
optional: true
66+
type: string
67+
projectInstruction:
68+
optional: true
69+
type: string
70+
name:
71+
type: string
72+
projectDetails:
73+
type: string
74+
projectNumber:
75+
type: int
76+
projectRegion:
77+
type: string
78+
projectTopic:
79+
type: string
80+
projectTopicKey:
81+
type: string
82+
deprecated: true
83+
# NOTE: Name of the organisation
84+
requestingOrganisation:
85+
type: string
86+
tutorialId:
87+
type: string
88+
language:
89+
type: string
90+
manualUrl:
91+
optional: true
92+
type: string
93+
teamId:
94+
optional: true
95+
type: string
96+
status:
97+
type: FbEnumProjectStatus
98+
99+
FbProjectCreateOnlyInput:
100+
model: alias
101+
docs: Represents project fields that are valid while creating a project
102+
type:
103+
type: object
104+
fields:
105+
created:
106+
type: timestamp
107+
createdBy:
108+
type: string
109+
groupMaxSize:
110+
type: int
111+
groupSize:
112+
type: int
113+
maxTasksPerUser:
114+
optional: true
115+
type: int
116+
projectId:
117+
type: string
118+
projectType:
119+
type: FbEnumProjectType
120+
# project_type:
121+
# type: FbEnumProjectType
122+
requiredResults:
123+
type: int
124+
verificationNumber:
125+
type: int
126+
127+
FbMappingGroupReadonlyType:
128+
model: alias
129+
docs: Represents mapping group fields that cannot be updated from backend
130+
type:
131+
type: object
132+
fields:
133+
finishedCount:
134+
type: int
135+
progress:
136+
type: int
137+
138+
FbMappingGroupCreateOnlyInput:
139+
model: alias
140+
docs: Represents mapping group fields that are valid while creating a mapping group
141+
type:
142+
type: object
143+
fields:
144+
projectId:
145+
type: string
146+
numberOfTasks:
147+
type: int
148+
requiredCount:
149+
type: int
150+
151+
FbMappingTaskCreateOnlyInput:
152+
model: alias
153+
# path: tasks/{projectId}/{groupId}/{index}
154+
docs: Represents mapping task fields that are valid while creating a task
155+
type:
156+
type: object
157+
fields:
158+
projectId:
159+
type: string
160+
161+
FbMappingResult:
162+
model: alias
163+
# path: results/{projectId}/{groupId}/{userId}
164+
docs: Represents a mapswipe project
165+
type:
166+
type: object
167+
fields:
168+
appVersion:
169+
type: string
170+
clientType:
171+
# FIXME: this is an enum
172+
type: string
173+
optional: true
174+
endTime:
175+
type: timestamp
176+
startTime:
177+
type: timestamp
178+
results:
179+
optional: true
180+
type:
181+
# NOTE: The key is taskId
182+
type: map
183+
valueType: int
184+
usergroups:
185+
optional: true
186+
type:
187+
# NOTE: The key is usergroupId
188+
type: map
189+
valueType: boolean
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbBaseObjCustomSubOption:
4+
model: alias
5+
docs: Represents a custom sub-option
6+
type:
7+
type: object
8+
fields:
9+
value:
10+
type: int
11+
description:
12+
type: string
13+
14+
FbObjCustomOption:
15+
model: alias
16+
docs: Represents a custom option
17+
type:
18+
type: object
19+
fields:
20+
value:
21+
type: int
22+
title:
23+
type: string
24+
description:
25+
type: string
26+
# FIXME: Do we add enum here?
27+
icon:
28+
type: string
29+
iconColor:
30+
type: string
31+
subOptions:
32+
optional: true
33+
type:
34+
type: list
35+
elementType: FbBaseObjCustomSubOption
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbProjectCompareCreateOnlyInput:
4+
model: alias
5+
docs: Represents COMPARE project fields that are valid while creating a project
6+
type:
7+
type: object
8+
fields:
9+
zoomLevel:
10+
type: int
11+
tileServer:
12+
type: FbObjRasterTileServer
13+
tileServerB:
14+
type: FbObjRasterTileServer
15+
16+
FbMappingTaskCompareCreateOnlyInput:
17+
model: alias
18+
docs: Represents COMPARE mapping task fields that are valid while creating a task
19+
type:
20+
type: object
21+
fields:
22+
groupId:
23+
type: string
24+
taskId:
25+
type: string
26+
taskX:
27+
type: int
28+
optional: true
29+
taskY:
30+
type: int
31+
optional: true
32+
url:
33+
type: string
34+
optional: true
35+
urlB:
36+
type: string
37+
optional: true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbEnumOverlayTileServerType:
4+
model: alias
5+
type:
6+
type: enum
7+
members:
8+
- label: 'RASTER'
9+
value: 'raster'
10+
- label: 'VECTOR'
11+
value: 'vector'
12+
13+
FbObjUnifiedOverlayTileServer:
14+
model: alias
15+
docs: Represents an overlay layer
16+
type:
17+
type: object
18+
fields:
19+
type:
20+
type: FbEnumOverlayTileServerType
21+
raster:
22+
optional: true
23+
type: FbObjRasterTileServerOverlay
24+
vector:
25+
optional: true
26+
type: FbObjVectorTileServerOverlay
27+
28+
FbProjectCompletenessCreateOnlyInput:
29+
model: alias
30+
docs: Represents COMPLETNESS project fields that are valid while creating a project
31+
type:
32+
type: object
33+
fields:
34+
zoomLevel:
35+
type: int
36+
tileServer:
37+
type: FbObjRasterTileServer
38+
tileServerB:
39+
type: FbObjRasterTileServer
40+
overlayTileServer:
41+
type: FbObjUnifiedOverlayTileServer
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbProjectFindCreateOnlyInput:
4+
model: alias
5+
docs: Represents FIND project fields that are valid while creating a project
6+
type:
7+
type: object
8+
fields:
9+
zoomLevel:
10+
type: int
11+
tileServer:
12+
type: FbObjRasterTileServer
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbMappingGroupTileMapServiceCreateOnlyInput:
4+
model: alias
5+
docs: Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group
6+
type:
7+
type: object
8+
fields:
9+
groupId:
10+
type: string
11+
xMax:
12+
type: int
13+
xMin:
14+
type: int
15+
yMax:
16+
type: int
17+
yMin:
18+
type: int
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbEnumValidateInputType:
4+
model: alias
5+
type:
6+
type: enum
7+
members:
8+
- label: 'AOI_FILE'
9+
value: 'aoi_file'
10+
- label: 'LINK'
11+
value: 'link'
12+
- label: 'TMID'
13+
value: 'TMId'
14+
15+
FbProjectValidateCreateOnlyInput:
16+
model: alias
17+
docs: Represents VALIDATE project fields that are valid while creating a project
18+
type:
19+
type: object
20+
fields:
21+
customOptions:
22+
optional: true
23+
type:
24+
type: list
25+
elementType: FbObjCustomOption
26+
tileServer:
27+
type: FbObjRasterTileServer
28+
inputType:
29+
type: FbEnumValidateInputType
30+
31+
# NOTE: available for aoi_file and TMId
32+
filter:
33+
type: string
34+
optional: true
35+
# NOTE: available for TMId
36+
TMId:
37+
type: string
38+
optional: true
39+
40+
FbMappingGroupValidateCreateOnlyInput:
41+
model: alias
42+
docs: Represents VALIDATE mapping group fields that are valid while creating a mapping group
43+
type:
44+
type: object
45+
fields:
46+
groupId:
47+
type: string
48+
49+
FbMappingTaskValidateCreateOnlyInput:
50+
model: alias
51+
docs: Represents VALIDATE mapping task fields that are valid while creating a task
52+
type:
53+
type: object
54+
fields:
55+
taskId:
56+
type: string
57+
geojson:
58+
# NOTE: This is not optional
59+
type:
60+
type: map
61+
valueType: any

0 commit comments

Comments
 (0)