@budibase/server 1.0.81 → 1.0.84-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/builder/assets/{index.f89561ac.js → index.0297e6da.js} +140 -139
  2. package/builder/assets/{index.dd19c61c.css → index.7c8961b4.css} +2 -2
  3. package/builder/index.html +2 -2
  4. package/coverage/clover.xml +10 -5
  5. package/coverage/coverage-final.json +2 -2
  6. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  7. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/index.html +1 -1
  17. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/index.js.html +1 -1
  24. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/row/external.js.html +5 -5
  28. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  39. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  45. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  46. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  47. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  48. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  49. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  50. package/coverage/lcov-report/api/index.html +1 -1
  51. package/coverage/lcov-report/api/index.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/index.html +1 -1
  64. package/coverage/lcov-report/api/routes/index.js.html +1 -1
  65. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/utils/index.html +1 -1
  81. package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
  82. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  83. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  84. package/coverage/lcov-report/automations/actions.js.html +1 -1
  85. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  86. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  87. package/coverage/lcov-report/automations/index.html +1 -1
  88. package/coverage/lcov-report/automations/index.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/index.html +1 -1
  98. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  100. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  101. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  102. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  103. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  104. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  105. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  106. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  109. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  110. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  111. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  112. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  113. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  114. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  115. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  116. package/coverage/lcov-report/automations/utils.js.html +1 -1
  117. package/coverage/lcov-report/constants/index.html +1 -1
  118. package/coverage/lcov-report/constants/index.js.html +1 -1
  119. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  120. package/coverage/lcov-report/constants/screens.js.html +1 -1
  121. package/coverage/lcov-report/db/client.js.html +1 -1
  122. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  123. package/coverage/lcov-report/db/index.html +1 -1
  124. package/coverage/lcov-report/db/index.js.html +1 -1
  125. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  126. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  127. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  128. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  129. package/coverage/lcov-report/db/newid.js.html +1 -1
  130. package/coverage/lcov-report/db/utils.js.html +1 -1
  131. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  132. package/coverage/lcov-report/events/index.html +1 -1
  133. package/coverage/lcov-report/events/index.js.html +1 -1
  134. package/coverage/lcov-report/events/utils.js.html +1 -1
  135. package/coverage/lcov-report/index.html +18 -18
  136. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  137. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  138. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  139. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  140. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  141. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  142. package/coverage/lcov-report/middleware/index.html +1 -1
  143. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  144. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  145. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  146. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  147. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  148. package/coverage/lcov-report/threads/automation.js.html +1 -1
  149. package/coverage/lcov-report/threads/index.html +1 -1
  150. package/coverage/lcov-report/threads/index.js.html +1 -1
  151. package/coverage/lcov-report/threads/query.js.html +1 -1
  152. package/coverage/lcov-report/threads/utils.js.html +1 -1
  153. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  154. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  155. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  156. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  157. package/coverage/lcov-report/utilities/global.js.html +1 -1
  158. package/coverage/lcov-report/utilities/index.html +18 -18
  159. package/coverage/lcov-report/utilities/index.js.html +34 -10
  160. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  161. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  162. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  163. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  164. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  165. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  166. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  167. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  168. package/coverage/lcov-report/utilities/security.js.html +1 -1
  169. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  170. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  171. package/coverage/lcov-report/utilities/usageQuota/index.js.html +1 -1
  172. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  173. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  174. package/coverage/lcov-report/utilities/users.js.html +1 -1
  175. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  176. package/coverage/lcov.info +17 -6
  177. package/dist/api/controllers/public/rows.js +2 -1
  178. package/dist/api/controllers/row/external.js +4 -4
  179. package/dist/api/routes/public/applications.js +1 -10
  180. package/dist/api/routes/public/queries.js +1 -8
  181. package/dist/api/routes/public/tables.js +1 -8
  182. package/dist/api/routes/public/users.js +1 -8
  183. package/dist/package.json +4 -4
  184. package/dist/tsconfig.tsbuildinfo +1 -1
  185. package/dist/utilities/index.js +7 -0
  186. package/package.json +5 -5
  187. package/scripts/docs/toSwagger.js +1 -1
  188. package/specs/openapi.json +430 -55
  189. package/specs/openapi.yaml +337 -35
  190. package/specs/resources/application.js +7 -1
  191. package/specs/resources/query.js +6 -0
  192. package/specs/resources/table.js +6 -0
  193. package/specs/resources/user.js +6 -0
  194. package/src/api/controllers/public/rows.ts +2 -1
  195. package/src/api/controllers/row/external.js +4 -4
  196. package/src/api/routes/public/applications.ts +1 -10
  197. package/src/api/routes/public/queries.ts +1 -8
  198. package/src/api/routes/public/tables.ts +1 -8
  199. package/src/api/routes/public/users.ts +1 -8
  200. package/src/definitions/openapi.ts +591 -415
  201. package/src/utilities/index.js +8 -0
