Skip to content

Commit 9a05e56

Browse files
committed
feat(typesync): add models/fields for all existing project types
- add types for tile_map_service, validate and validate_image - update docs for all models
1 parent a3deda6 commit 9a05e56

File tree

2 files changed

+220
-91
lines changed

2 files changed

+220
-91
lines changed

functions/definition/models.yaml

Lines changed: 110 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# yaml-language-server: $schema=https://schema.typesync.org/v0.13.json
22

3-
# NOTE: projectsUsers and groupsUsers cannot be modeled
4-
53
# XXX(tnagorra): The pydantic classess are generated in alphabetical order.
64
# So, we must be careful on how we name the models so that the dependencies
75
# are always generated before hand.
@@ -33,7 +31,7 @@ FbEnumUserGroupMembershipAction:
3331

3432
FbEnumRasterTileServerName:
3533
model: alias
36-
docs: Represents a project status
34+
docs: Represents supported raster tile server
3735
type:
3836
type: enum
3937
members:
@@ -54,7 +52,7 @@ FbEnumRasterTileServerName:
5452

5553
FbEnumProjectStatus:
5654
model: alias
57-
docs: Represents a project status
55+
docs: Represents project status
5856
type:
5957
type: enum
6058
members:
@@ -72,7 +70,7 @@ FbEnumProjectStatus:
7270

7371
FbEnumProjectType:
7472
model: alias
75-
docs: Represents a project type
73+
docs: Represents project type
7674
type:
7775
type: enum
7876
members:
@@ -121,7 +119,7 @@ FbOrganisation:
121119
FbTeam:
122120
model: document
123121
path: teams/{teamId}
124-
docs: Represents a mapswipe team
122+
docs: Represents a team
125123
type:
126124
type: object
127125
fields:
@@ -134,7 +132,7 @@ FbTeam:
134132

135133
FbBaseObjCustomSubOption:
136134
model: alias
137-
docs: Represents a custom sub option
135+
docs: Represents a custom sub-option
138136
type:
139137
type: object
140138
fields:
@@ -168,7 +166,7 @@ FbObjCustomOption:
168166

169167
FbObjRasterTileServer:
170168
model: alias
171-
docs: Represents a raster tile server
169+
docs: Represents a raster tile server configuration
172170
type:
173171
type: object
174172
fields:
@@ -189,30 +187,26 @@ FbObjRasterTileServer:
189187

190188
FbProjectReadonlyType:
191189
model: alias
192-
docs: Represents fields that cannot be updated from backend
190+
docs: Represents project fields that cannot be updated from backend
193191
type:
194192
type: object
195193
fields:
196-
# NOTE: initially zero
197194
contributorCount:
198195
type: int
199-
# NOTE: intially zero
200196
progress:
201197
type: int
202-
# NOTE: intially zero
203198
resultCount:
204199
type: int
205200

206201
FbProjectUpdateInput:
207202
model: alias
208-
docs: Represents fields that are valid while updating a project
203+
docs: Represents project fields that are valid while updating a project
209204
type:
210205
type: object
211206
fields:
212207
image:
213208
type: string
214209
optional: true
215-
# NOTE: Initially false
216210
isFeatured:
217211
type: boolean
218212
lookFor:
@@ -222,20 +216,19 @@ FbProjectUpdateInput:
222216
projectDetails:
223217
type: string
224218
projectNumber:
225-
type: int # NOTE: This could also be str?
219+
type: int
226220
projectRegion:
227221
type: string
228222
projectTopic:
229223
type: string
230-
# NOTE: We can remove this later @deprecated
224+
# TODO: We can remove this @deprecated
231225
projectTopicKey:
232226
type: string
233227
# NOTE: Name of the organisation
234228
requestingOrganisation:
235229
type: string
236230
tutorialId:
237231
type: string
238-
# NOTE: Initially en-us
239232
language:
240233
type: string
241234
manualUrl:
@@ -244,21 +237,19 @@ FbProjectUpdateInput:
244237
teamId:
245238
optional: true
246239
type: string
247-
# NOTE: Intially inactive or private_inactive
248240
status:
249241
type: FbEnumProjectStatus
250242

