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