@budibase/server 1.0.8 → 1.0.9-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 (207) hide show
  1. package/builder/assets/{index.4fb3f887.css → index.9337c392.css} +1 -1
  2. package/builder/assets/{index.6e1bf75f.js → index.eb5b7e70.js} +164 -164
  3. package/builder/assets/{vendor.470042a4.js → vendor.a9288856.js} +1 -1
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +191 -162
  6. package/coverage/coverage-final.json +8 -7
  7. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/component.js.html +1 -1
  15. package/coverage/lcov-report/api/controllers/datasource.js.html +14 -14
  16. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/hosting.js.html +1 -1
  18. package/coverage/lcov-report/api/controllers/index.html +9 -24
  19. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/index.html +126 -0
  24. package/coverage/lcov-report/api/controllers/{query.js.html → query/index.js.html} +150 -24
  25. package/coverage/lcov-report/api/controllers/query/validation.js.html +200 -0
  26. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/row/internalSearch.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/external.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  38. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
  40. package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/user.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  45. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  46. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  47. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  48. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  49. package/coverage/lcov-report/api/index.html +1 -1
  50. package/coverage/lcov-report/api/index.js.html +1 -1
  51. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  52. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/hosting.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/index.html +9 -9
  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/permission.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/query.js.html +11 -98
  70. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  81. package/coverage/lcov-report/automations/actions.js.html +1 -1
  82. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  83. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  84. package/coverage/lcov-report/automations/index.html +1 -1
  85. package/coverage/lcov-report/automations/index.js.html +1 -1
  86. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  87. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/index.html +1 -1
  95. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  97. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  98. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  100. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  101. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  102. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  103. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  104. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  105. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  109. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  110. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  111. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  112. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  113. package/coverage/lcov-report/automations/utils.js.html +1 -1
  114. package/coverage/lcov-report/constants/index.html +1 -1
  115. package/coverage/lcov-report/constants/index.js.html +1 -1
  116. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  117. package/coverage/lcov-report/constants/screens.js.html +1 -1
  118. package/coverage/lcov-report/db/client.js.html +1 -1
  119. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  120. package/coverage/lcov-report/db/index.html +1 -1
  121. package/coverage/lcov-report/db/index.js.html +1 -1
  122. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  123. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  124. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  125. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  126. package/coverage/lcov-report/db/newid.js.html +4 -4
  127. package/coverage/lcov-report/db/utils.js.html +58 -58
  128. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  129. package/coverage/lcov-report/events/index.html +1 -1
  130. package/coverage/lcov-report/events/index.js.html +1 -1
  131. package/coverage/lcov-report/events/utils.js.html +1 -1
  132. package/coverage/lcov-report/index.html +40 -25
  133. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  134. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  135. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  136. package/coverage/lcov-report/middleware/authorized.js.html +2 -2
  137. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  138. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  139. package/coverage/lcov-report/middleware/index.html +1 -1
  140. package/coverage/lcov-report/middleware/joi-validator.js.html +3 -3
  141. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  142. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  143. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  144. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  145. package/coverage/lcov-report/threads/automation.js.html +1 -1
  146. package/coverage/lcov-report/threads/index.html +1 -1
  147. package/coverage/lcov-report/threads/index.js.html +1 -1
  148. package/coverage/lcov-report/threads/query.js.html +1 -1
  149. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  150. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  151. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  152. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  153. package/coverage/lcov-report/utilities/global.js.html +1 -1
  154. package/coverage/lcov-report/utilities/index.html +1 -1
  155. package/coverage/lcov-report/utilities/index.js.html +1 -1
  156. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  157. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  158. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  159. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  160. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  161. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  162. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  163. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  164. package/coverage/lcov-report/utilities/security.js.html +1 -1
  165. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  166. package/coverage/lcov-report/utilities/users.js.html +1 -1
  167. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  168. package/coverage/lcov.info +255 -217
  169. package/dist/api/controllers/query/import/index.js +79 -0
  170. package/dist/api/controllers/query/import/sources/base/index.js +63 -0
  171. package/dist/api/controllers/query/import/sources/base/openapi.js +42 -0
  172. package/dist/api/controllers/query/import/sources/curl.js +90 -0
  173. package/dist/api/controllers/query/import/sources/openapi2.js +139 -0
  174. package/dist/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.json +253 -0
  175. package/dist/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.json +1054 -0
  176. package/dist/api/controllers/{query.js → query/index.js} +38 -4
  177. package/dist/api/controllers/query/validation.js +36 -0
  178. package/dist/api/routes/query.js +2 -32
  179. package/dist/package.json +8 -4
  180. package/dist/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +9 -5
  182. package/src/api/controllers/query/import/index.ts +85 -0
  183. package/src/api/controllers/query/import/sources/base/index.ts +86 -0
  184. package/src/api/controllers/query/import/sources/base/openapi.ts +24 -0
  185. package/src/api/controllers/query/import/sources/curl.ts +94 -0
  186. package/src/api/controllers/query/import/sources/openapi2.ts +159 -0
  187. package/src/api/controllers/query/import/sources/tests/curl/curl.spec.js +104 -0
  188. package/src/api/controllers/query/import/sources/tests/curl/data/delete.txt +1 -0
  189. package/src/api/controllers/query/import/sources/tests/curl/data/empty-body.txt +2 -0
  190. package/src/api/controllers/query/import/sources/tests/curl/data/get.txt +1 -0
  191. package/src/api/controllers/query/import/sources/tests/curl/data/headers.txt +3 -0
  192. package/src/api/controllers/query/import/sources/tests/curl/data/patch.txt +2 -0
  193. package/src/api/controllers/query/import/sources/tests/curl/data/path.txt +1 -0
  194. package/src/api/controllers/query/import/sources/tests/curl/data/post.txt +2 -0
  195. package/src/api/controllers/query/import/sources/tests/curl/data/put.txt +2 -0
  196. package/src/api/controllers/query/import/sources/tests/curl/data/query.txt +1 -0
  197. package/src/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.json +253 -0
  198. package/src/api/controllers/query/import/sources/tests/openapi2/data/crud/crud.yaml +160 -0
  199. package/src/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.json +1054 -0
  200. package/src/api/controllers/query/import/sources/tests/openapi2/data/petstore/petstore.yaml +711 -0
  201. package/src/api/controllers/query/import/sources/tests/openapi2/openapi2.spec.js +239 -0
  202. package/src/api/controllers/query/import/tests/index.spec.js +115 -0
  203. package/src/api/controllers/{query.js → query/index.js} +46 -4
  204. package/src/api/controllers/query/validation.js +40 -0
  205. package/src/api/routes/query.js +5 -34
  206. package/src/definitions/common.ts +22 -0
  207. package/src/integrations/oracle.ts +1 -1
