@xylabs/sdk-meta 5.0.94 → 5.0.96

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/README.md CHANGED
@@ -1,58 +1,52 @@
1
1
  # @xylabs/sdk-meta
2
2
 
3
- [![logo][]](https://xylabs.com)
3
+ [![npm][npm-badge]][npm-link]
4
+ [![license][license-badge]][license-link]
4
5
 
5
- [![main-build][]][main-build-link]
6
- [![npm-badge][]][npm-link]
7
- [![npm-downloads-badge][]][npm-link]
8
- [![jsdelivr-badge][]][jsdelivr-link]
9
- [![npm-license-badge][]](LICENSE)
10
- [![codacy-badge][]][codacy-link]
11
- [![codeclimate-badge][]][codeclimate-link]
12
- [![snyk-badge][]][snyk-link]
13
- [![socket-badge][]][socket-link]
6
+ > Base functionality used throughout XYO TypeScript/JavaScript libraries
14
7
 
8
+ ## Install
15
9
 
16
- Base functionality used throughout XYO TypeScript/JavaScript libraries
10
+ Using npm:
17
11
 
12
+ ```sh
13
+ npm install {{name}}
14
+ ```
18
15
 
16
+ Using yarn:
19
17
 
20
- ## Reference
18
+ ```sh
19
+ yarn add {{name}}
20
+ ```
21
21
 
22
- **@xylabs/sdk-meta**
22
+ Using pnpm:
23
23
 
24
- ***
24
+ ```sh
25
+ pnpm add {{name}}
26
+ ```
25
27
 
26
- ## Interfaces
28
+ Using bun:
27
29
 
28
- | Interface | Description |
29
- | ------ | ------ |
30
- | [Meta](#interfaces/Meta) | Represents page metadata including Open Graph and Twitter card properties. |
31
- | [OpenGraphMeta](#interfaces/OpenGraphMeta) | Open Graph protocol metadata for rich link previews. |
32
- | [OpenGraphStructured](#interfaces/OpenGraphStructured) | Structured properties for an Open Graph media object (image, video, or audio). |
33
- | [TwitterMeta](#interfaces/TwitterMeta) | https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup |
34
- | [TwitterApp](#interfaces/TwitterApp) | Twitter App Card metadata containing app store identifiers, names, and URLs per platform. |
35
- | [TwitterPlayer](#interfaces/TwitterPlayer) | https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card |
30
+ ```sh
31
+ bun add {{name}}
32
+ ```
36
33
 
37
- ## Type Aliases
38
34
 
39
- | Type Alias | Description |
40
- | ------ | ------ |
41
- | [StringIndexable](#type-aliases/StringIndexable) | An object with string keys and arbitrary values, used for recursive meta flattening. |
42
- | [OpenGraphStructuredProperty](#type-aliases/OpenGraphStructuredProperty) | A structured Open Graph property value: a URL string, a structured object, or an array of either. |
35
+ ## License
36
+
37
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
38
+
39
+ ## Reference
40
+
41
+ ### packages
43
42
 
44
- ## Functions
43
+ ### meta
45
44
 
46
- | Function | Description |
47
- | ------ | ------ |
48
- | [mergeDocumentHead](#functions/mergeDocumentHead) | Merges meta tags from the source HTML head into the destination HTML head. Existing meta tags with matching property attributes are replaced; others are appended. |
49
- | [getMetaAsDict](#functions/getMetaAsDict) | Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys. |
50
- | [addMetaToHead](#functions/addMetaToHead) | Adds or replaces a meta tag in the document head. |
51
- | [metaBuilder](#functions/metaBuilder) | Injects meta properties, title, and description into an HTML string. |
45
+ ### .temp-typedoc
52
46
 
53
- ### functions
47
+ ### functions
54
48
 
55
- ### <a id="addMetaToHead"></a>addMetaToHead
49
+ ### <a id="addMetaToHead"></a>addMetaToHead
56
50
 
57
51
  [**@xylabs/sdk-meta**](#../README)
58
52
 
@@ -60,43 +54,62 @@ Base functionality used throughout XYO TypeScript/JavaScript libraries
60
54
 
61
55
  ```ts
62
56
  function addMetaToHead(
63
- $: CheerioAPI,
64
- name: string,
65
- value: string | object): void;
57
+ $,
58
+ name,
59
+ value): void;
66
60
  ```
67
61
 
68
62
  Adds or replaces a meta tag in the document head.
69
63
 
70
64
  ## Parameters
71
65
 
72
- | Parameter | Type | Description |
73
- | ------ | ------ | ------ |
74
- | `$` | `CheerioAPI` | The Cheerio API instance for the document. |
75
- | `name` | `string` | The meta property name. |
76
- | `value` | `string` \| `object` | The meta content value (string, array, or nested object). |
66
+ ### $
67
+
68
+ `CheerioAPI`
69
+
70
+ The Cheerio API instance for the document.
71
+
72
+ ### name
73
+
74
+ `string`
75
+
76
+ The meta property name.
77
+
78
+ ### value
79
+
80
+ `string` \| `object`
81
+
82
+ The meta content value (string, array, or nested object).
77
83
 
78
84
  ## Returns
79
85
 
80
86
  `void`
81
87
 
82
- ### <a id="getMetaAsDict"></a>getMetaAsDict
88
+ ### <a id="getMetaAsDict"></a>getMetaAsDict
83
89
 
84
90
  [**@xylabs/sdk-meta**](#../README)
85
91
 
86
92
  ***
87
93
 
88
94
  ```ts
89
- function getMetaAsDict(obj: StringIndexable, parentKey?: string): Record<string, string>;
95
+ function getMetaAsDict(obj, parentKey?): Record<string, string>;
90
96
  ```
91
97
 
92
98
  Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.
93
99
 
94
100
  ## Parameters
95
101
 
96
- | Parameter | Type | Description |
97
- | ------ | ------ | ------ |
98
- | `obj` | [`StringIndexable`](#../type-aliases/StringIndexable) | The nested object to flatten. |
99
- | `parentKey?` | `string` | The accumulated key prefix from parent levels. |
102
+ ### obj
103
+
104
+ [`StringIndexable`](#../type-aliases/StringIndexable)
105
+
106
+ The nested object to flatten.
107
+
108
+ ### parentKey?
109
+
110
+ `string`
111
+
112
+ The accumulated key prefix from parent levels.
100
113
 
101
114
  ## Returns
102
115
 
@@ -104,14 +117,14 @@ Recursively flattens a nested meta object into a flat dictionary with colon-deli
104
117
 
105
118
  A flat record mapping colon-delimited property names to string values.
106
119
 
107
- ### <a id="mergeDocumentHead"></a>mergeDocumentHead
120
+ ### <a id="mergeDocumentHead"></a>mergeDocumentHead
108
121
 
109
122
  [**@xylabs/sdk-meta**](#../README)
110
123
 
111
124
  ***
112
125
 
113
126
  ```ts
114
- function mergeDocumentHead(destination: string, source: string): string;
127
+ function mergeDocumentHead(destination, source): string;
115
128
  ```
116
129
 
117
130
  Merges meta tags from the source HTML head into the destination HTML head.
@@ -119,10 +132,17 @@ Existing meta tags with matching property attributes are replaced; others are ap
119
132
 
120
133
  ## Parameters
121
134
 
122
- | Parameter | Type | Description |
123
- | ------ | ------ | ------ |
124
- | `destination` | `string` | The base HTML string to merge into. |
125
- | `source` | `string` | The HTML string whose head meta tags will be merged. |
135
+ ### destination
136
+
137
+ `string`
138
+
139
+ The base HTML string to merge into.
140
+
141
+ ### source
142
+
143
+ `string`
144
+
145
+ The HTML string whose head meta tags will be merged.
126
146
 
127
147
  ## Returns
128
148
 
@@ -130,7 +150,7 @@ Existing meta tags with matching property attributes are replaced; others are ap
130
150
 
131
151
  The merged HTML string.
132
152
 
133
- ### <a id="metaBuilder"></a>metaBuilder
153
+ ### <a id="metaBuilder"></a>metaBuilder
134
154
 
135
155
  [**@xylabs/sdk-meta**](#../README)
136
156
 
@@ -138,20 +158,32 @@ The merged HTML string.
138
158
 
139
159
  ```ts
140
160
  function metaBuilder(
141
- html: string,
142
- meta: Meta,
143
- handler?: string): string;
161
+ html,
162
+ meta,
163
+ handler?): string;
144
164
  ```
145
165
 
146
166
  Injects meta properties, title, and description into an HTML string.
147
167
 
148
168
  ## Parameters
149
169
 
150
- | Parameter | Type | Description |
151
- | ------ | ------ | ------ |
152
- | `html` | `string` | The base HTML string to modify. |
153
- | `meta` | [`Meta`](#../interfaces/Meta) | The metadata to inject. |
154
- | `handler?` | `string` | Optional meta-handler property value to include. |
170
+ ### html
171
+
172
+ `string`
173
+
174
+ The base HTML string to modify.
175
+
176
+ ### meta
177
+
178
+ [`Meta`](#../interfaces/Meta)
179
+
180
+ The metadata to inject.
181
+
182
+ ### handler?
183
+
184
+ `string`
185
+
186
+ Optional meta-handler property value to include.
155
187
 
156
188
  ## Returns
157
189
 
@@ -159,9 +191,9 @@ Injects meta properties, title, and description into an HTML string.
159
191
 
160
192
  The modified HTML string with injected metadata.
161
193
 
162
- ### interfaces
194
+ ### interfaces
163
195
 
164
- ### <a id="Meta"></a>Meta
196
+ ### <a id="Meta"></a>Meta
165
197
 
166
198
  [**@xylabs/sdk-meta**](#../README)
167
199
 
@@ -171,14 +203,37 @@ Represents page metadata including Open Graph and Twitter card properties.
171
203
 
172
204
  ## Properties
173
205
 
174
- | Property | Type |
175
- | ------ | ------ |
176
- | <a id="description"></a> `description?` | `string` |
177
- | <a id="og"></a> `og?` | [`OpenGraphMeta`](#OpenGraphMeta) |
178
- | <a id="title"></a> `title?` | `string` |
179
- | <a id="twitter"></a> `twitter?` | [`TwitterMeta`](#TwitterMeta) |
206
+ ### description?
207
+
208
+ ```ts
209
+ optional description?: string;
210
+ ```
211
+
212
+ ***
180
213
 
181
- ### <a id="OpenGraphMeta"></a>OpenGraphMeta
214
+ ### og?
215
+
216
+ ```ts
217
+ optional og?: OpenGraphMeta;
218
+ ```
219
+
220
+ ***
221
+
222
+ ### title?
223
+
224
+ ```ts
225
+ optional title?: string;
226
+ ```
227
+
228
+ ***
229
+
230
+ ### twitter?
231
+
232
+ ```ts
233
+ optional twitter?: TwitterMeta;
234
+ ```
235
+
236
+ ### <a id="OpenGraphMeta"></a>OpenGraphMeta
182
237
 
183
238
  [**@xylabs/sdk-meta**](#../README)
184
239
 
@@ -188,20 +243,85 @@ Open Graph protocol metadata for rich link previews.
188
243
 
189
244
  ## Properties
190
245
 
191
- | Property | Type |
192
- | ------ | ------ |
193
- | <a id="audio"></a> `audio?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
194
- | <a id="description"></a> `description?` | `string` |
195
- | <a id="determiner"></a> `determiner?` | `string` |
196
- | <a id="image"></a> `image?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
197
- | <a id="locale"></a> `locale?` | `string` \| `string`[] |
198
- | <a id="site_name"></a> `site_name?` | `string` |
199
- | <a id="title"></a> `title?` | `string` |
200
- | <a id="type"></a> `type?` | `string` |
201
- | <a id="url"></a> `url?` | `string` |
202
- | <a id="video"></a> `video?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
203
-
204
- ### <a id="OpenGraphStructured"></a>OpenGraphStructured
246
+ ### audio?
247
+
248
+ ```ts
249
+ optional audio?: OpenGraphStructuredProperty;
250
+ ```
251
+
252
+ ***
253
+
254
+ ### description?
255
+
256
+ ```ts
257
+ optional description?: string;
258
+ ```
259
+
260
+ ***
261
+
262
+ ### determiner?
263
+
264
+ ```ts
265
+ optional determiner?: string;
266
+ ```
267
+
268
+ ***
269
+
270
+ ### image?
271
+
272
+ ```ts
273
+ optional image?: OpenGraphStructuredProperty;
274
+ ```
275
+
276
+ ***
277
+
278
+ ### locale?
279
+
280
+ ```ts
281
+ optional locale?: string | string[];
282
+ ```
283
+
284
+ ***
285
+
286
+ ### site\_name?
287
+
288
+ ```ts
289
+ optional site_name?: string;
290
+ ```
291
+
292
+ ***
293
+
294
+ ### title?
295
+
296
+ ```ts
297
+ optional title?: string;
298
+ ```
299
+
300
+ ***
301
+
302
+ ### type?
303
+
304
+ ```ts
305
+ optional type?: string;
306
+ ```
307
+
308
+ ***
309
+
310
+ ### url?
311
+
312
+ ```ts
313
+ optional url?: string;
314
+ ```
315
+
316
+ ***
317
+
318
+ ### video?
319
+
320
+ ```ts
321
+ optional video?: OpenGraphStructuredProperty;
322
+ ```
323
+
324
+ ### <a id="OpenGraphStructured"></a>OpenGraphStructured
205
325
 
206
326
  [**@xylabs/sdk-meta**](#../README)
207
327
 
@@ -211,17 +331,61 @@ Structured properties for an Open Graph media object (image, video, or audio).
211
331
 
212
332
  ## Properties
213
333
 
214
- | Property | Type |
215
- | ------ | ------ |
216
- | <a id="_"></a> `?` | `string` |
217
- | <a id="alt"></a> `alt?` | `string` |
218
- | <a id="height"></a> `height?` | `number` |
219
- | <a id="secure_url"></a> `secure_url?` | `string` |
220
- | <a id="type"></a> `type?` | `string` |
221
- | <a id="url"></a> `url?` | `string` |
222
- | <a id="width"></a> `width?` | `number` |
334
+ ### ?
223
335
 
224
- ### <a id="TwitterApp"></a>TwitterApp
336
+ ```ts
337
+ optional ?: string;
338
+ ```
339
+
340
+ ***
341
+
342
+ ### alt?
343
+
344
+ ```ts
345
+ optional alt?: string;
346
+ ```
347
+
348
+ ***
349
+
350
+ ### height?
351
+
352
+ ```ts
353
+ optional height?: number;
354
+ ```
355
+
356
+ ***
357
+
358
+ ### secure\_url?
359
+
360
+ ```ts
361
+ optional secure_url?: string;
362
+ ```
363
+
364
+ ***
365
+
366
+ ### type?
367
+
368
+ ```ts
369
+ optional type?: string;
370
+ ```
371
+
372
+ ***
373
+
374
+ ### url?
375
+
376
+ ```ts
377
+ optional url?: string;
378
+ ```
379
+
380
+ ***
381
+
382
+ ### width?
383
+
384
+ ```ts
385
+ optional width?: number;
386
+ ```
387
+
388
+ ### <a id="TwitterApp"></a>TwitterApp
225
389
 
226
390
  [**@xylabs/sdk-meta**](#../README)
227
391
 
@@ -231,22 +395,83 @@ Twitter App Card metadata containing app store identifiers, names, and URLs per
231
395
 
232
396
  ## Properties
233
397
 
234
- | Property | Type |
235
- | ------ | ------ |
236
- | <a id="id"></a> `id?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
237
- | `id.googleplay?` | `string` |
238
- | `id.ipad?` | `string` |
239
- | `id.iphone?` | `string` |
240
- | <a id="name"></a> `name?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
241
- | `name.googleplay?` | `string` |
242
- | `name.ipad?` | `string` |
243
- | `name.iphone?` | `string` |
244
- | <a id="url"></a> `url?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
245
- | `url.googleplay?` | `string` |
246
- | `url.ipad?` | `string` |
247
- | `url.iphone?` | `string` |
248
-
249
- ### <a id="TwitterMeta"></a>TwitterMeta
398
+ ### id?
399
+
400
+ ```ts
401
+ optional id?: object;
402
+ ```
403
+
404
+ ### googleplay?
405
+
406
+ ```ts
407
+ optional googleplay?: string;
408
+ ```
409
+
410
+ ### ipad?
411
+
412
+ ```ts
413
+ optional ipad?: string;
414
+ ```
415
+
416
+ ### iphone?
417
+
418
+ ```ts
419
+ optional iphone?: string;
420
+ ```
421
+
422
+ ***
423
+
424
+ ### name?
425
+
426
+ ```ts
427
+ optional name?: object;
428
+ ```
429
+
430
+ ### googleplay?
431
+
432
+ ```ts
433
+ optional googleplay?: string;
434
+ ```
435
+
436
+ ### ipad?
437
+
438
+ ```ts
439
+ optional ipad?: string;
440
+ ```
441
+
442
+ ### iphone?
443
+
444
+ ```ts
445
+ optional iphone?: string;
446
+ ```
447
+
448
+ ***
449
+
450
+ ### url?
451
+
452
+ ```ts
453
+ optional url?: object;
454
+ ```
455
+
456
+ ### googleplay?
457
+
458
+ ```ts
459
+ optional googleplay?: string;
460
+ ```
461
+
462
+ ### ipad?
463
+
464
+ ```ts
465
+ optional ipad?: string;
466
+ ```
467
+
468
+ ### iphone?
469
+
470
+ ```ts
471
+ optional iphone?: string;
472
+ ```
473
+
474
+ ### <a id="TwitterMeta"></a>TwitterMeta
250
475
 
251
476
  [**@xylabs/sdk-meta**](#../README)
252
477
 
@@ -256,113 +481,225 @@ https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
256
481
 
257
482
  ## Properties
258
483
 
259
- | Property | Type | Description |
260
- | ------ | ------ | ------ |
261
- | <a id="app"></a> `app?` | [`TwitterApp`](#TwitterApp) | - |
262
- | <a id="card"></a> `card?` | `"summary"` \| `"summary_large_image"` \| `"app"` \| `"player"` | The card type. Used with all cards. Fallback: og:type. If an og:type, og:title and og:description exist in the markup but twitter:card is absent, then a summary card may be rendered. |
263
- | <a id="creator"></a> `creator?` | \{ `?`: `string`; `id?`: `string`; \} | - |
264
- | `creator.?` | `string` | The **Username** of content creator. Used with summary_large_image cards |
265
- | `creator.id?` | `string` | Twitter user ID of content creator. Used with summary, summary_large_image cards |
266
- | <a id="description"></a> `description?` | `string` | Description of content (maximum 200 characters). Used with summary, summary_large_image, player cards. Fallback: og:description. |
267
- | <a id="image"></a> `image?` | \{ `?`: `string`; `alt?`: `string`; \} | - |
268
- | `image.?` | `string` | URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported. Used with summary, summary_large_image, player cards. Fallback: og:image |
269
- | `image.alt?` | `string` | A text description of the image conveying the essential nature of an image to users who are visually impaired. Maximum 420 characters. Used with summary, summary_large_image, player cards |
270
- | <a id="player"></a> `player?` | [`TwitterPlayer`](#TwitterPlayer) | - |
271
- | <a id="site"></a> `site?` | \{ `?`: `string`; `id?`: `string`; \} | The **Username** of website. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, app, player cards |
272
- | `site.?` | `string` | - |
273
- | `site.id?` | `string` | Same as twitter:site, but the user’s Twitter ID. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, player cards |
274
- | <a id="title"></a> `title?` | `string` | Title of content (max 70 characters). Used with summary, summary_large_image, player cards. Fallback: og:title. |
275
-
276
- ### <a id="TwitterPlayer"></a>TwitterPlayer
484
+ ### app?
277
485
 
278
- [**@xylabs/sdk-meta**](#../README)
486
+ ```ts
487
+ optional app?: TwitterApp;
488
+ ```
279
489
 
280
490
  ***
281
491
 
282
- https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
492
+ ### card?
283
493
 
284
- ## Properties
494
+ ```ts
495
+ optional card?: "summary" | "summary_large_image" | "app" | "player";
496
+ ```
285
497
 
286
- | Property | Type | Description |
287
- | ------ | ------ | ------ |
288
- | <a id="_"></a> `` | `string` | HTTPS URL to iFrame player. This must be a HTTPS URL which does not generate active mixed content warnings in a web browser. The audio or video player must not require plugins such as Adobe Flash. |
289
- | <a id="height"></a> `height?` | `number` | Height of iframe in pixels. Used with player card |
290
- | <a id="stream"></a> `stream?` | `string` | URL to raw video or audio stream. Used with player card |
291
- | <a id="width"></a> `width?` | `number` | Width of iframe in pixels. Used with player card |
498
+ The card type. Used with all cards. Fallback: og:type.
499
+ If an og:type, og:title and og:description exist in the markup but
500
+ twitter:card is absent, then a summary card may be rendered.
292
501
 
293
- ### type-aliases
502
+ ***
294
503
 
295
- ### <a id="OpenGraphStructuredProperty"></a>OpenGraphStructuredProperty
504
+ ### creator?
296
505
 
297
- [**@xylabs/sdk-meta**](#../README)
506
+ ```ts
507
+ optional creator?: object;
508
+ ```
509
+
510
+ ### ?
511
+
512
+ ```ts
513
+ optional ?: string;
514
+ ```
515
+
516
+ The
517
+
518
+ #### Username
519
+
520
+ of content creator. Used with summary_large_image cards
521
+
522
+ ### id?
523
+
524
+ ```ts
525
+ optional id?: string;
526
+ ```
527
+
528
+ Twitter user ID of content creator. Used with summary,
529
+ summary_large_image cards
298
530
 
299
531
  ***
300
532
 
533
+ ### description?
534
+
301
535
  ```ts
302
- type OpenGraphStructuredProperty =
303
- | string
304
- | OpenGraphStructured
305
- | (string | OpenGraphStructured)[];
536
+ optional description?: string;
306
537
  ```
307
538
 
308
- A structured Open Graph property value: a URL string, a structured object, or an array of either.
539
+ Description of content (maximum 200 characters). Used with summary,
540
+ summary_large_image, player cards. Fallback: og:description.
541
+
542
+ ***
309
543
 
310
- ### <a id="StringIndexable"></a>StringIndexable
544
+ ### image?
545
+
546
+ ```ts
547
+ optional image?: object;
548
+ ```
549
+
550
+ ### ?
551
+
552
+ ```ts
553
+ optional ?: string;
554
+ ```
555
+
556
+ URL of image to use in the card. Images must be less than 5MB in size.
557
+ JPG, PNG, WEBP and GIF formats are supported. Only the first frame of
558
+ an animated GIF will be used. SVG is not supported. Used with summary,
559
+ summary_large_image, player cards. Fallback: og:image
560
+
561
+ ### alt?
562
+
563
+ ```ts
564
+ optional alt?: string;
565
+ ```
566
+
567
+ A text description of the image conveying the essential nature of
568
+ an image to users who are visually impaired. Maximum 420
569
+ characters. Used with summary, summary_large_image, player cards
570
+
571
+ ***
572
+
573
+ ### player?
574
+
575
+ ```ts
576
+ optional player?: TwitterPlayer;
577
+ ```
578
+
579
+ ***
580
+
581
+ ### site?
582
+
583
+ ```ts
584
+ optional site?: object;
585
+ ```
586
+
587
+ The
588
+
589
+ ### ?
590
+
591
+ ```ts
592
+ optional ?: string;
593
+ ```
594
+
595
+ ### id?
596
+
597
+ ```ts
598
+ optional id?: string;
599
+ ```
600
+
601
+ Same as twitter:site, but the user’s Twitter ID. Either
602
+ twitter:site or twitter:site:id is required. Used with
603
+ summary, summary_large_image, player cards
604
+
605
+ ### Username
606
+
607
+ of website. Either twitter:site or twitter:site:id is
608
+ required. Used with summary, summary_large_image, app, player
609
+ cards
610
+
611
+ ***
612
+
613
+ ### title?
614
+
615
+ ```ts
616
+ optional title?: string;
617
+ ```
618
+
619
+ Title of content (max 70 characters). Used with summary,
620
+ summary_large_image, player cards. Fallback: og:title.
621
+
622
+ ### <a id="TwitterPlayer"></a>TwitterPlayer
311
623
 
312
624
  [**@xylabs/sdk-meta**](#../README)
313
625
 
314
626
  ***
315
627
 
628
+ https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
629
+
630
+ ## Properties
631
+
632
+ ###
633
+
634
+ ```ts
635
+ : string;
636
+ ```
637
+
638
+ HTTPS URL to iFrame player. This must be a HTTPS URL which does not
639
+ generate active mixed content warnings in a web browser. The audio or
640
+ video player must not require plugins such as Adobe Flash.
641
+
642
+ ***
643
+
644
+ ### height?
645
+
316
646
  ```ts
317
- type StringIndexable = {
318
- [key: string]: any;
319
- };
647
+ optional height?: number;
320
648
  ```
321
649
 
322
- An object with string keys and arbitrary values, used for recursive meta flattening.
650
+ Height of iframe in pixels. Used with player card
651
+
652
+ ***
323
653
 
324
- ## Index Signature
654
+ ### stream?
325
655
 
326
656
  ```ts
327
- [key: string]: any
657
+ optional stream?: string;
328
658
  ```
329
659
 
660
+ URL to raw video or audio stream. Used with player card
330
661
 
331
- Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
662
+ ***
332
663
 
333
- ## Maintainers
664
+ ### width?
334
665
 
335
- - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
336
- - [Matt Jones](https://github.com/jonesmac)
337
- - [Joel Carter](https://github.com/JoelBCarter)
338
- - [Jordan Trouw](https://github.com/jordantrouw)
666
+ ```ts
667
+ optional width?: number;
668
+ ```
339
669
 
340
- ## License
670
+ Width of iframe in pixels. Used with player card
341
671
 
342
- > See the [LICENSE](LICENSE) file for license details
672
+ ### type-aliases
343
673
 
344
- ## Credits
674
+ ### <a id="OpenGraphStructuredProperty"></a>OpenGraphStructuredProperty
345
675
 
346
- [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
676
+ [**@xylabs/sdk-meta**](#../README)
347
677
 
348
- [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
678
+ ***
349
679
 
350
- [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
351
- [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
352
- [npm-badge]: https://img.shields.io/npm/v/@xylabs/sdk-meta.svg
353
- [npm-link]: https://www.npmjs.com/package/@xylabs/sdk-meta
354
- [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
355
- [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
356
- [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
357
- [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
358
- [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
359
- [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
680
+ ```ts
681
+ type OpenGraphStructuredProperty =
682
+ | string
683
+ | OpenGraphStructured
684
+ | (string | OpenGraphStructured)[];
685
+ ```
686
+
687
+ A structured Open Graph property value: a URL string, a structured object, or an array of either.
688
+
689
+ ### <a id="StringIndexable"></a>StringIndexable
360
690
 
361
- [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/sdk-meta
362
- [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/sdk-meta
691
+ [**@xylabs/sdk-meta**](#../README)
692
+
693
+ ***
694
+
695
+ ```ts
696
+ type StringIndexable = Record<string, any>;
697
+ ```
698
+
699
+ An object with string keys and arbitrary values, used for recursive meta flattening.
363
700
 
364
- [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/sdk-meta/badge
365
- [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/sdk-meta
366
701
 
367
- [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/sdk-meta
368
- [socket-link]: https://socket.dev/npm/package/@xylabs/sdk-meta
702
+ [npm-badge]: https://img.shields.io/npm/v/@xylabs/sdk-meta.svg
703
+ [npm-link]: https://www.npmjs.com/package/@xylabs/sdk-meta
704
+ [license-badge]: https://img.shields.io/npm/l/@xylabs/sdk-meta.svg
705
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
@@ -56,7 +56,7 @@ var addMetaToHead = ($, name, value) => {
56
56
  } else if (Array.isArray(value)) {
57
57
  for (const item of value) addMetaToHead($, `${name}`, item);
58
58
  } else if (typeof value === "object") {
59
- for (let [key, v] of Object.entries(value)) {
59
+ for (const [key, v] of Object.entries(value)) {
60
60
  if (key === "url") {
61
61
  addMetaToHead($, name, v);
62
62
  } else {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/html/mergeDocumentHead.ts","../../src/lib/getMetaAsDict.ts","../../src/meta/builder.ts"],"sourcesContent":["import { isString } from '@xylabs/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 } else {\n $destination('head').append(el)\n }\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 '@xylabs/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 = { [key: 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] = `${obj[key]}`\n }\n }\n return flatRecord\n}\n","import { isString } from '@xylabs/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: string | object) => {\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') {\n for (let [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":"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","names":["isString","isString","load","load","isString"]}
1
+ {"version":3,"sources":["../../src/html/mergeDocumentHead.ts","../../src/lib/getMetaAsDict.ts","../../src/meta/builder.ts"],"sourcesContent":["import { isString } from '@xylabs/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 } else {\n $destination('head').append(el)\n }\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 '@xylabs/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] = `${obj[key]}`\n }\n }\n return flatRecord\n}\n","import { isString } from '@xylabs/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: string | object) => {\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') {\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":"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","names":["isString","isString","load","load","isString"]}
@@ -1,7 +1,5 @@
1
1
  /** An object with string keys and arbitrary values, used for recursive meta flattening. */
2
- export type StringIndexable = {
3
- [key: string]: any;
4
- };
2
+ export type StringIndexable = Record<string, any>;
5
3
  /**
6
4
  * Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.
7
5
  * @param obj - The nested object to flatten.
@@ -1 +1 @@
1
- {"version":3,"file":"getMetaAsDict.d.ts","sourceRoot":"","sources":["../../../src/lib/getMetaAsDict.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAE3F,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAIpD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,eAAe,EAAE,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAe7F,CAAA"}
1
+ {"version":3,"file":"getMetaAsDict.d.ts","sourceRoot":"","sources":["../../../src/lib/getMetaAsDict.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAE3F,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAIjD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,eAAe,EAAE,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAe7F,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/sdk-meta",
3
- "version": "5.0.94",
3
+ "version": "5.0.96",
4
4
  "description": "Base functionality used throughout XYO TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "meta",
@@ -24,12 +24,10 @@
24
24
  "exports": {
25
25
  ".": {
26
26
  "types": "./dist/neutral/index.d.ts",
27
- "import": "./dist/neutral/index.mjs",
28
27
  "default": "./dist/neutral/index.mjs"
29
28
  },
30
29
  "./package.json": "./package.json"
31
30
  },
32
- "types": "./dist/neutral/index.d.ts",
33
31
  "files": [
34
32
  "dist",
35
33
  "!**/*.bench.*",
@@ -39,18 +37,19 @@
39
37
  ],
40
38
  "dependencies": {
41
39
  "cheerio": "~1.2.0",
42
- "@xylabs/typeof": "~5.0.94"
40
+ "@xylabs/typeof": "~5.0.96"
43
41
  },
44
42
  "devDependencies": {
45
- "@types/node": "~25.5.2",
46
- "@xylabs/ts-scripts-common": "~7.7.3",
47
- "@xylabs/ts-scripts-pnpm": "~7.7.3",
48
- "@xylabs/tsconfig": "~7.7.3",
49
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0",
43
+ "@types/node": "~25.6.0",
44
+ "@xylabs/toolchain": "~7.10.4",
45
+ "@xylabs/tsconfig": "~7.10.4",
50
46
  "esbuild": "^0.28.0",
51
47
  "typescript": "^5",
52
- "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
53
- "vitest": "^4.1.2"
48
+ "vite": "^8.0.8",
49
+ "vitest": "^4.1.4"
50
+ },
51
+ "engines": {
52
+ "node": ">=18"
54
53
  },
55
54
  "publishConfig": {
56
55
  "access": "public"