@budibase/server 1.0.212-alpha.14 → 1.0.212-alpha.15
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.
- package/builder/assets/{index.1f366fcc.js → index.83448a6c.js} +1 -1
- package/builder/index.html +1 -1
- package/coverage/clover.xml +115 -97
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +1 -1
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1 -1
- package/coverage/lcov-report/threads/index.html +19 -19
- package/coverage/lcov-report/threads/query.js.html +147 -18
- package/coverage/lcov-report/threads/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +188 -154
- package/dist/api/controllers/query/index.js +19 -0
- package/dist/package.json +6 -6
- package/dist/threads/query.js +35 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/api/controllers/query/index.ts +23 -1
- package/src/module.d.ts +1 -0
- package/src/threads/query.js +50 -7
package/coverage/lcov.info
CHANGED
|
@@ -7091,19 +7091,20 @@ BRH:20
|
|
|
7091
7091
|
end_of_record
|
|
7092
7092
|
TN:
|
|
7093
7093
|
SF:src/threads/query.js
|
|
7094
|
-
FN:
|
|
7095
|
-
FN:
|
|
7096
|
-
FN:
|
|
7097
|
-
FN:
|
|
7098
|
-
FN:
|
|
7099
|
-
FN:
|
|
7100
|
-
FN:
|
|
7101
|
-
FN:
|
|
7102
|
-
FN:
|
|
7103
|
-
FN:
|
|
7104
|
-
FN:
|
|
7105
|
-
FN:
|
|
7106
|
-
|
|
7094
|
+
FN:20,(anonymous_0)
|
|
7095
|
+
FN:40,(anonymous_1)
|
|
7096
|
+
FN:50,(anonymous_2)
|
|
7097
|
+
FN:142,(anonymous_3)
|
|
7098
|
+
FN:143,(anonymous_4)
|
|
7099
|
+
FN:156,(anonymous_5)
|
|
7100
|
+
FN:172,(anonymous_6)
|
|
7101
|
+
FN:197,(anonymous_7)
|
|
7102
|
+
FN:215,(anonymous_8)
|
|
7103
|
+
FN:230,(anonymous_9)
|
|
7104
|
+
FN:239,(anonymous_10)
|
|
7105
|
+
FN:261,(anonymous_11)
|
|
7106
|
+
FN:262,(anonymous_12)
|
|
7107
|
+
FNF:13
|
|
7107
7108
|
FNH:10
|
|
7108
7109
|
FNDA:22,(anonymous_0)
|
|
7109
7110
|
FNDA:23,(anonymous_1)
|
|
@@ -7111,171 +7112,204 @@ FNDA:0,(anonymous_2)
|
|
|
7111
7112
|
FNDA:20,(anonymous_3)
|
|
7112
7113
|
FNDA:0,(anonymous_4)
|
|
7113
7114
|
FNDA:5,(anonymous_5)
|
|
7114
|
-
FNDA:
|
|
7115
|
-
FNDA:
|
|
7116
|
-
FNDA:
|
|
7115
|
+
FNDA:0,(anonymous_6)
|
|
7116
|
+
FNDA:6,(anonymous_7)
|
|
7117
|
+
FNDA:21,(anonymous_8)
|
|
7117
7118
|
FNDA:6,(anonymous_9)
|
|
7118
|
-
FNDA:
|
|
7119
|
+
FNDA:6,(anonymous_10)
|
|
7119
7120
|
FNDA:17,(anonymous_11)
|
|
7121
|
+
FNDA:17,(anonymous_12)
|
|
7120
7122
|
DA:1,2
|
|
7121
7123
|
DA:2,2
|
|
7122
7124
|
DA:3,2
|
|
7123
7125
|
DA:4,2
|
|
7124
7126
|
DA:5,2
|
|
7125
7127
|
DA:6,2
|
|
7126
|
-
DA:
|
|
7128
|
+
DA:10,2
|
|
7127
7129
|
DA:11,2
|
|
7128
|
-
DA:
|
|
7129
|
-
DA:
|
|
7130
|
-
DA:17,22
|
|
7131
|
-
DA:18,22
|
|
7132
|
-
DA:19,22
|
|
7133
|
-
DA:20,22
|
|
7130
|
+
DA:13,2
|
|
7131
|
+
DA:17,2
|
|
7134
7132
|
DA:21,22
|
|
7135
7133
|
DA:22,22
|
|
7136
7134
|
DA:23,22
|
|
7135
|
+
DA:24,22
|
|
7137
7136
|
DA:25,22
|
|
7137
|
+
DA:26,22
|
|
7138
|
+
DA:27,22
|
|
7139
|
+
DA:28,22
|
|
7138
7140
|
DA:29,22
|
|
7139
|
-
DA:
|
|
7140
|
-
DA:
|
|
7141
|
-
DA:
|
|
7142
|
-
DA:
|
|
7143
|
-
DA:
|
|
7144
|
-
DA:
|
|
7145
|
-
DA:
|
|
7146
|
-
DA:
|
|
7141
|
+
DA:31,22
|
|
7142
|
+
DA:35,22
|
|
7143
|
+
DA:36,22
|
|
7144
|
+
DA:37,22
|
|
7145
|
+
DA:41,23
|
|
7146
|
+
DA:43,23
|
|
7147
|
+
DA:44,23
|
|
7148
|
+
DA:45,2
|
|
7147
7149
|
DA:48,21
|
|
7148
|
-
DA:
|
|
7149
|
-
DA:
|
|
7150
|
+
DA:49,0
|
|
7151
|
+
DA:51,0
|
|
7150
7152
|
DA:56,21
|
|
7151
7153
|
DA:59,21
|
|
7152
|
-
DA:
|
|
7153
|
-
DA:
|
|
7154
|
-
DA:
|
|
7155
|
-
DA:
|
|
7156
|
-
DA:
|
|
7157
|
-
DA:
|
|
7158
|
-
DA:79,
|
|
7159
|
-
DA:80,21
|
|
7160
|
-
DA:81,21
|
|
7161
|
-
DA:82,21
|
|
7154
|
+
DA:63,21
|
|
7155
|
+
DA:64,21
|
|
7156
|
+
DA:67,21
|
|
7157
|
+
DA:68,1
|
|
7158
|
+
DA:76,21
|
|
7159
|
+
DA:77,2
|
|
7160
|
+
DA:79,19
|
|
7162
7161
|
DA:83,21
|
|
7163
|
-
DA:84,
|
|
7164
|
-
DA:
|
|
7165
|
-
DA:
|
|
7166
|
-
DA:
|
|
7167
|
-
DA:
|
|
7162
|
+
DA:84,0
|
|
7163
|
+
DA:87,21
|
|
7164
|
+
DA:88,21
|
|
7165
|
+
DA:89,21
|
|
7166
|
+
DA:90,21
|
|
7167
|
+
DA:91,21
|
|
7168
7168
|
DA:92,21
|
|
7169
|
-
DA:93,
|
|
7170
|
-
DA:
|
|
7171
|
-
DA:
|
|
7172
|
-
DA:
|
|
7173
|
-
DA:
|
|
7169
|
+
DA:93,19
|
|
7170
|
+
DA:94,19
|
|
7171
|
+
DA:95,19
|
|
7172
|
+
DA:96,19
|
|
7173
|
+
DA:100,21
|
|
7174
|
+
DA:101,0
|
|
7175
|
+
DA:105,0
|
|
7176
|
+
DA:109,21
|
|
7174
7177
|
DA:110,1
|
|
7175
|
-
DA:
|
|
7176
|
-
DA:
|
|
7177
|
-
DA:119,
|
|
7178
|
-
DA:
|
|
7179
|
-
DA:
|
|
7180
|
-
DA:
|
|
7181
|
-
DA:
|
|
7182
|
-
DA:
|
|
7183
|
-
DA:
|
|
7184
|
-
DA:
|
|
7185
|
-
DA:
|
|
7186
|
-
DA:
|
|
7187
|
-
DA:
|
|
7188
|
-
DA:
|
|
7189
|
-
DA:
|
|
7190
|
-
DA:
|
|
7191
|
-
DA:
|
|
7192
|
-
DA:
|
|
7193
|
-
DA:
|
|
7178
|
+
DA:116,0
|
|
7179
|
+
DA:117,0
|
|
7180
|
+
DA:119,0
|
|
7181
|
+
DA:122,0
|
|
7182
|
+
DA:126,1
|
|
7183
|
+
DA:127,1
|
|
7184
|
+
DA:128,1
|
|
7185
|
+
DA:132,20
|
|
7186
|
+
DA:133,0
|
|
7187
|
+
DA:137,20
|
|
7188
|
+
DA:138,18
|
|
7189
|
+
DA:142,20
|
|
7190
|
+
DA:143,0
|
|
7191
|
+
DA:147,20
|
|
7192
|
+
DA:149,20
|
|
7193
|
+
DA:150,0
|
|
7194
|
+
DA:153,20
|
|
7195
|
+
DA:157,5
|
|
7196
|
+
DA:158,5
|
|
7197
|
+
DA:159,5
|
|
7194
7198
|
DA:160,5
|
|
7195
|
-
DA:
|
|
7196
|
-
DA:
|
|
7197
|
-
DA:
|
|
7198
|
-
DA:
|
|
7199
|
-
DA:
|
|
7200
|
-
DA:
|
|
7201
|
-
DA:
|
|
7202
|
-
DA:177,21
|
|
7203
|
-
DA:178,21
|
|
7204
|
-
DA:179,21
|
|
7205
|
-
DA:180,2
|
|
7206
|
-
DA:181,2
|
|
7207
|
-
DA:184,21
|
|
7208
|
-
DA:186,16
|
|
7209
|
-
DA:187,16
|
|
7210
|
-
DA:189,6
|
|
7199
|
+
DA:173,0
|
|
7200
|
+
DA:174,0
|
|
7201
|
+
DA:176,0
|
|
7202
|
+
DA:177,0
|
|
7203
|
+
DA:178,0
|
|
7204
|
+
DA:181,0
|
|
7205
|
+
DA:189,0
|
|
7211
7206
|
DA:190,0
|
|
7212
|
-
DA:
|
|
7213
|
-
DA:194,
|
|
7214
|
-
DA:
|
|
7215
|
-
DA:197,16
|
|
7216
|
-
DA:198,16
|
|
7207
|
+
DA:191,0
|
|
7208
|
+
DA:194,0
|
|
7209
|
+
DA:198,6
|
|
7217
7210
|
DA:199,6
|
|
7218
7211
|
DA:200,6
|
|
7219
|
-
DA:
|
|
7220
|
-
DA:
|
|
7221
|
-
DA:
|
|
7222
|
-
DA:
|
|
7223
|
-
DA:
|
|
7224
|
-
DA:
|
|
7225
|
-
DA:
|
|
7226
|
-
DA:
|
|
7227
|
-
DA:
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
BRDA:
|
|
7258
|
-
BRDA:
|
|
7259
|
-
BRDA:
|
|
7260
|
-
BRDA:
|
|
7261
|
-
BRDA:
|
|
7262
|
-
BRDA:
|
|
7263
|
-
BRDA:
|
|
7264
|
-
BRDA:
|
|
7265
|
-
BRDA:
|
|
7266
|
-
BRDA:
|
|
7267
|
-
BRDA:
|
|
7268
|
-
BRDA:
|
|
7269
|
-
BRDA:
|
|
7270
|
-
BRDA:
|
|
7271
|
-
BRDA:
|
|
7272
|
-
BRDA:
|
|
7273
|
-
BRDA:
|
|
7274
|
-
BRDA:
|
|
7275
|
-
BRDA:
|
|
7276
|
-
BRDA:
|
|
7277
|
-
|
|
7278
|
-
|
|
7212
|
+
DA:201,6
|
|
7213
|
+
DA:202,6
|
|
7214
|
+
DA:203,5
|
|
7215
|
+
DA:207,5
|
|
7216
|
+
DA:208,5
|
|
7217
|
+
DA:210,1
|
|
7218
|
+
DA:212,6
|
|
7219
|
+
DA:216,21
|
|
7220
|
+
DA:217,21
|
|
7221
|
+
DA:218,0
|
|
7222
|
+
DA:220,21
|
|
7223
|
+
DA:221,21
|
|
7224
|
+
DA:222,21
|
|
7225
|
+
DA:223,2
|
|
7226
|
+
DA:224,2
|
|
7227
|
+
DA:227,21
|
|
7228
|
+
DA:229,16
|
|
7229
|
+
DA:230,16
|
|
7230
|
+
DA:232,6
|
|
7231
|
+
DA:233,0
|
|
7232
|
+
DA:236,6
|
|
7233
|
+
DA:237,6
|
|
7234
|
+
DA:239,16
|
|
7235
|
+
DA:240,16
|
|
7236
|
+
DA:241,16
|
|
7237
|
+
DA:242,6
|
|
7238
|
+
DA:243,6
|
|
7239
|
+
DA:254,6
|
|
7240
|
+
DA:257,21
|
|
7241
|
+
DA:261,2
|
|
7242
|
+
DA:262,17
|
|
7243
|
+
DA:263,17
|
|
7244
|
+
DA:264,17
|
|
7245
|
+
DA:265,17
|
|
7246
|
+
DA:266,15
|
|
7247
|
+
DA:268,2
|
|
7248
|
+
LF:126
|
|
7249
|
+
LH:102
|
|
7250
|
+
BRDA:20,0,0,17
|
|
7251
|
+
BRDA:44,1,0,2
|
|
7252
|
+
BRDA:44,1,1,21
|
|
7253
|
+
BRDA:48,2,0,0
|
|
7254
|
+
BRDA:48,2,1,21
|
|
7255
|
+
BRDA:67,3,0,1
|
|
7256
|
+
BRDA:67,3,1,20
|
|
7257
|
+
BRDA:76,4,0,2
|
|
7258
|
+
BRDA:76,4,1,19
|
|
7259
|
+
BRDA:83,5,0,0
|
|
7260
|
+
BRDA:83,5,1,21
|
|
7261
|
+
BRDA:92,6,0,19
|
|
7262
|
+
BRDA:92,6,1,2
|
|
7263
|
+
BRDA:100,7,0,0
|
|
7264
|
+
BRDA:100,7,1,21
|
|
7265
|
+
BRDA:109,8,0,1
|
|
7266
|
+
BRDA:109,8,1,20
|
|
7267
|
+
BRDA:109,9,0,21
|
|
7268
|
+
BRDA:109,9,1,19
|
|
7269
|
+
BRDA:109,9,2,1
|
|
7270
|
+
BRDA:110,10,0,0
|
|
7271
|
+
BRDA:110,10,1,1
|
|
7272
|
+
BRDA:111,11,0,1
|
|
7273
|
+
BRDA:111,11,1,0
|
|
7274
|
+
BRDA:111,11,2,0
|
|
7275
|
+
BRDA:119,12,0,0
|
|
7276
|
+
BRDA:119,12,1,0
|
|
7277
|
+
BRDA:119,13,0,0
|
|
7278
|
+
BRDA:119,13,1,0
|
|
7279
|
+
BRDA:132,14,0,0
|
|
7280
|
+
BRDA:132,14,1,20
|
|
7281
|
+
BRDA:137,15,0,18
|
|
7282
|
+
BRDA:137,15,1,2
|
|
7283
|
+
BRDA:142,16,0,0
|
|
7284
|
+
BRDA:142,16,1,20
|
|
7285
|
+
BRDA:149,17,0,0
|
|
7286
|
+
BRDA:149,17,1,20
|
|
7287
|
+
BRDA:176,18,0,0
|
|
7288
|
+
BRDA:176,18,1,0
|
|
7289
|
+
BRDA:176,19,0,0
|
|
7290
|
+
BRDA:176,19,1,0
|
|
7291
|
+
BRDA:189,20,0,0
|
|
7292
|
+
BRDA:189,20,1,0
|
|
7293
|
+
BRDA:202,21,0,5
|
|
7294
|
+
BRDA:202,21,1,1
|
|
7295
|
+
BRDA:203,22,0,0
|
|
7296
|
+
BRDA:203,22,1,5
|
|
7297
|
+
BRDA:217,23,0,0
|
|
7298
|
+
BRDA:217,23,1,21
|
|
7299
|
+
BRDA:217,24,0,21
|
|
7300
|
+
BRDA:217,24,1,21
|
|
7301
|
+
BRDA:220,25,0,21
|
|
7302
|
+
BRDA:220,25,1,20
|
|
7303
|
+
BRDA:221,26,0,21
|
|
7304
|
+
BRDA:221,26,1,10
|
|
7305
|
+
BRDA:223,27,0,2
|
|
7306
|
+
BRDA:223,27,1,0
|
|
7307
|
+
BRDA:227,28,0,16
|
|
7308
|
+
BRDA:227,28,1,5
|
|
7309
|
+
BRDA:232,29,0,0
|
|
7310
|
+
BRDA:232,29,1,6
|
|
7311
|
+
BRF:61
|
|
7312
|
+
BRH:38
|
|
7279
7313
|
end_of_record
|
|
7280
7314
|
TN:
|
|
7281
7315
|
SF:src/threads/utils.js
|
|
@@ -20,6 +20,8 @@ const environment_1 = require("../../../environment");
|
|
|
20
20
|
const context_1 = require("@budibase/backend-core/context");
|
|
21
21
|
const pro_1 = require("@budibase/pro");
|
|
22
22
|
const backend_core_1 = require("@budibase/backend-core");
|
|
23
|
+
const utils_3 = require("@budibase/backend-core/utils");
|
|
24
|
+
const constants_2 = require("@budibase/backend-core/constants");
|
|
23
25
|
const Runner = new threads_1.Thread(threads_1.ThreadType.QUERY, {
|
|
24
26
|
timeoutMs: environment_1.QUERY_THREAD_TIMEOUT || 10000,
|
|
25
27
|
});
|
|
@@ -111,6 +113,19 @@ function find(ctx) {
|
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
115
|
exports.find = find;
|
|
116
|
+
//Required to discern between OIDC OAuth config entries
|
|
117
|
+
function getOAuthConfigCookieId(ctx) {
|
|
118
|
+
if (ctx.user.providerType === constants_2.Configs.OIDC) {
|
|
119
|
+
return (0, utils_3.getCookie)(ctx, constants_2.Cookies.OIDC_CONFIG);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function getAuthConfig(ctx) {
|
|
123
|
+
const authCookie = (0, utils_3.getCookie)(ctx, constants_2.Cookies.Auth);
|
|
124
|
+
let authConfigCtx = {};
|
|
125
|
+
authConfigCtx["configId"] = getOAuthConfigCookieId(ctx);
|
|
126
|
+
authConfigCtx["sessionId"] = authCookie ? authCookie.sessionId : null;
|
|
127
|
+
return authConfigCtx;
|
|
128
|
+
}
|
|
114
129
|
function preview(ctx) {
|
|
115
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
131
|
const db = (0, context_1.getAppDB)();
|
|
@@ -119,6 +134,7 @@ function preview(ctx) {
|
|
|
119
134
|
// preview may not have a queryId as it hasn't been saved, but if it does
|
|
120
135
|
// this stops dynamic variables from calling the same query
|
|
121
136
|
const { fields, parameters, queryVerb, transformer, queryId } = query;
|
|
137
|
+
const authConfigCtx = getAuthConfig(ctx);
|
|
122
138
|
try {
|
|
123
139
|
const runFn = () => Runner.run({
|
|
124
140
|
appId: ctx.appId,
|
|
@@ -130,6 +146,7 @@ function preview(ctx) {
|
|
|
130
146
|
queryId,
|
|
131
147
|
ctx: {
|
|
132
148
|
user: ctx.user,
|
|
149
|
+
auth: Object.assign({}, authConfigCtx),
|
|
133
150
|
},
|
|
134
151
|
});
|
|
135
152
|
const { rows, keys, info, extra } = yield pro_1.quotas.addQuery(runFn);
|
|
@@ -152,6 +169,7 @@ function execute(ctx, opts = { rowsOnly: false }) {
|
|
|
152
169
|
const db = (0, context_1.getAppDB)();
|
|
153
170
|
const query = yield db.get(ctx.params.queryId);
|
|
154
171
|
const datasource = yield db.get(query.datasourceId);
|
|
172
|
+
const authConfigCtx = getAuthConfig(ctx);
|
|
155
173
|
const enrichedParameters = ctx.request.body.parameters || {};
|
|
156
174
|
// make sure parameters are fully enriched with defaults
|
|
157
175
|
if (query && query.parameters) {
|
|
@@ -174,6 +192,7 @@ function execute(ctx, opts = { rowsOnly: false }) {
|
|
|
174
192
|
queryId: ctx.params.queryId,
|
|
175
193
|
ctx: {
|
|
176
194
|
user: ctx.user,
|
|
195
|
+
auth: Object.assign({}, authConfigCtx),
|
|
177
196
|
},
|
|
178
197
|
});
|
|
179
198
|
const { rows, pagination, extra } = yield pro_1.quotas.addQuery(runFn);
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "1.0.212-alpha.
|
|
4
|
+
"version": "1.0.212-alpha.14",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"license": "GPL-3.0",
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
80
|
-
"@budibase/backend-core": "^1.0.212-alpha.
|
|
81
|
-
"@budibase/client": "^1.0.212-alpha.
|
|
82
|
-
"@budibase/pro": "1.0.212-alpha.
|
|
83
|
-
"@budibase/string-templates": "^1.0.212-alpha.
|
|
84
|
-
"@budibase/types": "^1.0.212-alpha.
|
|
80
|
+
"@budibase/backend-core": "^1.0.212-alpha.14",
|
|
81
|
+
"@budibase/client": "^1.0.212-alpha.14",
|
|
82
|
+
"@budibase/pro": "1.0.212-alpha.14",
|
|
83
|
+
"@budibase/string-templates": "^1.0.212-alpha.14",
|
|
84
|
+
"@budibase/types": "^1.0.212-alpha.14",
|
|
85
85
|
"@bull-board/api": "3.7.0",
|
|
86
86
|
"@bull-board/koa": "3.9.4",
|
|
87
87
|
"@elastic/elasticsearch": "7.10.0",
|
package/dist/threads/query.js
CHANGED
|
@@ -14,6 +14,8 @@ const ScriptRunner = require("../utilities/scriptRunner");
|
|
|
14
14
|
const { integrations } = require("../integrations");
|
|
15
15
|
const { processStringSync } = require("@budibase/string-templates");
|
|
16
16
|
const { doInAppContext, getAppDB } = require("@budibase/backend-core/context");
|
|
17
|
+
const { refreshOAuthToken, updateUserOAuth, } = require("@budibase/backend-core/auth");
|
|
18
|
+
const { getGlobalIDFromUserMetadataID } = require("../db/utils");
|
|
17
19
|
const { isSQL } = require("../integrations/utils");
|
|
18
20
|
const { enrichQueryFields, interpolateSQL, } = require("../integrations/queries/sql");
|
|
19
21
|
class QueryRunner {
|
|
@@ -34,8 +36,10 @@ class QueryRunner {
|
|
|
34
36
|
// it can be
|
|
35
37
|
this.queryResponse = {};
|
|
36
38
|
this.hasRerun = false;
|
|
39
|
+
this.hasRefreshedOAuth = false;
|
|
37
40
|
}
|
|
38
41
|
execute() {
|
|
42
|
+
var _a;
|
|
39
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
44
|
let { datasource, fields, queryVerb, transformer } = this;
|
|
41
45
|
const Integration = integrations[datasource.source];
|
|
@@ -87,12 +91,20 @@ class QueryRunner {
|
|
|
87
91
|
rows = runner.execute();
|
|
88
92
|
}
|
|
89
93
|
// if the request fails we retry once, invalidating the cached value
|
|
90
|
-
if (info &&
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
if (info && info.code >= 400 && !this.hasRerun) {
|
|
95
|
+
if (((_a = this.ctx.user) === null || _a === void 0 ? void 0 : _a.provider) &&
|
|
96
|
+
info.code === 401 &&
|
|
97
|
+
!this.hasRefreshedOAuth) {
|
|
98
|
+
// Attempt to refresh the access token from the provider
|
|
99
|
+
this.hasRefreshedOAuth = true;
|
|
100
|
+
const authResponse = yield this.refreshOAuth2(this.ctx);
|
|
101
|
+
if (!authResponse || authResponse.err) {
|
|
102
|
+
// In this event the user may have oAuth issues that
|
|
103
|
+
// could require re-authenticating with their provider.
|
|
104
|
+
throw new Error("OAuth2 access token could not be refreshed");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
94
107
|
this.hasRerun = true;
|
|
95
|
-
// invalidate the cache value
|
|
96
108
|
yield threadUtils.invalidateDynamicVariables(this.cachedVariables);
|
|
97
109
|
return this.execute();
|
|
98
110
|
}
|
|
@@ -130,6 +142,24 @@ class QueryRunner {
|
|
|
130
142
|
}, { noRecursiveQuery: true }).execute();
|
|
131
143
|
});
|
|
132
144
|
}
|
|
145
|
+
refreshOAuth2(ctx) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const { oauth2, providerType, _id } = ctx.user;
|
|
148
|
+
const { configId } = ctx.auth;
|
|
149
|
+
if (!providerType || !(oauth2 === null || oauth2 === void 0 ? void 0 : oauth2.refreshToken)) {
|
|
150
|
+
console.error("No refresh token found for authenticated user");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const resp = yield refreshOAuthToken(oauth2.refreshToken, providerType, configId);
|
|
154
|
+
// Refresh session flow. Should be in same location as refreshOAuthToken
|
|
155
|
+
// There are several other properties available in 'resp'
|
|
156
|
+
if (!resp.error) {
|
|
157
|
+
const globalUserId = getGlobalIDFromUserMetadataID(_id);
|
|
158
|
+
yield updateUserOAuth(globalUserId, resp);
|
|
159
|
+
}
|
|
160
|
+
return resp;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
133
163
|
getDynamicVariable(variable) {
|
|
134
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
165
|
let { parameters } = this;
|