@@ -837,12 +837,12 @@ FNDA:0,(anonymous_12)
837
837
  FNDA:0,updateError
838
838
  FNDA:0,(anonymous_14)
839
839
  FNDA:0,(anonymous_15)
840
- DA:1,33
841
- DA:9,33
842
- DA:10,33
843
- DA:11,33
844
- DA:12,33
845
- DA:14,33
840
+ DA:1,34
841
+ DA:9,34
842
+ DA:10,34
843
+ DA:11,34
844
+ DA:12,34
845
+ DA:14,34
846
846
  DA:15,2
847
847
  DA:18,2
848
848
  DA:19,2
@@ -851,7 +851,7 @@ DA:26,2
851
851
  DA:32,2
852
852
  DA:38,1
853
853
  DA:40,2
854
- DA:43,33
854
+ DA:43,34
855
855
  DA:44,0
856
856
  DA:45,0
857
857
  DA:47,0
@@ -862,7 +862,7 @@ DA:53,0
862
862
  DA:54,0
863
863
  DA:55,0
864
864
  DA:57,0
865
- DA:60,33
865
+ DA:60,34
866
866
  DA:61,0
867
867
  DA:62,0
868
868
  DA:63,0
@@ -876,7 +876,7 @@ DA:73,0
876
876
  DA:77,0
