alice-runtime
Advanced tools
Comparing version 0.1.18 to 0.1.19
249
index.js
@@ -1,5 +0,127 @@ | ||
const {DataCluster} = require("./lib/data-cluster"); | ||
const { | ||
DataCluster, | ||
} = require("./lib/data-cluster"); | ||
const utility = require("./lib/utility"); | ||
const { | ||
connect, | ||
disconnect, | ||
isConnected, | ||
listCollections, | ||
createCollection, | ||
getCollection, | ||
getCollectionDataIndex, | ||
getCollectionDataStream, | ||
getCollectionTriggerIndex, | ||
getCollectionTriggerStream, | ||
getCollectionCommandIndex, | ||
getCollectionCommandStream, | ||
getCollectionStreamSequenceNumber, | ||
getCollectionStatsContextAggregate, | ||
getCollectionUtility, | ||
getCollectionView, | ||
getCollectionCommandPrivate, | ||
makeUtilityCollectionId, | ||
getNextDataStreamSequenceNumber, | ||
getNextDataIndexSequenceNumber, | ||
// COLLECTION_LIST, | ||
// UTILITY_NAMESPACE, | ||
} = require("./lib/database"); | ||
const { | ||
checkIndexes, | ||
} = require("./lib/database-indexes"); | ||
const { | ||
storeDataEvent, | ||
storeDataEventOnPayloadChange, | ||
} = require("./lib/store-data-event"); | ||
const { | ||
getDataEventStream, | ||
getLastDataEvent, | ||
getDataEvent, | ||
isEventLink, | ||
loadLinkedDataEvent, | ||
resolveEvent, | ||
getItemDataIndex, | ||
queryDataIndex, | ||
} = require("./lib/get-data-events"); | ||
const { | ||
createDataTrigger, | ||
} = require("./lib/create-data-trigger"); | ||
const { | ||
processNextTrigger, | ||
processTrigger, | ||
} = require("./lib/process-trigger"); | ||
const { | ||
processNextCommand, | ||
processCommands, | ||
} = require("./lib/process-commands"); | ||
const { | ||
dispatchNextEvent, | ||
dispatchEvents, | ||
} = require("./lib/dispatch-events"); | ||
const { | ||
loadRuntimeConfig, | ||
} = require("./lib/load-runtime-config"); | ||
const { | ||
getTriggerCheckForUpdatesCount, | ||
getTriggerIndexOverview, | ||
getUnhandledCommandCount, | ||
getCommandIndexOverview, | ||
getDataIndexOverview, | ||
getUndispatchedDataEventCount, | ||
} = require("./lib/dashboard-stats"); | ||
const { | ||
getDataIndex, | ||
getCommandIndex, | ||
getTriggerIndex, | ||
getDataContextAggregateList, | ||
getCommandContextAggregateList, | ||
getTriggerContextAggregateList, | ||
} = require("./lib/dashboard-list"); | ||
const { | ||
getItemTriggerIndex, | ||
} = require("./lib/get-trigger-events"); | ||
const { | ||
csvImport, | ||
} = require("./lib/csv-import"); | ||
const { | ||
process, | ||
} = require("./lib/process"); | ||
const { | ||
dashboardApi, | ||
} = require("./lib/dashboard-api"); | ||
const { | ||
setOneCommandPaused, | ||
setOneCommandNotPaused, | ||
setOneCommandHandled, | ||
setOneCommandNotHandled, | ||
setOneCommandNotRunning, | ||
setManyCommandsPaused, | ||
setManyCommandsNotPaused, | ||
setManyCommandsHandled, | ||
setManyCommandsNotHandled, | ||
} = require("./lib/command-control"); | ||
const { | ||
makeCommandId, | ||
@@ -16,3 +138,3 @@ emitCommand, | ||
const { | ||
getCommand | ||
getCommand, | ||
} = require("./lib/get-command-events"); | ||
@@ -24,19 +146,104 @@ | ||
module.exports = { | ||
...(require('./lib/database')), | ||
...(require('./lib/database-indexes')), | ||
...(require("./lib/store-data-event")), | ||
...(require("./lib/get-data-events")), | ||
...(require("./lib/create-data-trigger")), | ||
...(require("./lib/process-trigger")), | ||
...(require("./lib/process-commands")), | ||
...(require("./lib/dispatch-events")), | ||
...(require("./lib/load-runtime-config")), | ||
...(require("./lib/dashboard-stats")), | ||
...(require("./lib/dashboard-list")), | ||
...(require("./lib/get-trigger-events")), | ||
...(require("./lib/csv-import")), | ||
...(require("./lib/process")), | ||
...(require("./lib/dashboard-api")), | ||
...(require("./lib/command-control")), | ||
// database | ||
connect, | ||
disconnect, | ||
isConnected, | ||
listCollections, | ||
createCollection, | ||
getCollection, | ||
getCollectionDataIndex, | ||
getCollectionDataStream, | ||
getCollectionTriggerIndex, | ||
getCollectionTriggerStream, | ||
getCollectionCommandIndex, | ||
getCollectionCommandStream, | ||
getCollectionStreamSequenceNumber, | ||
getCollectionStatsContextAggregate, | ||
getCollectionUtility, | ||
getCollectionView, | ||
getCollectionCommandPrivate, | ||
makeUtilityCollectionId, | ||
getNextDataStreamSequenceNumber, | ||
getNextDataIndexSequenceNumber, | ||
// database-indexes | ||
checkIndexes, | ||
// store-data-event | ||
storeDataEvent, | ||
storeDataEventOnPayloadChange, | ||
// get-data-events | ||
getDataEventStream, | ||
getLastDataEvent, | ||
getDataEvent, | ||
isEventLink, | ||
loadLinkedDataEvent, | ||
resolveEvent, | ||
getItemDataIndex, | ||
queryDataIndex, | ||
// create-data-trigger | ||
createDataTrigger, | ||
// process-trigger | ||
processNextTrigger, | ||
processTrigger, | ||
// process-commands | ||
processNextCommand, | ||
processCommands, | ||
// dispatch-events | ||
dispatchNextEvent, | ||
dispatchEvents, | ||
// load-runtime-config | ||
loadRuntimeConfig, | ||
// dashboard-stats | ||
getTriggerCheckForUpdatesCount, | ||
getTriggerIndexOverview, | ||
getUnhandledCommandCount, | ||
getCommandIndexOverview, | ||
getDataIndexOverview, | ||
getUndispatchedDataEventCount, | ||
// dashboard-list | ||
getDataIndex, | ||
getCommandIndex, | ||
getTriggerIndex, | ||
getDataContextAggregateList, | ||
getCommandContextAggregateList, | ||
getTriggerContextAggregateList, | ||
// get-trigger-events | ||
getItemTriggerIndex, | ||
// csv-import | ||
csvImport, | ||
// process | ||
process, | ||
//dashboard-api | ||
dashboardApi, | ||
// command-control | ||
setOneCommandPaused, | ||
setOneCommandNotPaused, | ||
setOneCommandHandled, | ||
setOneCommandNotHandled, | ||
setOneCommandNotRunning, | ||
setManyCommandsPaused, | ||
setManyCommandsNotPaused, | ||
setManyCommandsHandled, | ||
setManyCommandsNotHandled, | ||
// emit-command | ||
makeCommandId, | ||
@@ -51,6 +258,8 @@ emitCommand, | ||
// get-command-events | ||
getCommand, | ||
// rest | ||
utility, | ||
DataCluster, | ||
getCommand, | ||
}; |
@@ -75,3 +75,3 @@ const ftDev = require("ftws-node-dev-tools"); | ||
module.exports = { | ||
createDataTrigger | ||
createDataTrigger, | ||
}; |
@@ -164,3 +164,3 @@ const ftDev = require("ftws-node-dev-tools"); | ||
module.exports = { | ||
csvImport | ||
csvImport, | ||
}; |
@@ -207,2 +207,3 @@ // const ftDev = require("ftws-node-dev-tools"); | ||
const commandId = makeCommandId(context, aggregate, command, invokeId); //R.join("/", [context, aggregate, command, invokeId]); | ||
const uniqueId = uuid(); | ||
@@ -216,2 +217,3 @@ let commandData = { | ||
invokeId, | ||
uniqueId, | ||
multiInvoke: true, | ||
@@ -266,2 +268,3 @@ createdAt: new Date(), | ||
invokeId, | ||
uniqueId, | ||
multiInvoke: true, | ||
@@ -301,2 +304,4 @@ createdAt: new Date(), | ||
// todo -> return command data from existing command like -> uniqueId | ||
return commandData; | ||
@@ -303,0 +308,0 @@ }; |
@@ -50,4 +50,4 @@ // const ftDev = require("ftws-node-dev-tools"); | ||
module.exports = { | ||
getItemCommandIndex, | ||
getItemCommandIndex, // internal function | ||
getCommand, | ||
}; |
@@ -26,3 +26,3 @@ const ftDev = require("ftws-node-dev-tools"); | ||
module.exports = { | ||
getItemTriggerIndex | ||
getItemTriggerIndex, | ||
}; |
@@ -43,3 +43,3 @@ const {resolve} = require("path"); | ||
module.exports = { | ||
loadRuntimeConfig | ||
loadRuntimeConfig, | ||
}; |
@@ -9,2 +9,3 @@ const ftDev = require("ftws-node-dev-tools"); | ||
const u = require("./utility"); | ||
const {v1: uuid} = require("uuid"); | ||
@@ -61,2 +62,3 @@ const dc = require("node-dev-console"); | ||
aggregateId, | ||
uniqueId: uuid(), | ||
event, | ||
@@ -63,0 +65,0 @@ streamId: streamId, |
@@ -26,2 +26,3 @@ const R = require("ramda"); | ||
const getInvokeId = R.propOr(null, "invokeId"); | ||
const getUniqueId = R.propOr(null, "uniqueId"); | ||
const getVersion = R.propOr("", "version"); | ||
@@ -34,2 +35,9 @@ const getPayload = R.propOr({}, "payload"); | ||
/** | ||
* | ||
* @param {object} event | ||
* @return {string} | ||
*/ | ||
const makeSubscriptionId = event => `${getContext(event)}/${getAggregate(event)}?${getAggregateId(event)}` | ||
// todo -> add schema validation functions | ||
@@ -135,2 +143,3 @@ | ||
getInvokeId, | ||
getUniqueId, | ||
getVersion, | ||
@@ -142,2 +151,3 @@ getPayload, | ||
isCallbackFromEmpty, | ||
makeSubscriptionId, | ||
parse, | ||
@@ -150,2 +160,2 @@ parseAggregateId, | ||
returnCmdError, | ||
}; | ||
}; |
{ | ||
"name": "alice-runtime", | ||
"description": "The alice runtime is under heavy development. Expect many and uncommented breaking changes!", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "test": "set DEV_CONSOLE_FORCE_OFF=1&& npx mocha --ui bdd ./test/**/*.test.js", |
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
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
165785
4206