Adds support for applying built-in Microsoft site designs (store 1). Closes #7460#7461
Open
fabianhutzli wants to merge 1 commit into
Open
Adds support for applying built-in Microsoft site designs (store 1). Closes #7460#7461fabianhutzli wants to merge 1 commit into
fabianhutzli wants to merge 1 commit into
Conversation
spo sitedesign list/get/apply only reached tenant-registered custom site designs (store 0) via the SiteScriptUtility REST API. Microsoft's built-in designs (Event, Department, Human Resources, etc.) live in the site template store (store 1) and require passing a store parameter, mirroring the approach recently added to PnP PowerShell's Get-PnPSiteDesign -BuiltIn and Invoke-PnPSiteDesign -Template (pnp/powershell#5358). - spo sitedesign list --builtIn lists the store 1 designs - spo sitedesign get --builtIn resolves a single one by id or title - spo sitedesign apply --template <name> or --id --builtIn applies a built-in design; --asTask is rejected in that case as unsupported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Summary
Closes #7460
Adds support for Microsoft's built-in SharePoint site designs (the "store 1" designs) to
spo sitedesign apply,spo sitedesign getandspo sitedesign list. Previously, these commands only reached tenant-registered custom designs (store 0) via theSiteScriptUtilityREST API. Built-in Microsoft site templates such as Event, Department and Human Resources live in a separate store and could only be reached by adding"store": 1to the same REST calls — making them inaccessible from the CLI without a rawm365 requestcall.This mirrors the equivalent feature already shipped in PnP PowerShell: pnp/powershell#5358
Modified commands
spo sitedesign list-b, --builtInswitch. When specified, callsSiteScriptUtility.GetSiteDesignswithstore: 1and returns all built-in Microsoft site designs, enriched with aTemplateproperty containing the matching friendly template name.spo sitedesign get-b, --builtInswitch. When specified, resolves a single built-in design by--idor--titlefrom the store 1 list (rather thanGetSiteDesignMetadata, which only supports store 0), enriched with the sameTemplateproperty.spo sitedesign apply--template <template>option (mutually exclusive with--id). Resolves the GUID from a static mapping of built-in Microsoft site design names and callsSiteScriptUtility.ApplySiteDesignwithstore: 1.-b, --builtInswitch, usable together with--id, for applying a built-in design when you already know its GUID.--asTaskis rejected when combined with--builtIn/--template, since the built-in store has noAddSiteDesignTaskequivalent.--id-only behaviour (custom designs, store 0) is unchanged.Implementation notes
src/m365/spo/commands/sitedesign/BuiltInSiteDesigns.ts, a GUID-to-name mapping for all built-in Microsoft site design templates, ported from PnP PowerShell'sBuiltInSiteTemplateSettingsso both tools expose the same friendly names..mdxhelp pages updated with new options, examples and response shapes for the built-in case).