877
877
  DA:78,0
878
878
  DA:79,0
879
- DA:82,33
879
+ DA:82,34
880
880
  DA:83,24
881
881
  DA:84,24
882
882
  DA:85,24
@@ -896,7 +896,7 @@ DA:111,24
896
896
  DA:112,24
897
897
  DA:113,0
898
898
  DA:115,24
899
- DA:118,33
899
+ DA:118,34
900
900
  DA:119,1
901
901
  DA:122,1
902
902
  DA:125,1
@@ -904,10 +904,10 @@ DA:126,1
904
904
  DA:134,1
905
905
  DA:136,1
906
906
  DA:137,1
907
- DA:140,33
907
+ DA:140,34
908
908
  DA:141,1
909
909
  DA:142,1
910
- DA:146,33
910
+ DA:146,34
911
911
  DA:147,1
912
912
  DA:148,1
913
913
  DA:149,1
@@ -921,7 +921,7 @@ DA:165,0
921
921
  DA:166,0
922
922
  DA:168,0
923
923
  DA:169,0
924
- DA:172,33
924
+ DA:172,34
925
925
  DA:173,0
926
926
  DA:176,0
927
927
  DA:177,0
@@ -1386,128 +1386,6 @@ BRF:33
1386
1386
  BRH:30
1387
1387
  end_of_record
1388
1388
  TN:
1389
- SF:src/api/controllers/query.js
1390
- FN:14,enrichQueries
1391
- FN:25,(anonymous_1)
1392
- FN:33,(anonymous_2)
1393
- FN:36,(anonymous_3)
1394
- FN:51,enrichQueryFields
1395
- FN:92,(anonymous_5)
1396
- FN:103,(anonymous_6)
1397
- FN:128,(anonymous_7)
1398
- FN:153,(anonymous_8)
1399
- FNF:9
1400
- FNH:9
1401
- FNDA:5,enrichQueries
1402
- FNDA:2,(anonymous_1)
1403
- FNDA:1,(anonymous_2)
1404
- FNDA:20,(anonymous_3)
1405
- FNDA:4,enrichQueryFields
1406
- FNDA:3,(anonymous_5)
1407
- FNDA:2,(anonymous_6)
1408
- FNDA:2,(anonymous_7)
1409
- FNDA:1,(anonymous_8)
1410
- DA:1,34
1411
- DA:2,34
1412
- DA:7,34
1413
- DA:8,34
1414
- DA:9,34
1415
- DA:11,34
1416
- DA:15,5
1417
- DA:16,5
1418
- DA:17,5
1419
- DA:18,4
1420
- DA:19,4
1421
- DA:22,5
1422
- DA:25,34
1423
- DA:26,2
1424
- DA:28,2
1425
- DA:33,2
1426
- DA:36,34
1427
- DA:37,20
1428
- DA:38,20
1429
- DA:40,20
1430
- DA:41,20
1431
- DA:44,20
1432
- DA:45,20
1433
- DA:47,20
1434
- DA:48,20
1435
- DA:52,4
1436
- DA:55,4
1437
- DA:56,0
1438
- DA:57,0
1439
- DA:59,0
1440
- DA:61,0
1441
- DA:62,0
1442
- DA:64,0
1443
- DA:68,0
1444
- DA:72,4
1445
- DA:77,0
1446
- DA:78,0
1447
- DA:84,0
1448
- DA:86,0
1449
- DA:89,4
1450
- DA:92,34
1451
- DA:93,3
1452
- DA:94,3
1453
- DA:96,3
1454
- DA:97,1
1455
- DA:98,1
1456
- DA:100,3
1457
- DA:103,34
1458
- DA:104,2
1459
- DA:106,2
1460
- DA:108,2
1461
- DA:109,2
1462
- DA:111,2
1463
- DA:112,2
1464
- DA:119,1
1465
- DA:124,1
1466
- DA:128,34
1467
- DA:129,2
1468
- DA:131,2
1469
- DA:132,2
1470
- DA:134,2
1471
- DA:140,2
1472
- DA:141,2
1473
- DA:147,1
1474
- DA:149,1
1475
- DA:153,34
1476
- DA:154,1
1477
- DA:155,1
1478
- DA:156,1
1479
- DA:157,1
1480
- LF:70
1481
- LH:59
1482
- BRDA:16,0,0,2
1483
- BRDA:16,0,1,3
1484
- BRDA:18,1,0,4
1485
- BRDA:18,1,1,0
1486
- BRDA:22,2,0,2
1487
- BRDA:22,2,1,3
1488
- BRDA:40,3,0,20
1489
- BRDA:40,3,1,0
1490
- BRDA:51,4,0,0
1491
- BRDA:56,5,0,0
1492
- BRDA:56,5,1,0
1493
- BRDA:59,6,0,0
1494
- BRDA:59,6,1,0
1495
- BRDA:62,7,0,0
1496
- BRDA:62,7,1,0
1497
- BRDA:72,8,0,0
1498
- BRDA:72,8,1,4
1499
- BRDA:73,9,0,4
1500
- BRDA:73,9,1,4
1501
- BRDA:73,9,2,4
1502
- BRDA:79,10,0,0
1503
- BRDA:79,10,1,0
1504
- BRDA:79,10,2,0
1505
- BRDA:96,11,0,1
1506
- BRDA:96,11,1,2
1507
- BRF:25
1508
- BRH:12
1509
- end_of_record
1510
- TN:
1511
1389
  SF:src/api/controllers/role.js
