alice-runtime
Advanced tools
Comparing version 0.1.19 to 0.2.0
11
index.js
@@ -6,2 +6,3 @@ const { | ||
const utility = require("./lib/utility"); | ||
const entity = require("./lib/entity"); | ||
@@ -55,2 +56,3 @@ const { | ||
queryDataIndex, | ||
countDataIndex, | ||
} = require("./lib/get-data-events"); | ||
@@ -143,2 +145,6 @@ | ||
const { | ||
frontendApi, | ||
} = require("./lib/frontend-api"); | ||
// ---------------------------------------------------------- | ||
@@ -190,2 +196,3 @@ // Module Export | ||
queryDataIndex, | ||
countDataIndex, | ||
@@ -263,5 +270,9 @@ // create-data-trigger | ||
// frontend API | ||
frontendApi, | ||
// rest | ||
utility, | ||
entity, | ||
DataCluster, | ||
}; |
@@ -186,2 +186,3 @@ // const ftDev = require("ftws-node-dev-tools"); | ||
paused = null, | ||
backupCommand = null, | ||
subscription = [], | ||
@@ -253,2 +254,12 @@ callbackFrom = false, | ||
// create command as handled + don't execute or re execute it (don't set handled if command already exists) | ||
if (backupCommand) { | ||
addInsertData.handled = true; | ||
commandData.handled = true; | ||
// todo -> create test | ||
} | ||
else { | ||
addUpdateData.handled = false; | ||
} | ||
const filter = { | ||
@@ -259,3 +270,2 @@ _id: commandId, | ||
$set: { | ||
handled: false, | ||
payload, | ||
@@ -262,0 +272,0 @@ ...addUpdateData, |
@@ -5,2 +5,3 @@ const ftDev = require("ftws-node-dev-tools"); | ||
const R = require("ramda"); | ||
const dc = require("node-dev-console"); | ||
const utility = require("./utility"); | ||
@@ -184,2 +185,3 @@ const hasValue = R.complement(R.isNil); | ||
* @param {number} limit | ||
* @param {object|null} sort | ||
* @return {Promise<[]|*>} | ||
@@ -192,10 +194,15 @@ */ | ||
limit = 0, | ||
sort = null, | ||
} = {}) => { | ||
// debug("queryDataIndex().findOne(%s)", jsonString(query)); | ||
if (R.isNil(sort)) { | ||
sort = { | ||
sequenceNumber: 1 | ||
}; | ||
} | ||
let indexResult = getCollectionDataIndex().find( | ||
query, | ||
{ | ||
sort: { | ||
sequenceNumber: 1 | ||
} | ||
sort, | ||
}); | ||
@@ -226,2 +233,12 @@ if (skip > 0) { | ||
/** | ||
* | ||
* @param {Object} query | ||
* @return {Promise<[]|*>} | ||
*/ | ||
const countDataIndex = async (query) => { | ||
// dc.j(query, "countDataIndex().query"); | ||
return await getCollectionDataIndex().countDocuments(query); | ||
}; | ||
module.exports = { | ||
@@ -236,4 +253,5 @@ getDataEventStream, | ||
queryDataIndex, | ||
countDataIndex, | ||
// makeDataStreamId: makeStreamId, | ||
// getLastDataEventSequenceNumber: getLastDataEvent | ||
}; |
@@ -33,2 +33,7 @@ const R = require("ramda"); | ||
const isCallbackFromEmpty = command => R.isEmpty(getCallbackFrom(command)); | ||
const isMultiInvokeCommand = R.propEq("multiInvoke", true); | ||
const aggregateExists = R.allPass([ | ||
R.complement(R.equals(false)), | ||
R.complement(R.propEq("event", "Deleted")) | ||
]); | ||
@@ -149,2 +154,4 @@ /** | ||
isCallbackFromEmpty, | ||
isMultiInvokeCommand, | ||
aggregateExists, | ||
makeSubscriptionId, | ||
@@ -151,0 +158,0 @@ parse, |
{ | ||
"name": "alice-runtime", | ||
"description": "The alice runtime is under heavy development. Expect many and uncommented breaking changes!", | ||
"version": "0.1.19", | ||
"version": "0.2.0", | ||
"scripts": { | ||
@@ -26,3 +26,4 @@ "test": "set DEV_CONSOLE_FORCE_OFF=1&& npx mocha --ui bdd ./test/**/*.test.js", | ||
"supports-color": "^7.1.0", | ||
"uuid": "^8.1.0" | ||
"uuid": "^8.1.0", | ||
"yup": "^0.29.1" | ||
}, | ||
@@ -29,0 +30,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194830
55
5023
15
26
+ Addedyup@^0.29.1
+ Added@babel/runtime@7.26.0(transitive)
+ Addedfn-name@3.0.0(transitive)
+ Addedlodash-es@4.17.21(transitive)
+ Addedproperty-expr@2.0.6(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedsynchronous-promise@2.0.17(transitive)
+ Addedtoposort@2.0.2(transitive)
+ Addedyup@0.29.3(transitive)