@@ -309,7 +309,6 @@ components:
309
309
  type: string
310
310
  required:
311
311
  - name
312
- - url
313
312
  applicationOutput:
314
313
  type: object
315
314
  properties:
@@ -360,6 +359,58 @@ components:
360
359
  - version
361
360
  required:
362
361
  - data
362
+ applicationSearch:
363
+ type: object
364
+ properties:
365
+ data:
366
+ type: array
367
+ items:
368
+ type: object
369
+ properties:
370
+ name:
371
+ description: The name of the app.
372
+ type: string
373
+ url:
374
+ description: The URL by which the app is accessed, this must be URL encoded.
375
+ type: string
376
+ _id:
377
+ description: The ID of the app.
378
+ type: string
379
+ status:
380
+ description: The status of the app, stating it if is the development or
381
+ published version.
382
+ type: string
383
+ enum:
384
+ - development
385
+ - published
386
+ createdAt:
387
+ description: States when the app was created, will be constant. Stored in ISO
388
+ format.
389
+ type: string
390
+ updatedAt:
391
+ description: States the last time the app was updated - stored in ISO format.
392
+ type: string
393
+ version:
394
+ description: States the version of the Budibase client this app is currently
395
+ based on.
396
+ type: string
397
+ tenantId:
398
+ description: In a multi-tenant environment this will state the tenant this app
399
+ is within.
400
+ type: string
401
+ lockedBy:
402
+ description: The user this app is currently being built by.
403
+ type: object
404
+ required:
405
+ - _id
406
+ - name
407
+ - url
408
+ - status
409
+ - createdAt
410
+ - updatedAt
411
+ - version
412
+ required:
413
+ - data
363
414
  row:
364
415
  description: The row to be created/updated, based on the table schema.
365
416
  type: object
@@ -730,6 +781,175 @@ components:
730
781
  type: string
731
782
  required:
732
783
  - data