1512
1390
  FN:19,updateRolesOnUserTable
1513
1391
  FN:42,(anonymous_1)
@@ -2044,6 +1922,173 @@ BRF:10
2044
1922
  BRH:4
2045
1923
  end_of_record
2046
1924
  TN:
1925
+ SF:src/api/controllers/query/index.js
1926
+ FN:16,enrichQueries
1927
+ FN:27,(anonymous_1)
1928
+ FN:36,(anonymous_2)
1929
+ FN:39,(anonymous_3)
1930
+ FN:78,(anonymous_4)
1931
+ FN:93,enrichQueryFields
1932
+ FN:134,(anonymous_6)
1933
+ FN:145,(anonymous_7)
1934
+ FN:170,(anonymous_8)
1935
+ FN:195,(anonymous_9)
1936
+ FNF:10
1937
+ FNH:9
1938
+ FNDA:5,enrichQueries
1939
+ FNDA:2,(anonymous_1)
1940
+ FNDA:1,(anonymous_2)
1941
+ FNDA:0,(anonymous_3)
1942
+ FNDA:20,(anonymous_4)
1943
+ FNDA:4,enrichQueryFields
1944
+ FNDA:3,(anonymous_6)
1945
+ FNDA:2,(anonymous_7)
1946
+ FNDA:2,(anonymous_8)
1947
+ FNDA:1,(anonymous_9)
1948
+ DA:1,34
1949
+ DA:2,34
1950
+ DA:7,34
1951
+ DA:8,34
1952
+ DA:9,34
1953
+ DA:10,34
1954
+ DA:11,34
1955
+ DA:13,34
1956
+ DA:17,5
1957
+ DA:18,5
1958
+ DA:19,5
1959
+ DA:20,4
1960
+ DA:21,4
1961
+ DA:24,5
1962
+ DA:27,34
1963
+ DA:28,2
1964
+ DA:30,2
1965
+ DA:36,2
1966
+ DA:39,34
1967
+ DA:40,0
1968
+ DA:41,0
1969
+ DA:43,0
1970
+ DA:44,0
1971
+ DA:47,0
1972
+ DA:49,0
1973
+ DA:50,0
1974
+ DA:60,0
1975
+ DA:61,0
1976
+ DA:62,0
1977
+ DA:63,0
1978
+ DA:66,0
1979
+ DA:69,0
1980
+ DA:71,0
1981
+ DA:75,0
1982
+ DA:78,34
1983
+ DA:79,20
1984
+ DA:80,20
1985
+ DA:82,20
1986
+ DA:83,20
1987
+ DA:86,20
1988
+ DA:87,20
1989
+ DA:89,20
1990
+ DA:90,20
1991
+ DA:94,4
1992
+ DA:97,4
1993
+ DA:98,0
1994
+ DA:99,0
1995
+ DA:101,0
1996
+ DA:103,0
1997
+ DA:104,0
1998
+ DA:106,0
1999
+ DA:110,0
2000
+ DA:114,4
2001
+ DA:119,0
2002
+ DA:120,0
2003
+ DA:126,0
2004
+ DA:128,0
2005
+ DA:131,4
2006
+ DA:134,34
2007
+ DA:135,3
2008
+ DA:136,3
2009
+ DA:138,3
2010
+ DA:139,1
2011
+ DA:140,1
2012
+ DA:142,3
2013
+ DA:145,34
2014
+ DA:146,2
2015
+ DA:148,2
2016
+ DA:150,2
2017
+ DA:151,2
2018
+ DA:153,2
2019
+ DA:154,2
2020
+ DA:161,1
2021
+ DA:166,1
2022
+ DA:170,34
2023
+ DA:171,2
2024
+ DA:173,2
2025
+ DA:174,2
2026
+ DA:176,2
2027
+ DA:182,2
2028
+ DA:183,2
2029
+ DA:189,1
2030
+ DA:191,1
2031
+ DA:195,34
2032
+ DA:196,1
2033
+ DA:197,1
2034
+ DA:198,1
2035
+ DA:199,1
2036
+ LF:88
2037
+ LH:62
2038
+ BRDA:18,0,0,2
2039
+ BRDA:18,0,1,3
2040
+ BRDA:20,1,0,4
2041
+ BRDA:20,1,1,0
2042
+ BRDA:24,2,0,2
2043
+ BRDA:24,2,1,3
2044
+ BRDA:47,3,0,0
2045
+ BRDA:47,3,1,0
2046
+ BRDA:82,4,0,20
2047
+ BRDA:82,4,1,0
2048
+ BRDA:93,5,0,0
2049
+ BRDA:98,6,0,0
2050
+ BRDA:98,6,1,0
2051
+ BRDA:101,7,0,0
2052
+ BRDA:101,7,1,0
2053
+ BRDA:104,8,0,0
2054
+ BRDA:104,8,1,0
2055
+ BRDA:114,9,0,0
2056
+ BRDA:114,9,1,4
2057
+ BRDA:115,10,0,4
2058
+ BRDA:115,10,1,4
2059
+ BRDA:115,10,2,4
2060
+ BRDA:121,11,0,0
2061
+ BRDA:121,11,1,0
2062
+ BRDA:121,11,2,0
2063
+ BRDA:138,12,0,1
2064
+ BRDA:138,12,1,2
2065
+ BRF:27
2066
+ BRH:12
2067
+ end_of_record
2068
+ TN:
2069
+ SF:src/api/controllers/query/validation.js
2070
+ FN:4,(anonymous_0)
2071
+ FN:25,(anonymous_1)
2072
+ FN:30,(anonymous_2)
2073
+ FNF:3
2074
+ FNH:3
2075
+ FNDA:28,(anonymous_0)
2076
+ FNDA:23,(anonymous_1)
2077
+ FNDA:23,(anonymous_2)
2078
+ DA:1,35
2079
+ DA:2,35
2080
+ DA:4,35
2081
+ DA:5,28
2082
+ DA:25,35
2083
+ DA:27,23
2084
+ DA:30,35
2085
+ DA:32,23
2086
+ LF:8
2087
+ LH:8
2088
+ BRF:0
2089
+ BRH:0
2090
+ end_of_record
2091
+ TN:
2047
2092
  SF:src/api/controllers/row/external.js
