In your app
A function makes the call on the client it is given, so your code passes the real one and a test passes a fake.Add the function
src/attract/revert-global-draft-to-published.ts
Call it
A script makes the client once and calls the function:A route handler, a job or a queue worker calls it the same way.
scripts/revert-global-draft-to-published.ts
Terminal
false when it had no changes to discard).
Find the id
id is the document’s _id, from a list. Ask the list for only the fields you need: each row is a document’s id and those fields.
TypeScript
row.id as id. Drafts: list with { aposMode: 'draft' } to get the draft’s id (Find an id).
Required parameters
Required parameters
Returns
Returns
GlobalContent | false: the GlobalContent, or false. The site-wide settings document (one per site and locale), with the fields this site adds. Read its properties (globalContent.id): each says whether the site always sends it. The example answer is the site’s wire JSON: some keys differ from the property names (_id → id, _logo → logo, _logoLight → logoLight …).Always sent. Change this — to “2”, a date, anything — and every visitor is asked again. Do that whenever what you do with the data materially changes; consent given under the old terms does not carry over.
Always sent. Give this the same visual weight as Accept. A reject option that is harder to find than accept is the single most commonly penalized banner design.
Sometimes sent:
undefined when the site leaves it out, and it can be null. Default title field.Sometimes sent:
undefined when the site leaves it out, and it can be null. The _id of the piece/page that was copied to create this document (only present if created via _copyingId)Sometimes sent:
undefined when the site leaves it out, and it can be null. Business name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown in the site header on the dark theme (and over the hero). Upload to the Images library first. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional darker logo for the light theme. If empty, the white logo is auto-inverted. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Browser tab icon — the default, also used when the browser is in dark mode. Upload a square PNG or SVG (at least 64×64) to the Images library. If empty, the bundled default icon is used. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Used when the visitor’s BROWSER or device is in light mode — this follows the browser’s color scheme, not the site’s own theme toggle. If empty, the main favicon is used everywhere. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown in the footer. Use up to three lines for a full street address, or just one for a town/region.Sometimes sent:
undefined when the site leaves it out, and it can be null. Address line 2.Sometimes sent:
undefined when the site leaves it out, and it can be null. Address line 3.Sometimes sent:
undefined when the site leaves it out, and it can be null. The registered name of the company, e.g. “Example Holdings LLC”. Fills [Business legal name].Sometimes sent:
undefined when the site leaves it out, and it can be null. Any other names the business operates under, e.g. “Example Studio and Example Supply”. Fills [Trade names].Sometimes sent:
undefined when the site leaves it out, and it can be null. Where the business is based, for governing law. Fills [State or region].Sometimes sent:
undefined when the site leaves it out, and it can be null. Fills [Country].Sometimes sent:
undefined when the site leaves it out, and it can be null. Where legal disputes are heard. Fills [County or venue].Sometimes sent:
undefined when the site leaves it out, and it can be null. The youngest age your website is intended for, e.g. “13”. Fills [Minimum age].Sometimes sent:
undefined when the site leaves it out, and it can be null. Your main brand color — buttons, links, accents. Hover + soft tints are derived automatically. Leave empty for the built-in design color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Text/icon color shown ON primary-colored buttons. Defaults to white — set a dark color if your primary is pale.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Supporting color — eyebrows, offset shadows, secondary accents.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Warm accent, used sparingly.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Body-text link color (rich-text content). Leave empty to track the primary color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. The base page background.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Cards and raised panels that sit above the page background.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Recessed / inset bands.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Primary text color. Mind contrast against the page background.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Secondary / muted text color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Borders and dividers.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Positive / confirmation state (forms, alerts).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Caution state.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Error / destructive state.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Informational state.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Typeface used for headings and display type. Default is the built-in design font; the other sources replace it site-wide.Sometimes sent:
undefined when the site leaves it out, and it can be null. Display font — curated pick.Sometimes sent:
undefined when the site leaves it out, and it can be null. Where to browse for the family. Pick one, then follow the link below to find the exact name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Exactly as the provider’s catalog spells it, e.g. “Space Grotesk” or “Clash Display”.Sometimes sent:
undefined when the site leaves it out, and it can be null. Comma-separated weights to load, e.g. 400, 700. Empty loads 500, 700, 800. Weights the family doesn’t ship are skipped by the CDN and synthesized by the browser (faux bold).Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalFontDisplayUploadsItem. One file per weight/style of the SAME typeface. woff2 strongly recommended (smallest, universally supported); woff/ttf/otf also accepted.Sometimes sent:
undefined when the site leaves it out, and it can be null. Generic system fonts shown while the font loads (and if it fails). Curated picks set this automatically.Sometimes sent:
undefined when the site leaves it out, and it can be null. Typeface used for body text and UI. Default is the built-in design font; the other sources replace it site-wide.Sometimes sent:
undefined when the site leaves it out, and it can be null. Body font — curated pick.Sometimes sent:
undefined when the site leaves it out, and it can be null. Where to browse for the family. Pick one, then follow the link below to find the exact name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Exactly as the provider’s catalog spells it, e.g. “Space Grotesk” or “Clash Display”.Sometimes sent:
undefined when the site leaves it out, and it can be null. Comma-separated weights to load, e.g. 400, 700. Empty loads 400, 500, 600, 700. Weights the family doesn’t ship are skipped by the CDN and synthesized by the browser (faux bold).Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalFontBodyUploadsItem. One file per weight/style of the SAME typeface. woff2 strongly recommended (smallest, universally supported); woff/ttf/otf also accepted.Sometimes sent:
undefined when the site leaves it out, and it can be null. Generic system fonts shown while the font loads (and if it fails). Curated picks set this automatically.Sometimes sent:
undefined when the site leaves it out, and it can be null. Typeface used for code blocks and monospace accents. Default is the built-in design font; the other sources replace it site-wide.Sometimes sent:
undefined when the site leaves it out, and it can be null. Accent / mono font — curated pick.Sometimes sent:
undefined when the site leaves it out, and it can be null. Where to browse for the family. Pick one, then follow the link below to find the exact name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Exactly as the provider’s catalog spells it, e.g. “Space Grotesk” or “Clash Display”.Sometimes sent:
undefined when the site leaves it out, and it can be null. Comma-separated weights to load, e.g. 400, 700. Empty loads 400, 700. Weights the family doesn’t ship are skipped by the CDN and synthesized by the browser (faux bold).Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalFontAccentUploadsItem. One file per weight/style of the SAME typeface. woff2 strongly recommended (smallest, universally supported); woff/ttf/otf also accepted.Sometimes sent:
undefined when the site leaves it out, and it can be null. Generic system fonts shown while the font loads (and if it fails). Curated picks set this automatically.Sometimes sent:
undefined when the site leaves it out, and it can be null. The widest the page content gets: sections, layouts, the header and the footer all line up to it. Smaller screens always use their full width, minus the side margins.Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalSocialLinksItem. Each profile is optional — add only the networks you use. A link only appears once it has a URL. Pick a platform for its brand icon, or “Other / custom” to choose any icon.Sometimes sent:
undefined when the site leaves it out. An ImageArea. Site-wide fallback for link previews (Open Graph): used on any page that has neither its own Social share image nor a featured image. Recommended 1200×630. Widgets, top to bottom: send { "items": [ … ] }, one object per widget with its type. Writing it replaces the whole area.Sometimes sent:
undefined when the site leaves it out, and it can be null. Adds schema.org structured data about the business to every page, built from the Brand tab’s business name, address, phone and email plus the Social Links list. Helps search engines show rich results. Nothing is published until this is on and a business name is set.Sometimes sent:
undefined when the site leaves it out, and it can be null. The schema.org type that best describes the business. “Local business” fits most sites with a physical location or service area.Sometimes sent:
undefined when the site leaves it out, and it can be null. Adds the Service Area Map’s coverage (place names, service radius) to the business structured data on every page, and the full zip-code/boundary detail on pages with a Service Area Map section. Helps search engines and AI answers understand where the business serves — there is no visual search result for this, and it never affects map-pack ranking. Keep it consistent with the areas on the business’s Google Business Profile. Demo map data is never published.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional, plain words — e.g. “House cleaning” or “Airport transfers”. When set, the structured data pairs it with the service areas as a schema.org Service; when empty the areas attach directly to the business.Sometimes sent:
undefined when the site leaves it out, and it can be null. Plausible is a privacy-friendly, cookieless analytics service. Visitor page views are counted anonymously; logged-in editors are never tracked.Sometimes sent:
undefined when the site leaves it out, and it can be null. Paste the script address from your site’s snippet in Plausible → Site Settings → Site Installation (it looks like https://plausible.io/js/pa-XXXXXXXX.js and is unique per site). Analytics stay off until this is set. Optional measurements (outbound links, file downloads, form submissions) are toggled in the Plausible dashboard — no change needed here. When set, a URL; empty or null when not.Sometimes sent:
undefined when the site leaves it out, and it can be null. Off hides the banner AND stops every non-essential cookie and third-party embed — declining is the only safe reading of “never asked”. Turn it off only on a site that sets nothing beyond the strictly necessary.Sometimes sent:
undefined when the site leaves it out, and it can be null. Where opt-in applies, nothing non-essential runs until the visitor agrees. Everyone else sees the same banner as a notice: analytics and embedded content work immediately, and declining switches them off. The first option follows the law that is strictest about being asked first, without putting a wall in front of visitors whose law does not require one.Sometimes sent:
undefined when the site leaves it out, and it can be null. Country comes from your CDN or proxy (Cloudflare’s header, or one you configure). Without it the site falls back to this, plus a browser time-zone check that quietly upgrades an apparently European visitor to opt-in. Put Cloudflare or a GeoIP header in front of the site and this setting stops mattering.Sometimes sent:
undefined when the site leaves it out, and it can be null. Banner position.Sometimes sent:
undefined when the site leaves it out, and it can be null. Opens the per-category preferences panel. Leaving it on is the safer choice: accept-or-reject with no middle option is what regulators have been fining sites over.Sometimes sent:
undefined when the site leaves it out, and it can be null. A small button pinned to the bottom corner, over the page. Off by default because the footer link below already offers this — turn it on if you want the control visible without scrolling.Sometimes sent:
undefined when the site leaves it out, and it can be null. Puts the reopen control at the bottom of every page, under the “Powered by” line — where visitors look for it. Uses the reopen label from the Cookie banner wording tab. Leave this on unless the floating button above is on instead: consent must stay as easy to withdraw as it was to give.Sometimes sent:
undefined when the site leaves it out, and it can be null. GPC is a browser-level “do not sell or share my data” signal, legally binding in several US states. When on, a visitor sending it starts with everything non-essential switched off — they can still turn categories on by hand.Sometimes sent:
undefined when the site leaves it out, and it can be null. A third-party script that has already run cannot be switched off in place: it keeps running until the next full page load (each vendor is still told about the withdrawal straight away). On, the page reloads as soon as a visitor switches a category OFF, so nothing they declined keeps running. Off by default: the reload interrupts whatever the visitor was doing, and most visitors are not in a region that requires it.Sometimes sent:
undefined when the site leaves it out, and it can be null. How long a visitor’s answer stands before the banner returns. Six months is the common practice and twelve is the usual ceiling.Sometimes sent:
undefined when the site leaves it out, and it can be null. Stores a receipt for each decision (which categories, when, under which policy version) so you can show consent was given. Kept for two years, then deleted automatically.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty for the message alone, which is how most banners read best.Sometimes sent:
undefined when the site leaves it out, and it can be null. Rendered after the message as a link to the policy page. Leave empty to omit it.Sometimes sent:
undefined when the site leaves it out, and it can be null. A path on this site or a full URL. The default matches the parked Cookie Policy page.Sometimes sent:
undefined when the site leaves it out, and it can be null. Customize button.Sometimes sent:
undefined when the site leaves it out, and it can be null. Save-choices button.Sometimes sent:
undefined when the site leaves it out, and it can be null. Reopen control label.Sometimes sent:
undefined when the site leaves it out, and it can be null. Preferences panel intro.Sometimes sent:
undefined when the site leaves it out, and it can be null. Strictly necessary — label.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown beside this category’s switch in the preferences panel. Say what the visitor gains or loses, not which vendors are involved.Sometimes sent:
undefined when the site leaves it out, and it can be null. Functional — label.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown beside this category’s switch in the preferences panel. Say what the visitor gains or loses, not which vendors are involved.Sometimes sent:
undefined when the site leaves it out, and it can be null. Analytics — label.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown beside this category’s switch in the preferences panel. Say what the visitor gains or loses, not which vendors are involved.Sometimes sent:
undefined when the site leaves it out, and it can be null. Marketing — label.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown beside this category’s switch in the preferences panel. Say what the visitor gains or loses, not which vendors are involved.Sometimes sent:
undefined when the site leaves it out, and it can be null. Shown in place of an embed (a map, a social video) that is waiting on consent.Sometimes sent:
undefined when the site leaves it out, and it can be null. Blocked-content message.Sometimes sent:
undefined when the site leaves it out, and it can be null. Blocked-content button.Sometimes sent:
undefined when the site leaves it out, and it can be null. Takes the public site offline. Visitors and search engines see a “be right back” page (served with the correct temporary-outage signals, so search rankings are preserved); logged-in editors keep the full site and can continue editing. A new site starts with this on: turn it off when the site is ready to go live.Sometimes sent:
undefined when the site leaves it out, and it can be null. How long search engines should wait before checking back (the Retry-After hint). A rough estimate is fine — it is a hint, not a promise, and nothing switches back automatically.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional short message shown on the maintenance page (e.g. what is happening or when you expect to be back). Leave empty for a generic “we’ll be back soon” line.Sometimes sent:
undefined when the site leaves it out, and it can be null. Public reCAPTCHA v3 site key. Managed automatically from Connections → Spam protection — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Whether anonymous page views are being recorded. Managed automatically from Visitor data → Request log — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Whether anonymous visitors get the first-party visitor-ID cookie. Managed automatically from Visitor data → Request log — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Whether conversions and ad attribution are being recorded. Managed automatically from Visitor data → Conversions — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Sites visitors continue to (a booking site), for cross-domain ad attribution. Managed automatically from Visitor data → Conversions — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Public (referrer-restricted) Maps JavaScript key — the Service Area Map loads Google Maps with it. Managed automatically from Connections → Google Maps — edit it there, not here.Sometimes sent:
undefined when the site leaves it out, and it can be null. Master switch for the site’s scroll and entrance motion (section reveals, count-ups, marquees, the hero). When off, no animation code is loaded and every section appears in its final, static state. Visitors whose device requests reduced motion always get the static experience regardless of this setting.Sometimes sent:
undefined when the site leaves it out, and it can be null. A DesignLayer. Site-wide CSS for every section of a type and for shared elements (buttons, the header, the footer…). Type into the slot of the part you want to style; a section’s own CSS tab wins over this.Sometimes sent:
undefined when the site leaves it out, and it can be null. Floating rests transparent over the hero and morphs to glass on scroll; Glass is frosted from the top; Solid is an opaque bar (uses the bar background color).Sometimes sent:
undefined when the site leaves it out, and it can be null. Island floats as a contained pill; Full width spans edge-to-edge (squared corners, content still centered). Full width ignores the corner radius below.Sometimes sent:
undefined when the site leaves it out, and it can be null. Applies to the Island bar (Full width is always squared).Sometimes sent:
undefined when the site leaves it out, and it can be null. The bar fill for Glass / Solid styles (and the glass tint when scrolled). Leave empty to use the raised surface color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A hairline outline around the bar (shown when glass / solid / scrolled).Sometimes sent:
undefined when the site leaves it out, and it can be null. A soft drop shadow under the bar (when glass / solid / scrolled).Sometimes sent:
undefined when the site leaves it out, and it can be null. The bar slides away when scrolling down and returns when scrolling up.Sometimes sent:
undefined when the site leaves it out, and it can be null. The floating bar stays transparent at the top and becomes a glass pill once the page scrolls. Turn off to keep it transparent.Sometimes sent:
undefined when the site leaves it out, and it can be null. Keeps the whole navbar (bar, logo, wordmark, links, dropdown, button and mobile menu) in its dark-theme look even when a visitor switches to the light theme, e.g. a header that always sits over a dark hero photo. While on, the light-theme header colors and the light-theme logo are not used. Off follows the site theme.Sometimes sent:
undefined when the site leaves it out, and it can be null. Below this width the links collapse into the mobile menu (hamburger). Raise it if you have many or long links.Sometimes sent:
undefined when the site leaves it out, and it can be null. Logo height.Sometimes sent:
undefined when the site leaves it out, and it can be null. A subtle tilt + scale when the cursor is over the logo lockup.Sometimes sent:
undefined when the site leaves it out, and it can be null. The business name in type beside the logo. Turn off when the logo already includes the name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional override of the text wordmark. Leave empty to use the business name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Render the first word large and the rest as a small tracked-out caption beneath it. Off renders the whole wordmark on one line.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalHeaderNavItem. Header navigation.Sometimes sent:
undefined when the site leaves it out, and it can be null. Label for the overflow dropdown that holds links placed in “More”.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. How the hovered / active link is marked.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty to use the site accent color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Color + indicator for the current page’s link. Leave empty to use the secondary (mint) color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. The visible button text. Leave empty to hide the button.Sometimes sent:
undefined when the site leaves it out, and it can be null. Where the button goes — a path (/blog) or full URL.Sometimes sent:
undefined when the site leaves it out, and it can be null. Opens the link in a new browser tab (adds rel=“noopener noreferrer”).Sometimes sent:
undefined when the site leaves it out, and it can be null. Solid fills with the color; Outline / Soft / Text link use it for the border + text.Sometimes sent:
undefined when the site leaves it out, and it can be null. Button size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Corner radius.Sometimes sent:
undefined when the site leaves it out, and it can be null. Solid fill, or the border + text for the other styles. Defaults to the brand accent; CLEAR it for a transparent, outline-only button.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. The text/icon color. Clear it to derive from the button color (readable on solid fills).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Drives the hover treatment. Leave empty to derive it from the button color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. The hover treatment: a soft shadow, a colored offset shadow, a glow, a fill sweep, or a thicker border.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. The offset-shadow or glow color on hover. Leave empty to use the site secondary color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Hover motion.Sometimes sent:
undefined when the site leaves it out, and it can be null. Any Font Awesome icon name, e.g. star, bolt, arrow-left-to-bracket (no “fa-” prefix). Browse at fontawesome.com/icons.Sometimes sent:
undefined when the site leaves it out, and it can be null. Icon family.Sometimes sent:
undefined when the site leaves it out, and it can be null. Which side of the label the icon sits on (when an icon name is set).Sometimes sent:
undefined when the site leaves it out, and it can be null. The icon slides toward its side on hover (e.g. an arrow edges outward).Sometimes sent:
undefined when the site leaves it out, and it can be null. Drawer side.Sometimes sent:
undefined when the site leaves it out, and it can be null. Drawer width.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty to use the site surface color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Show logo in drawer.Sometimes sent:
undefined when the site leaves it out, and it can be null. Repeat the header button at the bottom of the mobile drawer.Sometimes sent:
undefined when the site leaves it out, and it can be null. A small animated hint shown when the menu links overflow.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty to use the site accent color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Site default keeps the footer’s sunken surface; Solid color and Image override it. The site surface color is the fallback when a color is left empty.Sometimes sent:
undefined when the site leaves it out, and it can be null. Used for a Solid background (and as the fallback behind an Image). Leave empty to use the site surface color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out. An ImageArea. Widgets, top to bottom: send { "items": [ … ] }, one object per widget with its type. Writing it replaces the whole area. Its fields are listed under the first ImageArea above.Sometimes sent:
undefined when the site leaves it out, and it can be null. Scrim over the image to keep the footer legible. Leave empty to use the surface color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Overlay opacity (%).Sometimes sent:
undefined when the site leaves it out, and it can be null. Vertical padding.Sometimes sent:
undefined when the site leaves it out, and it can be null. A hairline rule along the top edge of the footer.Sometimes sent:
undefined when the site leaves it out, and it can be null. Show “Back to top” button.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional logo shown at the top of the company column, used on the dark theme. Leave both footer logos empty to use the site logo (Site settings → Brand); with no logo at all the business name leads. Upload to the Images library first. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional darker logo for the light theme. If empty, the white logo is auto-inverted. The related @apostrophecms/image documents, in order (empty when none). To set it, send a list of { "_id": "…" }, one per document (one at most); a document the site can’t find is left out.Sometimes sent:
undefined when the site leaves it out, and it can be null. Logo height.Sometimes sent:
undefined when the site leaves it out, and it can be null. Aligns the logo within the company column (e.g. centered above the business name).Sometimes sent:
undefined when the site leaves it out, and it can be null. The business name as a heading at the top of the column. Turn off when the logo already carries the name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Show tagline.Sometimes sent:
undefined when the site leaves it out, and it can be null. Show address, phone & email.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalFooterLinkGroupsItem. Each group becomes a column in the footer. Add a Legal group for Terms & Privacy, etc.Sometimes sent:
undefined when the site leaves it out, and it can be null. How many columns the link groups flow into. Auto fits to the available width; a fixed count packs shorter groups together (e.g. Legal stacked under Elsewhere). Groups are never split across columns.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty to use the site accent color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Hover effect.Sometimes sent:
undefined when the site leaves it out, and it can be null. A slow ribbon of phrases scrolling across the top of the footer. Any page can override this for itself in Page Settings → Footer.Sometimes sent:
undefined when the site leaves it out, and it can be null. A list of GlobalFooterMarqueeItem. Each phrase can carry its own icon; without one, a dot separates it from the next phrase.Sometimes sent:
undefined when the site leaves it out, and it can be null. Marquee speed.Sometimes sent:
undefined when the site leaves it out, and it can be null. Adds a small, unobtrusive pause/play control so visitors can stop the auto-playing background motion (WCAG 2.2.2). Only appears when a moving background is set.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty for the muted default.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. A giant outlined word along the bottom of the footer. Reveals/fills on hover.Sometimes sent:
undefined when the site leaves it out, and it can be null. Keep it to one short word — it renders at display size. Leave empty to use the business name.Sometimes sent:
undefined when the site leaves it out, and it can be null. Watermark size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Watermark alignment.Sometimes sent:
undefined when the site leaves it out, and it can be null. Outlined letters that fill on hover one at a time, all at once, or always-solid (no ghost effect).Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Overrides the wordmark fill + outline tint. Leave empty to track the theme’s text color.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Type {year} where this year goes (it updates itself every January) and {business} for the business name. Left empty, the site shows “© {year} {business}. All rights reserved.”Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional short line shown beside the copyright (e.g. a slogan or license number).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Weight.Sometimes sent:
undefined when the site leaves it out, and it can be null. Size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Render the site’s social profiles (configured in the “Social Links” tab) in the footer.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional small heading above the icons (e.g. “Follow us”). Leave empty for none.Sometimes sent:
undefined when the site leaves it out, and it can be null. In the company column (under the contact details) or as its own centered row above the copyright bar.Sometimes sent:
undefined when the site leaves it out, and it can be null. A hairline rule above the dedicated social row, for a touch of separation from the watermark.Sometimes sent:
undefined when the site leaves it out, and it can be null. Icon style.Sometimes sent:
undefined when the site leaves it out, and it can be null. Icon size.Sometimes sent:
undefined when the site leaves it out, and it can be null. Gap between the icons.Sometimes sent:
undefined when the site leaves it out, and it can be null. Optional. Leave empty to match the footer’s other group headings (Footer: Links tab).Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Resting icon color. Leave empty for the muted default.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. Hover to each platform’s own brand color, or to the site accent (or a chosen hover color).Sometimes sent:
undefined when the site leaves it out, and it can be null. Used when “Hover color” is Accent / custom. Leave empty for the site accent.Sometimes sent:
undefined when the site leaves it out, and it can be null. A CSS color (#625bff, #625bffff, rgb(…), hsl(…), a color name) or a palette token’s name (--fetchski-accent).Sometimes sent:
undefined when the site leaves it out, and it can be null. OFF by default. While off, the server rejects every file submitted through a public form, regardless of the form’s fields. Turn on only after setting the limits below — anonymous file uploads are a deliberate, security-sensitive choice.Sometimes sent:
undefined when the site leaves it out, and it can be null. How many files one submission may include (hard ceiling 8).Sometimes sent:
undefined when the site leaves it out, and it can be null. Largest single file accepted, in megabytes (hard ceiling 10 MB).Sometimes sent:
undefined when the site leaves it out, and it can be null. Only these categories are accepted. Each file’s actual contents are verified by signature (magic bytes), not just its extension, so a renamed file is rejected. SVG and other script-capable formats can never be enabled here.Sometimes sent:
undefined when the site leaves it out, and it can be null. The draft’s preview share key, while its share link is on: the link is the draft’s _url with aposShareKey and aposShareId (the draft’s _id) in its query. Absent otherwise, and on published documents.Errors
Errors
Nothing to catch: the SDK retries what is safe, and throws the rest as the classes below; catch only what you want to react to (see Errors and testing).
The site refused what was sent:
errors lists each field’s problem, siteMessage the first.Retried first: No. Read: errors (field → messages), siteMessage.The API key is missing or refused (malformed, revoked, expired), or a signature its signing mode needs is missing or stale.Retried first: No. Read:
siteMessage, errorName, data.The key may not do this: a scope it lacks, or an address outside its allowlist.
siteMessage names it.Retried first: No. Read: siteMessage, errorName, data.Nothing matches, or the caller may not see it.Retried first: No. Read:
siteMessage, errorName, data.The site failed. Its logs say why.Retried first: No: a write may have landed. Read:
siteMessage, errorName, data.No answer: DNS, a refused connection, TLS, or the timeout (15 s per attempt by default).Retried first: Only when nothing reached the site (
neverConnected()); never after a timeout, when it may have landed. Read: reason, neverConnected.The client refused to send it (e.g. a path segment of
..); the site never saw it.Retried first: No. Read: reason (what to change).Any other status, or a success whose JSON doesn’t match this SDK version’s types (update the SDK).Retried first: No. Read:
reason, status.sites.forSite('acme') named a slug your sites (createSiteClients()) don’t have.Retried first: No: nothing was sent. Read: message, slug.Behavior
- Access: an API key with
global:write(or a master above it:global:all,admin:all). A signed-in person may call it as far as their own permissions allow; anyone else gets 403. - Rate limit: the key’s own writes-per-minute limit, set when the key is created (default 120); over it, 429 with
Retry-After. The client waits and retries for you; you seeRateLimitedonly if that runs out. - Retries: a write is sent again only after a 429 (refused before it acted) or when it never reached the site. After a timeout or a 5xx it may have landed: check before you send it again.
- Timeout: 15 s per attempt by default; raise
timeout(milliseconds) on the client for longer.
Test it
It calls the function above with a fake client: the fake answers every call with a valid example, so nothing leaves your machine and no settings or key are needed. Run it withnode --test.
tests/globalContent-revertGlobalDraftToPublished.test.ts
globalContent.revertGlobalDraftToPublished with factories.GlobalContent({...}), the fields you give over a valid example.
tests/globalContent-revertGlobalDraftToPublished-answer.test.ts
Related
List global documents
site.globalContent().listGlobalContent()Create a global document
site.globalContent().createGlobal()Archive global documents
site.globalContent().archiveGlobals()Copy global documents to another locale
site.globalContent().localizeGlobals()Publish global documents
site.globalContent().publishGlobals()Restore global documents
site.globalContent().restoreGlobals()POST /@apostrophecms/global/{_id}/revert-draft-to-published
The endpoint this calls, in the API reference: the HTTP request and answer, and every rule the site checks.