corebasic 1.0.149 → 1.0.151
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/dip.js +1 -1
- package/libs/elabase.js +4 -0
- package/package.json +1 -1
package/libs/dip.js
CHANGED
|
@@ -70,7 +70,7 @@ export const idip = async (message, callback, cleanup) => {
|
|
|
70
70
|
|
|
71
71
|
let IDip = await IdempotentDip().new(message.meta, message.txn)
|
|
72
72
|
if (!IDip) {
|
|
73
|
-
IDip = IdempotentDip().new(message.meta, message.txn, {blank: true})
|
|
73
|
+
IDip = await IdempotentDip().new(message.meta, message.txn, {blank: true})
|
|
74
74
|
await doCleanup(IDip)
|
|
75
75
|
return
|
|
76
76
|
}
|
package/libs/elabase.js
CHANGED
|
@@ -84,6 +84,7 @@ export function transactionCommit(arg) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export const insert = async (meta, collection, value, _id) => {
|
|
87
|
+
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.insert()"}
|
|
87
88
|
// Multi Company Support
|
|
88
89
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.insert()"}
|
|
89
90
|
collection = `${meta.company}.${collection}`
|
|
@@ -123,6 +124,7 @@ export const insert = async (meta, collection, value, _id) => {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
export const query = async (meta, collection, query, options) => {
|
|
127
|
+
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.query()"}
|
|
126
128
|
if (meta?.USE_EMPTY_COMPANY) {
|
|
127
129
|
|
|
128
130
|
} else {
|
|
@@ -172,6 +174,7 @@ function collectionArray(col) {
|
|
|
172
174
|
export const update = async (meta, collection, query, update, options) => {
|
|
173
175
|
// Multi Company Support
|
|
174
176
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.update()"}
|
|
177
|
+
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.update()"}
|
|
175
178
|
collection = `${meta.company}.${collection}`
|
|
176
179
|
if (meta.company !== "GLOBAL") {
|
|
177
180
|
query.company = meta.company
|
|
@@ -215,6 +218,7 @@ export const update = async (meta, collection, query, update, options) => {
|
|
|
215
218
|
export const remove = async (meta, collection, query) => {
|
|
216
219
|
// Multi Company Support
|
|
217
220
|
if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.remove()"}
|
|
221
|
+
if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.remove()"}
|
|
218
222
|
collection = `${meta.company}.${collection}`
|
|
219
223
|
if (meta.company !== "GLOBAL")
|
|
220
224
|
query.company = meta.company
|