@procaaso/procaaso-views-client
v1.2.4
Published
Procaaso Library to use with Views Development
Keywords
Readme
@procaaso/procaaso-views-client
Client library for integrating ProCaaSo real-time attribute streaming and control into React-based Views.
Prerequisites
- Node.js (v16+)
- npm
Install dependencies
npm installBuild
Compiles TypeScript source from src/ into dist/:
npm run buildRunning tests
Tests use Jest with ts-jest and a jsdom environment so DOM APIs like EventSource are available without a browser.
Run the full suite
npm testRun with detailed output
npm run test:verboseRun a specific test file
Pass the filename (or a pattern that matches it) after --:
npm test -- Component.test.ts
npm test -- createAttributeStream
npm test -- ProcaasoClientWatch mode (re-runs on file changes)
npm run test:watchWhat the tests cover
Tests live in src/js/tests/. Current test files:
| File | What it verifies |
|---|---|
| SmokeTest.test.ts | Basic sanity check that the test runner works |
| Component.test.ts | Component class — tree construction, getters/setters, error cases |
| MutationStructure.test.ts | MutationHandle shape, serialisation, getter consistency |
| ProcaasoClient.test.ts | Client lifecycle, setAttributeStream, setMultiAttributeStream, mutations, re-exported helpers |
| createAttributeStream.test.ts | SSE URL patterns for single and multi-attribute streams, handle behaviour, auth headers |
Tunnelling to a live environment
To run integration-level checks against a real ProCaaSo edge cluster, open a tunnel first:
syndi -p <profile> tunnel <SYSTEM_ID> \
--dest 5060/paracloud-edge-sidecar.paracloud.svc.cluster.local:5060 \
--dest 4040/paracloud-edge-structure.paracloud.svc.cluster.local:4040 \
--dest 5050/paracloud-edge-control.paracloud.svc.cluster.local:5050 \
--dest 6062/paracloud-edge-stream-v2.paracloud.svc.cluster.local:6062Replace <profile> and <SYSTEM_ID> with your target environment values.
Publishing
Often, while working in the procaaso space, we have specically configured permissions. To correctly publish this package, run the following commands:
npm login --registry=https://registry.npmjs.org/
npm whoami --registry=https://registry.npmjs.org/
npm publish --registry=https://registry.npmjs.org/Future Plans
- Look into backend providing a more concrete backend solution.
- Per Brandon: Think of a solution involving passing a naming scheme closer to the ENS, with a component-instrument-attribute schema, over working on attribute IDs. The processing can be done on the backend instead of on the client side
- I like the structure of the StuctSchema, something like that, but where it passes attr Ids might be better.