784
+ tableSearch:
785
+ type: object
786
+ properties:
787
+ data:
788
+ type: array
789
+ items:
790
+ description: The table to be created/updated.
791
+ type: object
792
+ required:
793
+ - name
794
+ - schema
795
+ - _id
796
+ properties:
797
+ name:
798
+ description: The name of the table.
799
+ type: string
800
+ primaryDisplay:
801
+ type: string
802
+ description: The name of the column which should be used in relationship tags
803
+ when relating to this table.
804
+ schema:
805
+ type: object
806
+ additionalProperties:
807
+ oneOf:
808
+ - type: object
809
+ properties:
810
+ type:
811
+ type: string
812
+ enum:
813
+ - link
814
+ description: A relationship column.
815
+ constraints:
816
+ type: object
817
+ description: A constraint can be applied to the column which will be validated
818
+ against when a row is saved.
819
+ properties:
820
+ type:
821
+ type: string
822
+ enum:
823
+ - string
824
+ - number
825
+ - object
826
+ - boolean
827
+ presence:
828
+ type: boolean
829
+ description: Defines whether the column is required or not.
830
+ name:
831
+ type: string
832
+ description: The name of the column.
833
+ autocolumn:
834
+ type: boolean
835
+ description: Defines whether the column is automatically generated.
836
+ fieldName:
837
+ type: string
838
+ description: The name of the column which a relationship column is related to in
839
+ another table.
840
+ tableId:
841
+ type: string
842
+ description: The ID of the table which a relationship column is related to.
843
+ relationshipType:
844
+ type: string
845
+ enum:
846
+ - one-to-many
847
+ - many-to-one
848
+ - many-to-many
849
+ description: Defines the type of relationship that this column will be used for.
850
+ through:
851
+ type: string
852
+ description: When using a SQL table that contains many to many relationships
853
+ this defines the table the relationships are linked
854
+ through.
855
+ foreignKey:
856
+ type: string
857
+ description: When using a SQL table that contains a one to many relationship
858
+ this defines the foreign key.
859
+ throughFrom:
860
+ type: string
861
+ description: When using a SQL table that utilises a through table, this defines
862
+ the primary key in the through table for this table.
863
+ throughTo:
864
+ type: string
865
+ description: When using a SQL table that utilises a through table, this defines
866
+ the primary key in the through table for the related
867
+ table.
868
+ - type: object
869
+ properties:
870
+ type:
871
+ type: string
872
+ enum:
873
+ - formula
874
+ description: A formula column.
875
+ constraints:
876
+ type: object
877
+ description: A constraint can be applied to the column which will be validated
878
+ against when a row is saved.
879
+ properties:
880
+ type:
881
+ type: string
882
+ enum:
883
+ - string
884
+ - number
885
+ - object
886
+ - boolean
887
+ presence:
888
+ type: boolean
889
+ description: Defines whether the column is required or not.
890
+ name:
891
+ type: string
892
+ description: The name of the column.
893
+ autocolumn:
894
+ type: boolean
895
+ description: Defines whether the column is automatically generated.
896
+ formula:
897
+ type: string
898
+ description: Defines a Handlebars or JavaScript formula to use, note that
899
+ Javascript formulas are expected to be provided in
900
+ the base64 format.
901
+ formulaType:
902
+ type: string
903
+ enum:
904
+ - static
905
+ - dynamic
906
+ description: Defines whether this is a static or dynamic formula.
907
+ - type: object
908
+ properties:
909
+ type:
910
+ type: string
911
+ enum:
912
+ - string
913
+ - longform
914
+ - options
915
+ - number
916
+ - boolean
917
+ - array
918
+ - datetime
919
+ - attachment
920
+ - link
921
+ - formula
922
+ - auto
923
+ - json
924
+ - internal
925
+ description: Defines the type of the column, most explain themselves, a link
926
+ column is a relationship.
927
+ constraints:
928
+ type: object
929
+ description: A constraint can be applied to the column which will be validated
930
+ against when a row is saved.
931
+ properties:
932
+ type:
933
+ type: string
934
+ enum:
935
+ - string
936
+ - number
937
+ - object
938
+ - boolean
939
+ presence:
940
+ type: boolean
941
+ description: Defines whether the column is required or not.
942
+ name:
943
+ type: string
944
+ description: The name of the column.
945
+ autocolumn:
946
+ type: boolean
947
+ description: Defines whether the column is automatically generated.
948
+ _id:
949
+ description: The ID of the table.
950
+ type: string
951
+ required:
952
+ - data
733
953
  executeQuery:
734
954
  description: The query body must contain the required parameters for the query,
735
955
  this depends on query type, setup and bindings.
@@ -803,6 +1023,55 @@ components:
803
1023
  - name
804
1024
  - schema
805
1025
  - _id