2048
2093
  FN:14,handleRequest
2049
2094
  FN:35,(anonymous_1)
@@ -4580,26 +4625,19 @@ BRH:0
4580
4625
  end_of_record
4581
4626
  TN:
4582
4627
  SF:src/api/routes/query.js
4583
- FN:19,generateQueryValidation
4584
- FN:39,generateQueryPreviewValidation
4585
- FNF:2
4586
- FNH:2
4587
- FNDA:23,generateQueryValidation
4588
- FNDA:23,generateQueryPreviewValidation
4628
+ FNF:0
4629
+ FNH:0
4589
4630
  DA:1,23
4590
4631
  DA:2,23
4591
4632
  DA:3,23
4592
- DA:4,23
4593
- DA:9,23
4594
- DA:10,23
4595
- DA:15,23
4633
+ DA:8,23
4634
+ DA:13,23
4596
4635
  DA:17,23
4636
+ DA:19,23
4597
4637
  DA:21,23
4598
- DA:41,23
4599
- DA:51,23
4600
- DA:86,23
4601
- LF:12
4602
- LH:12
4638
+ DA:57,23
4639
+ LF:9
4640
+ LH:9
4603
4641
  BRF:0
4604
4642
  BRH:0
4605
4643
  end_of_record
@@ -5962,10 +6000,10 @@ SF:src/db/newid.js
5962
6000
  FN:3,(anonymous_0)
