Integration
@nx/assetintegrates by being mounted as IGNIS components inside host applications — not by network calls between services. Its only external dependency is S3/Minio.
1. Sister Services
Direction:←mounted by (host consumes asset).
| Sister | Direction | Surface | Contract | Auth | Failure Mode | Idempotency |
|---|---|---|---|---|---|---|
@nx/commerce | ← | host.component(ApplicationAssetComponent) | in-process component | host JWT/Basic | component init throws → host boot fails | n/a |
@nx/finance | ← | host.component(ApplicationAssetBanksVNComponent) | in-process component | public routes | — | n/a |
@nx/ledger | ← | ApplicationAssetComponent + MetaLinkRepository for generated PDF/XLSX upload | in-process | host JWT/Basic | upload error logged per file | non-idempotent upload |
@nx/core | → | imports MetaLink, PostgresCoreDataSource, EnvironmentKeys, crudPermissions | TypeScript dependency | — | compile-time | n/a |
2. External Systems
| System | Direction | Surface | Auth | Failure Mode |
|---|---|---|---|---|
| S3 / Minio | → | BunS3Helper (@venizia/ignis-helpers/bun-s3) | APP_ENV_S3_ACCESS_KEY / APP_ENV_S3_SECRET_KEY | helper throws → 4xx/5xx to client; upload also captures MetaLink errors |
3. Critical Cross-Service Flows
3.1 Commerce mounts asset for product media
| Step | Detail |
|---|---|
| 2 | S3 connection params read at construction via applicationEnvironment.get() |
| 4 | Controllers mount under the host's base path (e.g. /v1/api/commerce/assets) |
3.2 Ledger uploads a generated document
4. Contract Stability
| Surface | Stability | Versioning |
|---|---|---|
host.component(ApplicationAssetComponent) | stable | TypeScript export |
REST /assets, /meta-links, /assets/banks-vn | stable | host URL /v1/ prefix |
BindingKeys.APPLICATION_S3_STORAGE_HELPER | stable | string key (note: namespaced @nx/commerce) |
Presigned-URL StaticAssetComponent path | not live | commented out in source — do not depend on it |