1026
+ querySearch:
1027
+ type: object
1028
+ properties:
1029
+ data:
1030
+ type: array
1031
+ items:
1032
+ type: object
1033
+ properties:
1034
+ _id:
1035
+ description: The ID of the query.
1036
+ type: string
1037
+ datasourceId:
1038
+ description: The ID of the data source the query belongs to.
1039
+ type: string
1040
+ parameters:
1041
+ description: The bindings which are required to perform this query.
1042
+ type: array
1043
+ items:
1044
+ type: string
1045
+ fields:
1046
+ description: The fields that are used to perform this query, e.g. the sql
1047
+ statement
1048
+ type: object
1049
+ queryVerb:
1050
+ description: The verb that describes this query.
1051
+ enum:
1052
+ - create
1053
+ - read
1054
+ - update
1055
+ - delete
1056
+ name:
1057
+ description: The name of the query.
1058
+ type: string
1059
+ schema:
1060
+ description: The schema of the data returned when the query is executed.
1061
+ type: object
1062
+ transformer:
1063
+ description: The JavaScript transformer function, applied after the query
1064
+ responds with data.
1065
+ type: string
1066
+ readable:
1067
+ description: Whether the query has readable data.
1068
+ type: boolean
1069
+ required:
1070
+ - name
1071
+ - schema
1072
+ - _id
1073
+ required:
1074
+ - data
806
1075
  user:
807
1076
  type: object
808
1077
  properties:
@@ -916,6 +1185,69 @@ components:
916
1185
  - _id
917
1186
  required:
918
1187
  - data
1188
+ userSearch:
1189
+ type: object
1190
+ properties:
1191
+ data:
1192
+ type: array
1193
+ items:
1194
+ type: object
1195
+ properties:
1196
+ email:
1197
+ description: The email address of the user, this must be unique.
1198
+ type: string
1199
+ password:
1200
+ description: The password of the user if using password based login - this will
1201
+ never be returned. This can be left out of subsequent requests
1202
+ (updates) and will be enriched back into the user structure.
1203
+ type: string
1204
+ status:
1205
+ description: The status of the user, if they are active.
1206
+ type: string
1207
+ enum:
1208
+ - active
1209
+ firstName:
1210
+ description: The first name of the user
1211
+ type: string
1212
+ lastName:
1213
+ description: The last name of the user
1214
+ type: string
1215
+ forceResetPassword:
1216
+ description: If set to true forces the user to reset their password on first
1217
+ login.
1218
+ type: boolean
1219
+ builder:
1220
+ description: Describes if the user is a builder user or not.
1221
+ type: object
1222
+ properties:
1223
+ global:
1224
+ description: If set to true the user will be able to build any app in the
1225
+ system.
1226
+ type: boolean
1227
+ admin:
1228
+ description: Describes if the user is an admin user or not.
1229
+ type: object
1230
+ properties:
1231
+ global:
1232
+ description: If set to true the user will be able to administrate the system.
1233
+ type: boolean
1234
+ roles:
1235
+ description: Contains the roles of the user per app (assuming they are not a
1236
+ builder user).
1237
+ type: object
1238
+ additionalProperties:
1239
+ type: string
1240
+ description: A map of app ID (production app ID, minus the _dev component) to a
1241
+ role ID, e.g. ADMIN.
1242
+ _id:
1243
+ description: The ID of the user.
1244
+ type: string
1245
+ required:
1246
+ - email
1247
+ - roles
1248
+ - _id
1249
+ required:
1250
+ - data
919
1251
  nameSearch:
920
1252
  type: object
921
1253
  properties:
@@ -1013,8 +1345,6 @@ paths:
1013
1345
  applications.
1014
1346
  tags:
1015
1347
  - applications
1016
- parameters:
1017
- - $ref: "#/components/parameters/appId"
1018
1348
  requestBody:
1019
1349
  required: true
1020
1350
  content:
@@ -1028,14 +1358,7 @@ paths:
1028
1358
  content:
1029
1359
  application/json:
1030
1360
  schema:
