Skip to content

Integration

@nx/asset tích hợp bằng cách được mount như các IGNIS component bên trong các ứng dụng host — không phải bằng các lời gọi mạng giữa các service. Phụ thuộc bên ngoài duy nhất của nó là S3/Minio.

1. Service anh em

Direction: được mount bởi (host tiêu thụ asset).

SisterDirectionSurfaceContractAuthFailure ModeIdempotency
@nx/commercehost.component(ApplicationAssetComponent)in-process componenthost JWT/Basiccomponent init throw → host boot failn/a
@nx/financehost.component(ApplicationAssetBanksVNComponent)in-process componentroute publicn/a
@nx/ledgerApplicationAssetComponent + MetaLinkRepository cho upload PDF/XLSX được tạoin-processhost JWT/Basiclỗi upload được log cho từng fileupload không idempotent
@nx/coreimport MetaLink, PostgresCoreDataSource, EnvironmentKeys, crudPermissionsTypeScript dependencycompile-timen/a

2. Hệ thống bên ngoài

SystemDirectionSurfaceAuthFailure Mode
S3 / MinioBunS3Helper (@venizia/ignis-helpers/bun-s3)APP_ENV_S3_ACCESS_KEY / APP_ENV_S3_SECRET_KEYhelper throw → 4xx/5xx tới client; upload cũng bắt lỗi MetaLink

3. Luồng cross-service quan trọng

3.1 Commerce mount asset cho media sản phẩm

BướcChi tiết
2Tham số kết nối S3 được đọc khi construct qua applicationEnvironment.get()
4Controller mount dưới base path của host (vd /v1/api/commerce/assets)

3.2 Ledger upload một tài liệu được tạo

4. Tính ổn định Contract

SurfaceStabilityVersioning
host.component(ApplicationAssetComponent)stableTypeScript export
REST /assets, /meta-links, /assets/banks-vnstablehost URL prefix /v1/
BindingKeys.APPLICATION_S3_STORAGE_HELPERstablestring key (lưu ý: namespace @nx/commerce)
Đường dẫn StaticAssetComponent presigned-URLkhông hoạt độngđã comment trong source — không phụ thuộc vào nó

5. Trang liên quan

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.