@budibase/server 1.0.81 → 1.0.82

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.5d245850.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 -8
  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 +429 -48
  189. package/specs/openapi.yaml +337 -32
  190. package/specs/resources/application.js +6 -0
  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 -8
  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 +194 -12
  201. package/src/utilities/index.js +8 -0
@@ -360,6 +360,58 @@ components:
360
360
  - version
361
361
  required:
362
362
  - data
363
+ applicationSearch:
364
+ type: object
365
+ properties:
366
+ data:
367
+ type: array
368
+ items:
369
+ type: object
370
+ properties:
371
+ name:
372
+ description: The name of the app.
373
+ type: string
374
+ url:
375
+ description: The URL by which the app is accessed, this must be URL encoded.
376
+ type: string
377
+ _id:
378
+ description: The ID of the app.
379
+ type: string
380
+ status:
381
+ description: The status of the app, stating it if is the development or
382
+ published version.
383
+ type: string
384
+ enum:
385
+ - development
386
+ - published
387
+ createdAt:
388
+ description: States when the app was created, will be constant. Stored in ISO
389
+ format.
390
+ type: string
391
+ updatedAt:
392
+ description: States the last time the app was updated - stored in ISO format.
393
+ type: string
394
+ version:
395
+ description: States the version of the Budibase client this app is currently
396
+ based on.
397
+ type: string
398
+ tenantId:
399
+ description: In a multi-tenant environment this will state the tenant this app
400
+ is within.
401
+ type: string
402
+ lockedBy:
403
+ description: The user this app is currently being built by.
404
+ type: object
405
+ required:
406
+ - _id
407
+ - name
408
+ - url
409
+ - status
410
+ - createdAt
411
+ - updatedAt
412
+ - version
413
+ required:
414
+ - data
363
415
  row:
364
416
  description: The row to be created/updated, based on the table schema.
365
417
  type: object
@@ -730,6 +782,175 @@ components:
730
782
  type: string
731
783
  required:
732
784
  - data
785
+ tableSearch:
786
+ type: object
787
+ properties:
788
+ data:
789
+ type: array
790
+ items:
791
+ description: The table to be created/updated.
792
+ type: object
793
+ required:
794
+ - name
795
+ - schema
796
+ - _id
797
+ properties:
798
+ name:
799
+ description: The name of the table.
800
+ type: string
801
+ primaryDisplay:
802
+ type: string
803
+ description: The name of the column which should be used in relationship tags
804
+ when relating to this table.
805
+ schema:
806
+ type: object
807
+ additionalProperties:
808
+ oneOf:
809
+ - type: object
810
+ properties:
811
+ type:
812
+ type: string
813
+ enum:
814
+ - link
815
+ description: A relationship column.
816
+ constraints:
817
+ type: object
818
+ description: A constraint can be applied to the column which will be validated
819
+ against when a row is saved.
820
+ properties:
821
+ type:
822
+ type: string
823
+ enum:
824
+ - string
825
+ - number
826
+ - object
827
+ - boolean
828
+ presence:
829
+ type: boolean
830
+ description: Defines whether the column is required or not.
831
+ name:
832
+ type: string
833
+ description: The name of the column.
834
+ autocolumn:
835
+ type: boolean
836
+ description: Defines whether the column is automatically generated.
837
+ fieldName:
838
+ type: string
839
+ description: The name of the column which a relationship column is related to in
840
+ another table.
841
+ tableId:
842
+ type: string
843
+ description: The ID of the table which a relationship column is related to.
844
+ relationshipType:
845
+ type: string
846
+ enum:
847
+ - one-to-many
848
+ - many-to-one
849
+ - many-to-many
850
+ description: Defines the type of relationship that this column will be used for.
851
+ through:
852
+ type: string
853
+ description: When using a SQL table that contains many to many relationships
854
+ this defines the table the relationships are linked
855
+ through.
856
+ foreignKey:
857
+ type: string
858
+ description: When using a SQL table that contains a one to many relationship
859
+ this defines the foreign key.
860
+ throughFrom:
861
+ type: string
862
+ description: When using a SQL table that utilises a through table, this defines
863
+ the primary key in the through table for this table.
864
+ throughTo:
865
+ type: string
866
+ description: When using a SQL table that utilises a through table, this defines
867
+ the primary key in the through table for the related
868
+ table.
869
+ - type: object
870
+ properties:
871
+ type:
872
+ type: string
873
+ enum:
874
+ - formula
875
+ description: A formula column.
876
+ constraints:
877
+ type: object
878
+ description: A constraint can be applied to the column which will be validated
879
+ against when a row is saved.
880
+ properties:
881
+ type:
882
+ type: string
883
+ enum:
884
+ - string
885
+ - number
886
+ - object
887
+ - boolean
888
+ presence:
889
+ type: boolean
890
+ description: Defines whether the column is required or not.
891
+ name:
892
+ type: string
893
+ description: The name of the column.
894
+ autocolumn:
895
+ type: boolean
896
+ description: Defines whether the column is automatically generated.
897
+ formula:
898
+ type: string
899
+ description: Defines a Handlebars or JavaScript formula to use, note that
900
+ Javascript formulas are expected to be provided in
901
+ the base64 format.
902
+ formulaType:
903
+ type: string
904
+ enum:
905
+ - static
906
+ - dynamic
907
+ description: Defines whether this is a static or dynamic formula.
908
+ - type: object
909
+ properties:
910
+ type:
911
+ type: string
912
+ enum:
913
+ - string
914
+ - longform
915
+ - options
916
+ - number
917
+ - boolean
918
+ - array
919
+ - datetime
920
+ - attachment
921
+ - link
922
+ - formula
923
+ - auto
924
+ - json
925
+ - internal
926
+ description: Defines the type of the column, most explain themselves, a link
927
+ column is a relationship.
928
+ constraints:
929
+ type: object
930
+ description: A constraint can be applied to the column which will be validated
931
+ against when a row is saved.
932
+ properties:
933
+ type:
934
+ type: string
935
+ enum:
936
+ - string
937
+ - number
938
+ - object
939
+ - boolean
940
+ presence:
941
+ type: boolean
942
+ description: Defines whether the column is required or not.
943
+ name:
944
+ type: string
945
+ description: The name of the column.
946
+ autocolumn:
947
+ type: boolean
948
+ description: Defines whether the column is automatically generated.
949
+ _id:
950
+ description: The ID of the table.
951
+ type: string
952
+ required:
953
+ - data
733
954
  executeQuery:
734
955
  description: The query body must contain the required parameters for the query,
735
956
  this depends on query type, setup and bindings.
@@ -803,6 +1024,55 @@ components:
803
1024
  - name
804
1025
  - schema
805
1026
  - _id
1027
+ querySearch:
1028
+ type: object
1029
+ properties:
1030
+ data:
1031
+ type: array
1032
+ items:
1033
+ type: object
1034
+ properties:
1035
+ _id:
1036
+ description: The ID of the query.
1037
+ type: string
1038
+ datasourceId:
1039
+ description: The ID of the data source the query belongs to.
1040
+ type: string
1041
+ parameters:
1042
+ description: The bindings which are required to perform this query.
1043
+ type: array
1044
+ items:
1045
+ type: string
1046
+ fields:
1047
+ description: The fields that are used to perform this query, e.g. the sql
1048
+ statement
1049
+ type: object
1050
+ queryVerb:
1051
+ description: The verb that describes this query.
1052
+ enum:
1053
+ - create
1054
+ - read
1055
+ - update
1056
+ - delete
1057
+ name:
1058
+ description: The name of the query.
1059
+ type: string
1060
+ schema:
1061
+ description: The schema of the data returned when the query is executed.
1062
+ type: object
1063
+ transformer:
1064
+ description: The JavaScript transformer function, applied after the query
1065
+ responds with data.
1066
+ type: string
1067
+ readable:
1068
+ description: Whether the query has readable data.
1069
+ type: boolean
1070
+ required:
1071
+ - name
1072
+ - schema
1073
+ - _id
1074
+ required:
1075
+ - data
806
1076
  user:
807
1077
  type: object
808
1078
  properties:
@@ -916,6 +1186,69 @@ components:
916
1186
  - _id
917
1187
  required:
918
1188
  - data