251243
FbProjectCreateOnlyInput:
252244
model: alias
253-
docs: Represents fields that are valid only while creating a project
245+
docs: Represents project fields that are valid while creating a project
254246
type:
255247
type: object
256248
fields:
257249
created:
258250
type: timestamp
259251
createdBy:
260252
type: string
261-
# NOTE: this is zero during project creation
262253
groupMaxSize:
263254
type: int
264255
groupSize:
@@ -279,7 +270,7 @@ FbProjectCreateOnlyInput:
279270

280271
FbProjectFindCreateOnlyInput:
281272
model: alias
282-
docs: Represents fields that are valid only while creating a project for FIND
273+
docs: Represents FIND project fields that are valid while creating a project
283274
type:
284275
type: object
285276
fields:
@@ -290,7 +281,7 @@ FbProjectFindCreateOnlyInput:
290281

291282
FbProjectCompareCreateOnlyInput:
292283
model: alias
293-
docs: Represents fields that are valid only while creating a project for COMPARE
284+
docs: Represents COMPARE project fields that are valid while creating a project
294285
type:
295286
type: object
296287
fields:
@@ -304,7 +295,7 @@ FbProjectCompareCreateOnlyInput:
304295

305296
FbProjectCompletenessCreateOnlyInput:
306297
model: alias
307-
docs: Represents fields that are valid only while creating a project for COMPLETENESS
298+
docs: Represents COMPLETNESS project fields that are valid while creating a project
308299
type:
309300
type: object
310301
fields:
@@ -318,7 +309,7 @@ FbProjectCompletenessCreateOnlyInput:
318309

319310
FbProjectValidateCreateOnlyInput:
320311
model: alias
321-
docs: Represents fields that are valid only while creating a project for VALIDATE
312+
docs: Represents VALIDATE project fields that are valid while creating a project
322313
type:
323314
type: object
324315
fields:
@@ -327,17 +318,21 @@ FbProjectValidateCreateOnlyInput:
327318
type:
328319
type: list
329320
elementType: FbObjCustomOption
330-
filter:
331-
type: string
332-
inputType:
333-
type: FbEnumValidateInputType
334321
tileServer:
335322
type: FbObjRasterTileServer
323+
inputType:
324+
type: FbEnumValidateInputType
325+
filter:
326+
type: string
327+
optional: true
328+
TMID:
329+
type: string
330+
optional: true
336331

337332

338333
FbProjectValidateImageCreateOnlyInput:
339334
model: alias
340-
docs: Represents fields that are valid only while creating a project for VALIDATE
335+
docs: Represents VALIDATE_IMAGE project fields that are valid while creating a project
341336
type:
342337
type: object
343338
fields:
@@ -351,76 +346,121 @@ FbProjectValidateImageCreateOnlyInput:
351346

352347
FbMappingGroupReadonlyType:
353348
model: alias
354-
docs: Represents fields that cannot be updated from backend
349+
docs: Represents mapping group fields that cannot be updated from backend
355350
type:
356351
type: object
357352
fields:
358-
# Initially zero
359353
finishedCount:
360354
type: int
361-
# NOTE: Initially zero
362355
progress:
363356
type: int
364357

