upload
Compile your stream/aggregation and realm definitions and upload them directly to a running iwentsourcing API.
Usage
bash
iwentsourcing upload <src...> [options]| Argument | Description |
|---|---|
<src...> | One or more source entry files that export your stream/aggregation definitions |
Options
| Flag | Default | Description |
|---|---|---|
--host <url> | http://localhost:3333 | API host URL |
-t, --tenant <tenant> | default | Tenant to upload to |
-v, --variable <name...> | — | Process only the specified named export(s). By default, all exports are processed. |
What It Does
- Compiles your source files using esbuild
- Builds a manifesto in memory by resolving all stream/aggregation definitions
- Sends the manifesto to the API, which checks for breaking schema changes and rejects the upload if any are detected
- Registers the new definitions — existing stream instances running a previous version are not removed
Unlike
build,uploaddoes not write a manifesto file to disk. The manifesto is built and sent in a single step. Usebuildwhen you need to inspect or store the manifesto separately.
Examples
bash
# Upload to local dev server
iwentsourcing upload src/state/export.ts
# Upload to production
iwentsourcing upload src/state/export.ts --host https://api.iwentsourcing.com --tenant production
# Upload specific exports only
iwentsourcing upload src/state/export.ts --variable todoStream personalTodoAggregation