cumin is the infrastructure and state management layer of the ChRIS interface ecosystem. It is a backend library that handles the "dirty work" of connecting to ChRIS, managing authentication tokens, and persisting user sessions.
cumin abstracts the ChRIS REST API into a stateful, object-oriented environment. It is responsible for:
- Connection Management: Handling authentication, token storage, and client initialization.
- Context Persistence: Implementing the "Context" engine that remembers the active User, CUBE URL, and Working Directory.
- IO & Storage: Providing an abstraction (
IStorageProvider) for filesystem access, enabling support for both Node.js (viafs) and other environments.
In the "Sandwich Model" architecture, cumin is the bottom layer (just above the raw API client).
- Consumers: Primarily
salsa(logic) andchili(CLI state). - Environment: Designed for Node.js but architected with interfaces to support browser environments.
ChrisContext: The state machine for multi-tenant, multi-backend sessions.ChRISConnection: Wrapper for the low-level API client.IStorageProvider: Abstraction interface for reading/writing config and data.- Includes
readBinaryfor binary file uploads. - Includes recursive directory traversal helpers.
- Includes
ChrisIO: High-level IO operations, including recursive directory uploading (uploadLocalPath).ChRISResource.resources_getAll(): Generic pagination handler.
To build the cumin library from source:
-
Install dependencies:
npm install
-
Compile:
npm run build
-30-