1031
- type: object
1032
- required:
1033
- - data
1034
- properties:
1035
- data:
1036
- type: array
1037
- items:
1038
- $ref: "#/components/schemas/application"
1361
+ $ref: "#/components/schemas/applicationSearch"
1039
1362
  examples:
1040
1363
  applications:
1041
1364
  $ref: "#/components/examples/applications"
@@ -1087,14 +1410,7 @@ paths:
1087
1410
  content:
1088
1411
  application/json:
1089
1412
  schema:
1090
- type: object
1091
- required:
1092
- - data
1093
- properties:
1094
- data:
1095
- type: array
1096
- items:
1097
- $ref: "#/components/schemas/query"
1413
+ $ref: "#/components/schemas/querySearch"
1098
1414
  examples:
1099
1415
  queries:
1100
1416
  $ref: "#/components/examples/queries"
@@ -1419,14 +1735,7 @@ paths:
1419
1735
  content:
1420
1736
  application/json:
1421
1737
  schema:
1422
- type: object
1423
- required:
1424
- - data
1425
- properties:
1426
- data:
1427
- type: array
1428
- items:
1429
- $ref: "#/components/schemas/table"
1738
+ $ref: "#/components/schemas/tableSearch"
1430
1739
  examples:
1431
1740
  tables:
1432
1741
  $ref: "#/components/examples/tables"
@@ -1524,14 +1833,7 @@ paths:
1524
1833
  content:
1525
1834
  application/json:
1526
1835
  schema:
1527
- type: object
1528
- required:
1529
- - data
1530
- properties:
1531
- data:
1532
- type: array
1533
- items:
1534
- $ref: "#/components/schemas/user"
1836
+ $ref: "#/components/schemas/userSearch"
1535
1837
  examples:
1536
1838
  users:
1537
1839
  $ref: "#/components/examples/users"
@@ -27,7 +27,7 @@ const base = {
27
27
  },
28
28
  }
29
29
 
30
- const applicationSchema = object(base, { required: ["name", "url"] })
30
+ const applicationSchema = object(base, { required: ["name"] })
31
31
 
32
32
  const applicationOutputSchema = object(
33
33
  {
@@ -98,4 +98,10 @@ module.exports = new Resource()
98
98
  applicationOutput: object({
99
99
  data: applicationOutputSchema,
100
100
  }),
101
+ applicationSearch: object({
102
+ data: {
103
+ type: "array",
104
+ items: applicationOutputSchema,
105
+ },
106
+ }),
101
107
  })
@@ -186,4 +186,10 @@ module.exports = new Resource()
186
186
  executeQuery: executeQuerySchema,
187
187
  executeQueryOutput: executeQueryOutputSchema,
188
188
  query: querySchema,
189
+ querySearch: object({
190
+ data: {
191
+ type: "array",
192
+ items: querySchema,
193
+ },
194
+ }),
189
195
  })
@@ -188,4 +188,10 @@ module.exports = new Resource()
188
188
  tableOutput: object({
189
189
  data: tableOutputSchema,
190
190
  }),
191
+ tableSearch: object({
192
+ data: {
193
+ type: "array",
194
+ items: tableOutputSchema,
195
+ },
196
+ }),
191
197
  })
@@ -123,4 +123,10 @@ module.exports = new Resource()
123
123
  userOutput: object({
124
124
  data: userOutputSchema,
125
125
  }),
126
+ userSearch: object({
127
+ data: {
128
+ type: "array",
129
+ items: userOutputSchema,
130
+ },
131
+ }),
126
132
  })
@@ -1,6 +1,7 @@
1
1
  import { default as rowController } from "../row"
2
2
  import { addRev } from "./utils"
3
3
  import { Row } from "../../../definitions/common"
4
+ import { convertBookmark } from "../../../utilities"
4
5
 
5
6
  // makes sure that the user doesn't need to pass in the type, tableId or _id params for
6
7
  // the call to be correct
