@bettercms-ai/sdk 1.31.1 → 1.33.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.
- package/dist/config.cjs +55 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +42 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/draft.cjs +86 -0
- package/dist/draft.cjs.map +1 -0
- package/dist/draft.d.cts +24 -0
- package/dist/draft.d.ts +24 -0
- package/dist/draft.js +56 -0
- package/dist/draft.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -235
- package/dist/index.d.ts +157 -235
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/seo.cjs +153 -0
- package/dist/seo.cjs.map +1 -0
- package/dist/seo.d.cts +99 -0
- package/dist/seo.d.ts +99 -0
- package/dist/seo.js +127 -0
- package/dist/seo.js.map +1 -0
- package/package.json +17 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _bettercms_ai_types from '@bettercms-ai/types';
|
|
2
|
-
import { ContentPageResult, Content, DeliveredLayout, ContentModelField, Fieldset,
|
|
2
|
+
import { ContentPageResult, Content, DeliveredLayout, ContentModelField, Fieldset, ComponentPreview, BetterCMSErrorCode, LayoutStructureDocument, LayoutDataDocument, PageLayoutOverrideDocument, ManagementLayoutCommand, AuthUser, AuthSession, SignInInput, SignUpInput, Perspective, DeliveryEntry, DeliveryList, DeliveryPage, DeliveryComponent, Page, MediaAsset, FormField, Form, FormSubmission, Workspace, ApiKey, ApiKeyPermission, ApiKeyTokenType } from '@bettercms-ai/types';
|
|
3
3
|
export { ApiError, ApiKey, ApiKeyPermission, ApiKeyTokenType, AssertEqual, AuthSession, AuthUser, BetterCMSErrorCode, BlockType, ButtonBlock, ButtonProps, ColumnsBlock, ColumnsProps, Content, ContentBlock, ContentEntry, ContentModel, ContentModelField, ContentPageResult, ContentResponse, DeepReadonly, DeliveryComponent, DeliveryEntry, DeliveryList, DeliveryPage, Form, FormBlock, FormField, FormProps, FormSubmission, HeadingBlock, HeadingProps, ImageBlock, ImageProps, MediaAsset, Page, PageMetaJson, PaginatedResult, Perspective, Redirect, SignInInput, SignUpInput, SiteSeoDefaults, SpacerBlock, SpacerProps, TextBlock, TextProps, VideoBlock, VideoProps, Workspace, getBlockType, isBlock } from '@bettercms-ai/types';
|
|
4
|
+
export { ResolvedSeo, SeoInput, SeoLocation, entrySeoInput, resolveSeo } from './seo.js';
|
|
4
5
|
export { ImageFit, ImageFormat, ImageSource, ImageUrlBuilder, ImageUrlOptions, imageUrl, default as imageUrlBuilder, imageValueObjectPosition, imageValueUrl } from '@bettercms-ai/image-url';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -387,6 +388,159 @@ declare function updateEntry(client: ManagementClient, id: string, input: Update
|
|
|
387
388
|
ifMatch?: number;
|
|
388
389
|
}): Promise<ManagedContentEntry & EntryWriteWarnings>;
|
|
389
390
|
|
|
391
|
+
/**
|
|
392
|
+
* Management API SDK methods — reusable components (discover + author).
|
|
393
|
+
*
|
|
394
|
+
* Call /api/v1/management/components (key-auth, content:manage). The MCP server wraps
|
|
395
|
+
* these so an agent can list/read components and author new ones (blockJson + props).
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
/** A component as returned by the Management API (render + author shape). */
|
|
399
|
+
interface ManagedComponent {
|
|
400
|
+
id: string;
|
|
401
|
+
projectId: string | null;
|
|
402
|
+
allowedOn: string[];
|
|
403
|
+
name: string;
|
|
404
|
+
slug: string;
|
|
405
|
+
category: string;
|
|
406
|
+
description: string | null;
|
|
407
|
+
blockJson: unknown[];
|
|
408
|
+
props: unknown[];
|
|
409
|
+
variantGroupId?: string | null;
|
|
410
|
+
publishedVariantGroupId?: string | null;
|
|
411
|
+
variantInputMappings?: Array<{
|
|
412
|
+
inputId: string;
|
|
413
|
+
targets: Array<{
|
|
414
|
+
blockId: string;
|
|
415
|
+
path: string;
|
|
416
|
+
}>;
|
|
417
|
+
}>;
|
|
418
|
+
publishedVariantInputMappings?: Array<{
|
|
419
|
+
inputId: string;
|
|
420
|
+
targets: Array<{
|
|
421
|
+
blockId: string;
|
|
422
|
+
path: string;
|
|
423
|
+
}>;
|
|
424
|
+
}> | null;
|
|
425
|
+
thumbnail?: string | null;
|
|
426
|
+
/** How an instance reads as a row in a parent's slot list. @see ComponentPreview */
|
|
427
|
+
preview?: ComponentPreview | null;
|
|
428
|
+
/** The block icon (a /kit schema's document-level `icon`), a dock icon name. */
|
|
429
|
+
icon?: string | null;
|
|
430
|
+
/** The /kit tabs no top-level prop sits in (declared, empty). @see ComponentTab */
|
|
431
|
+
tabs?: Array<{
|
|
432
|
+
id: string;
|
|
433
|
+
label: string;
|
|
434
|
+
icon?: string;
|
|
435
|
+
order?: number;
|
|
436
|
+
}> | null;
|
|
437
|
+
/** The bettercms://kit entry its V2 dock UI was built from (a kit-catalog id), or null. */
|
|
438
|
+
kitEntry?: string | null;
|
|
439
|
+
/** Send it back as `ifMatch` on updateComponent. */
|
|
440
|
+
optimisticVersion?: number;
|
|
441
|
+
}
|
|
442
|
+
/** Create/update input. `blockJson` is the ContentBlock tree; `props` the override allowlist. */
|
|
443
|
+
interface ManagedComponentInput {
|
|
444
|
+
projectId?: string | null;
|
|
445
|
+
allowedOn?: string[];
|
|
446
|
+
name?: string;
|
|
447
|
+
slug?: string;
|
|
448
|
+
category?: string;
|
|
449
|
+
sectionType?: string | null;
|
|
450
|
+
/**
|
|
451
|
+
* The organisational Group, by NAME. The API resolves it against the project's Groups and
|
|
452
|
+
* creates it when missing — a caller filing a whole site's components into folders has a name
|
|
453
|
+
* ("Sections"), never an id.
|
|
454
|
+
*/
|
|
455
|
+
group?: string;
|
|
456
|
+
groupId?: string | null;
|
|
457
|
+
description?: string;
|
|
458
|
+
/** title/subtitle/media name top-level prop keys (422 `preview_key_unknown` otherwise); null clears it. */
|
|
459
|
+
preview?: ComponentPreview | null;
|
|
460
|
+
/** The block icon, a dock icon name (bettercms://icons/dock); null clears it. */
|
|
461
|
+
icon?: string | null;
|
|
462
|
+
/** /kit tabs no top-level prop sits in; null clears them (422 component_tab_invalid on a prop's own tab). */
|
|
463
|
+
tabs?: Array<{
|
|
464
|
+
id: string;
|
|
465
|
+
label: string;
|
|
466
|
+
icon?: string;
|
|
467
|
+
order?: number;
|
|
468
|
+
}> | null;
|
|
469
|
+
/** The bettercms://kit entry its V2 dock UI follows (an id from bettercms://kit); null clears it. 422 `kit_entry_unknown` for an id not in the catalogue. */
|
|
470
|
+
kitEntry?: string | null;
|
|
471
|
+
blockJson?: unknown[];
|
|
472
|
+
props?: unknown[];
|
|
473
|
+
/**
|
|
474
|
+
* Make this a VARIANT of that component (id or slug, same project): it joins that component's
|
|
475
|
+
* variant family, which is started from it when it has none.
|
|
476
|
+
*/
|
|
477
|
+
variantOf?: string;
|
|
478
|
+
/** Create only: a built-in section id (`builtin:<key>`) to copy in; the fields you send win. */
|
|
479
|
+
from?: string;
|
|
480
|
+
/** Update only: prop chrome by prop path (`cta.label`). Any of these, or `override`, needs `ifMatch`. */
|
|
481
|
+
propUi?: Record<string, Record<string, unknown> | null>;
|
|
482
|
+
propGroup?: Record<string, Record<string, unknown> | null>;
|
|
483
|
+
propTab?: Record<string, Record<string, unknown> | null>;
|
|
484
|
+
propLabel?: Record<string, string>;
|
|
485
|
+
/** Replace chrome a person shaped; without it that is a 409 `ui_human_owned`. */
|
|
486
|
+
override?: boolean;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* The catalogue shape: what each component IS, without its block trees.
|
|
490
|
+
*
|
|
491
|
+
* The default list carries every component's draft AND live `blockJson`, which on a
|
|
492
|
+
* componentized site is the largest response this API produces — and a caller asking which
|
|
493
|
+
* components exist wants none of it. This shape also carries `sectionType`, `status` and the
|
|
494
|
+
* Group, the three facts that decide whether a component is insertable, whether it is on the
|
|
495
|
+
* live site, and where an editor finds it.
|
|
496
|
+
*/
|
|
497
|
+
interface ManagedComponentSummary {
|
|
498
|
+
id: string;
|
|
499
|
+
projectId: string | null;
|
|
500
|
+
name: string;
|
|
501
|
+
slug: string;
|
|
502
|
+
category: string;
|
|
503
|
+
sectionType: string | null;
|
|
504
|
+
status: string | null;
|
|
505
|
+
groupId: string | null;
|
|
506
|
+
groupName: string | null;
|
|
507
|
+
updatedAt: string | null;
|
|
508
|
+
builtin?: boolean;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* A set of sections that repeat across the project's pages, proposed as one component.
|
|
512
|
+
* Derived per request from the pages' DRAFT blocks — never stored.
|
|
513
|
+
*/
|
|
514
|
+
interface ExtractionCandidate {
|
|
515
|
+
/** Identifies the shape. Pass it back to `extractComponent`; it is re-verified server-side. */
|
|
516
|
+
hash: string;
|
|
517
|
+
blockType: string;
|
|
518
|
+
uses: number;
|
|
519
|
+
suggestedName: string;
|
|
520
|
+
blockJson: unknown[];
|
|
521
|
+
/** The leaves that differ between copies, which become the component's editable props. */
|
|
522
|
+
props: unknown[];
|
|
523
|
+
sites: {
|
|
524
|
+
pageId: string;
|
|
525
|
+
title: string;
|
|
526
|
+
slug: string;
|
|
527
|
+
blockId: string;
|
|
528
|
+
overrides: Record<string, unknown>;
|
|
529
|
+
}[];
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Create the component from one candidate and repoint every occurrence at it.
|
|
533
|
+
*
|
|
534
|
+
* Rewrites page DRAFTS on several pages at once. `hash` is re-verified against a fresh scan,
|
|
535
|
+
* so a proposal that went stale 409s rather than applying against pages that have moved on.
|
|
536
|
+
*/
|
|
537
|
+
/** The bettercms://kit entry an extracted component records: `link` is its resource, or bettercms://kit when none fits. */
|
|
538
|
+
interface ExtractedKit {
|
|
539
|
+
kitEntry: string | null;
|
|
540
|
+
score: number | null;
|
|
541
|
+
link: string;
|
|
542
|
+
}
|
|
543
|
+
|
|
390
544
|
/**
|
|
391
545
|
* Management API SDK method — media upload (P2).
|
|
392
546
|
*
|
|
@@ -731,143 +885,6 @@ interface ManagedFormInput {
|
|
|
731
885
|
notifyEmails?: string[];
|
|
732
886
|
}
|
|
733
887
|
|
|
734
|
-
/**
|
|
735
|
-
* Management API SDK methods — reusable components (discover + author).
|
|
736
|
-
*
|
|
737
|
-
* Call /api/v1/management/components (key-auth, content:manage). The MCP server wraps
|
|
738
|
-
* these so an agent can list/read components and author new ones (blockJson + props).
|
|
739
|
-
*/
|
|
740
|
-
|
|
741
|
-
/** A component as returned by the Management API (render + author shape). */
|
|
742
|
-
interface ManagedComponent {
|
|
743
|
-
id: string;
|
|
744
|
-
projectId: string | null;
|
|
745
|
-
allowedOn: string[];
|
|
746
|
-
name: string;
|
|
747
|
-
slug: string;
|
|
748
|
-
category: string;
|
|
749
|
-
description: string | null;
|
|
750
|
-
blockJson: unknown[];
|
|
751
|
-
props: unknown[];
|
|
752
|
-
variantGroupId?: string | null;
|
|
753
|
-
publishedVariantGroupId?: string | null;
|
|
754
|
-
variantInputMappings?: Array<{
|
|
755
|
-
inputId: string;
|
|
756
|
-
targets: Array<{
|
|
757
|
-
blockId: string;
|
|
758
|
-
path: string;
|
|
759
|
-
}>;
|
|
760
|
-
}>;
|
|
761
|
-
publishedVariantInputMappings?: Array<{
|
|
762
|
-
inputId: string;
|
|
763
|
-
targets: Array<{
|
|
764
|
-
blockId: string;
|
|
765
|
-
path: string;
|
|
766
|
-
}>;
|
|
767
|
-
}> | null;
|
|
768
|
-
thumbnail?: string | null;
|
|
769
|
-
/** How an instance reads as a row in a parent's slot list. @see ComponentPreview */
|
|
770
|
-
preview?: ComponentPreview | null;
|
|
771
|
-
/** The block icon (a /kit schema's document-level `icon`), a dock icon name. */
|
|
772
|
-
icon?: string | null;
|
|
773
|
-
/** The /kit tabs no top-level prop sits in (declared, empty). @see ComponentTab */
|
|
774
|
-
tabs?: Array<{
|
|
775
|
-
id: string;
|
|
776
|
-
label: string;
|
|
777
|
-
icon?: string;
|
|
778
|
-
order?: number;
|
|
779
|
-
}> | null;
|
|
780
|
-
/** Send it back as `ifMatch` on updateComponent. */
|
|
781
|
-
optimisticVersion?: number;
|
|
782
|
-
}
|
|
783
|
-
/** Create/update input. `blockJson` is the ContentBlock tree; `props` the override allowlist. */
|
|
784
|
-
interface ManagedComponentInput {
|
|
785
|
-
projectId?: string | null;
|
|
786
|
-
allowedOn?: string[];
|
|
787
|
-
name?: string;
|
|
788
|
-
slug?: string;
|
|
789
|
-
category?: string;
|
|
790
|
-
sectionType?: string | null;
|
|
791
|
-
/**
|
|
792
|
-
* The organisational Group, by NAME. The API resolves it against the project's Groups and
|
|
793
|
-
* creates it when missing — a caller filing a whole site's components into folders has a name
|
|
794
|
-
* ("Sections"), never an id.
|
|
795
|
-
*/
|
|
796
|
-
group?: string;
|
|
797
|
-
groupId?: string | null;
|
|
798
|
-
description?: string;
|
|
799
|
-
/** title/subtitle/media name top-level prop keys (422 `preview_key_unknown` otherwise); null clears it. */
|
|
800
|
-
preview?: ComponentPreview | null;
|
|
801
|
-
/** The block icon, a dock icon name (bettercms://icons/dock); null clears it. */
|
|
802
|
-
icon?: string | null;
|
|
803
|
-
/** /kit tabs no top-level prop sits in; null clears them (422 component_tab_invalid on a prop's own tab). */
|
|
804
|
-
tabs?: Array<{
|
|
805
|
-
id: string;
|
|
806
|
-
label: string;
|
|
807
|
-
icon?: string;
|
|
808
|
-
order?: number;
|
|
809
|
-
}> | null;
|
|
810
|
-
blockJson?: unknown[];
|
|
811
|
-
props?: unknown[];
|
|
812
|
-
/**
|
|
813
|
-
* Make this a VARIANT of that component (id or slug, same project): it joins that component's
|
|
814
|
-
* variant family, which is started from it when it has none.
|
|
815
|
-
*/
|
|
816
|
-
variantOf?: string;
|
|
817
|
-
/** Create only: a built-in section id (`builtin:<key>`) to copy in; the fields you send win. */
|
|
818
|
-
from?: string;
|
|
819
|
-
/** Update only: prop chrome by prop path (`cta.label`). Any of these, or `override`, needs `ifMatch`. */
|
|
820
|
-
propUi?: Record<string, Record<string, unknown> | null>;
|
|
821
|
-
propGroup?: Record<string, Record<string, unknown> | null>;
|
|
822
|
-
propTab?: Record<string, Record<string, unknown> | null>;
|
|
823
|
-
propLabel?: Record<string, string>;
|
|
824
|
-
/** Replace chrome a person shaped; without it that is a 409 `ui_human_owned`. */
|
|
825
|
-
override?: boolean;
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* The catalogue shape: what each component IS, without its block trees.
|
|
829
|
-
*
|
|
830
|
-
* The default list carries every component's draft AND live `blockJson`, which on a
|
|
831
|
-
* componentized site is the largest response this API produces — and a caller asking which
|
|
832
|
-
* components exist wants none of it. This shape also carries `sectionType`, `status` and the
|
|
833
|
-
* Group, the three facts that decide whether a component is insertable, whether it is on the
|
|
834
|
-
* live site, and where an editor finds it.
|
|
835
|
-
*/
|
|
836
|
-
interface ManagedComponentSummary {
|
|
837
|
-
id: string;
|
|
838
|
-
projectId: string | null;
|
|
839
|
-
name: string;
|
|
840
|
-
slug: string;
|
|
841
|
-
category: string;
|
|
842
|
-
sectionType: string | null;
|
|
843
|
-
status: string | null;
|
|
844
|
-
groupId: string | null;
|
|
845
|
-
groupName: string | null;
|
|
846
|
-
updatedAt: string | null;
|
|
847
|
-
builtin?: boolean;
|
|
848
|
-
}
|
|
849
|
-
/**
|
|
850
|
-
* A set of sections that repeat across the project's pages, proposed as one component.
|
|
851
|
-
* Derived per request from the pages' DRAFT blocks — never stored.
|
|
852
|
-
*/
|
|
853
|
-
interface ExtractionCandidate {
|
|
854
|
-
/** Identifies the shape. Pass it back to `extractComponent`; it is re-verified server-side. */
|
|
855
|
-
hash: string;
|
|
856
|
-
blockType: string;
|
|
857
|
-
uses: number;
|
|
858
|
-
suggestedName: string;
|
|
859
|
-
blockJson: unknown[];
|
|
860
|
-
/** The leaves that differ between copies, which become the component's editable props. */
|
|
861
|
-
props: unknown[];
|
|
862
|
-
sites: {
|
|
863
|
-
pageId: string;
|
|
864
|
-
title: string;
|
|
865
|
-
slug: string;
|
|
866
|
-
blockId: string;
|
|
867
|
-
overrides: Record<string, unknown>;
|
|
868
|
-
}[];
|
|
869
|
-
}
|
|
870
|
-
|
|
871
888
|
/**
|
|
872
889
|
* Management API SDK methods — AI content + SEO actions (Option B, portable skill).
|
|
873
890
|
*
|
|
@@ -1050,6 +1067,7 @@ declare class BetterCMSManagementClient extends BetterCMSDeliveryClient {
|
|
|
1050
1067
|
}): Promise<{
|
|
1051
1068
|
component: ManagedComponent;
|
|
1052
1069
|
replaced: number;
|
|
1070
|
+
kit?: ExtractedKit;
|
|
1053
1071
|
}>;
|
|
1054
1072
|
getManagedLayout(opts?: GetManagedLayoutOptions): Promise<ManagedLayoutDocument>;
|
|
1055
1073
|
commandManagedLayout(input: CommandManagedLayoutInput): Promise<ManagedLayoutDocument>;
|
|
@@ -1458,102 +1476,6 @@ declare function rich(value: TextOrRich, fallback?: string): string;
|
|
|
1458
1476
|
*/
|
|
1459
1477
|
declare function lines(value: TextOrRich, fallback?: string): string;
|
|
1460
1478
|
|
|
1461
|
-
/**
|
|
1462
|
-
* resolveSeo — framework-agnostic page-over-site SEO merge for headless consumers.
|
|
1463
|
-
*
|
|
1464
|
-
* The single source of truth for "per-page meta layered over project defaults",
|
|
1465
|
-
* mirroring the server renderer's `mergeSeoMeta` so `*.bettercms.site` and headless
|
|
1466
|
-
* sites (@bettercms-ai/next, @bettercms-ai/astro) emit identical <head> SEO. Pure: empty
|
|
1467
|
-
* inputs collapse to empty strings ("omit the tag"), never fabricated values.
|
|
1468
|
-
*
|
|
1469
|
-
* const seo = resolveSeo(page, siteDefaults);
|
|
1470
|
-
* // → { title, description, canonical, og, twitter, jsonLd }
|
|
1471
|
-
*
|
|
1472
|
-
* Next consumers map this to a `Metadata` via `buildMetadata` (@bettercms-ai/next);
|
|
1473
|
-
* Astro consumers read the fields straight into `<head>`.
|
|
1474
|
-
*/
|
|
1475
|
-
|
|
1476
|
-
/** Minimal page shape `resolveSeo` reads — a `DeliveryPage`/`BetterCMSPage` satisfies it. */
|
|
1477
|
-
interface SeoInput {
|
|
1478
|
-
title: string;
|
|
1479
|
-
metaTitle?: string | null;
|
|
1480
|
-
metaDescription?: string | null;
|
|
1481
|
-
metaJson?: PageMetaJson | null;
|
|
1482
|
-
/** `"home"` makes the Automatic JSON-LD a WebSite, as the hosted renderer does. */
|
|
1483
|
-
slug?: string | null;
|
|
1484
|
-
/** Exclude from search engines. Surfaces as `ResolvedSeo.noindex` / `robots`. */
|
|
1485
|
-
noindex?: boolean | null;
|
|
1486
|
-
}
|
|
1487
|
-
/** Fully-resolved SEO values, page-over-site. Empty string ⇒ omit that tag. */
|
|
1488
|
-
interface ResolvedSeo {
|
|
1489
|
-
title: string;
|
|
1490
|
-
description: string;
|
|
1491
|
-
/**
|
|
1492
|
-
* Canonical URL — the page's own `canonical`, else `siteUrl` + `path` when both are given,
|
|
1493
|
-
* else "". Empty means the consumer must omit the tag: a RELATIVE canonical is worse than
|
|
1494
|
-
* none at all.
|
|
1495
|
-
*/
|
|
1496
|
-
canonical: string;
|
|
1497
|
-
og: {
|
|
1498
|
-
title: string;
|
|
1499
|
-
description: string;
|
|
1500
|
-
type: string;
|
|
1501
|
-
image: string;
|
|
1502
|
-
url: string;
|
|
1503
|
-
};
|
|
1504
|
-
twitter: {
|
|
1505
|
-
card: string;
|
|
1506
|
-
title: string;
|
|
1507
|
-
description: string;
|
|
1508
|
-
image: string;
|
|
1509
|
-
site: string;
|
|
1510
|
-
};
|
|
1511
|
-
/**
|
|
1512
|
-
* JSON-LD nodes (site schema first, then the page's), already flattened + de-empted. The page's
|
|
1513
|
-
* part follows the renderer's precedence: Custom (`metaJson.schema`) > `metaJson.schemaType` >
|
|
1514
|
-
* Automatic (WebPage; WebSite on the home page).
|
|
1515
|
-
*/
|
|
1516
|
-
jsonLd: Array<Record<string, unknown>>;
|
|
1517
|
-
/** True when the page is excluded from search engines (the renderer's `<meta name="robots" content="noindex">`). */
|
|
1518
|
-
noindex: boolean;
|
|
1519
|
-
/** `noindex` in the `{ index, follow }` shape Next's `Metadata.robots` takes. */
|
|
1520
|
-
robots: {
|
|
1521
|
-
index: boolean;
|
|
1522
|
-
follow: boolean;
|
|
1523
|
-
};
|
|
1524
|
-
}
|
|
1525
|
-
/**
|
|
1526
|
-
* A Delivery API entry as a `resolveSeo` input. The server already resolved the collection
|
|
1527
|
-
* template's `{{field}}` tokens for this entry and merged the entry's own SEO over it, so this is
|
|
1528
|
-
* a reshape, not a resolver:
|
|
1529
|
-
*
|
|
1530
|
-
* const entry = await bcms.getEntry("astro");
|
|
1531
|
-
* const seo = resolveSeo(entrySeoInput(entry), siteDefaults, { siteUrl, path: `/tags/${entry.slug}` });
|
|
1532
|
-
* // seo.jsonLd holds the template's schema, resolved for this entry
|
|
1533
|
-
*/
|
|
1534
|
-
declare function entrySeoInput(entry: {
|
|
1535
|
-
slug: string;
|
|
1536
|
-
seo?: DeliveryEntrySeo | null;
|
|
1537
|
-
}): SeoInput;
|
|
1538
|
-
/** Where this page lives, so a canonical can be derived when the page sets none. */
|
|
1539
|
-
interface SeoLocation {
|
|
1540
|
-
/** Absolute site origin, e.g. `https://acme.com`. Trailing slash optional. */
|
|
1541
|
-
siteUrl?: string;
|
|
1542
|
-
/** This page's path, e.g. `/about` or `/`. */
|
|
1543
|
-
path?: string;
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* Merge a page's own SEO over the site defaults: page meta wins, then site defaults, then
|
|
1547
|
-
* sensible fallbacks.
|
|
1548
|
-
*
|
|
1549
|
-
* The CANONICAL is the one field that cannot be resolved from content alone, and getting this
|
|
1550
|
-
* wrong is silent. The hosted renderer (`mergeSeoMeta` in the backend) falls back to a canonical
|
|
1551
|
-
* it derives from the request's own origin and path — headless consumers have no request, so
|
|
1552
|
-
* they must pass `location`. Without it this returns "" and the caller ships no
|
|
1553
|
-
* `<link rel="canonical">` and no `og:url`, exactly as it did before `location` existed.
|
|
1554
|
-
*/
|
|
1555
|
-
declare function resolveSeo(page: SeoInput, defaults?: SiteSeoDefaults, location?: SeoLocation): ResolvedSeo;
|
|
1556
|
-
|
|
1557
1479
|
/**
|
|
1558
1480
|
* Public site search — the headless surface for the visitor-facing search box.
|
|
1559
1481
|
*
|
|
@@ -1953,4 +1875,4 @@ interface FramedWindow {
|
|
|
1953
1875
|
/** True inside the editor's canvas. Safe where there is no window (a server render): false. */
|
|
1954
1876
|
declare function inEditor(win?: FramedWindow | undefined): boolean;
|
|
1955
1877
|
|
|
1956
|
-
export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, EDITOR_FRAME_NAME, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type
|
|
1878
|
+
export { type AddPageFieldsInput, type ApiKeyUsage, type ApiKeyWithRaw, type AuthResult, BetterCMSError as BCMSClientError, ErrorCodes as BCMSErrorCodes, BetterCMS, BetterCMSAdminClient, type BetterCMSAdminOptions, BetterCMSDeliveryClient, BetterCMSError, BetterCMSManagementClient, type BetterCMSManagementOptions, type BetterCMSReadClient, type BetterCMSSiteOptions, CONTENT_APPLIED, type CommandManagedLayoutInput, type ContentAppliedMessage, type CreateApiKeyInput, type CreateClientOptions, type CreateEntryInput, type CreateFormInput, type CreateManagedPageInput, type CreateModelInput, type CreatePageInput, type CreateWebhookInput, type CreateWorkspaceInput, type DeliveryForm, type DeliveryFormField, type DeliveryFormFieldType, EDITOR_FRAME_NAME, ErrorCodes, type ExtractionCandidate, type FormFieldInput, type FormListOptions, type FormSubmitError, type FormValue, type FormValues, type GetEntryOptions, type GetManagedLayoutOptions, type ListContentAllOptions, type ListContentOptions, type ListEntriesFilter, type ListEntriesOptions, type ListPagesOptions, type ManagedComponent, type ManagedComponentInput, type ManagedComponentSummary, type ManagedContentEntry, type ManagedContentModel, type ManagedForm, type ManagedFormInput, type ManagedLayoutClient, type ManagedLayoutDocument, type ManagedMediaAsset, type ManagedPage, type ManagementClient, type MediaListOptions, type MediaMetadata, type Member, type MemberRole, type ModelFieldset, PORTABLE_TEXT_FORMAT, type PageCreateReport, type PageListOptions, type PendingInvite, type PublishManagedLayoutInput, type PublishedContent, type RichTextValue, STEGA_OPEN, type SearchHit, type SearchOptions, type SeoMeta, type SeoMetaInput, type SetPageContentInput, type StegaNode, type StegaPayload, type SubmissionListOptions, type SubmitFormOptions, type SubmitFormResult, type TextOrRich, type UpdateApiKeyInput, type UpdateAssetInput, type UpdateEntryInput, type UpdateFormInput, type UpdateModelInput, type UpdatePageInput, type UpdateWebhookInput, type UpdateWorkspaceInput, type UploadAssetInput, type UploadedAsset, type Webhook, type WebhookAdvancedConfig, type WebhookEvent, type WebhookListResponse, type WebhookWithSecret, type WriteContentInput, addModelFields, addPageFields, asStringArray, commandManagedLayout, contentApplied, createApiKey, createClient, createEntry, createForm, createManagedPage, createModel, createPage, createWorkspace, decodeStega, deleteForm, deleteMedia, deletePage, deleteSubmission, deleteWorkspace, encodeStega, formInitialValues, getApiKeyUsage, getEntry, getForm, getManagedLayout, getManagedPage, getMedia, getMember, getModel, getPage, getSubmission, getWorkspace, inEditor, inviteMember, isMultiValueField, isRichText, lines, listApiKeys, listEntries, listForms, listManagedPages, listMedia, listMembers, listModels, listPages, listSubmissions, listWorkspaces, onContentApplied, plain, portableText, publishManagedLayout, publishPage, publishedContentFile, publishedEntry, readPublishedContent, regenerateApiKey, removeMember, resetPublishedContentCache, resolveStega, revokeApiKey, rich, search, setPageContent, shouldShowField, signIn, signInWithGithub, signInWithGoogle, signUp, stegaClean, stripStega, submitForm, toggleOption, updateApiKey, updateEntry, updateForm, updateMemberRole, updateModel, updatePage, updatePageModel, updateWorkspace, uploadMedia };
|
package/dist/index.js
CHANGED
|
@@ -780,7 +780,7 @@ async function extractComponent(client, input) {
|
|
|
780
780
|
client.url("/management/components/extract"),
|
|
781
781
|
{ method: "POST", body: JSON.stringify(input) }
|
|
782
782
|
);
|
|
783
|
-
return { component: res.data, replaced: res.replaced };
|
|
783
|
+
return { component: res.data, replaced: res.replaced, ...res.kit ? { kit: res.kit } : {} };
|
|
784
784
|
}
|
|
785
785
|
async function updateComponent(client, id, input, opts) {
|
|
786
786
|
const res = await client.fetchJSON(
|