Skip to content

feat(template): add Template publish and unpublish methods [DX-903] [DX-904]#2971

Draft
Michael Pham (michaelphamcf) wants to merge 2 commits intofeat/dx-900-901-902-template-create-update-deletefrom
feat/dx-903-904-template-publish-unpublish
Draft

feat(template): add Template publish and unpublish methods [DX-903] [DX-904]#2971
Michael Pham (michaelphamcf) wants to merge 2 commits intofeat/dx-900-901-902-template-create-update-deletefrom
feat/dx-903-904-template-publish-unpublish

Conversation

@michaelphamcf
Copy link
Copy Markdown
Contributor

@michaelphamcf Michael Pham (michaelphamcf) commented Apr 7, 2026

Summary

Adds publish and unpublish methods for the Template entity in the CMA SDK, completing DX-903 and DX-904.

Description

  • publish: PUT /spaces/{spaceId}/environments/{environmentId}/templates/{templateId}/published — sends X-Contentful-Version header, returns updated TemplateProps
  • unpublish: DELETE /spaces/{spaceId}/environments/{environmentId}/templates/{templateId}/published — sends X-Contentful-Version header, returns updated TemplateProps

Changes across the standard layers:

  • lib/common-types.ts — added publish and unpublish to MRActions['Template']
  • lib/adapters/REST/endpoints/template.ts — REST endpoint functions following the ComponentType publish/unpublish pattern
  • lib/plain/entities/template.ts — method signatures added to TemplatePlainClientAPI
  • lib/plain/plain-client.ts — wired via wrap()
  • test/unit/adapters/REST/endpoints/template.test.ts — two unit tests verifying URL and X-Contentful-Version header for each method

This PR is based on feat/exo with the three open template PRs (#2966, #2967, #2969) merged in to avoid conflicts when they land.

Motivation and Context

Part of the incremental Template entity build-out for Experience Orchestration. Upstream contract: template.ts in assemblies.

Related tickets: DX-903, DX-904

PR Checklist

  • I have read the CONTRIBUTING.md file
  • All commits follow conventional commits
  • Documentation is updated (if necessary)
  • PR doesn't contain any sensitive information
  • There are no breaking changes

@bito-code-review
Copy link
Copy Markdown

bito-code-review bot commented Apr 7, 2026

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at michael.pearce@contentful.com.

@michaelphamcf Michael Pham (michaelphamcf) changed the base branch from feat/exo to feat/dx-900-901-902-template-create-update-delete April 7, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant