@xylabs/sdk-meta 4.13.4 → 4.13.6
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/neutral/index.d.ts +149 -149
- package/package.json +4 -4
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
googleplay?: string;
|
|
46
|
-
ipad?: string;
|
|
47
|
-
iphone?: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
* summary_large_image
|
|
94
|
-
*/
|
|
95
|
-
''?: string;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
* summary_large_image, player
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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.
|
|
3
|
+
"version": "4.13.6",
|
|
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.
|
|
34
|
+
"@xylabs/typeof": "^4.13.6",
|
|
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.
|
|
40
|
-
"@xylabs/tsconfig": "^7.0.0-rc.
|
|
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
|
},
|