@taprootio/site-authoring 0.62.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +63 -23
  2. package/package.json +2 -2
  3. package/src/api.js +149 -21
  4. package/src/appearance-contract.js +9 -0
  5. package/src/article-end-settings.js +295 -0
  6. package/src/changelog.json +39 -0
  7. package/src/chrome-input.js +1 -1
  8. package/src/cli.js +110 -26
  9. package/src/constants.js +7 -0
  10. package/src/content/components.js +130 -14
  11. package/src/content/cta-decoration-paint.js +321 -0
  12. package/src/content/form-placement-presentation.js +91 -0
  13. package/src/content/form-placement-presentation.json +6 -0
  14. package/src/content/free-form-section-registry.json +19 -1
  15. package/src/content/free-form-sections.js +64 -55
  16. package/src/content/markdown.js +13 -0
  17. package/src/content/tiptap-prosemirror.ts +72 -59
  18. package/src/content/validate-document.js +2 -0
  19. package/src/cta-artwork-warnings.js +164 -0
  20. package/src/errors.js +6 -0
  21. package/src/field-schema.json +6 -2
  22. package/src/field-validation.js +14 -5
  23. package/src/footer-workspace.js +7 -3
  24. package/src/form-references.js +71 -9
  25. package/src/forms-contract.js +3 -5
  26. package/src/heading-outline.js +7 -0
  27. package/src/output.js +2 -0
  28. package/src/page-article-end.js +66 -0
  29. package/src/page-block-catalog.js +54 -0
  30. package/src/page-form-presentation.js +104 -0
  31. package/src/page-structure-checks.js +7 -1
  32. package/src/placed-image-ids.js +15 -18
  33. package/src/presentation-reference.js +30 -52
  34. package/src/reference-help.js +97 -27
  35. package/src/reusable-blocks.js +429 -0
  36. package/src/reusable-placements.js +271 -0
  37. package/src/setting-reference.js +25 -1
  38. package/src/settings-catalog.js +1 -0
  39. package/src/site-check-findings.js +30 -2
  40. package/src/site-check-rules.json +1 -0
  41. package/src/site-checks.js +26 -2
  42. package/src/site-health-findings.js +25 -3
  43. package/src/site-health-image-checks.js +1 -1
  44. package/src/staging-check.js +108 -21
  45. package/src/staging-served.js +5 -49
  46. package/src/status-warning-paints.js +17 -0
  47. package/src/template-token-reach.json +14 -2
  48. package/src/theme-resolve.js +27 -0
  49. package/src/transport.js +41 -5
  50. package/src/typed-page-reference.js +55 -5
  51. package/src/typed-pages.js +27 -4
  52. package/src/verbs/approve.js +2 -1
  53. package/src/verbs/deploy.js +93 -15
  54. package/src/verbs/footer-push.js +4 -2
  55. package/src/verbs/forms-push.js +9 -0
  56. package/src/verbs/health.js +11 -6
  57. package/src/verbs/index.js +3 -0
  58. package/src/verbs/pages-blocks-pull.js +22 -0
  59. package/src/verbs/pages-push.js +89 -34
  60. package/src/verbs/plan.js +34 -5
  61. package/src/verbs/pull.js +213 -124
  62. package/src/verbs/status.js +20 -2
  63. package/src/verbs/theme-push.js +164 -14
  64. package/src/verbs/theme-resolve.js +114 -40
  65. package/src/verbs/validate.js +49 -18
  66. package/src/workspace-check.js +42 -5
  67. package/src/workspace-context-usage.js +54 -1
  68. package/src/workspace.js +37 -7
  69. package/test/fixtures/default-site-theme.json +1 -1
