Adopt the reworked bundle catalog API in the web SDK and CLI - #4821
Conversation
Also fixes the codegen identifier sanitizer, which split path segments on `/` and `-` only. The new `/api/message-rail/open/{token}.gif` route produced ApiMessageRailOpen.gif...`, so the generated SDK did not compile.
|
Web SDK Sample Build link |
There was a problem hiding this comment.
🟡 Changes recommended
The new BundleReleasesCommand currently uses a long? cursor where the generated API expects Optional<long>, and bundle dependency range parsing silently defaults missing min values to 0 instead of validating inputs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates this repo’s two bundle-catalog consumers (web SDK + CLI) to match the backend’s reworked bundle contract (name-scoped visibility, paged release log, and version-range dependencies), including a small Swagger generator fix to handle routes ending in extensions like .gif.
Changes:
- Regenerated the web SDK client/models and adopted the renamed bundle endpoints (
*History→*Releases,*ChecksumsAcl→*Acl) plus new/updated schemas. - Updated the CLI bundle workflow to be release-log driven (
bundles releases), name-scoped ACL, and version-rangebundleDependenciesin authored bundle configs. - Fixed the CLI Swagger generator’s method-name formatting to split on non-word characters (so
.gifroutes generate valid identifiers).
File summaries
| File | Description |
|---|---|
| web/src/generated/schemas/SendMailRequest.ts | Regenerated schema: adds metadata field (ordering change). |
| web/src/generated/schemas/SendMailObjectRequest.ts | Regenerated schema: adds metadata field (ordering change). |
| web/src/generated/schemas/SegmentAttribute.ts | Regenerated schema: adds new attribute metadata fields. |
| web/src/generated/schemas/RuleLeaf.ts | Regenerated schema: adds ns field. |
| web/src/generated/schemas/ReportRailFunnelStageRequest.ts | New generated request schema for message-rail funnel stage reporting. |
| web/src/generated/schemas/PublishBundleResponse.ts | Bundle publish response now includes version. |
| web/src/generated/schemas/PublishBundleRequest.ts | Renames peerDependencies → bundleDependencies with BundleDepRange. |
| web/src/generated/schemas/ProtoError.ts | New generated error schema type. |
| web/src/generated/schemas/OtelView.ts | Updates Otel view identity fields (accountId, id shape). |
| web/src/generated/schemas/Message.ts | Regenerated schema: adds metadata field (ordering change). |
| web/src/generated/schemas/ListBundlesResponse.ts | Bundle list response now returns BundleSummary[]. |
| web/src/generated/schemas/ListBundleReleasesResponse.ts | New generated response for paged bundle release log + tags. |
| web/src/generated/schemas/index.ts | Exports added/removed to align with regenerated schema set. |
| web/src/generated/schemas/GoalPredicateDto.ts | Adds property bounds filtering fields and enum dependency. |
| web/src/generated/schemas/GetBundleResponse.ts | Bundle tags become a tag→checksum map; adds version. |
| web/src/generated/schemas/enums/PropertyBoundsMode.ts | New generated enum. |
| web/src/generated/schemas/enums/BeamoV2FederationType.ts | Adds IFederatedMessageRail enum member. |
| web/src/generated/schemas/enums/AuthorKind.ts | New generated enum for audit authors. |
| web/src/generated/schemas/ClientAnalyticsEvent.ts | Adds c field to analytics event schema. |
| web/src/generated/schemas/CampaignSummaryDtoCampaignPageDto.ts | Fixes generated type name for campaigns list paging shape. |
| web/src/generated/schemas/CampaignSummaryDto.ts | Adds audit fields (createdAt/by, publishedAt/by). |
| web/src/generated/schemas/CampaignGraphDto.ts | Adds audit field linkage. |
| web/src/generated/schemas/CampaignAuditDto.ts | New generated audit DTO. |
| web/src/generated/schemas/BundleSummaryTag.ts | New generated tag entry used by bundle summaries. |
| web/src/generated/schemas/BundleSummary.ts | New generated per-name bundle summary type. |
| web/src/generated/schemas/BundleRelease.ts | Repurposes old tag type into a release-log entry (version + publishedAt). |
| web/src/generated/schemas/BundleDepRange.ts | New generated dependency range type. |
| web/src/generated/schemas/BundleDep.ts | New generated dependency entry type. |
| web/src/generated/schemas/Bundle.ts | Updates bundle model to include bundleDependencies array; removes old fields. |
| web/src/generated/schemas/AuthorDto.ts | New generated author DTO. |
| web/src/generated/schemas/ApiMessageRailOpenGifGetMessageRailResponse.ts | Fixes invalid generated export name for .gif route response type. |
| web/src/generated/schemas/ApiBeamoBundlesAclPutBeamoBundleResponse.ts | Fixes invalid generated export name for renamed ACL endpoint response type. |
| web/src/generated/schemas/AnalyticsSchemaResponse.ts | New generated analytics schema response type. |
| web/src/generated/schemas/AnalyticsSchemaProperty.ts | New generated analytics schema property type. |
| web/src/generated/schemas/AnalyticsSchemaListResponse.ts | Fixes invalid generated export name; adds events. |
| web/src/generated/schemas/AnalyticsObservedEventsResponse.ts | New generated observed-events response type. |
| web/src/generated/schemas/AnalyticsObservedEvent.ts | New generated observed-event entry type. |
| web/src/generated/apis/SegmentsApi.ts | Updates segments attributes endpoint signature to include new query filters. |
| web/src/generated/apis/MessageRailApi.ts | Adds .gif open-token endpoint wiring and constants usage. |
| web/src/generated/apis/constants.ts | Adds placeholders (event, token, etc.) and reorders constants. |
| web/src/generated/apis/CampaignApi.ts | Updates campaigns list endpoint to take filters and return a paged DTO. |
| web/src/generated/apis/BeamoOtelApi.ts | Renames query param from playerId → accountId. |
| web/src/generated/apis/BeamoBundleApi.ts | Adopts bundle API rename (history→releases, checksum ACL→name ACL) and new response types. |
| web/src/generated/apis/AnalyticsApi.ts | Adds new analytics read endpoints (events + schemas). |
| web/CHANGELOG.md | Documents the bundle API contract changes in the web SDK. |
| cli/cli/Services/SwaggerService.cs | Generator fix: method-name splitting uses Regex.Split(..., \\W) to handle extensions like .gif. |
| cli/cli/Services/Bundles/BundleWorkspace.cs | Authored bundle config model now uses bundleDependencies with {min,max} ranges. |
| cli/cli/Docs/SkillTemplates/beam-bundles.md.scriban | Updates CLI docs to reflect releases, name-scoped ACL, and dependency ranges. |
| cli/cli/Commands/BundleCommands/PublishBundleCommand.cs | Sends bundleDependencies ranges, logs publish version, and uses name-scoped ACL endpoint. |
| cli/cli/Commands/BundleCommands/NewBundleCommand.cs | New bundle template now writes bundleDependencies instead of peerDependencies. |
| cli/cli/Commands/BundleCommands/ListBundlesCommand.cs | Lists published bundles as per-name summaries and renders updated columns. |
| cli/cli/Commands/BundleCommands/GetBundleCommand.cs | Surfaces bundle version in command output. |
| cli/cli/Commands/BundleCommands/BundleTagInfoExtensions.cs | Maps tags from both tag→checksum maps and summary tag arrays into CLI contract. |
| cli/cli/Commands/BundleCommands/BundleSummaryInfo.cs | New CLI projection type for per-name published bundle summaries. |
| cli/cli/Commands/BundleCommands/BundleReleasesCommand.cs | New bundles releases command that walks the paged release log. |
| cli/cli/Commands/BundleCommands/BundleReleaseInfo.cs | New CLI projection type for one release-log entry. |
| cli/cli/Commands/BundleCommands/BundleInfo.cs | Updates bundle projection to store dependency ranges and removes ACL field. |
| cli/cli/Commands/BundleCommands/BundleHistoryCommand.cs | Removes the old bundles history command. |
| cli/cli/Commands/BundleCommands/BundleAclCommand.cs | Updates ACL command to require a bundle name (no tag/checksum) and calls new endpoint. |
| cli/cli/App.cs | Wires the bundles releases command instead of bundles history. |
| cli/beamable.common/Runtime/OpenApi/Models.gs.cs | Regenerates shared OpenAPI models for bundles (summaries, releases, ranges, tags map). |
| cli/beamable.common/Runtime/OpenApi/BeamBeamobundle.gs.cs | Regenerates bundle API client interface and endpoints (releases, name ACL). |
| cli/beamable.common/Runtime/BeamCli/Contracts/BundlesService/BundleTagInfo.cs | Updates bundle tag contract to match tag→checksum map shape. |
Review details
Files not reviewed (39)
- web/src/generated/apis/AnalyticsApi.ts: Generated file
- web/src/generated/apis/BeamoBundleApi.ts: Generated file
- web/src/generated/apis/BeamoOtelApi.ts: Generated file
- web/src/generated/apis/CampaignApi.ts: Generated file
- web/src/generated/apis/MessageRailApi.ts: Generated file
- web/src/generated/apis/SegmentsApi.ts: Generated file
- web/src/generated/apis/constants.ts: Generated file
- web/src/generated/schemas/AnalyticsObservedEvent.ts: Generated file
- web/src/generated/schemas/AnalyticsObservedEventsResponse.ts: Generated file
- web/src/generated/schemas/AnalyticsSchemaProperty.ts: Generated file
- web/src/generated/schemas/AnalyticsSchemaResponse.ts: Generated file
- web/src/generated/schemas/AuthorDto.ts: Generated file
- web/src/generated/schemas/Bundle.ts: Generated file
- web/src/generated/schemas/BundleDep.ts: Generated file
- web/src/generated/schemas/BundleDepRange.ts: Generated file
- web/src/generated/schemas/BundleSummary.ts: Generated file
- web/src/generated/schemas/BundleSummaryTag.ts: Generated file
- web/src/generated/schemas/CampaignAuditDto.ts: Generated file
- web/src/generated/schemas/CampaignGraphDto.ts: Generated file
- web/src/generated/schemas/CampaignSummaryDto.ts: Generated file
- web/src/generated/schemas/ClientAnalyticsEvent.ts: Generated file
- web/src/generated/schemas/GetBundleResponse.ts: Generated file
- web/src/generated/schemas/GoalPredicateDto.ts: Generated file
- web/src/generated/schemas/ListBundleReleasesResponse.ts: Generated file
- web/src/generated/schemas/ListBundlesResponse.ts: Generated file
- web/src/generated/schemas/Message.ts: Generated file
- web/src/generated/schemas/OtelView.ts: Generated file
- web/src/generated/schemas/ProtoError.ts: Generated file
- web/src/generated/schemas/PublishBundleRequest.ts: Generated file
- web/src/generated/schemas/PublishBundleResponse.ts: Generated file
- web/src/generated/schemas/ReportRailFunnelStageRequest.ts: Generated file
- web/src/generated/schemas/RuleLeaf.ts: Generated file
- web/src/generated/schemas/SegmentAttribute.ts: Generated file
- web/src/generated/schemas/SendMailObjectRequest.ts: Generated file
- web/src/generated/schemas/SendMailRequest.ts: Generated file
- web/src/generated/schemas/enums/AuthorKind.ts: Generated file
- web/src/generated/schemas/enums/BeamoV2FederationType.ts: Generated file
- web/src/generated/schemas/enums/PropertyBoundsMode.ts: Generated file
- web/src/generated/schemas/index.ts: Generated file
- Files reviewed: 24/63 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| var releases = new List<BundleReleaseInfo>(); | ||
| var tags = Array.Empty<BundleTagInfo>(); | ||
| long? fromVersion = null; |
| var range = kvp.Value as JObject; | ||
| config.bundleDependencies[kvp.Key] = new BundleDependencyConfig | ||
| { | ||
| type = (kvp.Value as JObject)?.Value<string>("type") | ||
| min = range?.Value<long?>("min") ?? 0, | ||
| max = range?.Value<long?>("max") |
| var (explicitNs, name, selector) = BundleRef.Split(args.bundleName); | ||
| if (!string.IsNullOrEmpty(selector)) | ||
| throw new CliException($"Reference=[{args.bundleName}] must be a bundle name without a tag or checksum: an ACL applies to every version published under the name."); | ||
|
|
||
| var ns = await BundleNamespace.Resolve(args, explicitNs); | ||
| var scope = BundleAclScope.Resolve(args.scope, args.AppContext); | ||
|
|
|
Lightbeam link |
gabrielbeamable
left a comment
There was a problem hiding this comment.
looks good to me, just a few questions:
I see you already generated the web sdk open api files, is there a RC release for this? while we don't do a definitive release of the web sdk, we've been releasing some RCs so to use these changes in Console and portal extensions
These API changes in the web sdk might break things in the Console, specifically the bundles view page, for history etc, is there something on the mends for this? If not, that is ok, I think it shouldn't block this PR and I can take on that work
Brief Description
BeamableApi changed the bundle catalog contract: visibility now belongs to a bundle's name rather than to each
published checksum, the publish history became a paged release log, and dependencies carry a version range. This branch brings the two consumers in this repo up to that contract.
The web SDK is regenerated against dev, taken whole as previous regens were. Two bundle functions are renamed as a result:
beamoGetBundlesHistoryis nowbeamoGetBundlesReleases, andbeamoPutBundlesChecksumsAclis nowbeamoPutBundlesAcl. The regen also needed a small fix to the generator, which split path segments on/and-only and produced an invalid type name for a route ending in.gif.The CLI's generated client is updated for the bundle types only, and the commands follow:
bundles historybecomesbundles releases,bundles acltakes a name instead of a checksum, andbundles listshows per-name summaries. The authored bundle file renamespeerDependenciestobundleDependencieswith a{min, max}range per entry.Nothing here is shipped yet, so there is no compatibility layer. The renamed routes were verified against dev.
Checklist