365358
FbMappingGroupCreateOnlyInput:
366359
model: alias
367-
# model: document
368-
# path: groups/{projectId}/{groupId}
369-
docs: Represents a group in a mapswipe project
360+
docs: Represents mapping group fields that are valid while creating a mapping group
370361
type:
371362
type: object
372363
fields:
373-
# ex: g101
374-
groupId:
375-
type: string
376364
projectId:
377365
type: string
378366
numberOfTasks:
379367
type: int
380368
requiredCount:
381369
type: int
382-
# PROJECT SPECIFIC FIELDS
383-
# xMax:
384-
# type: int
385-
# optional: true
386-
# xMin:
387-
# type: int
388-
# optional: true
389-
# yMax:
390-
# type: int
391-
# optional: true
392-
# yMin:
393-
# type: int
394-
# optional: true
370+
371+
FbMappingGroupTileMapServiceCreateOnlyInput:
372+
model: alias
373+
docs: Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group
374+
type:
375+
type: object
376+
fields:
377+
groupId:
378+
type: string
379+
xMax:
380+
type: int
381+
xMin:
382+
type: int
383+
yMax:
384+
type: int
385+
yMin:
386+
type: int
387+
388+
FbMappingGroupValidateCreateOnlyInput:
389+
model: alias
390+
docs: Represents VALIDATE mapping group fields that are valid while creating a mapping group
391+
type:
392+
type: object
393+
fields:
394+
groupId:
395+
type: string
396+
397+
FbMappingGroupValidateImageCreateOnlyInput:
398+
model: alias
399+
docs: Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group
400+
type:
401+
type: object
402+
fields:
403+
groupId:
404+
type: string
395405

396406
FbMappingTaskCreateOnlyInput:
397407
model: alias
398408
# model: document
399409
# path: tasks/{projectId}/{groupId}/{index}
400-
docs: Repesents a task in a group in a project
410+
docs: Represents mapping task fields that are valid while creating a task
401411
type:
402412
type: object
403413
fields:
404414
projectId:
405415
type: string
416+
417+
FbMappingTaskValidateCreateOnlyInput:
418+
model: alias
419+
docs: Represents VALIDATE mapping task fields that are valid while creating a task
420+
type:
421+
type: object
422+
fields:
423+
taskId:
424+
type: string
425+
geojson:
426+
type:
427+
type: map
428+
valueType: any
429+
430+
FbMappingTaskValidateImageCreateOnlyInput:
431+
model: alias
432+
docs: Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task
433+
type:
434+
type: object
435+
fields:
436+
taskId:
437+
type: string
438+
question:
439+
type: string
440+
optional: true
441+
442+
FbMappingTaskCompareCreateOnlyInput:
443+
model: alias
444+
docs: Represents COMPARE mapping task fields that are valid while creating a task
445+
type:
446+
type: object
447+
fields:
406448
groupId:
407449
type: string
408450
taskId:
409-
type: string # NOTE: int for street
410-
# For find, completeness, compare
411-
# taskX:
412-
# type: int # NOTE: this was string previously
413-
# optional: true
414-
# taskY:
415-
# type: int # NOTE: this was string previously
416-
# optional: true
417-
# url:
418-
# type: string
419-
# optional: true
420-
# # For compare
421-
# urlB:
422-
# type: string
423-
# optional: true
451+
type: string
452+
taskX:
453+
type: int
454+
optional: true
455+
taskY:
456+
type: int
457+
optional: true
458+
url:
459+
type: string
460+
optional: true
461+
urlB:
462+
type: string
463+
optional: true
424464

425465
FbMappingResult:
426466
model: alias
@@ -470,7 +510,7 @@ FbUserGroup:
470510
type: string
471511
name:
472512
type: string
473-
# NOTE: We can remove this
513+
# NOTE: We can remove this @deprecated
474514
nameKey:
475515
type: string
476516
users:
@@ -517,12 +557,12 @@ FbUser:
517557
type: timestamp
518558
userName:
519559
type: string
520-
# NOTE: We can remove this
560+
# NOTE: We can remove this @deprecated
521561
userNameKey:
522562
type: string
523563
username:
524564
type: string
525-
# NOTE: We can remove this
565+
# NOTE: We can remove this @deprecated
526566
usernameKey:
527567
type: string
528568
accessibility:

0 commit comments

Comments
 (0)