@budibase/server 1.4.17 → 1.4.18-alpha.1
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/Dockerfile +2 -0
- package/builder/assets/{index.2062efc5.js → index.7bac432b.js} +296 -292
- package/builder/assets/index.ffaba7b0.css +6 -0
- package/builder/index.html +2 -2
- package/coverage/clover.xml +144 -182
- package/coverage/coverage-final.json +34 -36
- package/coverage/lcov-report/api/controllers/apikeys.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/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +9 -24
- package/coverage/lcov-report/api/controllers/integration.js.html +2 -2
- 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 +5 -5
- package/coverage/lcov-report/api/controllers/row/internal.js.html +4 -4
- 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/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 +2 -2
- package/coverage/lcov-report/api/routes/apikeys.js.html +2 -2
- package/coverage/lcov-report/api/routes/automation.js.html +2 -2
- package/coverage/lcov-report/api/routes/backup.js.html +2 -2
- package/coverage/lcov-report/api/routes/cloud.js.html +2 -2
- package/coverage/lcov-report/api/routes/component.js.html +2 -2
- package/coverage/lcov-report/api/routes/datasource.js.html +2 -2
- package/coverage/lcov-report/api/routes/deploy.js.html +2 -2
- package/coverage/lcov-report/api/routes/dev.js.html +2 -2
- package/coverage/lcov-report/api/routes/index.html +5 -20
- package/coverage/lcov-report/api/routes/integration.js.html +2 -2
- package/coverage/lcov-report/api/routes/layout.js.html +2 -2
- package/coverage/lcov-report/api/routes/metadata.js.html +2 -2
- package/coverage/lcov-report/api/routes/migrations.js.html +2 -2
- package/coverage/lcov-report/api/routes/permission.js.html +2 -2
- package/coverage/lcov-report/api/routes/query.js.html +2 -2
- package/coverage/lcov-report/api/routes/role.js.html +2 -2
- package/coverage/lcov-report/api/routes/routing.js.html +2 -2
- package/coverage/lcov-report/api/routes/screen.js.html +2 -2
- package/coverage/lcov-report/api/routes/script.js.html +2 -2
- package/coverage/lcov-report/api/routes/table.js.html +2 -2
- package/coverage/lcov-report/api/routes/templates.js.html +2 -2
- package/coverage/lcov-report/api/routes/user.js.html +2 -2
- 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 +2 -2
- package/coverage/lcov-report/api/routes/webhook.js.html +2 -2
- 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 +52 -4
- 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 +5 -5
- package/coverage/lcov-report/db/index.js.html +4 -4
- 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 +11 -11
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +7 -7
- 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 +34 -34
- 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/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 +19 -13
- package/coverage/lcov-report/utilities/index.html +24 -24
- 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 +12 -12
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +8 -8
- 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 +21 -12
- package/coverage/lcov-report/utilities/workerRequests.js.html +33 -3
- package/coverage/lcov.info +236 -290
- package/dist/api/controllers/application.js +2 -0
- package/dist/api/controllers/auth.js +58 -49
- package/dist/api/controllers/integration.js +1 -1
- package/dist/api/controllers/row/internal.js +1 -1
- package/dist/api/routes/analytics.js +1 -1
- package/dist/api/routes/apikeys.js +1 -1
- package/dist/api/routes/auth.js +31 -4
- package/dist/api/routes/automation.js +1 -1
- package/dist/api/routes/backup.js +1 -1
- package/dist/api/routes/cloud.js +1 -1
- package/dist/api/routes/component.js +1 -1
- package/dist/api/routes/datasource.js +1 -1
- package/dist/api/routes/deploy.js +1 -1
- package/dist/api/routes/dev.js +1 -1
- package/dist/api/routes/integration.js +1 -1
- package/dist/api/routes/layout.js +1 -1
- package/dist/api/routes/metadata.js +1 -1
- package/dist/api/routes/migrations.js +1 -1
- package/dist/api/routes/permission.js +1 -1
- package/dist/api/routes/public/applications.js +5 -0
- package/dist/api/routes/public/queries.js +2 -0
- package/dist/api/routes/public/rows.js +5 -0
- package/dist/api/routes/public/tables.js +5 -0
- package/dist/api/routes/public/users.js +5 -0
- package/dist/api/routes/query.js +1 -1
- package/dist/api/routes/role.js +1 -1
- package/dist/api/routes/routing.js +1 -1
- package/dist/api/routes/screen.js +1 -1
- package/dist/api/routes/script.js +1 -1
- package/dist/api/routes/table.js +1 -1
- package/dist/api/routes/templates.js +1 -1
- package/dist/api/routes/user.js +1 -1
- package/dist/api/routes/view.js +1 -1
- package/dist/api/routes/webhook.js +1 -1
- package/dist/automations/steps/sendSmtpEmail.js +10 -2
- package/dist/db/index.js +1 -1
- package/dist/middleware/authorized.js +2 -2
- package/dist/migrations/functions/usageQuotas/syncApps.js +2 -1
- package/dist/migrations/functions/usageQuotas/syncRows.js +2 -1
- package/dist/package.json +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/global.js +6 -3
- package/dist/utilities/users.js +4 -2
- package/dist/utilities/workerRequests.js +3 -1
- package/package.json +7 -7
- package/scripts/dev/manage.js +1 -0
- package/specs/openapi.json +22 -0
- package/specs/openapi.yaml +22 -0
- package/src/api/controllers/application.ts +3 -7
- package/src/api/controllers/{auth.js → auth.ts} +20 -18
- package/src/api/controllers/integration.js +1 -1
- package/src/api/controllers/row/internal.js +1 -1
- package/src/api/routes/analytics.js +1 -1
- package/src/api/routes/apikeys.js +1 -1
- package/src/api/routes/auth.ts +8 -0
- package/src/api/routes/automation.js +1 -1
- package/src/api/routes/backup.js +1 -1
- package/src/api/routes/cloud.js +1 -1
- package/src/api/routes/component.js +1 -1
- package/src/api/routes/datasource.js +1 -1
- package/src/api/routes/deploy.js +1 -1
- package/src/api/routes/dev.js +1 -1
- package/src/api/routes/integration.js +1 -1
- package/src/api/routes/layout.js +1 -1
- package/src/api/routes/metadata.js +1 -1
- package/src/api/routes/migrations.js +1 -1
- package/src/api/routes/permission.js +1 -1
- package/src/api/routes/public/applications.ts +5 -0
- package/src/api/routes/public/queries.ts +2 -0
- package/src/api/routes/public/rows.ts +5 -0
- package/src/api/routes/public/tables.ts +5 -0
- package/src/api/routes/public/users.ts +5 -0
- package/src/api/routes/query.js +1 -1
- package/src/api/routes/role.js +1 -1
- package/src/api/routes/routing.js +1 -1
- package/src/api/routes/screen.js +1 -1
- package/src/api/routes/script.js +1 -1
- package/src/api/routes/table.js +1 -1
- package/src/api/routes/templates.js +1 -1
- package/src/api/routes/tests/row.spec.js +3 -1
- package/src/api/routes/user.js +1 -1
- package/src/api/routes/view.js +1 -1
- package/src/api/routes/webhook.js +1 -1
- package/src/automations/steps/sendSmtpEmail.js +18 -2
- package/src/db/index.js +1 -1
- package/src/definitions/openapi.ts +134 -447
- package/src/middleware/authorized.ts +2 -2
- package/src/migrations/functions/usageQuotas/syncApps.ts +2 -1
- package/src/migrations/functions/usageQuotas/syncRows.ts +2 -1
- package/src/migrations/functions/usageQuotas/tests/syncApps.spec.ts +2 -1
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +2 -1
- package/src/utilities/global.js +6 -4
- package/src/utilities/users.js +5 -2
- package/src/utilities/workerRequests.js +11 -1
- package/builder/assets/index.91c8117f.css +0 -6
- package/coverage/lcov-report/api/controllers/auth.js.html +0 -292
- package/coverage/lcov-report/api/routes/auth.js.html +0 -109
- package/src/api/routes/auth.js +0 -8
|
@@ -5,491 +5,67 @@
|
|
|
5
5
|
|
|
6
6
|
export interface paths {
|
|
7
7
|
"/applications": {
|
|
8
|
-
post:
|
|
9
|
-
parameters: {
|
|
10
|
-
header: {
|
|
11
|
-
/** The ID of the app which this request is targeting. */
|
|
12
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
responses: {
|
|
16
|
-
/** Returns the created application. */
|
|
17
|
-
200: {
|
|
18
|
-
content: {
|
|
19
|
-
"application/json": components["schemas"]["applicationOutput"];
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
requestBody: {
|
|
24
|
-
content: {
|
|
25
|
-
"application/json": components["schemas"]["application"];
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
8
|
+
post: operations["create"];
|
|
29
9
|
};
|
|
30
10
|
"/applications/{appId}": {
|
|
31
|
-
get:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/** The ID of the app which this request is targeting. */
|
|
35
|
-
appId: components["parameters"]["appIdUrl"];
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
responses: {
|
|
39
|
-
/** Returns the retrieved application. */
|
|
40
|
-
200: {
|
|
41
|
-
content: {
|
|
42
|
-
"application/json": components["schemas"]["applicationOutput"];
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
put: {
|
|
48
|
-
parameters: {
|
|
49
|
-
path: {
|
|
50
|
-
/** The ID of the app which this request is targeting. */
|
|
51
|
-
appId: components["parameters"]["appIdUrl"];
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
responses: {
|
|
55
|
-
/** Returns the updated application. */
|
|
56
|
-
200: {
|
|
57
|
-
content: {
|
|
58
|
-
"application/json": components["schemas"]["applicationOutput"];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
requestBody: {
|
|
63
|
-
content: {
|
|
64
|
-
"application/json": components["schemas"]["application"];
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
delete: {
|
|
69
|
-
parameters: {
|
|
70
|
-
path: {
|
|
71
|
-
/** The ID of the app which this request is targeting. */
|
|
72
|
-
appId: components["parameters"]["appIdUrl"];
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
responses: {
|
|
76
|
-
/** Returns the deleted application. */
|
|
77
|
-
200: {
|
|
78
|
-
content: {
|
|
79
|
-
"application/json": components["schemas"]["applicationOutput"];
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
11
|
+
get: operations["getById"];
|
|
12
|
+
put: operations["update"];
|
|
13
|
+
delete: operations["destroy"];
|
|
84
14
|
};
|
|
85
15
|
"/applications/search": {
|
|
86
16
|
/** Based on application properties (currently only name) search for applications. */
|
|
87
|
-
post:
|
|
88
|
-
responses: {
|
|
89
|
-
/** Returns the applications that were found based on the search parameters. */
|
|
90
|
-
200: {
|
|
91
|
-
content: {
|
|
92
|
-
"application/json": components["schemas"]["applicationSearch"];
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
requestBody: {
|
|
97
|
-
content: {
|
|
98
|
-
"application/json": components["schemas"]["nameSearch"];
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
};
|
|
17
|
+
post: operations["search"];
|
|
102
18
|
};
|
|
103
19
|
"/queries/{queryId}": {
|
|
104
20
|
/** Queries which have been created within a Budibase app can be executed using this, */
|
|
105
|
-
post:
|
|
106
|
-
parameters: {
|
|
107
|
-
path: {
|
|
108
|
-
/** The ID of the query which this request is targeting. */
|
|
109
|
-
queryId: components["parameters"]["queryId"];
|
|
110
|
-
};
|
|
111
|
-
header: {
|
|
112
|
-
/** The ID of the app which this request is targeting. */
|
|
113
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
responses: {
|
|
117
|
-
/** Returns the result of the query execution. */
|
|
118
|
-
200: {
|
|
119
|
-
content: {
|
|
120
|
-
"application/json": components["schemas"]["executeQueryOutput"];
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
requestBody: {
|
|
125
|
-
content: {
|
|
126
|
-
"application/json": components["schemas"]["executeQuery"];
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
21
|
+
post: operations["execute"];
|
|
130
22
|
};
|
|
131
23
|
"/queries/search": {
|
|
132
24
|
/** Based on query properties (currently only name) search for queries. */
|
|
133
|
-
post:
|
|
134
|
-
parameters: {
|
|
135
|
-
header: {
|
|
136
|
-
/** The ID of the app which this request is targeting. */
|
|
137
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
responses: {
|
|
141
|
-
/** Returns the queries found based on the search parameters. */
|
|
142
|
-
200: {
|
|
143
|
-
content: {
|
|
144
|
-
"application/json": components["schemas"]["querySearch"];
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
requestBody: {
|
|
149
|
-
content: {
|
|
150
|
-
"application/json": components["schemas"]["nameSearch"];
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
};
|
|
25
|
+
post: operations["search"];
|
|
154
26
|
};
|
|
155
27
|
"/tables/{tableId}/rows": {
|
|
156
28
|
/** Creates a row within the specified table. */
|
|
157
|
-
post:
|
|
158
|
-
parameters: {
|
|
159
|
-
path: {
|
|
160
|
-
/** The ID of the table which this request is targeting. */
|
|
161
|
-
tableId: components["parameters"]["tableId"];
|
|
162
|
-
};
|
|
163
|
-
header: {
|
|
164
|
-
/** The ID of the app which this request is targeting. */
|
|
165
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
responses: {
|
|
169
|
-
/** Returns the created row, including the ID which has been generated for it. This can be found in the Budibase portal, viewed under the developer information. */
|
|
170
|
-
200: {
|
|
171
|
-
content: {
|
|
172
|
-
"application/json": components["schemas"]["rowOutput"];
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
requestBody: {
|
|
177
|
-
content: {
|
|
178
|
-
"application/json": components["schemas"]["row"];
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
};
|
|
29
|
+
post: operations["create"];
|
|
182
30
|
};
|
|
183
31
|
"/tables/{tableId}/rows/{rowId}": {
|
|
184
32
|
/** This gets a single row, it will be enriched with the full related rows, rather than the squashed "primaryDisplay" format returned by the search endpoint. */
|
|
185
|
-
get:
|
|
186
|
-
parameters: {
|
|
187
|
-
path: {
|
|
188
|
-
/** The ID of the table which this request is targeting. */
|
|
189
|
-
tableId: components["parameters"]["tableId"];
|
|
190
|
-
/** The ID of the row which this request is targeting. */
|
|
191
|
-
rowId: components["parameters"]["rowId"];
|
|
192
|
-
};
|
|
193
|
-
header: {
|
|
194
|
-
/** The ID of the app which this request is targeting. */
|
|
195
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
responses: {
|
|
199
|
-
/** Returns the retrieved row. */
|
|
200
|
-
200: {
|
|
201
|
-
content: {
|
|
202
|
-
"application/json": components["schemas"]["rowOutput"];
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
};
|
|
33
|
+
get: operations["getById"];
|
|
207
34
|
/** Updates a row within the specified table. */
|
|
208
|
-
put:
|
|
209
|
-
parameters: {
|
|
210
|
-
path: {
|
|
211
|
-
/** The ID of the table which this request is targeting. */
|
|
212
|
-
tableId: components["parameters"]["tableId"];
|
|
213
|
-
/** The ID of the row which this request is targeting. */
|
|
214
|
-
rowId: components["parameters"]["rowId"];
|
|
215
|
-
};
|
|
216
|
-
header: {
|
|
217
|
-
/** The ID of the app which this request is targeting. */
|
|
218
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
responses: {
|
|
222
|
-
/** Returns the created row, including the ID which has been generated for it. */
|
|
223
|
-
200: {
|
|
224
|
-
content: {
|
|
225
|
-
"application/json": components["schemas"]["rowOutput"];
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
requestBody: {
|
|
230
|
-
content: {
|
|
231
|
-
"application/json": components["schemas"]["row"];
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
};
|
|
35
|
+
put: operations["update"];
|
|
235
36
|
/** Deletes a row within the specified table. */
|
|
236
|
-
delete:
|
|
237
|
-
parameters: {
|
|
238
|
-
path: {
|
|
239
|
-
/** The ID of the table which this request is targeting. */
|
|
240
|
-
tableId: components["parameters"]["tableId"];
|
|
241
|
-
/** The ID of the row which this request is targeting. */
|
|
242
|
-
rowId: components["parameters"]["rowId"];
|
|
243
|
-
};
|
|
244
|
-
header: {
|
|
245
|
-
/** The ID of the app which this request is targeting. */
|
|
246
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
responses: {
|
|
250
|
-
/** Returns the deleted row, including the ID which has been generated for it. */
|
|
251
|
-
200: {
|
|
252
|
-
content: {
|
|
253
|
-
"application/json": components["schemas"]["rowOutput"];
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
};
|
|
257
|
-
};
|
|
37
|
+
delete: operations["destroy"];
|
|
258
38
|
};
|
|
259
39
|
"/tables/{tableId}/rows/search": {
|
|
260
|
-
post:
|
|
261
|
-
parameters: {
|
|
262
|
-
path: {
|
|
263
|
-
/** The ID of the table which this request is targeting. */
|
|
264
|
-
tableId: components["parameters"]["tableId"];
|
|
265
|
-
};
|
|
266
|
-
header: {
|
|
267
|
-
/** The ID of the app which this request is targeting. */
|
|
268
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
responses: {
|
|
272
|
-
/** The response will contain an array of rows that match the search parameters. */
|
|
273
|
-
200: {
|
|
274
|
-
content: {
|
|
275
|
-
"application/json": components["schemas"]["searchOutput"];
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
requestBody: {
|
|
280
|
-
content: {
|
|
281
|
-
"application/json": components["schemas"]["rowSearch"];
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
};
|
|
40
|
+
post: operations["search"];
|
|
285
41
|
};
|
|
286
42
|
"/tables": {
|
|
287
43
|
/** Create a table, this could be internal or external. */
|
|
288
|
-
post:
|
|
289
|
-
parameters: {
|
|
290
|
-
header: {
|
|
291
|
-
/** The ID of the app which this request is targeting. */
|
|
292
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
responses: {
|
|
296
|
-
/** Returns the created table, including the ID which has been generated for it. This can be internal or external datasources. */
|
|
297
|
-
200: {
|
|
298
|
-
content: {
|
|
299
|
-
"application/json": components["schemas"]["tableOutput"];
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
};
|
|
303
|
-
requestBody: {
|
|
304
|
-
content: {
|
|
305
|
-
"application/json": components["schemas"]["table"];
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
};
|
|
44
|
+
post: operations["create"];
|
|
309
45
|
};
|
|
310
46
|
"/tables/{tableId}": {
|
|
311
47
|
/** Lookup a table, this could be internal or external. */
|
|
312
|
-
get:
|
|
313
|
-
parameters: {
|
|
314
|
-
path: {
|
|
315
|
-
/** The ID of the table which this request is targeting. */
|
|
316
|
-
tableId: components["parameters"]["tableId"];
|
|
317
|
-
};
|
|
318
|
-
header: {
|
|
319
|
-
/** The ID of the app which this request is targeting. */
|
|
320
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
responses: {
|
|
324
|
-
/** Returns the retrieved table. */
|
|
325
|
-
200: {
|
|
326
|
-
content: {
|
|
327
|
-
"application/json": components["schemas"]["tableOutput"];
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
};
|
|
48
|
+
get: operations["getById"];
|
|
332
49
|
/** Update a table, this could be internal or external. */
|
|
333
|
-
put:
|
|
334
|
-
parameters: {
|
|
335
|
-
path: {
|
|
336
|
-
/** The ID of the table which this request is targeting. */
|
|
337
|
-
tableId: components["parameters"]["tableId"];
|
|
338
|
-
};
|
|
339
|
-
header: {
|
|
340
|
-
/** The ID of the app which this request is targeting. */
|
|
341
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
responses: {
|
|
345
|
-
/** Returns the updated table. */
|
|
346
|
-
200: {
|
|
347
|
-
content: {
|
|
348
|
-
"application/json": components["schemas"]["tableOutput"];
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
requestBody: {
|
|
353
|
-
content: {
|
|
354
|
-
"application/json": components["schemas"]["table"];
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
};
|
|
50
|
+
put: operations["update"];
|
|
358
51
|
/** Delete a table, this could be internal or external. */
|
|
359
|
-
delete:
|
|
360
|
-
parameters: {
|
|
361
|
-
path: {
|
|
362
|
-
/** The ID of the table which this request is targeting. */
|
|
363
|
-
tableId: components["parameters"]["tableId"];
|
|
364
|
-
};
|
|
365
|
-
header: {
|
|
366
|
-
/** The ID of the app which this request is targeting. */
|
|
367
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
368
|
-
};
|
|
369
|
-
};
|
|
370
|
-
responses: {
|
|
371
|
-
/** Returns the deleted table. */
|
|
372
|
-
200: {
|
|
373
|
-
content: {
|
|
374
|
-
"application/json": components["schemas"]["tableOutput"];
|
|
375
|
-
};
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
};
|
|
52
|
+
delete: operations["destroy"];
|
|
379
53
|
};
|
|
380
54
|
"/tables/search": {
|
|
381
55
|
/** Based on table properties (currently only name) search for tables. This could be an internal or an external table. */
|
|
382
|
-
post:
|
|
383
|
-
parameters: {
|
|
384
|
-
header: {
|
|
385
|
-
/** The ID of the app which this request is targeting. */
|
|
386
|
-
"x-budibase-app-id": components["parameters"]["appId"];
|
|
387
|
-
};
|
|
388
|
-
};
|
|
389
|
-
responses: {
|
|
390
|
-
/** Returns the found tables, based on the search parameters. */
|
|
391
|
-
200: {
|
|
392
|
-
content: {
|
|
393
|
-
"application/json": components["schemas"]["tableSearch"];
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
requestBody: {
|
|
398
|
-
content: {
|
|
399
|
-
"application/json": components["schemas"]["nameSearch"];
|
|
400
|
-
};
|
|
401
|
-
};
|
|
402
|
-
};
|
|
56
|
+
post: operations["search"];
|
|
403
57
|
};
|
|
404
58
|
"/users": {
|
|
405
|
-
post:
|
|
406
|
-
responses: {
|
|
407
|
-
/** Returns the created user. */
|
|
408
|
-
200: {
|
|
409
|
-
content: {
|
|
410
|
-
"application/json": components["schemas"]["userOutput"];
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
};
|
|
414
|
-
requestBody: {
|
|
415
|
-
content: {
|
|
416
|
-
"application/json": components["schemas"]["user"];
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
};
|
|
59
|
+
post: operations["create"];
|
|
420
60
|
};
|
|
421
61
|
"/users/{userId}": {
|
|
422
|
-
get:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
/** The ID of the user which this request is targeting. */
|
|
426
|
-
userId: components["parameters"]["userId"];
|
|
427
|
-
};
|
|
428
|
-
};
|
|
429
|
-
responses: {
|
|
430
|
-
/** Returns the retrieved user. */
|
|
431
|
-
200: {
|
|
432
|
-
content: {
|
|
433
|
-
"application/json": components["schemas"]["userOutput"];
|
|
434
|
-
};
|
|
435
|
-
};
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
put: {
|
|
439
|
-
parameters: {
|
|
440
|
-
path: {
|
|
441
|
-
/** The ID of the user which this request is targeting. */
|
|
442
|
-
userId: components["parameters"]["userId"];
|
|
443
|
-
};
|
|
444
|
-
};
|
|
445
|
-
responses: {
|
|
446
|
-
/** Returns the updated user. */
|
|
447
|
-
200: {
|
|
448
|
-
content: {
|
|
449
|
-
"application/json": components["schemas"]["userOutput"];
|
|
450
|
-
};
|
|
451
|
-
};
|
|
452
|
-
};
|
|
453
|
-
requestBody: {
|
|
454
|
-
content: {
|
|
455
|
-
"application/json": components["schemas"]["user"];
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
delete: {
|
|
460
|
-
parameters: {
|
|
461
|
-
path: {
|
|
462
|
-
/** The ID of the user which this request is targeting. */
|
|
463
|
-
userId: components["parameters"]["userId"];
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
responses: {
|
|
467
|
-
/** Returns the deleted user. */
|
|
468
|
-
200: {
|
|
469
|
-
content: {
|
|
470
|
-
"application/json": components["schemas"]["userOutput"];
|
|
471
|
-
};
|
|
472
|
-
};
|
|
473
|
-
};
|
|
474
|
-
};
|
|
62
|
+
get: operations["getById"];
|
|
63
|
+
put: operations["update"];
|
|
64
|
+
delete: operations["destroy"];
|
|
475
65
|
};
|
|
476
66
|
"/users/search": {
|
|
477
67
|
/** Based on user properties (currently only name) search for users. */
|
|
478
|
-
post:
|
|
479
|
-
responses: {
|
|
480
|
-
/** Returns the found users based on search parameters. */
|
|
481
|
-
200: {
|
|
482
|
-
content: {
|
|
483
|
-
"application/json": components["schemas"]["userSearch"];
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
requestBody: {
|
|
488
|
-
content: {
|
|
489
|
-
"application/json": components["schemas"]["nameSearch"];
|
|
490
|
-
};
|
|
491
|
-
};
|
|
492
|
-
};
|
|
68
|
+
post: operations["search"];
|
|
493
69
|
};
|
|
494
70
|
}
|
|
495
71
|
|
|
@@ -1127,6 +703,117 @@ export interface components {
|
|
|
1127
703
|
};
|
|
1128
704
|
}
|
|
1129
705
|
|
|
1130
|
-
export interface operations {
|
|
706
|
+
export interface operations {
|
|
707
|
+
create: {
|
|
708
|
+
responses: {
|
|
709
|
+
/** Returns the created user. */
|
|
710
|
+
200: {
|
|
711
|
+
content: {
|
|
712
|
+
"application/json": components["schemas"]["userOutput"];
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
requestBody: {
|
|
717
|
+
content: {
|
|
718
|
+
"application/json": components["schemas"]["user"];
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
getById: {
|
|
723
|
+
parameters: {
|
|
724
|
+
path: {
|
|
725
|
+
/** The ID of the user which this request is targeting. */
|
|
726
|
+
userId: components["parameters"]["userId"];
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
responses: {
|
|
730
|
+
/** Returns the retrieved user. */
|
|
731
|
+
200: {
|
|
732
|
+
content: {
|
|
733
|
+
"application/json": components["schemas"]["userOutput"];
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
update: {
|
|
739
|
+
parameters: {
|
|
740
|
+
path: {
|
|
741
|
+
/** The ID of the user which this request is targeting. */
|
|
742
|
+
userId: components["parameters"]["userId"];
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
responses: {
|
|
746
|
+
/** Returns the updated user. */
|
|
747
|
+
200: {
|
|
748
|
+
content: {
|
|
749
|
+
"application/json": components["schemas"]["userOutput"];
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
requestBody: {
|
|
754
|
+
content: {
|
|
755
|
+
"application/json": components["schemas"]["user"];
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
destroy: {
|
|
760
|
+
parameters: {
|
|
761
|
+
path: {
|
|
762
|
+
/** The ID of the user which this request is targeting. */
|
|
763
|
+
userId: components["parameters"]["userId"];
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
responses: {
|
|
767
|
+
/** Returns the deleted user. */
|
|
768
|
+
200: {
|
|
769
|
+
content: {
|
|
770
|
+
"application/json": components["schemas"]["userOutput"];
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
/** Based on user properties (currently only name) search for users. */
|
|
776
|
+
search: {
|
|
777
|
+
responses: {
|
|
778
|
+
/** Returns the found users based on search parameters. */
|
|
779
|
+
200: {
|
|
780
|
+
content: {
|
|
781
|
+
"application/json": components["schemas"]["userSearch"];
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
requestBody: {
|
|
786
|
+
content: {
|
|
787
|
+
"application/json": components["schemas"]["nameSearch"];
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
/** Queries which have been created within a Budibase app can be executed using this, */
|
|
792
|
+
execute: {
|
|
793
|
+
parameters: {
|
|
794
|
+
path: {
|
|
795
|
+
/** The ID of the query which this request is targeting. */
|
|
796
|
+
queryId: components["parameters"]["queryId"];
|
|
797
|
+
};
|
|
798
|
+
header: {
|
|
799
|
+
/** The ID of the app which this request is targeting. */
|
|
800
|
+
"x-budibase-app-id": components["parameters"]["appId"];
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
responses: {
|
|
804
|
+
/** Returns the result of the query execution. */
|
|
805
|
+
200: {
|
|
806
|
+
content: {
|
|
807
|
+
"application/json": components["schemas"]["executeQueryOutput"];
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
requestBody: {
|
|
812
|
+
content: {
|
|
813
|
+
"application/json": components["schemas"]["executeQuery"];
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
}
|
|
1131
818
|
|
|
1132
819
|
export interface external {}
|
|
@@ -52,9 +52,9 @@ const checkAuthorizedResource = async (
|
|
|
52
52
|
) => {
|
|
53
53
|
// get the user's roles
|
|
54
54
|
const roleId = ctx.roleId || BUILTIN_ROLE_IDS.PUBLIC
|
|
55
|
-
const userRoles = await getUserRoleHierarchy(roleId, {
|
|
55
|
+
const userRoles = (await getUserRoleHierarchy(roleId, {
|
|
56
56
|
idOnly: false,
|
|
57
|
-
})
|
|
57
|
+
})) as { _id: string }[]
|
|
58
58
|
const permError = "User does not have permission"
|
|
59
59
|
// check if the user has the required role
|
|
60
60
|
if (resourceRoles.length > 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getTenantId } from "@budibase/backend-core/tenancy"
|
|
2
2
|
import { getAllApps } from "@budibase/backend-core/db"
|
|
3
|
-
import { quotas
|
|
3
|
+
import { quotas } from "@budibase/pro"
|
|
4
|
+
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
|
4
5
|
|
|
5
6
|
export const run = async () => {
|
|
6
7
|
// get app count
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getTenantId } from "@budibase/backend-core/tenancy"
|
|
2
2
|
import { getAllApps } from "@budibase/backend-core/db"
|
|
3
3
|
import { getUniqueRows } from "../../../utilities/usageQuota/rows"
|
|
4
|
-
import { quotas
|
|
4
|
+
import { quotas } from "@budibase/pro"
|
|
5
|
+
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
|
5
6
|
|
|
6
7
|
export const run = async () => {
|
|
7
8
|
// get all rows in all apps
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import TestConfig from "../../../../tests/utilities/TestConfiguration"
|
|
2
2
|
import * as syncApps from "../syncApps"
|
|
3
|
-
import { quotas
|
|
3
|
+
import { quotas } from "@budibase/pro"
|
|
4
|
+
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
|
4
5
|
|
|
5
6
|
describe("syncApps", () => {
|
|
6
7
|
let config = new TestConfig(false)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import TestConfig from "../../../../tests/utilities/TestConfiguration"
|
|
2
2
|
import * as syncRows from "../syncRows"
|
|
3
|
-
import { quotas
|
|
3
|
+
import { quotas } from "@budibase/pro"
|
|
4
|
+
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
|
4
5
|
|
|
5
6
|
describe("syncRows", () => {
|
|
6
7
|
let config = new TestConfig(false)
|