corebasic 1.0.177 → 1.0.178
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/libs/elabase.js +9 -5
- package/package.json +1 -1
package/libs/elabase.js
CHANGED
|
@@ -76,14 +76,14 @@ export function transactionCommit(arg) {
|
|
|
76
76
|
isTransaction = false
|
|
77
77
|
transactions = []
|
|
78
78
|
return new Promise((resolve, reject) => resolve())
|
|
79
|
-
.then(() => execute({ "transaction": txns, mode, stats: arg?.stats ?? false, version: arg?.version, compression: arg?.compression }))
|
|
79
|
+
.then(() => execute({ "transaction": txns, mode, stats: arg?.stats ?? false, version: arg?.version, compression: arg?.compression, size: arg?.size }))
|
|
80
80
|
.then (result => {
|
|
81
81
|
Events.send("Elabase.transactionCommit", { response: result })
|
|
82
82
|
return result
|
|
83
83
|
})
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export const insert = async (meta, collection, value, _id) => {
|
|
86
|
+
export const insert = async (meta, collection, value, _id, extras) => {
|
|
87
87
|
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.insert()"}
|
|
88
88
|
// Multi Company Support
|
|
89
89
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.insert()"}
|
|
@@ -101,6 +101,7 @@ export const insert = async (meta, collection, value, _id) => {
|
|
|
101
101
|
...(meta.DIP_URL ? {DIP_URL: meta.DIP_URL} : {}),
|
|
102
102
|
...(meta.DIP_DB ? {db: meta.DIP_DB} : {}),
|
|
103
103
|
}
|
|
104
|
+
arg = Object.assign(arg, extras)
|
|
104
105
|
if (_id)
|
|
105
106
|
arg._id = _id
|
|
106
107
|
|
|
@@ -123,7 +124,7 @@ export const insert = async (meta, collection, value, _id) => {
|
|
|
123
124
|
})
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
export const query = async (meta, collection, query, options) => {
|
|
127
|
+
export const query = async (meta, collection, query, options, extras) => {
|
|
127
128
|
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.query()"}
|
|
128
129
|
if (meta?.USE_EMPTY_COMPANY) {
|
|
129
130
|
|
|
@@ -144,6 +145,7 @@ export const query = async (meta, collection, query, options) => {
|
|
|
144
145
|
...(meta.DIP_URL ? {DIP_URL: meta.DIP_URL} : {}),
|
|
145
146
|
...(meta.DIP_DB ? {db: meta.DIP_DB} : {}),
|
|
146
147
|
}
|
|
148
|
+
arg = Object.assign(arg, extras)
|
|
147
149
|
if (isTransaction) {
|
|
148
150
|
transactions.push(arg)
|
|
149
151
|
return
|
|
@@ -171,7 +173,7 @@ function collectionArray(col) {
|
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
|
|
174
|
-
export const update = async (meta, collection, query, update, options) => {
|
|
176
|
+
export const update = async (meta, collection, query, update, options, extras) => {
|
|
175
177
|
// Multi Company Support
|
|
176
178
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.update()"}
|
|
177
179
|
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.update()"}
|
|
@@ -202,6 +204,7 @@ export const update = async (meta, collection, query, update, options) => {
|
|
|
202
204
|
...(meta.DIP_URL ? {DIP_URL: meta.DIP_URL} : {}),
|
|
203
205
|
...(meta.DIP_DB ? {db: meta.DIP_DB} : {}),
|
|
204
206
|
}
|
|
207
|
+
arg = Object.assign(arg, extras)
|
|
205
208
|
if (isTransaction) {
|
|
206
209
|
transactions.push(arg)
|
|
207
210
|
return
|
|
@@ -215,7 +218,7 @@ export const update = async (meta, collection, query, update, options) => {
|
|
|
215
218
|
})
|
|
216
219
|
}
|
|
217
220
|
|
|
218
|
-
export const remove = async (meta, collection, query) => {
|
|
221
|
+
export const remove = async (meta, collection, query, extras) => {
|
|
219
222
|
// Multi Company Support
|
|
220
223
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.remove()"}
|
|
221
224
|
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.remove()"}
|
|
@@ -231,6 +234,7 @@ export const remove = async (meta, collection, query) => {
|
|
|
231
234
|
...(meta.DIP_URL ? {DIP_URL: meta.DIP_URL} : {}),
|
|
232
235
|
...(meta.DIP_DB ? {db: meta.DIP_DB} : {}),
|
|
233
236
|
}
|
|
237
|
+
arg = Object.assign(arg, extras)
|
|
234
238
|
if (isTransaction) {
|
|
235
239
|
transactions.push(arg)
|
|
236
240
|
return
|