Changelog - 2026-11-10
Commit a direct upload from your own service
New FeatureIn one line. Two services run the upload-policy and upload-commit logic without a request, so a service can commit an upload in the same call that saves its record.
What changed
StaticAssetUploadPolicyServiceandStaticAssetUploadCommitService.issuePolicies({ files })andcommit({ commitToken, labels })do what the two routes do.commitanswers{ bucket, object, link, metaLink? }.- Bound for you. Every static-asset entry that sets
controller.directUploadand abucketgets both atStaticAssetBindingKeys.policyService({ name })and.commitService({ name }), wherenameis the entry's key in the options object. The routes run those same instances. - The routes behave as before. Paths, schemas, responses and error codes are unchanged.
Who is affected
- Apps that copied the route code to commit from a service. Replace the copy with an injected
StaticAssetUploadCommitService. Code that calls these services directly skipsdirectUpload.authorize, and a commit token carries no owner, so check that the user may act on the key yourself. - Apps that call
StaticAssetControllerFactory.buildthemselves withdirectUpload. PasspolicyServiceandcommitServicetoo; the controller no longer builds them. - Everyone else. No action needed.
Details
typescript
@inject({ key: StaticAssetBindingKeys.commitService({ name: 'assets' }) })
private assetCommit: StaticAssetUploadCommitService,
const committed = await this.assetCommit.commit({ commitToken, labels: { principalType: 'Product', principalId: sku } });See Direct upload for the full example, the ordering and the security note.