@c-rex/utils 0.1.21 → 0.1.22
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/cookies.js +96 -3
- package/dist/cookies.js.map +1 -1
- package/dist/cookies.mjs +96 -3
- package/dist/cookies.mjs.map +1 -1
- package/dist/directoryNodes.d.mts +5 -1
- package/dist/directoryNodes.d.ts +5 -1
- package/dist/directoryNodes.js +225 -27
- package/dist/directoryNodes.js.map +1 -1
- package/dist/directoryNodes.mjs +224 -27
- package/dist/directoryNodes.mjs.map +1 -1
- package/dist/index.d.mts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +246 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +62 -60
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -24,12 +34,14 @@ __export(index_exports, {
|
|
|
24
34
|
cn: () => cn,
|
|
25
35
|
createAvailableVersionList: () => createAvailableVersionList,
|
|
26
36
|
createParams: () => createParams,
|
|
37
|
+
extractCountryCodeFromLanguage: () => extractCountryCodeFromLanguage,
|
|
27
38
|
filteredItems: () => filteredItems,
|
|
28
39
|
formatDateToLocale: () => formatDateToLocale,
|
|
29
40
|
generateBreadcrumbItems: () => generateBreadcrumbItems,
|
|
30
41
|
generateQueryParams: () => generateQueryParams,
|
|
31
42
|
getCountryCodeByLang: () => getCountryCodeByLang,
|
|
32
43
|
getFileRenditions: () => getFileRenditions,
|
|
44
|
+
getHtmlRenditionViewUrl: () => getHtmlRenditionViewUrl,
|
|
33
45
|
getLabelByLang: () => getLabelByLang,
|
|
34
46
|
getLanguage: () => getLanguage,
|
|
35
47
|
getTitle: () => getTitle,
|
|
@@ -37,8 +49,13 @@ __export(index_exports, {
|
|
|
37
49
|
getVersions: () => getVersions,
|
|
38
50
|
isDate: () => isDate,
|
|
39
51
|
isLanguage: () => isLanguage,
|
|
52
|
+
metaTagsToMetadata: () => metaTagsToMetadata,
|
|
53
|
+
normalizeLanguageCode: () => normalizeLanguageCode,
|
|
54
|
+
parseHtmlContent: () => parseHtmlContent,
|
|
40
55
|
processDataToLabelValuePairs: () => processDataToLabelValuePairs,
|
|
41
56
|
replacePathParams: () => replacePathParams,
|
|
57
|
+
resolvePreferredLanguage: () => resolvePreferredLanguage,
|
|
58
|
+
sortAndDeduplicateLanguages: () => sortAndDeduplicateLanguages,
|
|
42
59
|
transformLanguageData: () => transformLanguageData
|
|
43
60
|
});
|
|
44
61
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -54,6 +71,7 @@ var AdministrativeMetadataModelFields = {
|
|
|
54
71
|
descriptions: "descriptions",
|
|
55
72
|
synonyms: "synonyms",
|
|
56
73
|
packages: "packages",
|
|
74
|
+
hasInformationUnits: "hasInformationUnits",
|
|
57
75
|
links: "links"
|
|
58
76
|
};
|
|
59
77
|
var AdministrativeMetadataModelFieldsAll = Object.values(AdministrativeMetadataModelFields);
|
|
@@ -68,6 +86,24 @@ var AuthStateModelFields = {
|
|
|
68
86
|
roles: "roles"
|
|
69
87
|
};
|
|
70
88
|
var AuthStateModelFieldsAll = Object.values(AuthStateModelFields);
|
|
89
|
+
var CategoryModelFields = {
|
|
90
|
+
id: "id",
|
|
91
|
+
shortId: "shortId",
|
|
92
|
+
score: "score",
|
|
93
|
+
class: "class",
|
|
94
|
+
labels: "labels",
|
|
95
|
+
comments: "comments",
|
|
96
|
+
descriptions: "descriptions",
|
|
97
|
+
synonyms: "synonyms",
|
|
98
|
+
packages: "packages",
|
|
99
|
+
hasInformationUnits: "hasInformationUnits",
|
|
100
|
+
links: "links",
|
|
101
|
+
parents: "parents",
|
|
102
|
+
ancestors: "ancestors",
|
|
103
|
+
ancestorsOrSelf: "ancestorsOrSelf",
|
|
104
|
+
categories: "categories"
|
|
105
|
+
};
|
|
106
|
+
var CategoryModelFieldsAll = Object.values(CategoryModelFields);
|
|
71
107
|
var ComponentModelFields = {
|
|
72
108
|
id: "id",
|
|
73
109
|
shortId: "shortId",
|
|
@@ -78,6 +114,7 @@ var ComponentModelFields = {
|
|
|
78
114
|
descriptions: "descriptions",
|
|
79
115
|
synonyms: "synonyms",
|
|
80
116
|
packages: "packages",
|
|
117
|
+
hasInformationUnits: "hasInformationUnits",
|
|
81
118
|
links: "links",
|
|
82
119
|
productGraphic: "productGraphic",
|
|
83
120
|
titles: "titles",
|
|
@@ -101,6 +138,7 @@ var ContentLifeCycleStatusModelFields = {
|
|
|
101
138
|
descriptions: "descriptions",
|
|
102
139
|
synonyms: "synonyms",
|
|
103
140
|
packages: "packages",
|
|
141
|
+
hasInformationUnits: "hasInformationUnits",
|
|
104
142
|
links: "links",
|
|
105
143
|
dateOfEffect: "dateOfEffect",
|
|
106
144
|
dateOfExpiry: "dateOfExpiry",
|
|
@@ -120,6 +158,7 @@ var ContentLifeCycleStatusValueModelFields = {
|
|
|
120
158
|
descriptions: "descriptions",
|
|
121
159
|
synonyms: "synonyms",
|
|
122
160
|
packages: "packages",
|
|
161
|
+
hasInformationUnits: "hasInformationUnits",
|
|
123
162
|
links: "links"
|
|
124
163
|
};
|
|
125
164
|
var ContentLifeCycleStatusValueModelFieldsAll = Object.values(ContentLifeCycleStatusValueModelFields);
|
|
@@ -133,6 +172,7 @@ var DirectoryNodeModelFields = {
|
|
|
133
172
|
descriptions: "descriptions",
|
|
134
173
|
synonyms: "synonyms",
|
|
135
174
|
packages: "packages",
|
|
175
|
+
hasInformationUnits: "hasInformationUnits",
|
|
136
176
|
links: "links",
|
|
137
177
|
structureType: "structureType",
|
|
138
178
|
parents: "parents",
|
|
@@ -152,6 +192,7 @@ var DirectoryNodeTypeModelFields = {
|
|
|
152
192
|
descriptions: "descriptions",
|
|
153
193
|
synonyms: "synonyms",
|
|
154
194
|
packages: "packages",
|
|
195
|
+
hasInformationUnits: "hasInformationUnits",
|
|
155
196
|
links: "links"
|
|
156
197
|
};
|
|
157
198
|
var DirectoryNodeTypeModelFieldsAll = Object.values(DirectoryNodeTypeModelFields);
|
|
@@ -165,6 +206,7 @@ var DocumentModelFields = {
|
|
|
165
206
|
descriptions: "descriptions",
|
|
166
207
|
synonyms: "synonyms",
|
|
167
208
|
packages: "packages",
|
|
209
|
+
hasInformationUnits: "hasInformationUnits",
|
|
168
210
|
links: "links",
|
|
169
211
|
revision: "revision",
|
|
170
212
|
created: "created",
|
|
@@ -206,6 +248,7 @@ var DocumentTypeModelFields = {
|
|
|
206
248
|
descriptions: "descriptions",
|
|
207
249
|
synonyms: "synonyms",
|
|
208
250
|
packages: "packages",
|
|
251
|
+
hasInformationUnits: "hasInformationUnits",
|
|
209
252
|
links: "links"
|
|
210
253
|
};
|
|
211
254
|
var DocumentTypeModelFieldsAll = Object.values(DocumentTypeModelFields);
|
|
@@ -219,6 +262,7 @@ var DocumentationMetadataModelFields = {
|
|
|
219
262
|
descriptions: "descriptions",
|
|
220
263
|
synonyms: "synonyms",
|
|
221
264
|
packages: "packages",
|
|
265
|
+
hasInformationUnits: "hasInformationUnits",
|
|
222
266
|
links: "links"
|
|
223
267
|
};
|
|
224
268
|
var DocumentationMetadataModelFieldsAll = Object.values(DocumentationMetadataModelFields);
|
|
@@ -231,7 +275,8 @@ var DomainEntityModelFields = {
|
|
|
231
275
|
comments: "comments",
|
|
232
276
|
descriptions: "descriptions",
|
|
233
277
|
synonyms: "synonyms",
|
|
234
|
-
packages: "packages"
|
|
278
|
+
packages: "packages",
|
|
279
|
+
hasInformationUnits: "hasInformationUnits"
|
|
235
280
|
};
|
|
236
281
|
var DomainEntityModelFieldsAll = Object.values(DomainEntityModelFields);
|
|
237
282
|
var EventModelFields = {
|
|
@@ -244,6 +289,7 @@ var EventModelFields = {
|
|
|
244
289
|
descriptions: "descriptions",
|
|
245
290
|
synonyms: "synonyms",
|
|
246
291
|
packages: "packages",
|
|
292
|
+
hasInformationUnits: "hasInformationUnits",
|
|
247
293
|
links: "links",
|
|
248
294
|
eventCode: "eventCode",
|
|
249
295
|
eventType: "eventType"
|
|
@@ -259,6 +305,7 @@ var ExternalProductGraphicModelFields = {
|
|
|
259
305
|
descriptions: "descriptions",
|
|
260
306
|
synonyms: "synonyms",
|
|
261
307
|
packages: "packages",
|
|
308
|
+
hasInformationUnits: "hasInformationUnits",
|
|
262
309
|
links: "links",
|
|
263
310
|
revision: "revision",
|
|
264
311
|
created: "created",
|
|
@@ -311,6 +358,7 @@ var FragmentModelFields = {
|
|
|
311
358
|
descriptions: "descriptions",
|
|
312
359
|
synonyms: "synonyms",
|
|
313
360
|
packages: "packages",
|
|
361
|
+
hasInformationUnits: "hasInformationUnits",
|
|
314
362
|
links: "links",
|
|
315
363
|
revision: "revision",
|
|
316
364
|
created: "created",
|
|
@@ -352,6 +400,7 @@ var FunctionalMetadataModelFields = {
|
|
|
352
400
|
descriptions: "descriptions",
|
|
353
401
|
synonyms: "synonyms",
|
|
354
402
|
packages: "packages",
|
|
403
|
+
hasInformationUnits: "hasInformationUnits",
|
|
355
404
|
links: "links"
|
|
356
405
|
};
|
|
357
406
|
var FunctionalMetadataModelFieldsAll = Object.values(FunctionalMetadataModelFields);
|
|
@@ -365,6 +414,7 @@ var IdentityDomainModelFields = {
|
|
|
365
414
|
descriptions: "descriptions",
|
|
366
415
|
synonyms: "synonyms",
|
|
367
416
|
packages: "packages",
|
|
417
|
+
hasInformationUnits: "hasInformationUnits",
|
|
368
418
|
links: "links",
|
|
369
419
|
parties: "parties"
|
|
370
420
|
};
|
|
@@ -379,6 +429,7 @@ var IdentityModelFields = {
|
|
|
379
429
|
descriptions: "descriptions",
|
|
380
430
|
synonyms: "synonyms",
|
|
381
431
|
packages: "packages",
|
|
432
|
+
hasInformationUnits: "hasInformationUnits",
|
|
382
433
|
links: "links",
|
|
383
434
|
identifier: "identifier",
|
|
384
435
|
identityDomain: "identityDomain"
|
|
@@ -394,6 +445,7 @@ var InformationObjectModelFields = {
|
|
|
394
445
|
descriptions: "descriptions",
|
|
395
446
|
synonyms: "synonyms",
|
|
396
447
|
packages: "packages",
|
|
448
|
+
hasInformationUnits: "hasInformationUnits",
|
|
397
449
|
links: "links",
|
|
398
450
|
identities: "identities"
|
|
399
451
|
};
|
|
@@ -408,6 +460,7 @@ var InformationSubjectCollectionModelFields = {
|
|
|
408
460
|
descriptions: "descriptions",
|
|
409
461
|
synonyms: "synonyms",
|
|
410
462
|
packages: "packages",
|
|
463
|
+
hasInformationUnits: "hasInformationUnits",
|
|
411
464
|
links: "links"
|
|
412
465
|
};
|
|
413
466
|
var InformationSubjectCollectionModelFieldsAll = Object.values(InformationSubjectCollectionModelFields);
|
|
@@ -421,6 +474,7 @@ var InformationSubjectConformityModelFields = {
|
|
|
421
474
|
descriptions: "descriptions",
|
|
422
475
|
synonyms: "synonyms",
|
|
423
476
|
packages: "packages",
|
|
477
|
+
hasInformationUnits: "hasInformationUnits",
|
|
424
478
|
links: "links"
|
|
425
479
|
};
|
|
426
480
|
var InformationSubjectConformityModelFieldsAll = Object.values(InformationSubjectConformityModelFields);
|
|
@@ -434,6 +488,7 @@ var InformationSubjectFormalityModelFields = {
|
|
|
434
488
|
descriptions: "descriptions",
|
|
435
489
|
synonyms: "synonyms",
|
|
436
490
|
packages: "packages",
|
|
491
|
+
hasInformationUnits: "hasInformationUnits",
|
|
437
492
|
links: "links"
|
|
438
493
|
};
|
|
439
494
|
var InformationSubjectFormalityModelFieldsAll = Object.values(InformationSubjectFormalityModelFields);
|
|
@@ -447,6 +502,7 @@ var InformationSubjectFunctionalityModelFields = {
|
|
|
447
502
|
descriptions: "descriptions",
|
|
448
503
|
synonyms: "synonyms",
|
|
449
504
|
packages: "packages",
|
|
505
|
+
hasInformationUnits: "hasInformationUnits",
|
|
450
506
|
links: "links"
|
|
451
507
|
};
|
|
452
508
|
var InformationSubjectFunctionalityModelFieldsAll = Object.values(InformationSubjectFunctionalityModelFields);
|
|
@@ -460,6 +516,7 @@ var InformationSubjectModelFields = {
|
|
|
460
516
|
descriptions: "descriptions",
|
|
461
517
|
synonyms: "synonyms",
|
|
462
518
|
packages: "packages",
|
|
519
|
+
hasInformationUnits: "hasInformationUnits",
|
|
463
520
|
links: "links"
|
|
464
521
|
};
|
|
465
522
|
var InformationSubjectModelFieldsAll = Object.values(InformationSubjectModelFields);
|
|
@@ -473,6 +530,7 @@ var InformationSubjectProcessModelFields = {
|
|
|
473
530
|
descriptions: "descriptions",
|
|
474
531
|
synonyms: "synonyms",
|
|
475
532
|
packages: "packages",
|
|
533
|
+
hasInformationUnits: "hasInformationUnits",
|
|
476
534
|
links: "links"
|
|
477
535
|
};
|
|
478
536
|
var InformationSubjectProcessModelFieldsAll = Object.values(InformationSubjectProcessModelFields);
|
|
@@ -486,6 +544,7 @@ var InformationSubjectSafetyModelFields = {
|
|
|
486
544
|
descriptions: "descriptions",
|
|
487
545
|
synonyms: "synonyms",
|
|
488
546
|
packages: "packages",
|
|
547
|
+
hasInformationUnits: "hasInformationUnits",
|
|
489
548
|
links: "links"
|
|
490
549
|
};
|
|
491
550
|
var InformationSubjectSafetyModelFieldsAll = Object.values(InformationSubjectSafetyModelFields);
|
|
@@ -499,6 +558,7 @@ var InformationSubjectSafetyWarningMessageModelFields = {
|
|
|
499
558
|
descriptions: "descriptions",
|
|
500
559
|
synonyms: "synonyms",
|
|
501
560
|
packages: "packages",
|
|
561
|
+
hasInformationUnits: "hasInformationUnits",
|
|
502
562
|
links: "links"
|
|
503
563
|
};
|
|
504
564
|
var InformationSubjectSafetyWarningMessageModelFieldsAll = Object.values(InformationSubjectSafetyWarningMessageModelFields);
|
|
@@ -512,6 +572,7 @@ var InformationSubjectTechnicalDataModelFields = {
|
|
|
512
572
|
descriptions: "descriptions",
|
|
513
573
|
synonyms: "synonyms",
|
|
514
574
|
packages: "packages",
|
|
575
|
+
hasInformationUnits: "hasInformationUnits",
|
|
515
576
|
links: "links"
|
|
516
577
|
};
|
|
517
578
|
var InformationSubjectTechnicalDataModelFieldsAll = Object.values(InformationSubjectTechnicalDataModelFields);
|
|
@@ -525,6 +586,7 @@ var InformationSubjectTechnicalOverviewModelFields = {
|
|
|
525
586
|
descriptions: "descriptions",
|
|
526
587
|
synonyms: "synonyms",
|
|
527
588
|
packages: "packages",
|
|
589
|
+
hasInformationUnits: "hasInformationUnits",
|
|
528
590
|
links: "links"
|
|
529
591
|
};
|
|
530
592
|
var InformationSubjectTechnicalOverviewModelFieldsAll = Object.values(InformationSubjectTechnicalOverviewModelFields);
|
|
@@ -538,6 +600,7 @@ var InformationTypeModelFields = {
|
|
|
538
600
|
descriptions: "descriptions",
|
|
539
601
|
synonyms: "synonyms",
|
|
540
602
|
packages: "packages",
|
|
603
|
+
hasInformationUnits: "hasInformationUnits",
|
|
541
604
|
links: "links"
|
|
542
605
|
};
|
|
543
606
|
var InformationTypeModelFieldsAll = Object.values(InformationTypeModelFields);
|
|
@@ -551,6 +614,7 @@ var InformationUnitModelFields = {
|
|
|
551
614
|
descriptions: "descriptions",
|
|
552
615
|
synonyms: "synonyms",
|
|
553
616
|
packages: "packages",
|
|
617
|
+
hasInformationUnits: "hasInformationUnits",
|
|
554
618
|
links: "links",
|
|
555
619
|
revision: "revision",
|
|
556
620
|
created: "created",
|
|
@@ -591,7 +655,8 @@ var OwlClassModelFields = {
|
|
|
591
655
|
comments: "comments",
|
|
592
656
|
descriptions: "descriptions",
|
|
593
657
|
synonyms: "synonyms",
|
|
594
|
-
packages: "packages"
|
|
658
|
+
packages: "packages",
|
|
659
|
+
hasInformationUnits: "hasInformationUnits"
|
|
595
660
|
};
|
|
596
661
|
var OwlClassModelFieldsAll = Object.values(OwlClassModelFields);
|
|
597
662
|
var PackageModelFields = {
|
|
@@ -604,6 +669,7 @@ var PackageModelFields = {
|
|
|
604
669
|
descriptions: "descriptions",
|
|
605
670
|
synonyms: "synonyms",
|
|
606
671
|
packages: "packages",
|
|
672
|
+
hasInformationUnits: "hasInformationUnits",
|
|
607
673
|
links: "links",
|
|
608
674
|
revision: "revision",
|
|
609
675
|
created: "created",
|
|
@@ -648,6 +714,7 @@ var PartyModelFields = {
|
|
|
648
714
|
descriptions: "descriptions",
|
|
649
715
|
synonyms: "synonyms",
|
|
650
716
|
packages: "packages",
|
|
717
|
+
hasInformationUnits: "hasInformationUnits",
|
|
651
718
|
links: "links",
|
|
652
719
|
partyRole: "partyRole",
|
|
653
720
|
vcard: "vcard"
|
|
@@ -663,6 +730,7 @@ var PartyRoleModelFields = {
|
|
|
663
730
|
descriptions: "descriptions",
|
|
664
731
|
synonyms: "synonyms",
|
|
665
732
|
packages: "packages",
|
|
733
|
+
hasInformationUnits: "hasInformationUnits",
|
|
666
734
|
links: "links"
|
|
667
735
|
};
|
|
668
736
|
var PartyRoleModelFieldsAll = Object.values(PartyRoleModelFields);
|
|
@@ -676,6 +744,7 @@ var PlanningDownTimeModelFields = {
|
|
|
676
744
|
descriptions: "descriptions",
|
|
677
745
|
synonyms: "synonyms",
|
|
678
746
|
packages: "packages",
|
|
747
|
+
hasInformationUnits: "hasInformationUnits",
|
|
679
748
|
links: "links",
|
|
680
749
|
duration: "duration"
|
|
681
750
|
};
|
|
@@ -690,6 +759,7 @@ var PlanningMaintenanceIntervalModelFields = {
|
|
|
690
759
|
descriptions: "descriptions",
|
|
691
760
|
synonyms: "synonyms",
|
|
692
761
|
packages: "packages",
|
|
762
|
+
hasInformationUnits: "hasInformationUnits",
|
|
693
763
|
links: "links",
|
|
694
764
|
duration: "duration",
|
|
695
765
|
frequency: "frequency"
|
|
@@ -705,6 +775,7 @@ var PlanningSetupTimeModelFields = {
|
|
|
705
775
|
descriptions: "descriptions",
|
|
706
776
|
synonyms: "synonyms",
|
|
707
777
|
packages: "packages",
|
|
778
|
+
hasInformationUnits: "hasInformationUnits",
|
|
708
779
|
links: "links",
|
|
709
780
|
duration: "duration"
|
|
710
781
|
};
|
|
@@ -719,6 +790,7 @@ var PlanningTimeModelFields = {
|
|
|
719
790
|
descriptions: "descriptions",
|
|
720
791
|
synonyms: "synonyms",
|
|
721
792
|
packages: "packages",
|
|
793
|
+
hasInformationUnits: "hasInformationUnits",
|
|
722
794
|
links: "links",
|
|
723
795
|
duration: "duration"
|
|
724
796
|
};
|
|
@@ -733,6 +805,7 @@ var PlanningWorkingTimeModelFields = {
|
|
|
733
805
|
descriptions: "descriptions",
|
|
734
806
|
synonyms: "synonyms",
|
|
735
807
|
packages: "packages",
|
|
808
|
+
hasInformationUnits: "hasInformationUnits",
|
|
736
809
|
links: "links",
|
|
737
810
|
duration: "duration"
|
|
738
811
|
};
|
|
@@ -747,6 +820,7 @@ var ProductFeatureModelFields = {
|
|
|
747
820
|
descriptions: "descriptions",
|
|
748
821
|
synonyms: "synonyms",
|
|
749
822
|
packages: "packages",
|
|
823
|
+
hasInformationUnits: "hasInformationUnits",
|
|
750
824
|
links: "links"
|
|
751
825
|
};
|
|
752
826
|
var ProductFeatureModelFieldsAll = Object.values(ProductFeatureModelFields);
|
|
@@ -760,6 +834,7 @@ var ProductFunctionModelFields = {
|
|
|
760
834
|
descriptions: "descriptions",
|
|
761
835
|
synonyms: "synonyms",
|
|
762
836
|
packages: "packages",
|
|
837
|
+
hasInformationUnits: "hasInformationUnits",
|
|
763
838
|
links: "links"
|
|
764
839
|
};
|
|
765
840
|
var ProductFunctionModelFieldsAll = Object.values(ProductFunctionModelFields);
|
|
@@ -773,6 +848,7 @@ var ProductLcpAfterUseModelFields = {
|
|
|
773
848
|
descriptions: "descriptions",
|
|
774
849
|
synonyms: "synonyms",
|
|
775
850
|
packages: "packages",
|
|
851
|
+
hasInformationUnits: "hasInformationUnits",
|
|
776
852
|
links: "links"
|
|
777
853
|
};
|
|
778
854
|
var ProductLcpAfterUseModelFieldsAll = Object.values(ProductLcpAfterUseModelFields);
|
|
@@ -786,6 +862,7 @@ var ProductLcpDesignAndRealizationModelFields = {
|
|
|
786
862
|
descriptions: "descriptions",
|
|
787
863
|
synonyms: "synonyms",
|
|
788
864
|
packages: "packages",
|
|
865
|
+
hasInformationUnits: "hasInformationUnits",
|
|
789
866
|
links: "links"
|
|
790
867
|
};
|
|
791
868
|
var ProductLcpDesignAndRealizationModelFieldsAll = Object.values(ProductLcpDesignAndRealizationModelFields);
|
|
@@ -799,6 +876,7 @@ var ProductLcpPuttingToUseModelFields = {
|
|
|
799
876
|
descriptions: "descriptions",
|
|
800
877
|
synonyms: "synonyms",
|
|
801
878
|
packages: "packages",
|
|
879
|
+
hasInformationUnits: "hasInformationUnits",
|
|
802
880
|
links: "links"
|
|
803
881
|
};
|
|
804
882
|
var ProductLcpPuttingToUseModelFieldsAll = Object.values(ProductLcpPuttingToUseModelFields);
|
|
@@ -812,6 +890,7 @@ var ProductLcpUseModelFields = {
|
|
|
812
890
|
descriptions: "descriptions",
|
|
813
891
|
synonyms: "synonyms",
|
|
814
892
|
packages: "packages",
|
|
893
|
+
hasInformationUnits: "hasInformationUnits",
|
|
815
894
|
links: "links"
|
|
816
895
|
};
|
|
817
896
|
var ProductLcpUseModelFieldsAll = Object.values(ProductLcpUseModelFields);
|
|
@@ -825,6 +904,7 @@ var ProductLifeCyclePhaseModelFields = {
|
|
|
825
904
|
descriptions: "descriptions",
|
|
826
905
|
synonyms: "synonyms",
|
|
827
906
|
packages: "packages",
|
|
907
|
+
hasInformationUnits: "hasInformationUnits",
|
|
828
908
|
links: "links"
|
|
829
909
|
};
|
|
830
910
|
var ProductLifeCyclePhaseModelFieldsAll = Object.values(ProductLifeCyclePhaseModelFields);
|
|
@@ -838,6 +918,7 @@ var ProductMetadataModelFields = {
|
|
|
838
918
|
descriptions: "descriptions",
|
|
839
919
|
synonyms: "synonyms",
|
|
840
920
|
packages: "packages",
|
|
921
|
+
hasInformationUnits: "hasInformationUnits",
|
|
841
922
|
links: "links"
|
|
842
923
|
};
|
|
843
924
|
var ProductMetadataModelFieldsAll = Object.values(ProductMetadataModelFields);
|
|
@@ -851,6 +932,7 @@ var ProductPropertyModelFields = {
|
|
|
851
932
|
descriptions: "descriptions",
|
|
852
933
|
synonyms: "synonyms",
|
|
853
934
|
packages: "packages",
|
|
935
|
+
hasInformationUnits: "hasInformationUnits",
|
|
854
936
|
links: "links"
|
|
855
937
|
};
|
|
856
938
|
var ProductPropertyModelFieldsAll = Object.values(ProductPropertyModelFields);
|
|
@@ -864,6 +946,7 @@ var ProductVariantModelFields = {
|
|
|
864
946
|
descriptions: "descriptions",
|
|
865
947
|
synonyms: "synonyms",
|
|
866
948
|
packages: "packages",
|
|
949
|
+
hasInformationUnits: "hasInformationUnits",
|
|
867
950
|
links: "links",
|
|
868
951
|
identities: "identities",
|
|
869
952
|
parties: "parties"
|
|
@@ -879,6 +962,7 @@ var QualificationModelFields = {
|
|
|
879
962
|
descriptions: "descriptions",
|
|
880
963
|
synonyms: "synonyms",
|
|
881
964
|
packages: "packages",
|
|
965
|
+
hasInformationUnits: "hasInformationUnits",
|
|
882
966
|
links: "links"
|
|
883
967
|
};
|
|
884
968
|
var QualificationModelFieldsAll = Object.values(QualificationModelFields);
|
|
@@ -892,6 +976,7 @@ var QualificationRoleModelFields = {
|
|
|
892
976
|
descriptions: "descriptions",
|
|
893
977
|
synonyms: "synonyms",
|
|
894
978
|
packages: "packages",
|
|
979
|
+
hasInformationUnits: "hasInformationUnits",
|
|
895
980
|
links: "links"
|
|
896
981
|
};
|
|
897
982
|
var QualificationRoleModelFieldsAll = Object.values(QualificationRoleModelFields);
|
|
@@ -905,6 +990,7 @@ var QualificationSkillLevelModelFields = {
|
|
|
905
990
|
descriptions: "descriptions",
|
|
906
991
|
synonyms: "synonyms",
|
|
907
992
|
packages: "packages",
|
|
993
|
+
hasInformationUnits: "hasInformationUnits",
|
|
908
994
|
links: "links"
|
|
909
995
|
};
|
|
910
996
|
var QualificationSkillLevelModelFieldsAll = Object.values(QualificationSkillLevelModelFields);
|
|
@@ -918,6 +1004,7 @@ var RenditionModelFields = {
|
|
|
918
1004
|
descriptions: "descriptions",
|
|
919
1005
|
synonyms: "synonyms",
|
|
920
1006
|
packages: "packages",
|
|
1007
|
+
hasInformationUnits: "hasInformationUnits",
|
|
921
1008
|
links: "links",
|
|
922
1009
|
source: "source",
|
|
923
1010
|
format: "format",
|
|
@@ -935,7 +1022,8 @@ var RenditionSelectorModelFields = {
|
|
|
935
1022
|
comments: "comments",
|
|
936
1023
|
descriptions: "descriptions",
|
|
937
1024
|
synonyms: "synonyms",
|
|
938
|
-
packages: "packages"
|
|
1025
|
+
packages: "packages",
|
|
1026
|
+
hasInformationUnits: "hasInformationUnits"
|
|
939
1027
|
};
|
|
940
1028
|
var RenditionSelectorModelFieldsAll = Object.values(RenditionSelectorModelFields);
|
|
941
1029
|
var SupplyConsumableModelFields = {
|
|
@@ -948,6 +1036,7 @@ var SupplyConsumableModelFields = {
|
|
|
948
1036
|
descriptions: "descriptions",
|
|
949
1037
|
synonyms: "synonyms",
|
|
950
1038
|
packages: "packages",
|
|
1039
|
+
hasInformationUnits: "hasInformationUnits",
|
|
951
1040
|
links: "links"
|
|
952
1041
|
};
|
|
953
1042
|
var SupplyConsumableModelFieldsAll = Object.values(SupplyConsumableModelFields);
|
|
@@ -961,6 +1050,7 @@ var SupplyHardwareToolModelFields = {
|
|
|
961
1050
|
descriptions: "descriptions",
|
|
962
1051
|
synonyms: "synonyms",
|
|
963
1052
|
packages: "packages",
|
|
1053
|
+
hasInformationUnits: "hasInformationUnits",
|
|
964
1054
|
links: "links"
|
|
965
1055
|
};
|
|
966
1056
|
var SupplyHardwareToolModelFieldsAll = Object.values(SupplyHardwareToolModelFields);
|
|
@@ -974,6 +1064,7 @@ var SupplyLubricantModelFields = {
|
|
|
974
1064
|
descriptions: "descriptions",
|
|
975
1065
|
synonyms: "synonyms",
|
|
976
1066
|
packages: "packages",
|
|
1067
|
+
hasInformationUnits: "hasInformationUnits",
|
|
977
1068
|
links: "links"
|
|
978
1069
|
};
|
|
979
1070
|
var SupplyLubricantModelFieldsAll = Object.values(SupplyLubricantModelFields);
|
|
@@ -987,6 +1078,7 @@ var SupplyModelFields = {
|
|
|
987
1078
|
descriptions: "descriptions",
|
|
988
1079
|
synonyms: "synonyms",
|
|
989
1080
|
packages: "packages",
|
|
1081
|
+
hasInformationUnits: "hasInformationUnits",
|
|
990
1082
|
links: "links"
|
|
991
1083
|
};
|
|
992
1084
|
var SupplyModelFieldsAll = Object.values(SupplyModelFields);
|
|
@@ -1000,6 +1092,7 @@ var SupplyOperatingModelFields = {
|
|
|
1000
1092
|
descriptions: "descriptions",
|
|
1001
1093
|
synonyms: "synonyms",
|
|
1002
1094
|
packages: "packages",
|
|
1095
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1003
1096
|
links: "links"
|
|
1004
1097
|
};
|
|
1005
1098
|
var SupplyOperatingModelFieldsAll = Object.values(SupplyOperatingModelFields);
|
|
@@ -1013,6 +1106,7 @@ var SupplySparePartModelFields = {
|
|
|
1013
1106
|
descriptions: "descriptions",
|
|
1014
1107
|
synonyms: "synonyms",
|
|
1015
1108
|
packages: "packages",
|
|
1109
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1016
1110
|
links: "links"
|
|
1017
1111
|
};
|
|
1018
1112
|
var SupplySparePartModelFieldsAll = Object.values(SupplySparePartModelFields);
|
|
@@ -1026,6 +1120,7 @@ var TopicModelFields = {
|
|
|
1026
1120
|
descriptions: "descriptions",
|
|
1027
1121
|
synonyms: "synonyms",
|
|
1028
1122
|
packages: "packages",
|
|
1123
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1029
1124
|
links: "links",
|
|
1030
1125
|
revision: "revision",
|
|
1031
1126
|
created: "created",
|
|
@@ -1067,6 +1162,7 @@ var TopicTypeConceptModelFields = {
|
|
|
1067
1162
|
descriptions: "descriptions",
|
|
1068
1163
|
synonyms: "synonyms",
|
|
1069
1164
|
packages: "packages",
|
|
1165
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1070
1166
|
links: "links"
|
|
1071
1167
|
};
|
|
1072
1168
|
var TopicTypeConceptModelFieldsAll = Object.values(TopicTypeConceptModelFields);
|
|
@@ -1080,6 +1176,7 @@ var TopicTypeFormModelFields = {
|
|
|
1080
1176
|
descriptions: "descriptions",
|
|
1081
1177
|
synonyms: "synonyms",
|
|
1082
1178
|
packages: "packages",
|
|
1179
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1083
1180
|
links: "links"
|
|
1084
1181
|
};
|
|
1085
1182
|
var TopicTypeFormModelFieldsAll = Object.values(TopicTypeFormModelFields);
|
|
@@ -1093,6 +1190,7 @@ var TopicTypeLearningModelFields = {
|
|
|
1093
1190
|
descriptions: "descriptions",
|
|
1094
1191
|
synonyms: "synonyms",
|
|
1095
1192
|
packages: "packages",
|
|
1193
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1096
1194
|
links: "links"
|
|
1097
1195
|
};
|
|
1098
1196
|
var TopicTypeLearningModelFieldsAll = Object.values(TopicTypeLearningModelFields);
|
|
@@ -1106,6 +1204,7 @@ var TopicTypeModelFields = {
|
|
|
1106
1204
|
descriptions: "descriptions",
|
|
1107
1205
|
synonyms: "synonyms",
|
|
1108
1206
|
packages: "packages",
|
|
1207
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1109
1208
|
links: "links"
|
|
1110
1209
|
};
|
|
1111
1210
|
var TopicTypeModelFieldsAll = Object.values(TopicTypeModelFields);
|
|
@@ -1119,6 +1218,7 @@ var TopicTypeReferenceModelFields = {
|
|
|
1119
1218
|
descriptions: "descriptions",
|
|
1120
1219
|
synonyms: "synonyms",
|
|
1121
1220
|
packages: "packages",
|
|
1221
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1122
1222
|
links: "links"
|
|
1123
1223
|
};
|
|
1124
1224
|
var TopicTypeReferenceModelFieldsAll = Object.values(TopicTypeReferenceModelFields);
|
|
@@ -1132,6 +1232,7 @@ var TopicTypeTaskModelFields = {
|
|
|
1132
1232
|
descriptions: "descriptions",
|
|
1133
1233
|
synonyms: "synonyms",
|
|
1134
1234
|
packages: "packages",
|
|
1235
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1135
1236
|
links: "links"
|
|
1136
1237
|
};
|
|
1137
1238
|
var TopicTypeTaskModelFieldsAll = Object.values(TopicTypeTaskModelFields);
|
|
@@ -1145,6 +1246,7 @@ var TopicTypeTroubleShootingModelFields = {
|
|
|
1145
1246
|
descriptions: "descriptions",
|
|
1146
1247
|
synonyms: "synonyms",
|
|
1147
1248
|
packages: "packages",
|
|
1249
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1148
1250
|
links: "links"
|
|
1149
1251
|
};
|
|
1150
1252
|
var TopicTypeTroubleShootingModelFieldsAll = Object.values(TopicTypeTroubleShootingModelFields);
|
|
@@ -1158,6 +1260,7 @@ var VCardCalendarModelFields = {
|
|
|
1158
1260
|
descriptions: "descriptions",
|
|
1159
1261
|
synonyms: "synonyms",
|
|
1160
1262
|
packages: "packages",
|
|
1263
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1161
1264
|
source: "source"
|
|
1162
1265
|
};
|
|
1163
1266
|
var VCardCalendarModelFieldsAll = Object.values(VCardCalendarModelFields);
|
|
@@ -1171,6 +1274,7 @@ var VCardGroupModelFields = {
|
|
|
1171
1274
|
descriptions: "descriptions",
|
|
1172
1275
|
synonyms: "synonyms",
|
|
1173
1276
|
packages: "packages",
|
|
1277
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1174
1278
|
links: "links",
|
|
1175
1279
|
fullName: "fullName",
|
|
1176
1280
|
photos: "photos",
|
|
@@ -1192,6 +1296,7 @@ var VCardImageModelFields = {
|
|
|
1192
1296
|
descriptions: "descriptions",
|
|
1193
1297
|
synonyms: "synonyms",
|
|
1194
1298
|
packages: "packages",
|
|
1299
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1195
1300
|
classes: "classes",
|
|
1196
1301
|
value: "value",
|
|
1197
1302
|
source: "source"
|
|
@@ -1207,6 +1312,7 @@ var VCardIndividualModelFields = {
|
|
|
1207
1312
|
descriptions: "descriptions",
|
|
1208
1313
|
synonyms: "synonyms",
|
|
1209
1314
|
packages: "packages",
|
|
1315
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1210
1316
|
links: "links",
|
|
1211
1317
|
fullName: "fullName",
|
|
1212
1318
|
photos: "photos",
|
|
@@ -1225,6 +1331,7 @@ var VCardInfoModelFields = {
|
|
|
1225
1331
|
shortId: "shortId",
|
|
1226
1332
|
score: "score",
|
|
1227
1333
|
classes: "classes",
|
|
1334
|
+
types: "types",
|
|
1228
1335
|
value: "value",
|
|
1229
1336
|
countryName: "countryName",
|
|
1230
1337
|
locality: "locality",
|
|
@@ -1242,6 +1349,7 @@ var VCardLocationModelFields = {
|
|
|
1242
1349
|
descriptions: "descriptions",
|
|
1243
1350
|
synonyms: "synonyms",
|
|
1244
1351
|
packages: "packages",
|
|
1352
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1245
1353
|
links: "links",
|
|
1246
1354
|
fullName: "fullName",
|
|
1247
1355
|
photos: "photos",
|
|
@@ -1263,6 +1371,7 @@ var VCardModelFields = {
|
|
|
1263
1371
|
descriptions: "descriptions",
|
|
1264
1372
|
synonyms: "synonyms",
|
|
1265
1373
|
packages: "packages",
|
|
1374
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1266
1375
|
links: "links",
|
|
1267
1376
|
fullName: "fullName",
|
|
1268
1377
|
photos: "photos",
|
|
@@ -1283,6 +1392,7 @@ var VCardOrganizationModelFields = {
|
|
|
1283
1392
|
descriptions: "descriptions",
|
|
1284
1393
|
synonyms: "synonyms",
|
|
1285
1394
|
packages: "packages",
|
|
1395
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1286
1396
|
links: "links",
|
|
1287
1397
|
fullName: "fullName",
|
|
1288
1398
|
photos: "photos",
|
|
@@ -1326,14 +1436,33 @@ var formatDateToLocale = (date, locale) => {
|
|
|
1326
1436
|
year: "numeric"
|
|
1327
1437
|
}).format(dateAux);
|
|
1328
1438
|
};
|
|
1329
|
-
var createAvailableVersionList = (versions,
|
|
1330
|
-
const
|
|
1439
|
+
var createAvailableVersionList = (versions, linkPattern, activeShortId) => {
|
|
1440
|
+
const uniqueByShortId = /* @__PURE__ */ new Map();
|
|
1441
|
+
versions.forEach((item) => {
|
|
1442
|
+
const shortId = item.shortId;
|
|
1443
|
+
const lang = item.languages?.[0];
|
|
1444
|
+
if (!shortId || !lang) return;
|
|
1445
|
+
const active = shortId === activeShortId;
|
|
1446
|
+
if (uniqueByShortId.has(shortId)) {
|
|
1447
|
+
const current = uniqueByShortId.get(shortId);
|
|
1448
|
+
if (active) current.active = true;
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
uniqueByShortId.set(shortId, {
|
|
1452
|
+
shortId,
|
|
1453
|
+
active,
|
|
1454
|
+
lang,
|
|
1455
|
+
country: lang.split("-")[1],
|
|
1456
|
+
link: linkPattern.replace("{shortId}", shortId)
|
|
1457
|
+
});
|
|
1458
|
+
});
|
|
1459
|
+
const availableVersions = Array.from(uniqueByShortId.values()).map((item) => {
|
|
1331
1460
|
return {
|
|
1332
1461
|
shortId: item.shortId,
|
|
1333
|
-
active: item.
|
|
1334
|
-
lang: item.
|
|
1335
|
-
country: item.
|
|
1336
|
-
link:
|
|
1462
|
+
active: item.active,
|
|
1463
|
+
lang: item.lang,
|
|
1464
|
+
country: item.country,
|
|
1465
|
+
link: item.link
|
|
1337
1466
|
};
|
|
1338
1467
|
}).sort((a, b) => {
|
|
1339
1468
|
if (a.lang < b.lang) return -1;
|
|
@@ -1352,7 +1481,7 @@ var replacePathParams = (endpointTemplate, pathParams) => {
|
|
|
1352
1481
|
}
|
|
1353
1482
|
return endpoint;
|
|
1354
1483
|
};
|
|
1355
|
-
var processDataToLabelValuePairs = (data, excludeKeys = ["shortId", "id", "labels"]) => {
|
|
1484
|
+
var processDataToLabelValuePairs = (data, excludeKeys = ["shortId", "id", "labels", "score"]) => {
|
|
1356
1485
|
const result = [];
|
|
1357
1486
|
Object.entries(data).forEach(([key, value]) => {
|
|
1358
1487
|
if (excludeKeys.includes(key) || value === null || value === void 0) {
|
|
@@ -1475,20 +1604,49 @@ var call = async (method, params) => {
|
|
|
1475
1604
|
};
|
|
1476
1605
|
|
|
1477
1606
|
// src/language.ts
|
|
1607
|
+
var normalizeLanguageCode = (value) => {
|
|
1608
|
+
const trimmed = value.trim();
|
|
1609
|
+
if (!trimmed) return trimmed;
|
|
1610
|
+
const [rawLang, rawCountry, ...rest] = trimmed.split("-");
|
|
1611
|
+
const lang = (rawLang || "").toLowerCase();
|
|
1612
|
+
if (!rawCountry) return lang;
|
|
1613
|
+
const country = rawCountry.toUpperCase();
|
|
1614
|
+
const suffix = rest.length > 0 ? `-${rest.join("-")}` : "";
|
|
1615
|
+
return `${lang}-${country}${suffix}`;
|
|
1616
|
+
};
|
|
1617
|
+
var sortAndDeduplicateLanguages = (languages) => {
|
|
1618
|
+
const normalized = languages.map((item) => (item || "").trim()).filter((item) => item.length > 0).map((item) => normalizeLanguageCode(item));
|
|
1619
|
+
return Array.from(new Set(normalized)).sort((a, b) => a.localeCompare(b));
|
|
1620
|
+
};
|
|
1621
|
+
var resolvePreferredLanguage = (languages, uiLanguage) => {
|
|
1622
|
+
if (!languages || languages.length === 0) return void 0;
|
|
1623
|
+
const normalizedUiLanguage = normalizeLanguageCode(uiLanguage);
|
|
1624
|
+
const baseLanguage = normalizedUiLanguage.split("-")[0];
|
|
1625
|
+
const normalized = sortAndDeduplicateLanguages(languages);
|
|
1626
|
+
const exact = normalized.find((item) => item === normalizedUiLanguage);
|
|
1627
|
+
if (exact) return exact;
|
|
1628
|
+
const base = normalized.find((item) => item === baseLanguage || item.startsWith(`${baseLanguage}-`));
|
|
1629
|
+
if (base) return base;
|
|
1630
|
+
const english = normalized.find((item) => item === "en" || item === "en-US" || item.startsWith("en-"));
|
|
1631
|
+
if (english) return english;
|
|
1632
|
+
return normalized[0];
|
|
1633
|
+
};
|
|
1634
|
+
var extractCountryCodeFromLanguage = (language) => {
|
|
1635
|
+
const normalizedLanguage = normalizeLanguageCode(language);
|
|
1636
|
+
const [lang, country] = normalizedLanguage.split("-");
|
|
1637
|
+
if (country) return country;
|
|
1638
|
+
return getCountryCodeByLang(lang || language);
|
|
1639
|
+
};
|
|
1478
1640
|
var transformLanguageData = (data) => {
|
|
1479
1641
|
const countryCodeList = data.map((item) => {
|
|
1480
|
-
const
|
|
1642
|
+
const normalizedValue = normalizeLanguageCode(item.value);
|
|
1643
|
+
const splittedValue = normalizedValue.split("-");
|
|
1481
1644
|
const lang = splittedValue[0];
|
|
1482
|
-
|
|
1483
|
-
if (splittedValue.length > 1) {
|
|
1484
|
-
country = splittedValue[1];
|
|
1485
|
-
} else {
|
|
1486
|
-
country = getCountryCodeByLang(lang);
|
|
1487
|
-
}
|
|
1645
|
+
const country = extractCountryCodeFromLanguage(normalizedValue);
|
|
1488
1646
|
return {
|
|
1489
1647
|
country,
|
|
1490
1648
|
lang,
|
|
1491
|
-
value:
|
|
1649
|
+
value: normalizedValue
|
|
1492
1650
|
};
|
|
1493
1651
|
});
|
|
1494
1652
|
return countryCodeList.sort((a, b) => {
|
|
@@ -1496,7 +1654,7 @@ var transformLanguageData = (data) => {
|
|
|
1496
1654
|
});
|
|
1497
1655
|
};
|
|
1498
1656
|
|
|
1499
|
-
// src/
|
|
1657
|
+
// src/metadata.ts
|
|
1500
1658
|
var isDate = (value) => {
|
|
1501
1659
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(value);
|
|
1502
1660
|
};
|
|
@@ -1505,50 +1663,83 @@ var isLanguage = (label) => {
|
|
|
1505
1663
|
};
|
|
1506
1664
|
var filteredItems = (items) => {
|
|
1507
1665
|
const hasTitle = items.some((item) => item.label === "titles");
|
|
1508
|
-
return items.filter((item) => hasTitle ?
|
|
1666
|
+
return items.filter((item) => hasTitle ? item.label !== "labels" : true);
|
|
1509
1667
|
};
|
|
1510
1668
|
var getType = (classObj) => {
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
1669
|
+
const type = classObj?.labels?.find((item) => item.language === EN_LANG)?.value?.toUpperCase();
|
|
1670
|
+
return type;
|
|
1513
1671
|
};
|
|
1514
1672
|
var getTitle = (titles, labels) => {
|
|
1515
|
-
let title = "NO TITLE";
|
|
1516
1673
|
if (titles) {
|
|
1517
|
-
|
|
1518
|
-
} else if (labels) {
|
|
1519
|
-
title = labels[0]?.value;
|
|
1674
|
+
return titles[0]?.value;
|
|
1520
1675
|
}
|
|
1521
|
-
|
|
1676
|
+
if (labels) {
|
|
1677
|
+
return labels[0]?.value;
|
|
1678
|
+
}
|
|
1679
|
+
return "NO TITLE";
|
|
1522
1680
|
};
|
|
1523
1681
|
var getLabelByLang = (labels, lang = EN_LANG) => {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
const label = labels.find((item) => item.language === lang);
|
|
1527
|
-
if (label) {
|
|
1528
|
-
title = label.value;
|
|
1529
|
-
} else {
|
|
1530
|
-
const defaultLabel = labels.find((item) => item.language === EN_LANG);
|
|
1531
|
-
if (defaultLabel) {
|
|
1532
|
-
title = defaultLabel.value;
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1682
|
+
if (!labels) {
|
|
1683
|
+
return "NO TITLE";
|
|
1535
1684
|
}
|
|
1536
|
-
|
|
1685
|
+
const preferred = labels.find((item) => item.language === lang);
|
|
1686
|
+
if (preferred) {
|
|
1687
|
+
return preferred.value;
|
|
1688
|
+
}
|
|
1689
|
+
const fallback = labels.find((item) => item.language === EN_LANG);
|
|
1690
|
+
if (fallback) {
|
|
1691
|
+
return fallback.value;
|
|
1692
|
+
}
|
|
1693
|
+
return "NO TITLE";
|
|
1537
1694
|
};
|
|
1538
1695
|
var getLanguage = (languages) => {
|
|
1539
|
-
let language = "NO LANGUAGE";
|
|
1540
1696
|
if (languages && languages.length > 0) {
|
|
1541
|
-
|
|
1697
|
+
return languages[0];
|
|
1542
1698
|
}
|
|
1543
|
-
return
|
|
1699
|
+
return "NO LANGUAGE";
|
|
1544
1700
|
};
|
|
1545
1701
|
var getVersions = (versionOf) => {
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1702
|
+
if (!versionOf?.labels) return [];
|
|
1703
|
+
return sortAndDeduplicateLanguages(versionOf.labels.map((item) => item.language));
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
// src/html-content.ts
|
|
1707
|
+
var cheerio = __toESM(require("cheerio"));
|
|
1708
|
+
var parseHtmlContent = (html) => {
|
|
1709
|
+
const $ = cheerio.load(html);
|
|
1710
|
+
const metaTags = $("meta").map((_, el) => {
|
|
1711
|
+
const name = $(el).attr("name");
|
|
1712
|
+
const content = $(el).attr("content");
|
|
1713
|
+
return name && content ? { name, content } : null;
|
|
1714
|
+
}).get().filter((tag) => tag !== null);
|
|
1715
|
+
const articleHtml = $("main").html() || "";
|
|
1716
|
+
return {
|
|
1717
|
+
articleHtml,
|
|
1718
|
+
metaTags
|
|
1719
|
+
};
|
|
1720
|
+
};
|
|
1721
|
+
var getHtmlRenditionViewUrl = (renditions, htmlFormats = ["application/xhtml+xml", "application/html", "text/html"]) => {
|
|
1722
|
+
if (!renditions || renditions.length === 0) return void 0;
|
|
1723
|
+
const htmlRendition = renditions.find((rendition) => {
|
|
1724
|
+
return !!rendition.format && htmlFormats.includes(rendition.format);
|
|
1725
|
+
});
|
|
1726
|
+
const href = htmlRendition?.links?.find((link) => link.rel === "view")?.href;
|
|
1727
|
+
return href ?? void 0;
|
|
1728
|
+
};
|
|
1729
|
+
var metaTagsToMetadata = (metaTags) => {
|
|
1730
|
+
const description = metaTags.find((metaTag) => metaTag.name === "description")?.content;
|
|
1731
|
+
const keywordsRaw = metaTags.find((metaTag) => metaTag.name === "keywords")?.content;
|
|
1732
|
+
const other = {};
|
|
1733
|
+
metaTags.forEach((metaTag) => {
|
|
1734
|
+
if (metaTag.name !== "description" && metaTag.name !== "keywords") {
|
|
1735
|
+
other[metaTag.name] = metaTag.content;
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
return {
|
|
1739
|
+
description,
|
|
1740
|
+
keywords: keywordsRaw ? keywordsRaw.split(",").map((item) => item.trim()).filter(Boolean) : void 0,
|
|
1741
|
+
other: Object.keys(other).length > 0 ? other : void 0
|
|
1742
|
+
};
|
|
1552
1743
|
};
|
|
1553
1744
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1554
1745
|
0 && (module.exports = {
|
|
@@ -1556,12 +1747,14 @@ var getVersions = (versionOf) => {
|
|
|
1556
1747
|
cn,
|
|
1557
1748
|
createAvailableVersionList,
|
|
1558
1749
|
createParams,
|
|
1750
|
+
extractCountryCodeFromLanguage,
|
|
1559
1751
|
filteredItems,
|
|
1560
1752
|
formatDateToLocale,
|
|
1561
1753
|
generateBreadcrumbItems,
|
|
1562
1754
|
generateQueryParams,
|
|
1563
1755
|
getCountryCodeByLang,
|
|
1564
1756
|
getFileRenditions,
|
|
1757
|
+
getHtmlRenditionViewUrl,
|
|
1565
1758
|
getLabelByLang,
|
|
1566
1759
|
getLanguage,
|
|
1567
1760
|
getTitle,
|
|
@@ -1569,8 +1762,13 @@ var getVersions = (versionOf) => {
|
|
|
1569
1762
|
getVersions,
|
|
1570
1763
|
isDate,
|
|
1571
1764
|
isLanguage,
|
|
1765
|
+
metaTagsToMetadata,
|
|
1766
|
+
normalizeLanguageCode,
|
|
1767
|
+
parseHtmlContent,
|
|
1572
1768
|
processDataToLabelValuePairs,
|
|
1573
1769
|
replacePathParams,
|
|
1770
|
+
resolvePreferredLanguage,
|
|
1771
|
+
sortAndDeduplicateLanguages,
|
|
1574
1772
|
transformLanguageData
|
|
1575
1773
|
});
|
|
1576
1774
|
//# sourceMappingURL=index.js.map
|