Seneca entity data storage plugin for CosmosDB
Requires Seneca 4, @seneca/entity 29 and Node.js 24 or later:
npm install seneca@^4 @seneca/entity @seneca/cosmos-store @azure/cosmosThe tests need a Cosmos DB account or the Cosmos DB emulator. Set
SENECA_COSMOS_KEY to the account key (for the emulator, its well-known
key from the emulator documentation) and SENECA_COSMOS_ENDPOINT to the
endpoint (default https://localhost:8081), or write test/local-env.js
as test/setup.sh describes. The Linux emulator (vNext preview) serves
plain HTTP. The tests pass on its build vnext-EN20261019. The later builds
EN20261117pre and EN20261123 answer a sort on two fields in opposite
directions with an internal error, which fails the test "double sort":
docker run -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-EN20261019
export SENECA_COSMOS_ENDPOINT=http://127.0.0.1:8081
export SENECA_COSMOS_KEY='<emulator key>'
npm testWith SENECA_COSMOS_KEY set, npm test first creates the test database
and containers (npm run test-create-db). Without a key or
test/local-env.js, only the plugin validation test runs.