@@ -30,7 +31,7 @@ export async function search(ctx: any, next: any) {
30
31
  sort: sort.column,
31
32
  sortType: sort.type,
32
33
  sortOrder: sort.order,
33
- bookmark,
34
+ bookmark: convertBookmark(bookmark),
34
35
  paginate,
35
36
  limit,
36
37
  query,
@@ -33,11 +33,11 @@ exports.handleRequest = handleRequest
33
33
  exports.patch = async ctx => {
34
34
  const inputs = ctx.request.body
35
35
  const tableId = ctx.params.tableId
36
- const id = breakRowIdField(inputs._id)
36
+ const id = inputs._id
37
37
  // don't save the ID to db
38
38
  delete inputs._id
39
39
  return handleRequest(DataSourceOperation.UPDATE, tableId, {
40
- id,
40
+ id: breakRowIdField(id),
41
41
  row: inputs,
42
42
  })
43
43
  }
@@ -67,7 +67,7 @@ exports.find = async ctx => {
67
67
  const id = ctx.params.rowId
68
68
  const tableId = ctx.params.tableId
69
69
  const response = await handleRequest(DataSourceOperation.READ, tableId, {
70
- id,
70
+ id: breakRowIdField(id),
71
71
  })
72
72
  return response ? response[0] : response
73
73
  }
@@ -76,7 +76,7 @@ exports.destroy = async ctx => {
76
76
  const tableId = ctx.params.tableId
77
77
  const id = ctx.request.body._id
78
78
  const { row } = await handleRequest(DataSourceOperation.DELETE, tableId, {
79
- id,
79
+ id: breakRowIdField(id),
80
80
  })
81
81
  return { response: { ok: true }, row }
82
82
  }
@@ -121,8 +121,6 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
121
121
  * description: Based on application properties (currently only name) search for applications.
122
122
  * tags:
123
123
  * - applications
124
- * parameters:
125
- * - $ref: '#/components/parameters/appId'
126
124
  * requestBody:
127
125
  * required: true
128
126
  * content:
@@ -135,14 +133,7 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
135
133
  * content:
136
134
  * application/json:
137
135
  * schema:
138
- * type: object
139
- * required:
140
- * - data
141
- * properties:
142
- * data:
143
- * type: array
144
- * items:
145
- * $ref: '#/components/schemas/application'
136
+ * $ref: '#/components/schemas/applicationSearch'
146
137
  * examples:
147
138
  * applications:
148
139
  * $ref: '#/components/examples/applications'
@@ -60,14 +60,7 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute))
60
60
  * content:
61
61
  * application/json:
62
62
  * schema:
63
- * type: object
64
- * required:
65
- * - data
66
- * properties:
67
- * data:
68
- * type: array
69
- * items:
70
- * $ref: '#/components/schemas/query'
63
+ * $ref: '#/components/schemas/querySearch'
71
64
  * examples:
72
65
  * queries:
73
66
  * $ref: '#/components/examples/queries'
@@ -148,14 +148,7 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read))
148
148
  * content:
149
149
  * application/json:
150
150
  * schema:
151
- * type: object
152
- * required:
153
- * - data
154
- * properties:
155
- * data:
156
- * type: array
157
- * items:
158
- * $ref: '#/components/schemas/table'
151
+ * $ref: '#/components/schemas/tableSearch'
159
152
  * examples:
160
153
  * tables:
161
154
  * $ref: '#/components/examples/tables'
@@ -123,14 +123,7 @@ read.push(new Endpoint("get", "/users/:userId", controller.read))
123
123
  * content:
124
124
  * application/json:
125
125
  * schema:
126
- * type: object
127
- * required:
128
- * - data
129
- * properties:
130
- * data:
131
- * type: array
132
- * items:
133
- * $ref: '#/components/schemas/user'
126
+ * $ref: '#/components/schemas/userSearch'
134
127
  * examples:
135
128
  * users:
136
129
  * $ref: '#/components/examples/users'