@xylabs/sdk-meta 4.13.4 → 4.13.5

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.
@@ -1,149 +1,149 @@
1
- export declare const getMetaAsDict: (obj: StringIndexable, parentKey?: string) => Record<string, string>;
2
-
3
- export declare const mergeDocumentHead: (destination: string, source: string) => string;
4
-
5
- export declare interface Meta {
6
- description?: string;
7
- og?: OpenGraphMeta;
8
- title?: string;
9
- twitter?: TwitterMeta;
10
- }
11
-
12
- export declare const metaBuilder: (html: string, meta: Meta, handler?: string) => string;
13
-
14
- export declare interface OpenGraphMeta {
15
- audio?: OpenGraphStructuredProperty;
16
- description?: string;
17
- determiner?: string;
18
- image?: OpenGraphStructuredProperty;
19
- locale?: string | string[];
20
- site_name?: string;
21
- title?: string;
22
- type?: string;
23
- url?: string;
24
- video?: OpenGraphStructuredProperty;
25
- }
26
-
27
- export declare interface OpenGraphStructured {
28
- ''?: string;
29
- 'alt'?: string;
30
- 'height'?: number;
31
- 'secure_url'?: string;
32
- 'type'?: string;
33
- 'url'?: string;
34
- 'width'?: number;
35
- }
36
-
37
- export declare type OpenGraphStructuredProperty = string | OpenGraphStructured | (string | OpenGraphStructured)[];
38
-
39
- export declare type StringIndexable = {
40
- [key: string]: any;
41
- };
42
-
43
- export declare interface TwitterApp {
44
- id?: {
45
- googleplay?: string;
46
- ipad?: string;
47
- iphone?: string;
48
- };
49
- name?: {
50
- googleplay?: string;
51
- ipad?: string;
52
- iphone?: string;
53
- };
54
- url?: {
55
- googleplay?: string;
56
- ipad?: string;
57
- iphone?: string;
58
- };
59
- }
60
-
61
- /**
62
- * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
63
- */
64
- export declare interface TwitterMeta {
65
- app?: TwitterApp;
66
- /**
67
- * The card type. Used with all cards. Fallback: og:type.
68
- * If an og:type, og:title and og:description exist in the markup but
69
- * twitter:card is absent, then a summary card may be rendered.
70
- */
71
- card?: 'summary' | 'summary_large_image' | 'app' | 'player';
72
- creator?: {
73
- /**
74
- * The @username of content creator. Used with summary_large_image cards
75
- */
76
- ''?: string;
77
- /**
78
- * Twitter user ID of content creator. Used with summary,
79
- * summary_large_image cards
80
- */
81
- 'id'?: string;
82
- };
83
- /**
84
- * Description of content (maximum 200 characters). Used with summary,
85
- * summary_large_image, player cards. Fallback: og:description.
86
- */
87
- description?: string;
88
- image?: {
89
- /**
90
- * URL of image to use in the card. Images must be less than 5MB in size.
91
- * JPG, PNG, WEBP and GIF formats are supported. Only the first frame of
92
- * an animated GIF will be used. SVG is not supported. Used with summary,
93
- * summary_large_image, player cards. Fallback: og:image
94
- */
95
- ''?: string;
96
- /**
97
- * A text description of the image conveying the essential nature of
98
- * an image to users who are visually impaired. Maximum 420
99
- * characters. Used with summary, summary_large_image, player cards
100
- */
101
- 'alt'?: string;
102
- };
103
- player?: TwitterPlayer;
104
- /**
105
- * The @username of website. Either twitter:site or twitter:site:id is
106
- * required. Used with summary, summary_large_image, app, player
107
- * cards
108
- */
109
- site?: {
110
- ''?: string;
111
- /**
112
- * Same as twitter:site, but the user’s Twitter ID. Either
113
- * twitter:site or twitter:site:id is required. Used with
114
- * summary, summary_large_image, player cards
115
- */
116
- 'id'?: string;
117
- };
118
- /**
119
- * Title of content (max 70 characters). Used with summary,
120
- * summary_large_image, player cards. Fallback: og:title.
121
- */
122
- title?: string;
123
- }
124
-
125
- /**
126
- * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
127
- */
128
- export declare interface TwitterPlayer {
129
- /**
130
- * HTTPS URL to iFrame player. This must be a HTTPS URL which does not
131
- * generate active mixed content warnings in a web browser. The audio or
132
- * video player must not require plugins such as Adobe Flash.
133
- */
134
- '': string;
135
- /**
136
- * Height of iframe in pixels. Used with player card
137
- */
138
- 'height'?: number;
139
- /**
140
- * URL to raw video or audio stream. Used with player card
141
- */
142
- 'stream'?: string;
143
- /**
144
- * Width of iframe in pixels. Used with player card
145
- */
146
- 'width'?: number;
147
- }
148
-
149
- export { }
1
+ declare const mergeDocumentHead: (destination: string, source: string) => string;
2
+
3
+ type StringIndexable = {
4
+ [key: string]: any;
5
+ };
6
+ declare const getMetaAsDict: (obj: StringIndexable, parentKey?: string) => Record<string, string>;
7
+
8
+ interface OpenGraphStructured {
9
+ ''?: string;
10
+ 'alt'?: string;
11
+ 'height'?: number;
12
+ 'secure_url'?: string;
13
+ 'type'?: string;
14
+ 'url'?: string;
15
+ 'width'?: number;
16
+ }
17
+
18
+ type OpenGraphStructuredProperty = string | OpenGraphStructured | (string | OpenGraphStructured)[];
19
+
20
+ interface OpenGraphMeta {
21
+ audio?: OpenGraphStructuredProperty;
22
+ description?: string;
23
+ determiner?: string;
24
+ image?: OpenGraphStructuredProperty;
25
+ locale?: string | string[];
26
+ site_name?: string;
27
+ title?: string;
28
+ type?: string;
29
+ url?: string;
30
+ video?: OpenGraphStructuredProperty;
31
+ }
32
+
33
+ interface TwitterApp {
34
+ id?: {
35
+ googleplay?: string;
36
+ ipad?: string;
37
+ iphone?: string;
38
+ };
39
+ name?: {
40
+ googleplay?: string;
41
+ ipad?: string;
42
+ iphone?: string;
43
+ };
44
+ url?: {
45
+ googleplay?: string;
46
+ ipad?: string;
47
+ iphone?: string;
48
+ };
49
+ }
50
+
51
+ /**
52
+ * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
53
+ */
54
+ interface TwitterPlayer {
55
+ /**
56
+ * HTTPS URL to iFrame player. This must be a HTTPS URL which does not
57
+ * generate active mixed content warnings in a web browser. The audio or
58
+ * video player must not require plugins such as Adobe Flash.
59
+ */
60
+ '': string;
61
+ /**
62
+ * Height of iframe in pixels. Used with player card
63
+ */
64
+ 'height'?: number;
65
+ /**
66
+ * URL to raw video or audio stream. Used with player card
67
+ */
68
+ 'stream'?: string;
69
+ /**
70
+ * Width of iframe in pixels. Used with player card
71
+ */
72
+ 'width'?: number;
73
+ }
74
+
75
+ /**
76
+ * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
77
+ */
78
+ interface TwitterMeta {
79
+ app?: TwitterApp;
80
+ /**
81
+ * The card type. Used with all cards. Fallback: og:type.
82
+ * If an og:type, og:title and og:description exist in the markup but
83
+ * twitter:card is absent, then a summary card may be rendered.
84
+ */
85
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
86
+ creator?: {
87
+ /**
88
+ * The @username of content creator. Used with summary_large_image cards
89
+ */
90
+ ''?: string;
91
+ /**
92
+ * Twitter user ID of content creator. Used with summary,
93
+ * summary_large_image cards
94
+ */
95
+ 'id'?: string;
96
+ };
97
+ /**
98
+ * Description of content (maximum 200 characters). Used with summary,
99
+ * summary_large_image, player cards. Fallback: og:description.
100
+ */
101
+ description?: string;
102
+ image?: {
103
+ /**
104
+ * URL of image to use in the card. Images must be less than 5MB in size.
105
+ * JPG, PNG, WEBP and GIF formats are supported. Only the first frame of
106
+ * an animated GIF will be used. SVG is not supported. Used with summary,
107
+ * summary_large_image, player cards. Fallback: og:image
108
+ */
109
+ ''?: string;
110
+ /**
111
+ * A text description of the image conveying the essential nature of
112
+ * an image to users who are visually impaired. Maximum 420
113
+ * characters. Used with summary, summary_large_image, player cards
114
+ */
115
+ 'alt'?: string;
116
+ };
117
+ player?: TwitterPlayer;
118
+ /**
119
+ * The @username of website. Either twitter:site or twitter:site:id is
120
+ * required. Used with summary, summary_large_image, app, player
121
+ * cards
122
+ */
123
+ site?: {
124
+ ''?: string;
125
+ /**
126
+ * Same as twitter:site, but the user’s Twitter ID. Either
127
+ * twitter:site or twitter:site:id is required. Used with
128
+ * summary, summary_large_image, player cards
129
+ */
130
+ 'id'?: string;
131
+ };
132
+ /**
133
+ * Title of content (max 70 characters). Used with summary,
134
+ * summary_large_image, player cards. Fallback: og:title.
135
+ */
136
+ title?: string;
137
+ }
138
+
139
+ interface Meta {
140
+ description?: string;
141
+ og?: OpenGraphMeta;
142
+ title?: string;
143
+ twitter?: TwitterMeta;
144
+ }
145
+
146
+ declare const metaBuilder: (html: string, meta: Meta, handler?: string) => string;
147
+
148
+ export { getMetaAsDict, mergeDocumentHead, metaBuilder };
149
+ export type { Meta, OpenGraphMeta, OpenGraphStructured, OpenGraphStructuredProperty, StringIndexable, TwitterApp, TwitterMeta, TwitterPlayer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/sdk-meta",
3
- "version": "4.13.4",
3
+ "version": "4.13.5",
4
4
  "description": "Base functionality used throughout XYO TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "meta",
@@ -31,13 +31,13 @@
31
31
  "module": "dist/neutral/index.mjs",
32
32
  "types": "dist/neutral/index.d.ts",
33
33
  "dependencies": {
34
- "@xylabs/typeof": "^4.13.4",
34
+ "@xylabs/typeof": "^4.13.5",
35
35
  "cheerio": "^1.1.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^24.0.13",
39
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.7",
40
- "@xylabs/tsconfig": "^7.0.0-rc.7",
39
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.8",
40
+ "@xylabs/tsconfig": "^7.0.0-rc.8",
41
41
  "typescript": "^5.8.3",
42
42
  "vitest": "^3.2.4"
43
43
  },