@ariestools/sdk-meta
Advanced tools
| { | ||
| "version": 3, | ||
| "sources": ["../../src/html/mergeDocumentHead.ts", "../../src/lib/getMetaAsDict.ts", "../../src/meta/builder.ts"], | ||
| "sourcesContent": ["import { isString } from '@ariestools/sdk/typeof'\nimport { load } from 'cheerio'\n\nconst opts = {}\n// const opts = { decodeEntities: false }\n\n/**\n * Merges meta tags from the source HTML head into the destination HTML head.\n * Existing meta tags with matching property attributes are replaced; others are appended.\n * @param destination - The base HTML string to merge into.\n * @param source - The HTML string whose head meta tags will be merged.\n * @returns The merged HTML string.\n */\nexport const mergeDocumentHead = (destination: string, source: string) => {\n const $destination = load(destination, opts)\n const $source = load(source, opts)\n\n // For each child node of the source head\n $source('head')\n .children()\n .each((_, element) => {\n const el = $destination(element)\n\n // Special case for meta tags: We want to match them by the name attribute\n if (el[0].tagName === 'meta') {\n const property = el.attr('property')\n if (isString(property)) {\n const match = $destination(`head meta[property=\"${property}\"]`)\n\n // If it exists, replace it, otherwise append it\n if (match.length > 0) {\n match.replaceWith(el)\n return\n }\n $destination('head').append(el)\n }\n // else {\n // // For all other elements, just check if the same element exists in the first HTML string\n // const match = $destination(el[0].tagName)\n\n // // If it exists, replace it, otherwise append it\n // if (match.length > 0) {\n // match.replaceWith(el)\n // } else {\n // $destination('head').append(el)\n // }\n // }\n }\n })\n\n // Return the merged HTML\n return $destination.html(opts)\n}\n", "import { isString } from '@ariestools/sdk/typeof'\n\n/** An object with string keys and arbitrary values, used for recursive meta flattening. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type StringIndexable = Record<string, any>\n\nconst propertyDelimiter = ':'\n\n/**\n * Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.\n * @param obj - The nested object to flatten.\n * @param parentKey - The accumulated key prefix from parent levels.\n * @returns A flat record mapping colon-delimited property names to string values.\n */\nexport const getMetaAsDict = (obj: StringIndexable, parentKey?: string): Record<string, string> => {\n let flatRecord: StringIndexable = {}\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null) {\n // If the value is another object, we want to iterate through its keys as well.\n const childRecord = getMetaAsDict(obj[key] as StringIndexable, `${isString(parentKey) ? parentKey : ''}${key}${propertyDelimiter}`)\n flatRecord = { ...flatRecord, ...childRecord }\n } else {\n // Concatenate the key with its parent key.\n const newKey = isString(parentKey) ? `${parentKey}${key}` : key\n const trimmed = newKey.endsWith(propertyDelimiter) ? newKey.slice(0, -1) : newKey\n flatRecord[trimmed] = String(obj[key])\n }\n }\n return flatRecord\n}\n", "import { isString } from '@ariestools/sdk/typeof'\nimport type { CheerioAPI } from 'cheerio'\nimport { load } from 'cheerio'\n\nimport { getMetaAsDict } from '../lib/index.ts'\nimport type { Meta } from '../models/index.ts'\n\n/* test change */\n\n/**\n * Adds or replaces a meta tag in the document head.\n * @param $ - The Cheerio API instance for the document.\n * @param name - The meta property name.\n * @param value - The meta content value (string, array, or nested object).\n */\nexport const addMetaToHead = ($: CheerioAPI, name: string, value: unknown) => {\n if (typeof value === 'string') {\n const newMeta = `<meta property=\"${name}\" content=\"${value}\" />`\n const existingMeta = $(`head meta[property=\"${name}\"]`)\n if ((existingMeta?.length ?? 0) > 0) {\n existingMeta.replaceWith(newMeta)\n } else {\n $('head').append(newMeta)\n }\n } else if (Array.isArray(value)) {\n for (const item of value) addMetaToHead($, name, item)\n } else if (typeof value === 'object' && value !== null) {\n for (const [key, v] of Object.entries(value)) {\n if (key === 'url') {\n addMetaToHead($, name, v)\n } else {\n addMetaToHead($, `${name}:${key}`, v)\n }\n }\n } else {\n throw new TypeError(`Invalid item type [${name}, ${typeof value}]`)\n }\n}\n\n/**\n * Injects meta properties, title, and description into an HTML string.\n * @param HTML - The base HTML string to modify.\n * @param meta - The metadata to inject.\n * @param handler - Optional meta-handler property value to include.\n * @returns The modified HTML string with injected metadata.\n */\nexport const metaBuilder = (html: string, meta: Meta, handler?: string) => {\n const $ = load(html)\n // NOTE: This assumes unique meta properties (no duplicates)\n // which is generally the case, but not always (you can have\n // multiple og:video:tag tags, for example)\n const metaProperties = getMetaAsDict(meta)\n for (const [key, value] of Object.entries(metaProperties)) {\n addMetaToHead($, key, value)\n }\n if (isString(meta.description)) {\n addMetaToHead($, 'description', meta.description)\n }\n if (isString(meta.title)) {\n $('title').text(meta.title)\n }\n if (isString(handler)) {\n addMetaToHead($, 'meta-handler', handler)\n }\n return $.html()\n}\n"], | ||
| "mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,IAAM,OAAO,CAAC;AAUP,IAAM,oBAAoB,CAAC,aAAqB,WAAmB;AACxE,QAAM,eAAe,KAAK,aAAa,IAAI;AAC3C,QAAM,UAAU,KAAK,QAAQ,IAAI;AAGjC,UAAQ,MAAM,EACX,SAAS,EACT,KAAK,CAAC,GAAG,YAAY;AACpB,UAAM,KAAK,aAAa,OAAO;AAG/B,QAAI,GAAG,CAAC,EAAE,YAAY,QAAQ;AAC5B,YAAM,WAAW,GAAG,KAAK,UAAU;AACnC,UAAI,SAAS,QAAQ,GAAG;AACtB,cAAM,QAAQ,aAAa,uBAAuB,QAAQ,IAAI;AAG9D,YAAI,MAAM,SAAS,GAAG;AACpB,gBAAM,YAAY,EAAE;AACpB;AAAA,QACF;AACA,qBAAa,MAAM,EAAE,OAAO,EAAE;AAAA,MAChC;AAAA,IAYF;AAAA,EACF,CAAC;AAGH,SAAO,aAAa,KAAK,IAAI;AAC/B;;;ACpDA,SAAS,YAAAA,iBAAgB;AAMzB,IAAM,oBAAoB;AAQnB,IAAM,gBAAgB,CAAC,KAAsB,cAA+C;AACjG,MAAI,aAA8B,CAAC;AACnC,aAAW,OAAO,KAAK;AACrB,QAAI,OAAO,IAAI,GAAG,MAAM,YAAY,IAAI,GAAG,MAAM,MAAM;AAErD,YAAM,cAAc,cAAc,IAAI,GAAG,GAAsB,GAAGA,UAAS,SAAS,IAAI,YAAY,EAAE,GAAG,GAAG,GAAG,iBAAiB,EAAE;AAClI,mBAAa,EAAE,GAAG,YAAY,GAAG,YAAY;AA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GAAG,KAAK,KAAK;AAAA,EAC7B;AACA,MAAIC,UAAS,KAAK,WAAW,GAAG;AAC9B,kBAAc,GAAG,eAAe,KAAK,WAAW;AAAA,EAClD;AACA,MAAIA,UAAS,KAAK,KAAK,GAAG;AACxB,MAAE,OAAO,EAAE,KAAK,KAAK,KAAK;AAAA,EAC5B;AACA,MAAIA,UAAS,OAAO,GAAG;AACrB,kBAAc,GAAG,gBAAgB,OAAO;AAAA,EAC1C;AACA,SAAO,EAAE,KAAK;AAChB;", | ||
| "sourcesContent": ["import { isString } from '@ariestools/sdk/typeof'\nimport { load } from 'cheerio'\n\nconst opts = {}\n// const opts = { decodeEntities: false }\n\n/**\n * Merges meta tags from the source HTML head into the destination HTML head.\n * Existing meta tags with matching property attributes are replaced; others are appended.\n * @param destination - The base HTML string to merge into.\n * @param source - The HTML string whose head meta tags will be merged.\n * @returns The merged HTML string.\n */\nexport const mergeDocumentHead = (destination: string, source: string) => {\n const $destination = load(destination, opts)\n const $source = load(source, opts)\n\n // For each child node of the source head\n $source('head')\n .children()\n .each((_, element) => {\n const el = $destination(element)\n\n // Special case for meta tags: We want to match them by the name attribute\n if (el[0].tagName === 'meta') {\n const property = el.attr('property')\n if (isString(property)) {\n const match = $destination(`head meta[property=\"${property}\"]`)\n\n // If it exists, replace it, otherwise append it\n if (match.length > 0) {\n match.replaceWith(el)\n return\n }\n $destination('head').append(el)\n }\n // else {\n // // For all other elements, just check if the same element exists in the first HTML string\n // const match = $destination(el[0].tagName)\n\n // // If it exists, replace it, otherwise append it\n // if (match.length > 0) {\n // match.replaceWith(el)\n // } else {\n // $destination('head').append(el)\n // }\n // }\n }\n })\n\n // Return the merged HTML\n return $destination.html(opts)\n}\n", "import { isString } from '@ariestools/sdk/typeof'\n\n/** An object with string keys and arbitrary values, used for recursive meta flattening. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type StringIndexable = Record<string, any>\n\nconst propertyDelimiter = ':'\n\n/**\n * Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.\n * @param obj - The nested object to flatten.\n * @param parentKey - The accumulated key prefix from parent levels.\n * @returns A flat record mapping colon-delimited property names to string values.\n */\nexport const getMetaAsDict = (obj: StringIndexable, parentKey?: string): Record<string, string> => {\n let flatRecord: StringIndexable = {}\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null) {\n // If the value is another object, we want to iterate through its keys as well.\n const childRecord = getMetaAsDict(obj[key] as StringIndexable, `${isString(parentKey) ? parentKey : ''}${key}${propertyDelimiter}`)\n flatRecord = { ...flatRecord, ...childRecord }\n } else {\n // Concatenate the key with its parent key.\n const newKey = isString(parentKey) ? `${parentKey}${key}` : key\n const trimmed = newKey.endsWith(propertyDelimiter) ? newKey.slice(0, -1) : newKey\n flatRecord[trimmed] = String(obj[key])\n }\n }\n return flatRecord\n}\n", "import { isString } from '@ariestools/sdk/typeof'\nimport type { CheerioAPI } from 'cheerio'\nimport { load } from 'cheerio'\n\nimport { getMetaAsDict } from '../lib/index.ts'\nimport type { Meta } from '../models/index.ts'\n\n/* test change */\n\n/**\n * Adds or replaces a meta tag in the document head.\n * @param $ - The Cheerio API instance for the document.\n * @param name - The meta property name.\n * @param value - The meta content value (string, array, or nested object).\n */\nexport const addMetaToHead = ($: CheerioAPI, name: string, value: unknown) => {\n if (typeof value === 'string') {\n const newMeta = `<meta property=\"${name}\" content=\"${value}\" />`\n const existingMeta = $(`head meta[property=\"${name}\"]`)\n if ((existingMeta?.length ?? 0) > 0) {\n existingMeta.replaceWith(newMeta)\n } else {\n $('head').append(newMeta)\n }\n } else if (Array.isArray(value)) {\n for (const item of value) addMetaToHead($, name, item)\n } else if (typeof value === 'object' && value !== null) {\n for (const [key, v] of Object.entries(value)) {\n if (key === 'url') {\n addMetaToHead($, name, v)\n } else {\n addMetaToHead($, `${name}:${key}`, v)\n }\n }\n } else {\n throw new TypeError(`Invalid item type [${name}, ${typeof value}]`)\n }\n}\n\n/**\n * Injects meta properties, title, and description into an HTML string.\n * @param meta - The metadata to inject.\n * @param handler - Optional meta-handler property value to include.\n * @returns The modified HTML string with injected metadata.\n */\nexport const metaBuilder = (html: string, meta: Meta, handler?: string) => {\n const $ = load(html)\n // NOTE: This assumes unique meta properties (no duplicates)\n // which is generally the case, but not always (you can have\n // multiple og:video:tag tags, for example)\n const metaProperties = getMetaAsDict(meta)\n for (const [key, value] of Object.entries(metaProperties)) {\n addMetaToHead($, key, value)\n }\n if (isString(meta.description)) {\n addMetaToHead($, 'description', meta.description)\n }\n if (isString(meta.title)) {\n $('title').text(meta.title)\n }\n if (isString(handler)) {\n addMetaToHead($, 'meta-handler', handler)\n }\n return $.html()\n}\n"], | ||
| "mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,IAAM,OAAO,CAAC;AAUP,IAAM,oBAAoB,CAAC,aAAqB,WAAmB;AACxE,QAAM,eAAe,KAAK,aAAa,IAAI;AAC3C,QAAM,UAAU,KAAK,QAAQ,IAAI;AAGjC,UAAQ,MAAM,EACX,SAAS,EACT,KAAK,CAAC,GAAG,YAAY;AACpB,UAAM,KAAK,aAAa,OAAO;AAG/B,QAAI,GAAG,CAAC,EAAE,YAAY,QAAQ;AAC5B,YAAM,WAAW,GAAG,KAAK,UAAU;AACnC,UAAI,SAAS,QAAQ,GAAG;AACtB,cAAM,QAAQ,aAAa,uBAAuB,QAAQ,IAAI;AAG9D,YAAI,MAAM,SAAS,GAAG;AACpB,gBAAM,YAAY,EAAE;AACpB;AAAA,QACF;AACA,qBAAa,MAAM,EAAE,OAAO,EAAE;AAAA,MAChC;AAAA,IAYF;AAAA,EACF,CAAC;AAGH,SAAO,aAAa,KAAK,IAAI;AAC/B;;;ACpDA,SAAS,YAAAA,iBAAgB;AAMzB,IAAM,oBAAoB;AAQnB,IAAM,gBAAgB,CAAC,KAAsB,cAA+C;AACjG,MAAI,aAA8B,CAAC;AACnC,aAAW,OAAO,KAAK;AACrB,QAAI,OAAO,IAAI,GAAG,MAAM,YAAY,IAAI,G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,IAAM,cAAc,CAAC,MAAc,MAAY,YAAqB;AACzE,QAAM,IAAIC,MAAK,IAAI;AAInB,QAAM,iBAAiB,cAAc,IAAI;AACzC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,cAAc,GAAG;AACzD,kBAAc,GAAG,KAAK,KAAK;AAAA,EAC7B;AACA,MAAIC,UAAS,KAAK,WAAW,GAAG;AAC9B,kBAAc,GAAG,eAAe,KAAK,WAAW;AAAA,EAClD;AACA,MAAIA,UAAS,KAAK,KAAK,GAAG;AACxB,MAAE,OAAO,EAAE,KAAK,KAAK,KAAK;AAAA,EAC5B;AACA,MAAIA,UAAS,OAAO,GAAG;AACrB,kBAAc,GAAG,gBAAgB,OAAO;AAAA,EAC1C;AACA,SAAO,EAAE,KAAK;AAChB;", | ||
| "names": ["isString", "isString", "load", "load", "isString"] | ||
| } |
@@ -12,3 +12,2 @@ import type { CheerioAPI } from 'cheerio'; | ||
| * Injects meta properties, title, and description into an HTML string. | ||
| * @param HTML - The base HTML string to modify. | ||
| * @param meta - The metadata to inject. | ||
@@ -15,0 +14,0 @@ * @param handler - Optional meta-handler property value to include. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/meta/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,UAAU,EAAE,MAAM,MAAM,EAAE,OAAO,OAAO,SAsBxE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,MAAM,IAAI,EAAE,UAAU,MAAM,WAmBrE,CAAA"} | ||
| {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/meta/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,UAAU,EAAE,MAAM,MAAM,EAAE,OAAO,OAAO,SAsBxE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,MAAM,IAAI,EAAE,UAAU,MAAM,WAmBrE,CAAA"} |
@@ -5,7 +5,11 @@ import type { OpenGraphMeta } from './OpenGraph/index.ts'; | ||
| export interface Meta { | ||
| /** Human-readable page summary. */ | ||
| description?: string; | ||
| /** Open Graph metadata used by rich-link consumers. */ | ||
| og?: OpenGraphMeta; | ||
| /** Page or content title. */ | ||
| title?: string; | ||
| /** Twitter card metadata. */ | ||
| twitter?: TwitterMeta; | ||
| } | ||
| //# sourceMappingURL=Meta.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../../../src/models/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB"} | ||
| {"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../../../src/models/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACnB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uDAAuD;IACvD,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB"} |
| import type { OpenGraphStructuredProperty } from './OpenGraphStructuredProperty.ts'; | ||
| /** Open Graph protocol metadata for rich link previews. */ | ||
| export interface OpenGraphMeta { | ||
| /** Audio media metadata. */ | ||
| audio?: OpenGraphStructuredProperty; | ||
| /** Short description of the object. */ | ||
| description?: string; | ||
| /** Word placed before the title, such as `a`, `an`, or `the`. */ | ||
| determiner?: string; | ||
| /** Image media metadata. */ | ||
| image?: OpenGraphStructuredProperty; | ||
| /** Content locale or ordered locale alternatives. */ | ||
| locale?: string | string[]; | ||
| /** Site name containing the represented object. */ | ||
| site_name?: string; | ||
| /** Title of the represented object. */ | ||
| title?: string; | ||
| /** Open Graph object type. */ | ||
| type?: string; | ||
| /** Canonical URL of the represented object. */ | ||
| url?: string; | ||
| /** Video media metadata. */ | ||
| video?: OpenGraphStructuredProperty; | ||
| } | ||
| //# sourceMappingURL=OpenGraphMeta.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OpenGraphMeta.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC"} | ||
| {"version":3,"file":"OpenGraphMeta.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC"} |
| /** Structured properties for an Open Graph media object (image, video, or audio). */ | ||
| export interface OpenGraphStructured { | ||
| /** Base media-object URL value. */ | ||
| ''?: string; | ||
| /** Accessible text alternative for the media. */ | ||
| 'alt'?: string; | ||
| /** Media height in pixels. */ | ||
| 'height'?: number; | ||
| /** HTTPS media URL. */ | ||
| 'secure_url'?: string; | ||
| /** MIME type of the media resource. */ | ||
| 'type'?: string; | ||
| /** Media-object URL. */ | ||
| 'url'?: string; | ||
| /** Media width in pixels. */ | ||
| 'width'?: number; | ||
| } | ||
| //# sourceMappingURL=OpenGraphStructured.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"OpenGraphStructured.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructured.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"} | ||
| {"version":3,"file":"OpenGraphStructured.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructured.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"} |
@@ -7,2 +7,3 @@ import type { TwitterApp } from './TwitterApp.ts'; | ||
| export interface TwitterMeta { | ||
| /** Platform-specific Twitter App Card metadata. */ | ||
| app?: TwitterApp; | ||
@@ -15,5 +16,6 @@ /** | ||
| card?: 'summary' | 'summary_large_image' | 'app' | 'player'; | ||
| /** Content creator account name and optional numeric Twitter ID. */ | ||
| creator?: { | ||
| /** | ||
| * The @username of content creator. Used with summary_large_image cards | ||
| * The `@username` of content creator. Used with summary_large_image cards | ||
| */ | ||
@@ -32,2 +34,3 @@ ''?: string; | ||
| description?: string; | ||
| /** Card image URL and accessible alternative text. */ | ||
| image?: { | ||
@@ -48,5 +51,6 @@ /** | ||
| }; | ||
| /** Embedded-player URL, dimensions, and optional stream metadata. */ | ||
| player?: TwitterPlayer; | ||
| /** | ||
| * The @username of website. Either twitter:site or twitter:site:id is | ||
| * The `@username` of website. Either twitter:site or twitter:site:id is | ||
| * required. Used with summary, summary_large_image, app, player | ||
@@ -53,0 +57,0 @@ * cards |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Twitter.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/Twitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,qBAAqB,GAAG,KAAK,GAAG,QAAQ,CAAA;IAE3D,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;WAGG;QACH,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE;QACN;;;;;WAKG;QACH,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;;WAIG;QACH,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;OAIG;IACH,IAAI,CAAC,EAAE;QACL,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;;WAIG;QACH,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"} | ||
| {"version":3,"file":"Twitter.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/Twitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,qBAAqB,GAAG,KAAK,GAAG,QAAQ,CAAA;IAE3D,oEAAoE;IACpE,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;WAGG;QACH,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,KAAK,CAAC,EAAE;QACN;;;;;WAKG;QACH,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;;WAIG;QACH,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,qEAAqE;IACrE,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;OAIG;IACH,IAAI,CAAC,EAAE;QACL,EAAE,CAAC,EAAE,MAAM,CAAA;QACX;;;;WAIG;QACH,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"} |
| /** Twitter App Card metadata containing app store identifiers, names, and URLs per platform. */ | ||
| export interface TwitterApp { | ||
| /** Store identifier for each supported app platform. */ | ||
| id?: { | ||
@@ -8,2 +9,3 @@ googleplay?: string; | ||
| }; | ||
| /** Display name for each supported app platform. */ | ||
| name?: { | ||
@@ -14,2 +16,3 @@ googleplay?: string; | ||
| }; | ||
| /** Deep-link URL for each supported app platform. */ | ||
| url?: { | ||
@@ -16,0 +19,0 @@ googleplay?: string; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"TwitterApp.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/TwitterApp.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"} | ||
| {"version":3,"file":"TwitterApp.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/TwitterApp.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,oDAAoD;IACpD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,qDAAqD;IACrD,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"} |
+2
-2
| { | ||
| "name": "@ariestools/sdk-meta", | ||
| "version": "8.1.1", | ||
| "version": "8.1.2", | ||
| "description": "Base functionality used throughout XYO TypeScript/JavaScript libraries", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
| "cheerio": "~1.2.0", | ||
| "@ariestools/sdk": "~8.1.1" | ||
| "@ariestools/sdk": "~8.1.2" | ||
| }, | ||
@@ -44,0 +44,0 @@ "devDependencies": { |
44031
3.76%309
9.57%Updated