package/src/cli.js CHANGED
@@ -9,13 +9,14 @@ import {
9
9
  CLI_VERSION,
10
10
  DEFAULT_LOGIN_KEY_NAME,
11
11
  DEPLOY_TARGET_PRODUCTION,
12
- DEPLOY_TARGET_STAGING,
12
+ DEPLOY_TARGET_RESET_STAGING,
13
13
  LIMITS,
14
14
  LOGIN_KEY_NAME_MAXIMUM,
15
15
  PLAN_HASH,
16
16
  PUBLISH_KEY_ENVIRONMENT_VARIABLE,
17
17
  REFUSAL_CREDENTIAL_REJECTED,
18
18
  RESULT_SCHEMA_VERSION,
19
+ STAGING_DEPLOYMENT_ID_OPTION,
19
20
  STAGING_REVIEW_SESSION_NOTE,
20
21
  SURFACE_DOCS_PRESENTATION,
21
22
  SURFACE_STANDARD,
@@ -45,6 +46,7 @@ import {
45
46
  VERB_MEDIA_IMAGES_GET,
46
47
  VERB_MEDIA_IMAGES_DESCRIBE,
47
48
  VERB_NAV_PUSH,
49
+ VERB_PAGES_BLOCKS_PULL,
48
50
  VERB_PAGES_DELETE,
49
51
  VERB_PAGES_META_SET,
50
52
  VERB_PAGES_PUSH,
@@ -181,7 +183,9 @@ const VERBS = Object.freeze([
181
183
  + "describe' command for its fix (notInSiteLibrary lists placed ids that are not in the site's library: deleted, another site's, or owned media such as a copied video poster, on which no description can be set). Placement alt strings "
182
184
  + "never decide whether an image default is missing; they only suggest the text. --site needs a workspace and a "
183
185
  + "sign-in, so it is refused with a directory argument or --init (validate.site_needs_workspace), and a managed "
184
- + "Docs site is not read. Known author-entered metadata also receives missing, "
186
+ + "Docs site is not read. Compact form findings (form.compact_unavailable) identify workspace or catalog evidence in detail. "
187
+ + "When evidence is unavailable, siteChecks.formCompactCheckReason gives form_definition_unavailable and a message. "
188
+ + "Known author-entered metadata also receives missing, "
185
189
  + "short, long and repeated-title description advice (title guidance 15–70 characters; description 50–160). "
186
190
  + "These are writing suggestions, never requirements. The terminal lists errors and publishing warnings "
187
191
  + "ahead of title and description advice. Generated custom values are checked; generated "
@@ -318,6 +322,7 @@ const VERBS = Object.freeze([
318
322
  // site.theme.manage — so a read-only snapshot still needs Design.
319
323
  capabilities: [CAPABILITY_CONTENT, CAPABILITY_DESIGN],
320
324
  tokens: ["pull"],
325
+ settingsOnly: true,
321
326
  summary: "Snapshot pages, navigation, and settings into the local workspace.",
322
327
  note: "Every page path keeps exactly one authoritative source. A page whose manifest entry names a source that is "
323
328
  + "still on disk keeps that file, so pull never writes a '.pm.json' beside a tracked '.md'. "
@@ -346,7 +351,19 @@ const VERBS = Object.freeze([
346
351
  + "(template 'generated'): you edit its custom title, breadcrumb title, custom description and introduction, "
347
352
  + "and the manifest keeps the title and description the site reports. "
348
353
  + "A form a page places is written back by its key, the name 'forms/<key>.json' uses, though the site stores "
349
- + "the form's id.",
354
+ + "the form's id. Use --settings-only to refresh presentation files with Design access while keeping the "
355
+ + "workspace's content inventory. Standard site reusable blocks are written to settings/reusable-blocks.json.",
356
+ },
357
+ {
358
+ name: VERB_PAGES_BLOCKS_PULL,
359
+ surface: SURFACE_STANDARD,
360
+ capabilities: [CAPABILITY_CONTENT],
361
+ tokens: ["pages", "blocks", "pull"],
362
+ summary: "Refresh the site's page block catalog in the workspace manifest.",
363
+ note: "Use a workspace already bound to this site. The catalog records available forms and reusable block "
364
+ + "choices. Use a same-type key as the only reusableKey field of a CTA or Form block. Include publishing "
365
+ + "preferences in a release for a definition only in draft. An empty list means there are no choices; an "
366
+ + "omitted list means this Taproot did not supply it.",
350
367
  },
351
368
  {
352
369
  name: VERB_PAGES_META_SET,
@@ -631,9 +648,9 @@ const VERBS = Object.freeze([
631
648
  {
632
649
  name: VERB_REDIRECTS_CHECK,
633
650
  surface: SURFACE_STANDARD,
634
- capabilities: [CAPABILITY_CONTENT, CAPABILITY_DEPLOYMENTS],
651
+ capabilities: [CAPABILITY_DEPLOYMENTS],
635
652
  tokens: ["redirects", "check"],
636
- summary: "Check the current redirect map through the authenticated staging edge.",
653
+ summary: "Check the acknowledged staging release’s redirects at the edge.",
637
654
  handoffOptions: true,
638
655
  note: "Reports each entry's path, HTTP status and Location in redirects.items, and redirects.verified, without "
639
656
  + "following redirects. A redirect is live only with the release that carries it, so this reads the staged release. "
@@ -756,6 +773,10 @@ const VERBS = Object.freeze([
756
773
  summary: "Validate and push the workspace's complete theme and appearance settings in one atomic save.",
757
774
  note: "Run pull first. Theme JSON stays decoded in the workspace; this command validates the complete light/dark"
758
775
  + " pair and encodes it only at the API boundary. Image settings reference site-owned image IDs from media upload. "
776
+ + "On Standard sites, edit settings/reusable-blocks.json to change the reusable CTA and Form definitions. "
777
+ + "An absent file preserves them. A blocks array with no entries requests to clear the list, subject to removal checks. "
778
+ + "The dry run lists removals. Run validate after a complete pull to find workspace placements. The real write also checks "
779
+ + "saved pages and retained releases and can refuse a definition that remains in use. "
759
780
  + "The complete change set — both themes, the appearance scalars, and the header/footer contexts and logo variants — is saved in "
760
781
  + "one transaction fenced by the presentation revision pull recorded: a concurrent change to any of those "
761
782
  + "fields refuses the whole push (theme.concurrent_modification) and nothing is written. A save whose response "
@@ -884,10 +905,11 @@ const VERBS = Object.freeze([
884
905
  surface: SURFACE_STANDARD,
885
906
  capabilities: [CAPABILITY_CONTENT],
886
907
  tokens: ["approve"],
887
- summary: "Publish drafts. This stages the site; it does not deploy it.",
908
+ summary: "Approve drafts so they can be selected for staging.",
888
909
  positionals: "pagePaths",
889
910
  note: "Positional arguments narrow the selection to those page paths;"
890
- + " with none, every draft the workspace manifest tracks is staged."
911
+ + " with none, approve the drafts tracked by the workspace manifest."
912
+ + " For a moved page, staging previews its automatic redirect. Production promotion makes it live and records history."
891
913
  + " The homepage is recorded with an empty path, so address it as '/'."
892
914
  + " A named page with no pending draft (already approved, or published with no new draft) is listed in"
893
915
  + " skipped { total, items: [{ pageId, path, status, reason }] } and the rest are approved; a path that names"
@@ -898,8 +920,8 @@ const VERBS = Object.freeze([
898
920
  surface: SURFACE_DOCS_PRESENTATION,
899
921
  // Deployments is the only capability this verb *writes* with; the other two
900
922
  // are for reads and re-reads the server makes on its behalf (TR00691).
901
- // Content: staging redirect checks read the current redirect map;
902
- // production also re-authorizes the stored candidate's pages.
923
+ // Staging view reads the acknowledged release’s frozen redirect map.
924
+ // Content lets the pipeline re-authorize the stored candidate’s pages.
903
925
  // Design: --production promotes a completed staging deployment, and the
904
926
  // pipeline re-authorizes that deployment's *stored* candidate — every
905
927
  // selected settings group and its navigation — against site.theme.manage,
@@ -908,7 +930,7 @@ const VERBS = Object.freeze([
908
930
  // Design is refused.
909
931
  capabilities: [CAPABILITY_CONTENT, CAPABILITY_DESIGN, CAPABILITY_DEPLOYMENTS],
910
932
  tokens: ["deploy"],
911
- summary: "Deploy to staging, or promote staging to production.",
933
+ summary: "Deploy a candidate, reset staging, or promote a reviewed stage.",
912
934
  target: true,
913
935
  handoffOptions: true,
914
936
  note: "If deploy.hosting_unavailable names Hosting, check stagingHosting in status. Activate the staging "
@@ -926,7 +948,9 @@ const VERBS = Object.freeze([
926
948
  + "propagating (still the previous release at the bound) or unverified (the change cannot be attributed to this deployment, or the last read did not name the previous release), "
927
949
  + "with the time to wait or the seconds waited. A Standard site's deploy --staging also reads the Site Health report "
928
950
  + "the staged release stored and returns it as siteHealth, the object 'health --staging' returns: each warning, the ones "
929
- + "new since production marked newSinceProduction, with a fix. A warning never fails the deploy, and a report that cannot be "
951
+ + "new since production marked newSinceProduction, with a fix."
952
+ + " An image finding is new when it adds an affected page. imageIdentityComplete is false when a group cannot be compared."
953
+ + " A warning never fails the deploy, and a report that cannot be "
930
954
  + "read is siteHealth with available false; fix every new warning and stage again before handing the release to the owner. "
931
955
  + "The four page counts differ. deployment.pageCount is the authored pages the release publishes, the number "
932
956
  + "counted against the published-pages allowance; on a Standard site it leaves out the home page, the 404 page "
@@ -936,7 +960,12 @@ const VERBS = Object.freeze([
936
960
  + "deploy. readiness.pageEstimate.plannedPageCount is the pages staging would generate, the number charged "
937
961
  + "against the pages-generated allowance. deploy.page_not_stageable carries Taproot's reason a page in the release "
938
962
  + "cannot be staged, naming its title, path and ID, such as a folder index no page in the release is listed on "
939
- + "(see 'help page generated'). "
963
+ + "(see 'help page generated'). deploy.stage_again means a new staging deployment is needed. "
964
+ + "deploy.stage_updating means Taproot is updating the staged release. Run 'status', review the current acknowledged "
965
+ + `stage after the update finishes, then pass its ID with ${STAGING_DEPLOYMENT_ID_OPTION} to promote that exact stage. `
966
+ + "deploy --reset-staging restores the current production release on Standard staging. It does not send a local "
967
+ + "selection and keeps your drafts and saved promotion selection. The reset cannot be promoted. "
968
+ + "If the releases already match, resetStatus is unchanged. Stage a later candidate normally. "
940
969
  + STAGING_REVIEW_SESSION_NOTE,
941
970
  },
942
971
  {
@@ -1015,7 +1044,10 @@ const VERBS = Object.freeze([
1015
1044
  summary:
1016
1045
  "Report the platform authoring switch, CLI release, deployments, readiness, image processing, and site health.",
1017
1046
  note: "stagingHosting reports staging host setup separately from candidate readiness. If the host is missing, "
1018
- + "check the site's Licence & domain settings and local staging host configuration. siteHealth summarizes the stored Site Health report of the last production release, with its findings (a rule id, severity, page, and the value found); stagedSiteHealth summarizes the staged release's report."
1047
+ + "check the site's Licence & domain settings and local staging host configuration. readiness shows a staged "
1048
+ + "release update's state and message when there is one. stagingHosting identifies the current acknowledged stage "
1049
+ + "when available. Review the stage before using stagingHosting.productionRetryCommand from the same workspace or with the same --config. "
1050
+ + "siteHealth summarizes the stored Site Health report of the last production release, with its findings (a rule id, severity, page, and the value found); stagedSiteHealth summarizes the staged release's report."
1019
1051
  + " Both read what a release stored when it was generated, so edits made since are outside them; run 'health --staging' or 'health --production' for each finding's file and fix."
1020
1052
  + " Content permission is required; a refused or failed production read fails status rather than reporting a clean site, and a failed staged read is reported as unavailable.",
1021
1053
  },
@@ -1040,8 +1072,9 @@ const VERBS = Object.freeze([
1040
1072
  + "imageFindings. Each finding names its file in the workspace and a fix; an image finding carries the exact "
1041
1073
  + "'media images describe' command with the image's description revision when the workspace's alt text "
1042
1074
  + "supplies a safe description, and otherwise needsDescription. With --staging each finding says "
1043
- + "newSinceProduction, and comparison says whether production had a report to compare with; without one "
1044
- + "every finding is listed as not compared. Both lists are bounded by size, with findingsTotal, "
1075
+ + "newSinceProduction when it can be compared."
1076
+ + " An image finding is new when it adds an affected page. imageIdentityComplete is false when a group cannot be compared."
1077
+ + " Without a production report, every finding is listed as not compared. Both lists are bounded by size, with findingsTotal, "
1045
1078
  + "imageFindingsTotal and the truncation flags. The terminal output for health and deploy --staging lists errors "
1046
1079
  + "and publishing warnings ahead of title and description advice. A site with no stored report says available false and why. "
1047
1080
  + "A managed Docs site returns covered false. Content permission is required.",
@@ -1161,7 +1194,9 @@ ${COMMON_OPTIONS}
1161
1194
  `;
1162
1195
 
1163
1196
  function verbHelp(verb) {
1164
- const targetUsage = verb.target ? " (--staging | --production)" : "";
1197
+ const targetUsage = verb.name === VERB_DEPLOY
1198
+ ? " (--staging | --production | --reset-staging)"
1199
+ : verb.target ? " (--staging | --production)" : "";
1165
1200
  const positionalUsage = verb.positionals === "fixturePath"
1166
1201
  ? " [<directory>]"
1167
1202
  : verb.positionals === "pageSelector"
@@ -1206,6 +1241,8 @@ function verbHelp(verb) {
1206
1241
  : verb.target && !verb.deliveryOptions
1207
1242
  ? `\n --staging Deploy the staged site to staging.
1208
1243
  --production Promote the completed staging deployment to production.
1244
+ --reset-staging Restore Standard staging from the current production release.
1245
+ ${STAGING_DEPLOYMENT_ID_OPTION} <id> With --production, promote this reviewed staging deployment.
1209
1246
  --allow-failed-preview Explicitly override the matching candidate's failed preview.`
1210
1247
  : "";
1211
1248
  const handoffOption = verb.handoffOptions
@@ -1256,6 +1293,7 @@ function verbHelp(verb) {
1256
1293
  --site Read the site's theme instead of the workspace's; needs a sign-in.
1257
1294
  --json Write the stable JSON result instead of the table.`
1258
1295
  : "";
1296
+ const settingsOnlyOption = verb.settingsOnly ? "\n --settings-only Refresh presentation with Design access." : "";
1259
1297
  const dryRunOption = verb.dryRun
1260
1298
  ? "\n --dry-run Read the site and report what a push would change, without writing."
1261
1299
  : "";
@@ -1363,7 +1401,7 @@ function verbHelp(verb) {
1363
1401
  ${verb.summary}
1364
1402
  ${boundary}
1365
1403
 
1366
- ${options}${targetOption}${handoffOption}${reviewPathOption}${sinceOption}${deliveryTargetOption}${metaOptions}${authorOptions}${imageOptions}${jsonOption}${resolveOptions}${dryRunOption}${describeOption}${archiveOption}${linkOptions}${planOption}${nameOption}${note}
1404
+ ${options}${targetOption}${handoffOption}${reviewPathOption}${sinceOption}${deliveryTargetOption}${metaOptions}${authorOptions}${imageOptions}${jsonOption}${resolveOptions}${dryRunOption}${settingsOnlyOption}${describeOption}${archiveOption}${linkOptions}${planOption}${nameOption}${note}
1367
1405
  `;
1368
1406
  }
1369
1407
 
@@ -1522,7 +1560,13 @@ function referenceResult(parsed) {
1522
1560
  case "topics":
1523
1561
  return { ...result, topic: "topics", topics: REFERENCE_TOPICS };
1524
1562
  case "pages":
1525
- return { ...result, topic: "page-types", pageTypes: listPageTypeReferences(), sourceRule: PAGE_SOURCE_CONFLICT_RULE };
1563
+ return {
1564
+ ...result, topic: "page-types", pageTypes: listPageTypeReferences(), sourceRule: PAGE_SOURCE_CONFLICT_RULE,
1565
+ pageBlockCatalog: {
1566
+ command: `${CLI_BINARY_NAME} ${VERB_PAGES_BLOCKS_PULL}`,
1567
+ description: "Refreshes Forms and reusable block choices in the site-bound workspace manifest using Content access.",
1568
+ },
1569
+ };
1526
1570
  case "sections":
1527
1571
  return { ...result, topic: "sections", sections: getSectionsReference() };
1528
1572
  case "components":
@@ -1813,6 +1857,7 @@ function parseArguments(arguments_) {
1813
1857
  let init = false;
1814
1858
  let quiet = false;
1815
1859
  let deployTarget;
1860
+ let stagingDeploymentId;
1816
1861
  let deliveryUrl;
1817
1862
  let propagationWaitSeconds;
1818
1863
  let browser;
@@ -1821,6 +1866,7 @@ function parseArguments(arguments_) {
1821
1866
  let reviewPath;
1822
1867
  let since;
1823
1868
  let dryRun = false;
1869
+ let settingsOnly = false;
1824
1870
  let describeMissingImages = false;
1825
1871
  let json = false;
1826
1872
  let themeScheme;
@@ -1858,20 +1904,35 @@ function parseArguments(arguments_) {
1858
1904
  field: "configPath",
1859
1905
  });
1860
1906
  }
1861
- if (verb.target && (argument === "--staging" || argument === "--production")) {
1862
- const candidate = argument === "--staging" ? DEPLOY_TARGET_STAGING : DEPLOY_TARGET_PRODUCTION;
1907
+ if (verb.target && (argument === "--staging" || argument === "--production"
1908
+ || (verb.name === VERB_DEPLOY && argument === "--reset-staging"))) {
1909
+ const candidate = argument.slice(2);
1863
1910
  if (deployTarget === candidate) {
1864
1911
  throw usageError("cli.duplicate_option", `${argument} may be supplied only once.`);
1865
1912
  }
1866
1913
  if (deployTarget !== undefined) {
1867
1914
  throw usageError(
1868
1915
  "cli.deploy_target",
1869
- `${verb.tokens.join(" ")} accepts exactly one of --staging or --production.`,
1916
+ `${verb.tokens.join(" ")} accepts only one target.`,
1870
1917
  );
1871
1918
  }
1872
1919
  deployTarget = candidate;
1873
1920
  continue;
1874
1921
  }
1922
+ if (verb.name === VERB_DEPLOY && argument === STAGING_DEPLOYMENT_ID_OPTION) {
1923
+ if (stagingDeploymentId !== undefined) {
1924
+ throw usageError("cli.duplicate_option", `${STAGING_DEPLOYMENT_ID_OPTION} may be supplied only once.`);
1925
+ }
1926
+ const id = rest[index + 1];
1927
+ if (!isCanonicalUuid(id)) {
1928
+ throw usageError("cli.staging_deployment_id", `${STAGING_DEPLOYMENT_ID_OPTION} requires a canonical lowercase UUID.`, {
1929
+ field: "stagingDeploymentId",
1930
+ });
1931
+ }
1932
+ stagingDeploymentId = id;
1933
+ index += 1;
1934
+ continue;
1935
+ }
1875
1936
  if (verb.deliveryOptions && argument === "--url") {
1876
1937
  if (deliveryUrl !== undefined) throw usageError("cli.duplicate_option", "--url may be supplied only once.");
1877
1938
  deliveryUrl = parseUrlOption(rest, index);
@@ -1947,6 +2008,11 @@ function parseArguments(arguments_) {
1947
2008
  index += consumed;
1948
2009
  continue;
1949
2010
  }
2011
+ if (verb.settingsOnly && argument === "--settings-only") {
2012
+ if (settingsOnly) throw usageError("cli.duplicate_option", "--settings-only may be supplied only once.");
2013
+ settingsOnly = true;
2014
+ continue;
2015
+ }
1950
2016
  if (verb.dryRun && argument === "--dry-run") {
1951
2017
  if (dryRun) throw usageError("cli.duplicate_option", "--dry-run may be supplied only once.");
1952
2018
  dryRun = true;
@@ -2069,7 +2135,9 @@ function parseArguments(arguments_) {
2069
2135
  if (verb.target && deployTarget === undefined) {
2070
2136
  throw usageError(
2071
2137
  "cli.deploy_target",
2072
- `${verb.tokens.join(" ")} requires exactly one of --staging or --production.`,
2138
+ verb.name === VERB_DEPLOY
2139
+ ? "deploy requires --staging, --production or --reset-staging."
2140
+ : `${verb.tokens.join(" ")} requires exactly one of --staging or --production.`,
2073
2141
  );
2074
2142
  }
2075
2143
  if (verb.handoffOptions && reviewPath !== undefined && handoff !== true) {
@@ -2079,8 +2147,16 @@ function parseArguments(arguments_) {
2079
2147
  { field: "reviewPath" },
2080
2148
  );
2081
2149
  }
2150
+ if (stagingDeploymentId !== undefined && deployTarget !== DEPLOY_TARGET_PRODUCTION) {
2151
+ throw usageError("cli.staging_deployment_id_target", `${STAGING_DEPLOYMENT_ID_OPTION} applies only to deploy --production.`, {
2152
+ field: "stagingDeploymentId",
2153
+ });
2154
+ }
2155
+ if (deployTarget === DEPLOY_TARGET_RESET_STAGING && allowFailedPreview) {
2156
+ throw usageError("cli.reset_staging_options", "--allow-failed-preview cannot be used with --reset-staging.");
2157
+ }
2082
2158
  if (handoff === true && verb.target && deployTarget === DEPLOY_TARGET_PRODUCTION) {
2083
- throw usageError("cli.handoff_target", "--handoff applies only to deploy --staging.", { field: "handoff" });
2159
+ throw usageError("cli.handoff_target", "--handoff applies only to staging deployments.", { field: "handoff" });
2084
2160
  }
2085
2161
  // Before the path-arity check: --site with --init is refused for the combination, not for a missing directory.
2086
2162
  if (verb.siteOption && fromSite && (init || positionals.length > 0)) throw siteNeedsWorkspaceError(init);
@@ -2176,6 +2252,9 @@ function parseArguments(arguments_) {
2176
2252
  if (legalDrafts && !["login", "logout", "whoami", "pull", "pages push", "plan", "apply"].includes(verb.name)) {
2177
2253
  throw usageError("cli.legal_option", "--legal-drafts applies to login, logout, whoami, pull, pages push, plan, or apply.");
2178
2254
  }
2255
+ if (settingsOnly && legalDrafts) {
2256
+ throw usageError("cli.legal_option", "--settings-only cannot be combined with --legal-drafts.");
2257
+ }
2179
2258
  if (quiet && verb.name === VERB_LOGIN) {
2180
2259
  // The approval URL and user code reach the operator only as progress
2181
2260
  // lines, and the JSON result is serialized only after polling ends — so a
@@ -2195,13 +2274,14 @@ function parseArguments(arguments_) {
2195
2274
  // the server resolves for them, not only the ones the verb's writes name.
2196
2275
  // It reaches the exchange so a content push never holds deploy, and a pull
2197
2276
  // never holds delete (TR00645). Two things count beyond the writes
2198
- // (TR00691): reads (nav push lists pages; deploy checks the redirect map),
2199
- // each gated on Content, and re-authorization
2277
+ // (TR00691): reads (nav push lists pages through Content), and re-authorization
2200
2278
  // of server-held state (deploy --production re-checks the promoted
2201
2279
  // candidate's stored settings and navigation against a Design permission).
2202
2280
  // `VERB_CAPABILITIES` below is what the tests pin against the routes each
2203
2281
  // verb actually calls.
2204
- capabilities: verb.capabilities,
2282
+ capabilities: deployTarget === DEPLOY_TARGET_RESET_STAGING
2283
+ ? [CAPABILITY_DESIGN, CAPABILITY_DEPLOYMENTS]
2284
+ : settingsOnly ? [CAPABILITY_DESIGN] : verb.capabilities,
2205
2285
  // The narrowest site surface the verb applies to (TR00790). `openSession`
2206
2286
  // refuses a verb its site cannot take before any request; `VERB_SURFACES`
2207
2287
  // below is what the tests pin.
@@ -2211,6 +2291,7 @@ function parseArguments(arguments_) {
2211
2291
  legalDrafts,
2212
2292
  quiet,
2213
2293
  deployTarget,
2294
+ ...(stagingDeploymentId === undefined ? {} : { stagingDeploymentId }),
2214
2295
  allowFailedPreview,
2215
2296
  ...(handoff === undefined ? {} : { handoff }),
2216
2297
  ...(reviewPath === undefined ? {} : { reviewPath }),
@@ -2220,6 +2301,7 @@ function parseArguments(arguments_) {
2220
2301
  ...(browser === undefined ? {} : { browser }),
2221
2302
  init,
2222
2303
  dryRun,
2304
+ ...(settingsOnly ? { settingsOnly } : {}),
2223
2305
  ...(describeMissingImages ? { describeMissingImages } : {}),
2224
2306
  json,
2225
2307
  keyName,
@@ -2317,6 +2399,7 @@ export async function runCli({
2317
2399
  configPath: parsed.configPath,
2318
2400
  legalDrafts: parsed.legalDrafts,
2319
2401
  deployTarget: parsed.deployTarget,
2402
+ ...(parsed.stagingDeploymentId === undefined ? {} : { stagingDeploymentId: parsed.stagingDeploymentId }),
2320
2403
  allowFailedPreview: parsed.allowFailedPreview,
2321
2404
  ...(parsed.handoff === undefined ? {} : { handoff: parsed.handoff }),
2322
2405
  ...(parsed.reviewPath === undefined ? {} : { reviewPath: parsed.reviewPath }),
@@ -2324,6 +2407,7 @@ export async function runCli({
2324
2407
  init: parsed.init,
2325
2408
  quiet: parsed.quiet,
2326
2409
  dryRun: parsed.dryRun,
2410
+ ...(parsed.settingsOnly ? { settingsOnly: true } : {}),
2327
2411
  ...(parsed.describeMissingImages ? { describeMissingImages: true } : {}),
2328
2412
  keyName: parsed.keyName,
2329
2413
  ...(parsed.themeScheme === undefined ? {} : { themeScheme: parsed.themeScheme }),
package/src/constants.js CHANGED
@@ -82,6 +82,7 @@ export const VERB_HELP = "help";
82
82
  export const VERB_VALIDATE = "validate";
83
83
  export const VERB_LOGIN = "login";
84
84
  export const VERB_LOGOUT = "logout";
85
+ export const VERB_PAGES_BLOCKS_PULL = "pages blocks pull";
85
86
  export const VERB_PAGES_PUSH = "pages push";
86
87
  export const VERB_PAGES_META_SET = "pages meta set";
87
88
  export const VERB_PAGES_DELETE = "pages delete";
@@ -158,7 +159,9 @@ export const SURFACE_NONE = "none";
158
159
  export const AUTHORING_SURFACES = Object.freeze([SURFACE_STANDARD, SURFACE_DOCS_PRESENTATION, SURFACE_NONE]);
159
160
 
160
161
  export const DEPLOY_TARGET_STAGING = "staging";
162
+ export const DEPLOY_TARGET_RESET_STAGING = "reset-staging";
161
163
  export const DEPLOY_TARGET_PRODUCTION = "production";
164
+ export const STAGING_DEPLOYMENT_ID_OPTION = "--staging-deployment-id";
162
165
 
163
166
  /**
164
167
  * The refusal vocabulary TR00602/TR00603/TR00691 speak, collapsed into the five
@@ -250,6 +253,8 @@ export const CAPABILITY_REFUSAL_FIELD = "GrantedCapabilities";
250
253
  export const DEPLOYMENT_ALLOWANCE_REFUSAL_REASON = "DEPLOYMENT_PERIOD_ALLOWANCE_EXCEEDED";
251
254
  export const BANDWIDTH_ALLOWANCE_REFUSAL_REASON = "BANDWIDTH_ALLOWANCE_EXCEEDED";
252
255
  export const SITE_DEPLOYMENT_REFUSAL_DOMAIN = "sites.taproot.io";
256
+ export const STAGED_RELEASE_STAGE_AGAIN_REFUSAL_REASON = "STAGED_RELEASE_STAGE_AGAIN";
257
+ export const STAGED_RELEASE_UPDATING_REFUSAL_REASON = "STAGED_RELEASE_UPDATING";
253
258
 
254
259
  // gRPC `ResourceExhausted`. Transcoded responses carry the numeric code in the
255
260
  // body; the HTTP mapping is 429.
@@ -282,6 +287,8 @@ export const LIMITS = Object.freeze({
282
287
  // Navigation replies include proto3 defaults that the workspace leaves out.
283
288
  navigationResponseBytes: 2 * NAVIGATION_WORKSPACE_BYTES,
284
289
  apiResponseBytes: 1024 * 1024,
290
+ // Opted-in health comparisons add up to 25,000 resource IDs to a 2 MiB report.
291
+ siteHealthComparisonResponseBytes: 4 * 1024 * 1024,
285
292
  // A redirect map also exceeds the ordinary response bound: two thousand
286
293
  // entries with long absolute targets. Sized with its workspace file
287
294
  // (WORKSPACE_LIMITS.redirectsBytes).