5963
6001
  FNF:1
5964
6002
  FNH:1
5965
- FNDA:630,(anonymous_0)
5966
- DA:1,47
5967
- DA:3,47
5968
- DA:4,630
6003
+ FNDA:683,(anonymous_0)
6004
+ DA:1,48
6005
+ DA:3,48
6006
+ DA:4,683
5969
6007
  LF:3
5970
6008
  LH:3
5971
6009
  BRF:0
@@ -6028,120 +6066,120 @@ FNDA:10,(anonymous_19)
6028
6066
  FNDA:2,(anonymous_20)
6029
6067
  FNDA:24,(anonymous_21)
6030
6068
  FNDA:3,(anonymous_22)
6031
- FNDA:20,(anonymous_23)
6069
+ FNDA:73,(anonymous_23)
6032
6070
  FNDA:3,(anonymous_24)
6033
6071
  FNDA:10,(anonymous_25)
6034
6072
  FNDA:0,(anonymous_26)
6035
6073
  FNDA:1,(anonymous_27)
6036
6074
  FNDA:0,(anonymous_28)
6037
6075
  FNDA:60,(anonymous_29)
6038
- DA:1,47
6039
- DA:12,47
6040
- DA:14,47
6041
- DA:16,47
6042
- DA:22,47
6043
- DA:45,47
6044
- DA:50,47
6045
- DA:54,47
6046
- DA:58,47
6047
- DA:60,47
6048
- DA:68,47
6049
- DA:69,47
6050
- DA:70,47
6051
- DA:71,47
6052
- DA:72,47
6053
- DA:73,47
6054
- DA:74,47
6055
- DA:75,47
6056
- DA:76,47
6057
- DA:77,47
6058
- DA:78,47
6059
- DA:79,47
6060
- DA:80,47
6061
- DA:81,47
6062
- DA:83,47
6063
- DA:84,47
6064
- DA:86,47
6076
+ DA:1,48
6077
+ DA:12,48
6078
+ DA:14,48
6079
+ DA:16,48
6080
+ DA:22,48
6081
+ DA:45,48
6082
+ DA:50,48
6083
+ DA:54,48
6084
+ DA:58,48
6085
+ DA:60,48
6086
+ DA:68,48
6087
+ DA:69,48
6088
+ DA:70,48
6089
+ DA:71,48
6090
+ DA:72,48
6091
+ DA:73,48
6092
+ DA:74,48
6093
+ DA:75,48
6094
+ DA:76,48
6095
+ DA:77,48
6096
+ DA:78,48
6097
+ DA:79,48
6098
+ DA:80,48
6099
+ DA:81,48
6100
+ DA:83,48
6101
+ DA:84,48
6102
+ DA:86,48
6065
6103
  DA:87,74
