@agility/content-fetch 2.0.13 → 2.0.14

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/index.d.ts CHANGED
@@ -5,7 +5,9 @@ import { Filter } from "./types/Filter";
5
5
  import { Gallery } from "./types/Gallery";
6
6
  import { Page } from "./types/Page";
7
7
  import { PageScripts } from "./types/PageScripts";
8
+ import { GeoProperties, GeoAi, SchemaType, LlmsInclude, AiCrawl, StructuredData } from "./types/Geo";
9
+ import { SEOProperties, SEORobots } from "./types/SEO";
8
10
  import { ApiClientInstance, getApi } from "./api-client";
9
11
  import { ContentReference } from "./types/ContentReference";
10
- export type { ApiClientInstance, Config, ContentItem, ContentList, ContentReference, Filter, Gallery, Page, PageScripts };
12
+ export type { ApiClientInstance, Config, ContentItem, ContentList, ContentReference, Filter, Gallery, Page, PageScripts, GeoProperties, GeoAi, SchemaType, LlmsInclude, AiCrawl, StructuredData, SEOProperties, SEORobots };
11
13
  export { getApi };
@@ -1,4 +1,5 @@
1
1
  import { SEOProperties } from "./SEO";
2
+ import { GeoProperties } from "./Geo";
2
3
  interface ContentItemProperties {
3
4
  state: number;
4
5
  modified: Date;
@@ -15,6 +16,7 @@ interface ContentItemProperties {
15
16
  * @property {ContentItemProperties} properties - The system properties of the content item.
16
17
  * @property {Object} fields - A dictionary of the fields and the values of the content item.
17
18
  * @property {SEOProperties} seo - Any SEO related fields for the content item. This is only returned for Dynamic Page Items.
19
+ * @property {GeoProperties} [geo] - The item's own GEO / AEO properties (schema.org type, summary, structured data, AI-engine settings). Only items in a list that backs a dynamic page carry it, and it's omitted when the item has none.
18
20
  */
19
21
  export interface ContentItem<T = {
20
22
  [key: string]: any;
@@ -23,5 +25,6 @@ export interface ContentItem<T = {
23
25
  properties: ContentItemProperties;
24
26
  fields: T;
25
27
  seo?: SEOProperties;
28
+ geo?: GeoProperties;
26
29
  }
27
30
  export {};
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The schema.org page type a page describes itself as. Used as the `@type` of the page's
3
+ * WebPage node when JSON-LD is generated.
4
+ * @typedef SchemaType
5
+ * @memberof AgilityFetch.Types
6
+ */
7
+ export type SchemaType = "WebPage" | "AboutPage" | "ContactPage" | "CollectionPage" | "FAQPage" | "ItemPage" | "ProfilePage";
8
+ /**
9
+ * Whether a page is listed in the site's llms.txt.
10
+ * - `inherit`: follow the page's sitemap visibility.
11
+ * - `include`: always list it.
12
+ * - `exclude`: never list it.
13
+ * @typedef LlmsInclude
14
+ * @memberof AgilityFetch.Types
15
+ */
16
+ export type LlmsInclude = "inherit" | "include" | "exclude";
17
+ /**
18
+ * Whether AI crawlers may crawl a page.
19
+ * - `inherit`: follow the site's AI-crawler policy.
20
+ * - `block`: disallow this page's path for AI crawlers in robots.txt.
21
+ * @typedef AiCrawl
22
+ * @memberof AgilityFetch.Types
23
+ */
24
+ export type AiCrawl = "inherit" | "block";
25
+ /**
26
+ * A page's AI-engine settings.
27
+ * @interface GeoAi
28
+ * @memberof AgilityFetch.Types
29
+ * @property {AgilityFetch.Types.LlmsInclude} [llmsInclude] - Whether the page is listed in llms.txt.
30
+ * @property {AgilityFetch.Types.AiCrawl} [crawl] - Whether AI crawlers may crawl the page.
31
+ */
32
+ export interface GeoAi {
33
+ llmsInclude?: LlmsInclude;
34
+ crawl?: AiCrawl;
35
+ }
36
+ /**
37
+ * JSON-LD supplied by an editor: a single object (which may hold an `@graph`) or an array of objects.
38
+ * @typedef StructuredData
39
+ * @memberof AgilityFetch.Types
40
+ */
41
+ export type StructuredData = Record<string, unknown> | Record<string, unknown>[];
42
+ /**
43
+ * The GEO / AEO (generative and answer engine optimization) properties of a **Page**, or of a
44
+ * **Content Item** in a list that backs a dynamic page (the item's own values; how they combine with
45
+ * the dynamic page's is up to the renderer, e.g. `@agility/geo`).
46
+ * Every property is optional, and the API leaves out any property that isn't set.
47
+ * Unknown properties may be added in later versions, so don't treat this shape as closed.
48
+ * @interface GeoProperties
49
+ * @memberof AgilityFetch.Types
50
+ * @property {AgilityFetch.Types.SchemaType} [schemaType] - The schema.org page type (defaults to `WebPage` when not set).
51
+ * @property {string} [summary] - A short, answer-first plain-text summary of the page.
52
+ * @property {AgilityFetch.Types.StructuredData} [structuredData] - Editor-supplied JSON-LD, merged into the page's generated structured data.
53
+ * @property {AgilityFetch.Types.GeoAi} [ai] - The page's AI-engine settings (llms.txt listing, AI-crawler access).
54
+ */
55
+ export interface GeoProperties {
56
+ schemaType?: SchemaType;
57
+ summary?: string;
58
+ structuredData?: StructuredData;
59
+ ai?: GeoAi;
60
+ }
@@ -16,12 +16,14 @@
16
16
  * @property {number} [dynamicItemContentID] - If this page is a dynamic page, then this property will show the associated contentID of the dynamic content item.
17
17
  * @property {AgilityFetch.Types.SitemapVisibility} visible - Object that contains properties pertaining to the intended visibility of this page for seo and menus.
18
18
  * @property {AgilityFetch.Types.PageScripts} [scripts] - The page's custom head/body scripts, and whether it opts out of the instance's global scripts.
19
+ * @property {AgilityFetch.Types.GeoProperties} [geo] - The page's GEO / AEO properties (schema.org type, summary, structured data, AI-engine settings). Omitted when the page has none.
19
20
  */
20
21
  import { ContentZone } from "./ContentZone";
21
22
  import { SystemProperties } from "./SystemProperties";
22
23
  import { SitemapVisibility } from "./SitemapVisibility";
23
24
  import { SEOProperties } from "./SEO";
24
25
  import { PageScripts } from "./PageScripts";
26
+ import { GeoProperties } from "./Geo";
25
27
  export interface Page {
26
28
  pageID: number;
27
29
  name: string;
@@ -40,4 +42,5 @@ export interface Page {
40
42
  visible: SitemapVisibility;
41
43
  seo?: SEOProperties;
42
44
  scripts?: PageScripts | null;
45
+ geo?: GeoProperties;
43
46
  }
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The robots directives for a page.
3
+ * @interface SEORobots
4
+ * @property {boolean} [index] - Whether search engines may index the page.
5
+ * @property {boolean} [follow] - Whether search engines may follow the page's links.
6
+ */
7
+ export interface SEORobots {
8
+ index?: boolean;
9
+ follow?: boolean;
10
+ }
1
11
  /**
2
12
  * Defines the SEO properties for a content item.
3
13
  * @interface SEOProperties
@@ -6,6 +16,10 @@
6
16
  * @property {string} metaHTML - The meta HTML for the content item.
7
17
  * @property {boolean} menuVisible - Whether the content item should be visible in the menu.
8
18
  * @property {boolean} sitemapVisible - Whether the content item should be visible in the sitemap.
19
+ * @property {string} [title] - The page's `<title>`, when it differs from the page title. Pages and dynamic page items; omitted when not set.
20
+ * @property {string} [canonicalUrl] - The page's canonical URL override. Pages and dynamic page items; omitted when not set.
21
+ * @property {SEORobots} [robots] - The page's robots directives. Pages and dynamic page items; omitted when not set.
22
+ * @property {string} [ogImage] - The URL of the page's social share (Open Graph) image. Pages and dynamic page items; omitted when not set.
9
23
  */
10
24
  export interface SEOProperties {
11
25
  metaDescription: string;
@@ -13,4 +27,8 @@ export interface SEOProperties {
13
27
  metaHTML: string;
14
28
  menuVisible: boolean;
15
29
  sitemapVisible: boolean;
30
+ title?: string;
31
+ canonicalUrl?: string;
32
+ robots?: SEORobots;
33
+ ogImage?: string;
16
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/content-fetch",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "JS/TS library for the Agility Fetch API",
5
5
  "repository": {
6
6
  "type": "git",