corebasic 1.0.200 → 1.0.202
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 +3 -1
- package/libs/elabase.js +5 -3
- package/package.json +1 -1
package/libs/dip.js
CHANGED
|
@@ -86,13 +86,15 @@ export const idip = async (message, callback, cleanup) => {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
export const insertKeys = message => {
|
|
89
|
+
export const insertKeys = (message, meta) => {
|
|
90
90
|
return {
|
|
91
91
|
"created": message.date, "updated": message.date,
|
|
92
92
|
"createdBy": message.meta.staff,
|
|
93
93
|
"updatedBy": message.meta.staff,
|
|
94
94
|
"createdByUser": message.meta.user,
|
|
95
95
|
"updatedByUser": message.meta.user,
|
|
96
|
+
...(meta?.company ? {"company": meta.company} : {}),
|
|
97
|
+
...(meta?.outlet ? {"outlet": meta.outlet} : {}),
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
export const updateKeys = message => {
|
package/libs/elabase.js
CHANGED
|
@@ -281,7 +281,7 @@ export const operation = async (name, extras) => {
|
|
|
281
281
|
|
|
282
282
|
|
|
283
283
|
// Ported
|
|
284
|
-
export const insert = async (meta, collection, value,
|
|
284
|
+
export const insert = async (meta, collection, value, options, extras) => {
|
|
285
285
|
|
|
286
286
|
if (!(meta instanceof DipMeta)) console.warn('Warn: Provided meta is not an instance of DipMeta in Dip.insert()') // TODO: throw error once review completes
|
|
287
287
|
|
|
@@ -303,8 +303,10 @@ export const insert = async (meta, collection, value, _id, options, extras) => {
|
|
|
303
303
|
arg.suffix = generate_suffix(meta)
|
|
304
304
|
arg.executor = meta.executor ?? "native"
|
|
305
305
|
arg = Object.assign({}, topology_meta, arg)
|
|
306
|
-
if (_id)
|
|
307
|
-
arg._id = _id
|
|
306
|
+
if (options?._id) {
|
|
307
|
+
arg._id = options._id
|
|
308
|
+
arg.options = {...options, _id: undefined}
|
|
309
|
+
}
|
|
308
310
|
|
|
309
311
|
if (meta.batch) {
|
|
310
312
|
if (!batches[meta.batch])
|