6066
6104
  DA:103,606
6067
6105
  DA:104,593
6068
6106
  DA:106,606
6069
- DA:113,47
6070
- DA:118,47
6107
+ DA:113,48
6108
+ DA:118,48
6071
6109
  DA:119,3
6072
- DA:126,47
6110
+ DA:126,48
6073
6111
  DA:127,99
6074
- DA:138,47
6112
+ DA:138,48
6075
6113
  DA:139,11
6076
6114
  DA:140,0
6077
6115
  DA:143,11
6078
6116
  DA:145,11
6079
- DA:154,47
6117
+ DA:154,48
6080
6118
  DA:155,201
6081
6119
  DA:156,201
6082
- DA:162,47
6120
+ DA:162,48
6083
6121
  DA:163,3
6084
- DA:171,47
6122
+ DA:171,48
6085
6123
  DA:172,133
6086
- DA:178,47
6124
+ DA:178,48
6087
6125
  DA:179,2
6088
6126
  DA:180,2
6089
6127
  DA:181,1
6090
6128
  DA:183,1
6091
- DA:189,47
6129
+ DA:189,48
6092
6130
  DA:190,204
6093
- DA:197,47
6131
+ DA:197,48
6094
6132
  DA:198,20
6095
- DA:212,47
6133
+ DA:212,48
6096
6134
  DA:220,9
6097
6135
  DA:221,9
6098
6136
  DA:222,9
6099
6137
  DA:223,9
6100
- DA:229,47
6138
+ DA:229,48
6101
6139
  DA:230,0
6102
- DA:237,47
6140
+ DA:237,48
6103
6141
  DA:238,179
6104
6142
  DA:239,179
6105
6143
  DA:240,0
6106
6144
  DA:242,179
6107
- DA:249,47
6145
+ DA:249,48
6108
6146
  DA:250,179
6109
6147
  DA:251,179
6110
6148
  DA:252,179
6111
- DA:259,47
6149
+ DA:259,48
6112
6150
  DA:260,5
6113
- DA:266,47
6151
+ DA:266,48
6114
6152
  DA:267,189
6115
- DA:274,47
6153
+ DA:274,48
6116
6154
  DA:275,19
6117
- DA:281,47
6155
+ DA:281,48
6118
6156
  DA:282,191
6119
- DA:289,47
6157
+ DA:289,48
6120
6158
  DA:290,10
6121
- DA:296,47
6159
+ DA:296,48
6122
6160
  DA:297,2
6123
- DA:304,47
6161
+ DA:304,48
6124
6162
  DA:305,24
6125
- DA:313,47
6163
+ DA:313,48
6126
6164
  DA:314,3
6127
- DA:321,47
6128
- DA:322,20
6129
- DA:330,47
6165
+ DA:321,48
6166
+ DA:322,73
6167
+ DA:330,48
6130
6168
  DA:331,3
6131
6169
  DA:332,2
6132
6170
  DA:335,1
6133
- DA:342,47
6171
+ DA:342,48
6134
6172
  DA:343,10
6135
- DA:346,47
6173
+ DA:346,48
6136
6174
  DA:347,0
6137
6175
  DA:348,0
6138
6176
  DA:349,0
6139
6177
  DA:351,0
6140
- DA:354,47
6178
+ DA:354,48
6141
6179
  DA:355,1
6142
- DA:358,47
6180
+ DA:358,48
6143
6181
  DA:359,0
6144
- DA:365,47
6182
+ DA:365,48
6145
6183
  DA:366,60
6146
6184
  LF:108
6147
6185
  LH:100
