@budibase/server 2.6.13 → 2.6.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.15",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"license": "GPL-3.0",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
48
|
-
"@budibase/backend-core": "^2.6.
|
|
49
|
-
"@budibase/client": "^2.6.
|
|
50
|
-
"@budibase/pro": "2.6.
|
|
51
|
-
"@budibase/shared-core": "^2.6.
|
|
52
|
-
"@budibase/string-templates": "^2.6.
|
|
53
|
-
"@budibase/types": "^2.6.
|
|
48
|
+
"@budibase/backend-core": "^2.6.15",
|
|
49
|
+
"@budibase/client": "^2.6.15",
|
|
50
|
+
"@budibase/pro": "2.6.14",
|
|
51
|
+
"@budibase/shared-core": "^2.6.15",
|
|
52
|
+
"@budibase/string-templates": "^2.6.15",
|
|
53
|
+
"@budibase/types": "^2.6.15",
|
|
54
54
|
"@bull-board/api": "3.7.0",
|
|
55
55
|
"@bull-board/koa": "3.9.4",
|
|
56
56
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"optionalDependencies": {
|
|
177
177
|
"oracledb": "5.3.0"
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "f66535137bdbfa0e3a4d9fca8e738a6845beeafb"
|
|
180
180
|
}
|
|
@@ -118,8 +118,11 @@ export async function patch(ctx: UserCtx) {
|
|
|
118
118
|
combinedRow[key] = inputs[key]
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
// need to copy the table so it can be differenced on way out
|
|
122
|
+
const tableClone = cloneDeep(dbTable)
|
|
123
|
+
|
|
121
124
|
// this returns the table and row incase they have been updated
|
|
122
|
-
let { table, row } = inputProcessing(ctx.user,
|
|
125
|
+
let { table, row } = inputProcessing(ctx.user, tableClone, combinedRow)
|
|
123
126
|
const validateResult = await utils.validate({
|
|
124
127
|
row,
|
|
125
128
|
table,
|
|
@@ -163,7 +166,12 @@ export async function save(ctx: UserCtx) {
|
|
|
163
166
|
|
|
164
167
|
// this returns the table and row incase they have been updated
|
|
165
168
|
const dbTable = await db.get(inputs.tableId)
|
|
166
|
-
|
|
169
|
+
|
|
170
|
+
// need to copy the table so it can be differenced on way out
|
|
171
|
+
const tableClone = cloneDeep(dbTable)
|
|
172
|
+
|
|
173
|
+
let { table, row } = inputProcessing(ctx.user, tableClone, inputs)
|
|
174
|
+
|
|
167
175
|
const validateResult = await utils.validate({
|
|
168
176
|
row,
|
|
169
177
|
table,
|
|
@@ -79,6 +79,60 @@ describe("/rows", () => {
|
|
|
79
79
|
await assertQueryUsage(queryUsage + 1)
|
|
80
80
|
})
|
|
81
81
|
|
|
82
|
+
it("Increment row autoId per create row request", async () => {
|
|
83
|
+
const rowUsage = await getRowUsage()
|
|
84
|
+
const queryUsage = await getQueryUsage()
|
|
85
|
+
|
|
86
|
+
const newTable = await config.createTable({
|
|
87
|
+
name: "TestTableAuto",
|
|
88
|
+
type: "table",
|
|
89
|
+
key: "name",
|
|
90
|
+
schema: {
|
|
91
|
+
...table.schema,
|
|
92
|
+
"Row ID": {
|
|
93
|
+
name: "Row ID",
|
|
94
|
+
type: "number",
|
|
95
|
+
subtype: "autoID",
|
|
96
|
+
icon: "ri-magic-line",
|
|
97
|
+
autocolumn: true,
|
|
98
|
+
constraints: {
|
|
99
|
+
type: "number",
|
|
100
|
+
presence: false,
|
|
101
|
+
numericality: {
|
|
102
|
+
greaterThanOrEqualTo: "",
|
|
103
|
+
lessThanOrEqualTo: "",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const ids = [1,2,3]
|
|
111
|
+
|
|
112
|
+
// Performing several create row requests should increment the autoID fields accordingly
|
|
113
|
+
const createRow = async (id) => {
|
|
114
|
+
const res = await request
|
|
115
|
+
.post(`/api/${newTable._id}/rows`)
|
|
116
|
+
.send({
|
|
117
|
+
name: "row_" + id
|
|
118
|
+
})
|
|
119
|
+
.set(config.defaultHeaders())
|
|
120
|
+
.expect('Content-Type', /json/)
|
|
121
|
+
.expect(200)
|
|
122
|
+
expect(res.res.statusMessage).toEqual(`${newTable.name} saved successfully`)
|
|
123
|
+
expect(res.body.name).toEqual("row_" + id)
|
|
124
|
+
expect(res.body._rev).toBeDefined()
|
|
125
|
+
expect(res.body["Row ID"]).toEqual(id)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
for (let i=0; i<ids.length; i++ ){
|
|
129
|
+
await createRow(ids[i])
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
await assertRowUsage(rowUsage + ids.length)
|
|
133
|
+
await assertQueryUsage(queryUsage + ids.length)
|
|
134
|
+
})
|
|
135
|
+
|
|
82
136
|
it("updates a row successfully", async () => {
|
|
83
137
|
const existing = await config.createRow()
|
|
84
138
|
const rowUsage = await getRowUsage()
|