1189
+ userSearch:
1190
+ type: object
1191
+ properties:
1192
+ data:
1193
+ type: array
1194
+ items:
1195
+ type: object
1196
+ properties:
1197
+ email:
1198
+ description: The email address of the user, this must be unique.
1199
+ type: string
1200
+ password:
1201
+ description: The password of the user if using password based login - this will
1202
+ never be returned. This can be left out of subsequent requests
1203
+ (updates) and will be enriched back into the user structure.
1204
+ type: string
1205
+ status:
1206
+ description: The status of the user, if they are active.
1207
+ type: string
1208
+ enum:
1209
+ - active
1210
+ firstName:
1211
+ description: The first name of the user
1212
+ type: string
1213
+ lastName:
1214
+ description: The last name of the user
1215
+ type: string
1216
+ forceResetPassword:
1217
+ description: If set to true forces the user to reset their password on first
1218
+ login.
1219
+ type: boolean
1220
+ builder:
1221
+ description: Describes if the user is a builder user or not.
1222
+ type: object
1223
+ properties:
1224
+ global:
1225
+ description: If set to true the user will be able to build any app in the
1226
+ system.
1227
+ type: boolean
1228
+ admin:
1229
+ description: Describes if the user is an admin user or not.
1230
+ type: object
1231
+ properties:
1232
+ global:
1233
+ description: If set to true the user will be able to administrate the system.
1234
+ type: boolean
1235
+ roles:
1236
+ description: Contains the roles of the user per app (assuming they are not a
1237
+ builder user).
1238
+ type: object
1239
+ additionalProperties:
1240
+ type: string
1241
+ description: A map of app ID (production app ID, minus the _dev component) to a
1242
+ role ID, e.g. ADMIN.
1243
+ _id:
1244
+ description: The ID of the user.
1245
+ type: string
1246
+ required:
1247
+ - email
1248
+ - roles
1249
+ - _id
1250
+ required:
1251
+ - data
919
1252
  nameSearch:
920
1253
  type: object
921
1254
  properties:
@@ -1028,14 +1361,7 @@ paths:
1028
1361
  content:
1029
1362
  application/json:
1030
1363
  schema:
1031
- type: object
1032
- required:
1033
- - data
1034
- properties:
1035
- data:
1036
- type: array
1037
- items:
1038
- $ref: "#/components/schemas/application"
1364
+ $ref: "#/components/schemas/applicationSearch"
1039
1365
  examples:
1040
1366
  applications:
1041
1367
  $ref: "#/components/examples/applications"
@@ -1087,14 +1413,7 @@ paths:
1087
1413
  content:
1088
1414
  application/json:
1089
1415
  schema:
1090
- type: object
1091
- required:
1092
- - data
1093
- properties:
1094
- data:
1095
- type: array
1096
- items:
1097
- $ref: "#/components/schemas/query"
1416
+ $ref: "#/components/schemas/querySearch"
1098
1417
  examples:
1099
1418
  queries:
1100
1419
  $ref: "#/components/examples/queries"
@@ -1419,14 +1738,7 @@ paths:
1419
1738
  content:
1420
1739
  application/json:
1421
1740
  schema:
1422
- type: object
1423
- required:
1424
- - data
1425
- properties:
1426
- data:
1427
- type: array
1428
- items:
1429
- $ref: "#/components/schemas/table"
1741
+ $ref: "#/components/schemas/tableSearch"
1430
1742
  examples:
1431
1743
  tables:
1432
1744
  $ref: "#/components/examples/tables"
@@ -1524,14 +1836,7 @@ paths:
1524
1836
  content:
1525
1837
  application/json:
1526
1838
  schema:
1527
- type: object
1528
- required:
1529
- - data
1530
- properties:
1531
- data:
1532
- type: array
1533
- items:
1534
- $ref: "#/components/schemas/user"
1839
+ $ref: "#/components/schemas/userSearch"
1535
1840
  examples:
1536
1841
  users:
1537
1842
  $ref: "#/components/examples/users"
@@ -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
  }
@@ -135,14 +135,7 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
135
135
  * content:
136
136
  * application/json:
137
137
  * schema:
138
- * type: object
139
- * required:
140
- * - data
141
- * properties:
142
- * data:
143
- * type: array
144
- * items:
145
- * $ref: '#/components/schemas/application'
138
+ * $ref: '#/components/schemas/applicationSearch'
146
139
  * examples:
147
140
  * applications:
148
141
  * $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'