@@ -6933,7 +6971,7 @@ FN:57,(anonymous_3)
6933
6971
  FNF:4
6934
6972
  FNH:4
6935
6973
  FNDA:7,hasResource
6936
- FNDA:2246,(anonymous_1)
6974
+ FNDA:2269,(anonymous_1)
6937
6975
  FNDA:151,(anonymous_2)
6938
6976
  FNDA:1,(anonymous_3)
6939
6977
  DA:5,24
@@ -6942,7 +6980,7 @@ DA:10,24
6942
6980
  DA:11,24
6943
6981
  DA:14,7
6944
6982
  DA:17,24
6945
- DA:19,2246
6983
+ DA:19,2269
6946
6984
  DA:22,151
6947
6985
  DA:23,1
6948
6986
  DA:26,150
@@ -6972,7 +7010,7 @@ DA:66,4
6972
7010
  DA:69,4
6973
7011
  LF:34
6974
7012
  LH:34
6975
- BRDA:18,0,0,1671
7013
+ BRDA:18,0,0,1694
6976
7014
  BRDA:22,1,0,1
6977
7015
  BRDA:22,1,1,150
6978
7016
  BRDA:22,2,0,151
@@ -7206,9 +7244,9 @@ DA:14,18
7206
7244
  DA:15,0
7207
7245
  DA:16,0
7208
7246
  DA:18,18
7209
- DA:22,23
7247
+ DA:22,35
7210
7248
  DA:23,230
7211
- DA:26,23
7249
+ DA:26,35
7212
7250
  DA:27,46
7213
7251
  LF:17
7214
7252
  LH:14
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RestImporter = void 0;
16
+ const db_1 = __importDefault(require("../../../../db"));
17
+ const validation_1 = require("../validation");
18
+ const utils_1 = require("../../../../db/utils");
19
+ const openapi2_1 = require("./sources/openapi2");
20
+ const curl_1 = require("./sources/curl");
21
+ class RestImporter {
22
+ constructor(data) {
23
+ this.init = () => __awaiter(this, void 0, void 0, function* () {
24
+ for (let source of this.sources) {
25
+ if (yield source.isSupported(this.data)) {
26
+ this.source = source;
27
+ break;
28
+ }
29
+ }
30
+ });
31
+ this.getInfo = () => __awaiter(this, void 0, void 0, function* () {
32
+ return this.source.getInfo();
33
+ });
34
+ this.importQueries = (appId, datasourceId) => __awaiter(this, void 0, void 0, function* () {
35
+ // constuct the queries
36
+ let queries = yield this.source.getQueries(datasourceId);
37
+ // validate queries
38
+ const errorQueries = [];
39
+ const schema = validation_1.queryValidation();
40
+ queries = queries
41
+ .filter(query => {
42
+ const validation = schema.validate(query);
43
+ if (validation.error) {
44
+ errorQueries.push(query);
45
+ return false;
46
+ }
47
+ return true;
48
+ })
49
+ .map(query => {
50
+ query._id = utils_1.generateQueryID(query.datasourceId);
51
+ return query;
52
+ });
53
+ // persist queries
54
+ const db = new db_1.default(appId);
55
+ const response = yield db.bulkDocs(queries);
56
+ // create index to seperate queries and errors
57
+ const queryIndex = queries.reduce((acc, query) => {
58
+ if (query._id) {
59
+ acc[query._id] = query;
60
+ }
61
+ return acc;
62
+ }, {});
63
+ // check for failed writes
64
+ response.forEach((query) => {
65
+ if (!query.ok) {
66
+ errorQueries.push(queryIndex[query.id]);
67
+ delete queryIndex[query.id];
68
+ }
69
+ });
70
+ return {
71
+ errorQueries,
72
+ queries: Object.values(queryIndex),
73
+ };
74
+ });
75
+ this.data = data;
76
+ this.sources = [new openapi2_1.OpenAPI2(), new curl_1.Curl()];
77
+ }
78
+ }
79
+ exports.RestImporter = RestImporter;