@c-rex/utils 0.1.20 → 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 +192 -1
- package/dist/directoryNodes.d.ts +192 -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 +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +251 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +233 -36
- 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,20 +34,28 @@ __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,
|
|
45
|
+
getLabelByLang: () => getLabelByLang,
|
|
33
46
|
getLanguage: () => getLanguage,
|
|
34
47
|
getTitle: () => getTitle,
|
|
35
48
|
getType: () => getType,
|
|
36
49
|
getVersions: () => getVersions,
|
|
37
50
|
isDate: () => isDate,
|
|
38
51
|
isLanguage: () => isLanguage,
|
|
52
|
+
metaTagsToMetadata: () => metaTagsToMetadata,
|
|
53
|
+
normalizeLanguageCode: () => normalizeLanguageCode,
|
|
54
|
+
parseHtmlContent: () => parseHtmlContent,
|
|
39
55
|
processDataToLabelValuePairs: () => processDataToLabelValuePairs,
|
|
40
56
|
replacePathParams: () => replacePathParams,
|
|
57
|
+
resolvePreferredLanguage: () => resolvePreferredLanguage,
|
|
58
|
+
sortAndDeduplicateLanguages: () => sortAndDeduplicateLanguages,
|
|
41
59
|
transformLanguageData: () => transformLanguageData
|
|
42
60
|
});
|
|
43
61
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -53,6 +71,7 @@ var AdministrativeMetadataModelFields = {
|
|
|
53
71
|
descriptions: "descriptions",
|
|
54
72
|
synonyms: "synonyms",
|
|
55
73
|
packages: "packages",
|
|
74
|
+
hasInformationUnits: "hasInformationUnits",
|
|
56
75
|
links: "links"
|
|
57
76
|
};
|
|
58
77
|
var AdministrativeMetadataModelFieldsAll = Object.values(AdministrativeMetadataModelFields);
|
|
@@ -67,6 +86,24 @@ var AuthStateModelFields = {
|
|
|
67
86
|
roles: "roles"
|
|
68
87
|
};
|
|
69
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);
|
|
70
107
|
var ComponentModelFields = {
|
|
71
108
|
id: "id",
|
|
72
109
|
shortId: "shortId",
|
|
@@ -77,6 +114,7 @@ var ComponentModelFields = {
|
|
|
77
114
|
descriptions: "descriptions",
|
|
78
115
|
synonyms: "synonyms",
|
|
79
116
|
packages: "packages",
|
|
117
|
+
hasInformationUnits: "hasInformationUnits",
|
|
80
118
|
links: "links",
|
|
81
119
|
productGraphic: "productGraphic",
|
|
82
120
|
titles: "titles",
|
|
@@ -100,6 +138,7 @@ var ContentLifeCycleStatusModelFields = {
|
|
|
100
138
|
descriptions: "descriptions",
|
|
101
139
|
synonyms: "synonyms",
|
|
102
140
|
packages: "packages",
|
|
141
|
+
hasInformationUnits: "hasInformationUnits",
|
|
103
142
|
links: "links",
|
|
104
143
|
dateOfEffect: "dateOfEffect",
|
|
105
144
|
dateOfExpiry: "dateOfExpiry",
|
|
@@ -119,6 +158,7 @@ var ContentLifeCycleStatusValueModelFields = {
|
|
|
119
158
|
descriptions: "descriptions",
|
|
120
159
|
synonyms: "synonyms",
|
|
121
160
|
packages: "packages",
|
|
161
|
+
hasInformationUnits: "hasInformationUnits",
|
|
122
162
|
links: "links"
|
|
123
163
|
};
|
|
124
164
|
var ContentLifeCycleStatusValueModelFieldsAll = Object.values(ContentLifeCycleStatusValueModelFields);
|
|
@@ -132,6 +172,7 @@ var DirectoryNodeModelFields = {
|
|
|
132
172
|
descriptions: "descriptions",
|
|
133
173
|
synonyms: "synonyms",
|
|
134
174
|
packages: "packages",
|
|
175
|
+
hasInformationUnits: "hasInformationUnits",
|
|
135
176
|
links: "links",
|
|
136
177
|
structureType: "structureType",
|
|
137
178
|
parents: "parents",
|
|
@@ -151,6 +192,7 @@ var DirectoryNodeTypeModelFields = {
|
|
|
151
192
|
descriptions: "descriptions",
|
|
152
193
|
synonyms: "synonyms",
|
|
153
194
|
packages: "packages",
|
|
195
|
+
hasInformationUnits: "hasInformationUnits",
|
|
154
196
|
links: "links"
|
|
155
197
|
};
|
|
156
198
|
var DirectoryNodeTypeModelFieldsAll = Object.values(DirectoryNodeTypeModelFields);
|
|
@@ -164,6 +206,7 @@ var DocumentModelFields = {
|
|
|
164
206
|
descriptions: "descriptions",
|
|
165
207
|
synonyms: "synonyms",
|
|
166
208
|
packages: "packages",
|
|
209
|
+
hasInformationUnits: "hasInformationUnits",
|
|
167
210
|
links: "links",
|
|
168
211
|
revision: "revision",
|
|
169
212
|
created: "created",
|
|
@@ -205,6 +248,7 @@ var DocumentTypeModelFields = {
|
|
|
205
248
|
descriptions: "descriptions",
|
|
206
249
|
synonyms: "synonyms",
|
|
207
250
|
packages: "packages",
|
|
251
|
+
hasInformationUnits: "hasInformationUnits",
|
|
208
252
|
links: "links"
|
|
209
253
|
};
|
|
210
254
|
var DocumentTypeModelFieldsAll = Object.values(DocumentTypeModelFields);
|
|
@@ -218,6 +262,7 @@ var DocumentationMetadataModelFields = {
|
|
|
218
262
|
descriptions: "descriptions",
|
|
219
263
|
synonyms: "synonyms",
|
|
220
264
|
packages: "packages",
|
|
265
|
+
hasInformationUnits: "hasInformationUnits",
|
|
221
266
|
links: "links"
|
|
222
267
|
};
|
|
223
268
|
var DocumentationMetadataModelFieldsAll = Object.values(DocumentationMetadataModelFields);
|
|
@@ -230,7 +275,8 @@ var DomainEntityModelFields = {
|
|
|
230
275
|
comments: "comments",
|
|
231
276
|
descriptions: "descriptions",
|
|
232
277
|
synonyms: "synonyms",
|
|
233
|
-
packages: "packages"
|
|
278
|
+
packages: "packages",
|
|
279
|
+
hasInformationUnits: "hasInformationUnits"
|
|
234
280
|
};
|
|
235
281
|
var DomainEntityModelFieldsAll = Object.values(DomainEntityModelFields);
|
|
236
282
|
var EventModelFields = {
|
|
@@ -243,6 +289,7 @@ var EventModelFields = {
|
|
|
243
289
|
descriptions: "descriptions",
|
|
244
290
|
synonyms: "synonyms",
|
|
245
291
|
packages: "packages",
|
|
292
|
+
hasInformationUnits: "hasInformationUnits",
|
|
246
293
|
links: "links",
|
|
247
294
|
eventCode: "eventCode",
|
|
248
295
|
eventType: "eventType"
|
|
@@ -258,6 +305,7 @@ var ExternalProductGraphicModelFields = {
|
|
|
258
305
|
descriptions: "descriptions",
|
|
259
306
|
synonyms: "synonyms",
|
|
260
307
|
packages: "packages",
|
|
308
|
+
hasInformationUnits: "hasInformationUnits",
|
|
261
309
|
links: "links",
|
|
262
310
|
revision: "revision",
|
|
263
311
|
created: "created",
|
|
@@ -310,6 +358,7 @@ var FragmentModelFields = {
|
|
|
310
358
|
descriptions: "descriptions",
|
|
311
359
|
synonyms: "synonyms",
|
|
312
360
|
packages: "packages",
|
|
361
|
+
hasInformationUnits: "hasInformationUnits",
|
|
313
362
|
links: "links",
|
|
314
363
|
revision: "revision",
|
|
315
364
|
created: "created",
|
|
@@ -351,6 +400,7 @@ var FunctionalMetadataModelFields = {
|
|
|
351
400
|
descriptions: "descriptions",
|
|
352
401
|
synonyms: "synonyms",
|
|
353
402
|
packages: "packages",
|
|
403
|
+
hasInformationUnits: "hasInformationUnits",
|
|
354
404
|
links: "links"
|
|
355
405
|
};
|
|
356
406
|
var FunctionalMetadataModelFieldsAll = Object.values(FunctionalMetadataModelFields);
|
|
@@ -364,6 +414,7 @@ var IdentityDomainModelFields = {
|
|
|
364
414
|
descriptions: "descriptions",
|
|
365
415
|
synonyms: "synonyms",
|
|
366
416
|
packages: "packages",
|
|
417
|
+
hasInformationUnits: "hasInformationUnits",
|
|
367
418
|
links: "links",
|
|
368
419
|
parties: "parties"
|
|
369
420
|
};
|
|
@@ -378,6 +429,7 @@ var IdentityModelFields = {
|
|
|
378
429
|
descriptions: "descriptions",
|
|
379
430
|
synonyms: "synonyms",
|
|
380
431
|
packages: "packages",
|
|
432
|
+
hasInformationUnits: "hasInformationUnits",
|
|
381
433
|
links: "links",
|
|
382
434
|
identifier: "identifier",
|
|
383
435
|
identityDomain: "identityDomain"
|
|
@@ -393,6 +445,7 @@ var InformationObjectModelFields = {
|
|
|
393
445
|
descriptions: "descriptions",
|
|
394
446
|
synonyms: "synonyms",
|
|
395
447
|
packages: "packages",
|
|
448
|
+
hasInformationUnits: "hasInformationUnits",
|
|
396
449
|
links: "links",
|
|
397
450
|
identities: "identities"
|
|
398
451
|
};
|
|
@@ -407,6 +460,7 @@ var InformationSubjectCollectionModelFields = {
|
|
|
407
460
|
descriptions: "descriptions",
|
|
408
461
|
synonyms: "synonyms",
|
|
409
462
|
packages: "packages",
|
|
463
|
+
hasInformationUnits: "hasInformationUnits",
|
|
410
464
|
links: "links"
|
|
411
465
|
};
|
|
412
466
|
var InformationSubjectCollectionModelFieldsAll = Object.values(InformationSubjectCollectionModelFields);
|
|
@@ -420,6 +474,7 @@ var InformationSubjectConformityModelFields = {
|
|
|
420
474
|
descriptions: "descriptions",
|
|
421
475
|
synonyms: "synonyms",
|
|
422
476
|
packages: "packages",
|
|
477
|
+
hasInformationUnits: "hasInformationUnits",
|
|
423
478
|
links: "links"
|
|
424
479
|
};
|
|
425
480
|
var InformationSubjectConformityModelFieldsAll = Object.values(InformationSubjectConformityModelFields);
|
|
@@ -433,6 +488,7 @@ var InformationSubjectFormalityModelFields = {
|
|
|
433
488
|
descriptions: "descriptions",
|
|
434
489
|
synonyms: "synonyms",
|
|
435
490
|
packages: "packages",
|
|
491
|
+
hasInformationUnits: "hasInformationUnits",
|
|
436
492
|
links: "links"
|
|
437
493
|
};
|
|
438
494
|
var InformationSubjectFormalityModelFieldsAll = Object.values(InformationSubjectFormalityModelFields);
|
|
@@ -446,6 +502,7 @@ var InformationSubjectFunctionalityModelFields = {
|
|
|
446
502
|
descriptions: "descriptions",
|
|
447
503
|
synonyms: "synonyms",
|
|
448
504
|
packages: "packages",
|
|
505
|
+
hasInformationUnits: "hasInformationUnits",
|
|
449
506
|
links: "links"
|
|
450
507
|
};
|
|
451
508
|
var InformationSubjectFunctionalityModelFieldsAll = Object.values(InformationSubjectFunctionalityModelFields);
|
|
@@ -459,6 +516,7 @@ var InformationSubjectModelFields = {
|
|
|
459
516
|
descriptions: "descriptions",
|
|
460
517
|
synonyms: "synonyms",
|
|
461
518
|
packages: "packages",
|
|
519
|
+
hasInformationUnits: "hasInformationUnits",
|
|
462
520
|
links: "links"
|
|
463
521
|
};
|
|
464
522
|
var InformationSubjectModelFieldsAll = Object.values(InformationSubjectModelFields);
|
|
@@ -472,6 +530,7 @@ var InformationSubjectProcessModelFields = {
|
|
|
472
530
|
descriptions: "descriptions",
|
|
473
531
|
synonyms: "synonyms",
|
|
474
532
|
packages: "packages",
|
|
533
|
+
hasInformationUnits: "hasInformationUnits",
|
|
475
534
|
links: "links"
|
|
476
535
|
};
|
|
477
536
|
var InformationSubjectProcessModelFieldsAll = Object.values(InformationSubjectProcessModelFields);
|
|
@@ -485,6 +544,7 @@ var InformationSubjectSafetyModelFields = {
|
|
|
485
544
|
descriptions: "descriptions",
|
|
486
545
|
synonyms: "synonyms",
|
|
487
546
|
packages: "packages",
|
|
547
|
+
hasInformationUnits: "hasInformationUnits",
|
|
488
548
|
links: "links"
|
|
489
549
|
};
|
|
490
550
|
var InformationSubjectSafetyModelFieldsAll = Object.values(InformationSubjectSafetyModelFields);
|
|
@@ -498,6 +558,7 @@ var InformationSubjectSafetyWarningMessageModelFields = {
|
|
|
498
558
|
descriptions: "descriptions",
|
|
499
559
|
synonyms: "synonyms",
|
|
500
560
|
packages: "packages",
|
|
561
|
+
hasInformationUnits: "hasInformationUnits",
|
|
501
562
|
links: "links"
|
|
502
563
|
};
|
|
503
564
|
var InformationSubjectSafetyWarningMessageModelFieldsAll = Object.values(InformationSubjectSafetyWarningMessageModelFields);
|
|
@@ -511,6 +572,7 @@ var InformationSubjectTechnicalDataModelFields = {
|
|
|
511
572
|
descriptions: "descriptions",
|
|
512
573
|
synonyms: "synonyms",
|
|
513
574
|
packages: "packages",
|
|
575
|
+
hasInformationUnits: "hasInformationUnits",
|
|
514
576
|
links: "links"
|
|
515
577
|
};
|
|
516
578
|
var InformationSubjectTechnicalDataModelFieldsAll = Object.values(InformationSubjectTechnicalDataModelFields);
|
|
@@ -524,6 +586,7 @@ var InformationSubjectTechnicalOverviewModelFields = {
|
|
|
524
586
|
descriptions: "descriptions",
|
|
525
587
|
synonyms: "synonyms",
|
|
526
588
|
packages: "packages",
|
|
589
|
+
hasInformationUnits: "hasInformationUnits",
|
|
527
590
|
links: "links"
|
|
528
591
|
};
|
|
529
592
|
var InformationSubjectTechnicalOverviewModelFieldsAll = Object.values(InformationSubjectTechnicalOverviewModelFields);
|
|
@@ -537,6 +600,7 @@ var InformationTypeModelFields = {
|
|
|
537
600
|
descriptions: "descriptions",
|
|
538
601
|
synonyms: "synonyms",
|
|
539
602
|
packages: "packages",
|
|
603
|
+
hasInformationUnits: "hasInformationUnits",
|
|
540
604
|
links: "links"
|
|
541
605
|
};
|
|
542
606
|
var InformationTypeModelFieldsAll = Object.values(InformationTypeModelFields);
|
|
@@ -550,6 +614,7 @@ var InformationUnitModelFields = {
|
|
|
550
614
|
descriptions: "descriptions",
|
|
551
615
|
synonyms: "synonyms",
|
|
552
616
|
packages: "packages",
|
|
617
|
+
hasInformationUnits: "hasInformationUnits",
|
|
553
618
|
links: "links",
|
|
554
619
|
revision: "revision",
|
|
555
620
|
created: "created",
|
|
@@ -590,7 +655,8 @@ var OwlClassModelFields = {
|
|
|
590
655
|
comments: "comments",
|
|
591
656
|
descriptions: "descriptions",
|
|
592
657
|
synonyms: "synonyms",
|
|
593
|
-
packages: "packages"
|
|
658
|
+
packages: "packages",
|
|
659
|
+
hasInformationUnits: "hasInformationUnits"
|
|
594
660
|
};
|
|
595
661
|
var OwlClassModelFieldsAll = Object.values(OwlClassModelFields);
|
|
596
662
|
var PackageModelFields = {
|
|
@@ -603,6 +669,7 @@ var PackageModelFields = {
|
|
|
603
669
|
descriptions: "descriptions",
|
|
604
670
|
synonyms: "synonyms",
|
|
605
671
|
packages: "packages",
|
|
672
|
+
hasInformationUnits: "hasInformationUnits",
|
|
606
673
|
links: "links",
|
|
607
674
|
revision: "revision",
|
|
608
675
|
created: "created",
|
|
@@ -647,6 +714,7 @@ var PartyModelFields = {
|
|
|
647
714
|
descriptions: "descriptions",
|
|
648
715
|
synonyms: "synonyms",
|
|
649
716
|
packages: "packages",
|
|
717
|
+
hasInformationUnits: "hasInformationUnits",
|
|
650
718
|
links: "links",
|
|
651
719
|
partyRole: "partyRole",
|
|
652
720
|
vcard: "vcard"
|
|
@@ -662,6 +730,7 @@ var PartyRoleModelFields = {
|
|
|
662
730
|
descriptions: "descriptions",
|
|
663
731
|
synonyms: "synonyms",
|
|
664
732
|
packages: "packages",
|
|
733
|
+
hasInformationUnits: "hasInformationUnits",
|
|
665
734
|
links: "links"
|
|
666
735
|
};
|
|
667
736
|
var PartyRoleModelFieldsAll = Object.values(PartyRoleModelFields);
|
|
@@ -675,6 +744,7 @@ var PlanningDownTimeModelFields = {
|
|
|
675
744
|
descriptions: "descriptions",
|
|
676
745
|
synonyms: "synonyms",
|
|
677
746
|
packages: "packages",
|
|
747
|
+
hasInformationUnits: "hasInformationUnits",
|
|
678
748
|
links: "links",
|
|
679
749
|
duration: "duration"
|
|
680
750
|
};
|
|
@@ -689,6 +759,7 @@ var PlanningMaintenanceIntervalModelFields = {
|
|
|
689
759
|
descriptions: "descriptions",
|
|
690
760
|
synonyms: "synonyms",
|
|
691
761
|
packages: "packages",
|
|
762
|
+
hasInformationUnits: "hasInformationUnits",
|
|
692
763
|
links: "links",
|
|
693
764
|
duration: "duration",
|
|
694
765
|
frequency: "frequency"
|
|
@@ -704,6 +775,7 @@ var PlanningSetupTimeModelFields = {
|
|
|
704
775
|
descriptions: "descriptions",
|
|
705
776
|
synonyms: "synonyms",
|
|
706
777
|
packages: "packages",
|
|
778
|
+
hasInformationUnits: "hasInformationUnits",
|
|
707
779
|
links: "links",
|
|
708
780
|
duration: "duration"
|
|
709
781
|
};
|
|
@@ -718,6 +790,7 @@ var PlanningTimeModelFields = {
|
|
|
718
790
|
descriptions: "descriptions",
|
|
719
791
|
synonyms: "synonyms",
|
|
720
792
|
packages: "packages",
|
|
793
|
+
hasInformationUnits: "hasInformationUnits",
|
|
721
794
|
links: "links",
|
|
722
795
|
duration: "duration"
|
|
723
796
|
};
|
|
@@ -732,6 +805,7 @@ var PlanningWorkingTimeModelFields = {
|
|
|
732
805
|
descriptions: "descriptions",
|
|
733
806
|
synonyms: "synonyms",
|
|
734
807
|
packages: "packages",
|
|
808
|
+
hasInformationUnits: "hasInformationUnits",
|
|
735
809
|
links: "links",
|
|
736
810
|
duration: "duration"
|
|
737
811
|
};
|
|
@@ -746,6 +820,7 @@ var ProductFeatureModelFields = {
|
|
|
746
820
|
descriptions: "descriptions",
|
|
747
821
|
synonyms: "synonyms",
|
|
748
822
|
packages: "packages",
|
|
823
|
+
hasInformationUnits: "hasInformationUnits",
|
|
749
824
|
links: "links"
|
|
750
825
|
};
|
|
751
826
|
var ProductFeatureModelFieldsAll = Object.values(ProductFeatureModelFields);
|
|
@@ -759,6 +834,7 @@ var ProductFunctionModelFields = {
|
|
|
759
834
|
descriptions: "descriptions",
|
|
760
835
|
synonyms: "synonyms",
|
|
761
836
|
packages: "packages",
|
|
837
|
+
hasInformationUnits: "hasInformationUnits",
|
|
762
838
|
links: "links"
|
|
763
839
|
};
|
|
764
840
|
var ProductFunctionModelFieldsAll = Object.values(ProductFunctionModelFields);
|
|
@@ -772,6 +848,7 @@ var ProductLcpAfterUseModelFields = {
|
|
|
772
848
|
descriptions: "descriptions",
|
|
773
849
|
synonyms: "synonyms",
|
|
774
850
|
packages: "packages",
|
|
851
|
+
hasInformationUnits: "hasInformationUnits",
|
|
775
852
|
links: "links"
|
|
776
853
|
};
|
|
777
854
|
var ProductLcpAfterUseModelFieldsAll = Object.values(ProductLcpAfterUseModelFields);
|
|
@@ -785,6 +862,7 @@ var ProductLcpDesignAndRealizationModelFields = {
|
|
|
785
862
|
descriptions: "descriptions",
|
|
786
863
|
synonyms: "synonyms",
|
|
787
864
|
packages: "packages",
|
|
865
|
+
hasInformationUnits: "hasInformationUnits",
|
|
788
866
|
links: "links"
|
|
789
867
|
};
|
|
790
868
|
var ProductLcpDesignAndRealizationModelFieldsAll = Object.values(ProductLcpDesignAndRealizationModelFields);
|
|
@@ -798,6 +876,7 @@ var ProductLcpPuttingToUseModelFields = {
|
|
|
798
876
|
descriptions: "descriptions",
|
|
799
877
|
synonyms: "synonyms",
|
|
800
878
|
packages: "packages",
|
|
879
|
+
hasInformationUnits: "hasInformationUnits",
|
|
801
880
|
links: "links"
|
|
802
881
|
};
|
|
803
882
|
var ProductLcpPuttingToUseModelFieldsAll = Object.values(ProductLcpPuttingToUseModelFields);
|
|
@@ -811,6 +890,7 @@ var ProductLcpUseModelFields = {
|
|
|
811
890
|
descriptions: "descriptions",
|
|
812
891
|
synonyms: "synonyms",
|
|
813
892
|
packages: "packages",
|
|
893
|
+
hasInformationUnits: "hasInformationUnits",
|
|
814
894
|
links: "links"
|
|
815
895
|
};
|
|
816
896
|
var ProductLcpUseModelFieldsAll = Object.values(ProductLcpUseModelFields);
|
|
@@ -824,6 +904,7 @@ var ProductLifeCyclePhaseModelFields = {
|
|
|
824
904
|
descriptions: "descriptions",
|
|
825
905
|
synonyms: "synonyms",
|
|
826
906
|
packages: "packages",
|
|
907
|
+
hasInformationUnits: "hasInformationUnits",
|
|
827
908
|
links: "links"
|
|
828
909
|
};
|
|
829
910
|
var ProductLifeCyclePhaseModelFieldsAll = Object.values(ProductLifeCyclePhaseModelFields);
|
|
@@ -837,6 +918,7 @@ var ProductMetadataModelFields = {
|
|
|
837
918
|
descriptions: "descriptions",
|
|
838
919
|
synonyms: "synonyms",
|
|
839
920
|
packages: "packages",
|
|
921
|
+
hasInformationUnits: "hasInformationUnits",
|
|
840
922
|
links: "links"
|
|
841
923
|
};
|
|
842
924
|
var ProductMetadataModelFieldsAll = Object.values(ProductMetadataModelFields);
|
|
@@ -850,6 +932,7 @@ var ProductPropertyModelFields = {
|
|
|
850
932
|
descriptions: "descriptions",
|
|
851
933
|
synonyms: "synonyms",
|
|
852
934
|
packages: "packages",
|
|
935
|
+
hasInformationUnits: "hasInformationUnits",
|
|
853
936
|
links: "links"
|
|
854
937
|
};
|
|
855
938
|
var ProductPropertyModelFieldsAll = Object.values(ProductPropertyModelFields);
|
|
@@ -863,6 +946,7 @@ var ProductVariantModelFields = {
|
|
|
863
946
|
descriptions: "descriptions",
|
|
864
947
|
synonyms: "synonyms",
|
|
865
948
|
packages: "packages",
|
|
949
|
+
hasInformationUnits: "hasInformationUnits",
|
|
866
950
|
links: "links",
|
|
867
951
|
identities: "identities",
|
|
868
952
|
parties: "parties"
|
|
@@ -878,6 +962,7 @@ var QualificationModelFields = {
|
|
|
878
962
|
descriptions: "descriptions",
|
|
879
963
|
synonyms: "synonyms",
|
|
880
964
|
packages: "packages",
|
|
965
|
+
hasInformationUnits: "hasInformationUnits",
|
|
881
966
|
links: "links"
|
|
882
967
|
};
|
|
883
968
|
var QualificationModelFieldsAll = Object.values(QualificationModelFields);
|
|
@@ -891,6 +976,7 @@ var QualificationRoleModelFields = {
|
|
|
891
976
|
descriptions: "descriptions",
|
|
892
977
|
synonyms: "synonyms",
|
|
893
978
|
packages: "packages",
|
|
979
|
+
hasInformationUnits: "hasInformationUnits",
|
|
894
980
|
links: "links"
|
|
895
981
|
};
|
|
896
982
|
var QualificationRoleModelFieldsAll = Object.values(QualificationRoleModelFields);
|
|
@@ -904,6 +990,7 @@ var QualificationSkillLevelModelFields = {
|
|
|
904
990
|
descriptions: "descriptions",
|
|
905
991
|
synonyms: "synonyms",
|
|
906
992
|
packages: "packages",
|
|
993
|
+
hasInformationUnits: "hasInformationUnits",
|
|
907
994
|
links: "links"
|
|
908
995
|
};
|
|
909
996
|
var QualificationSkillLevelModelFieldsAll = Object.values(QualificationSkillLevelModelFields);
|
|
@@ -917,6 +1004,7 @@ var RenditionModelFields = {
|
|
|
917
1004
|
descriptions: "descriptions",
|
|
918
1005
|
synonyms: "synonyms",
|
|
919
1006
|
packages: "packages",
|
|
1007
|
+
hasInformationUnits: "hasInformationUnits",
|
|
920
1008
|
links: "links",
|
|
921
1009
|
source: "source",
|
|
922
1010
|
format: "format",
|
|
@@ -934,7 +1022,8 @@ var RenditionSelectorModelFields = {
|
|
|
934
1022
|
comments: "comments",
|
|
935
1023
|
descriptions: "descriptions",
|
|
936
1024
|
synonyms: "synonyms",
|
|
937
|
-
packages: "packages"
|
|
1025
|
+
packages: "packages",
|
|
1026
|
+
hasInformationUnits: "hasInformationUnits"
|
|
938
1027
|
};
|
|
939
1028
|
var RenditionSelectorModelFieldsAll = Object.values(RenditionSelectorModelFields);
|
|
940
1029
|
var SupplyConsumableModelFields = {
|
|
@@ -947,6 +1036,7 @@ var SupplyConsumableModelFields = {
|
|
|
947
1036
|
descriptions: "descriptions",
|
|
948
1037
|
synonyms: "synonyms",
|
|
949
1038
|
packages: "packages",
|
|
1039
|
+
hasInformationUnits: "hasInformationUnits",
|
|
950
1040
|
links: "links"
|
|
951
1041
|
};
|
|
952
1042
|
var SupplyConsumableModelFieldsAll = Object.values(SupplyConsumableModelFields);
|
|
@@ -960,6 +1050,7 @@ var SupplyHardwareToolModelFields = {
|
|
|
960
1050
|
descriptions: "descriptions",
|
|
961
1051
|
synonyms: "synonyms",
|
|
962
1052
|
packages: "packages",
|
|
1053
|
+
hasInformationUnits: "hasInformationUnits",
|
|
963
1054
|
links: "links"
|
|
964
1055
|
};
|
|
965
1056
|
var SupplyHardwareToolModelFieldsAll = Object.values(SupplyHardwareToolModelFields);
|
|
@@ -973,6 +1064,7 @@ var SupplyLubricantModelFields = {
|
|
|
973
1064
|
descriptions: "descriptions",
|
|
974
1065
|
synonyms: "synonyms",
|
|
975
1066
|
packages: "packages",
|
|
1067
|
+
hasInformationUnits: "hasInformationUnits",
|
|
976
1068
|
links: "links"
|
|
977
1069
|
};
|
|
978
1070
|
var SupplyLubricantModelFieldsAll = Object.values(SupplyLubricantModelFields);
|
|
@@ -986,6 +1078,7 @@ var SupplyModelFields = {
|
|
|
986
1078
|
descriptions: "descriptions",
|
|
987
1079
|
synonyms: "synonyms",
|
|
988
1080
|
packages: "packages",
|
|
1081
|
+
hasInformationUnits: "hasInformationUnits",
|
|
989
1082
|
links: "links"
|
|
990
1083
|
};
|
|
991
1084
|
var SupplyModelFieldsAll = Object.values(SupplyModelFields);
|
|
@@ -999,6 +1092,7 @@ var SupplyOperatingModelFields = {
|
|
|
999
1092
|
descriptions: "descriptions",
|
|
1000
1093
|
synonyms: "synonyms",
|
|
1001
1094
|
packages: "packages",
|
|
1095
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1002
1096
|
links: "links"
|
|
1003
1097
|
};
|
|
1004
1098
|
var SupplyOperatingModelFieldsAll = Object.values(SupplyOperatingModelFields);
|
|
@@ -1012,6 +1106,7 @@ var SupplySparePartModelFields = {
|
|
|
1012
1106
|
descriptions: "descriptions",
|
|
1013
1107
|
synonyms: "synonyms",
|
|
1014
1108
|
packages: "packages",
|
|
1109
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1015
1110
|
links: "links"
|
|
1016
1111
|
};
|
|
1017
1112
|
var SupplySparePartModelFieldsAll = Object.values(SupplySparePartModelFields);
|
|
@@ -1025,6 +1120,7 @@ var TopicModelFields = {
|
|
|
1025
1120
|
descriptions: "descriptions",
|
|
1026
1121
|
synonyms: "synonyms",
|
|
1027
1122
|
packages: "packages",
|
|
1123
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1028
1124
|
links: "links",
|
|
1029
1125
|
revision: "revision",
|
|
1030
1126
|
created: "created",
|
|
@@ -1066,6 +1162,7 @@ var TopicTypeConceptModelFields = {
|
|
|
1066
1162
|
descriptions: "descriptions",
|
|
1067
1163
|
synonyms: "synonyms",
|
|
1068
1164
|
packages: "packages",
|
|
1165
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1069
1166
|
links: "links"
|
|
1070
1167
|
};
|
|
1071
1168
|
var TopicTypeConceptModelFieldsAll = Object.values(TopicTypeConceptModelFields);
|
|
@@ -1079,6 +1176,7 @@ var TopicTypeFormModelFields = {
|
|
|
1079
1176
|
descriptions: "descriptions",
|
|
1080
1177
|
synonyms: "synonyms",
|
|
1081
1178
|
packages: "packages",
|
|
1179
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1082
1180
|
links: "links"
|
|
1083
1181
|
};
|
|
1084
1182
|
var TopicTypeFormModelFieldsAll = Object.values(TopicTypeFormModelFields);
|
|
@@ -1092,6 +1190,7 @@ var TopicTypeLearningModelFields = {
|
|
|
1092
1190
|
descriptions: "descriptions",
|
|
1093
1191
|
synonyms: "synonyms",
|
|
1094
1192
|
packages: "packages",
|
|
1193
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1095
1194
|
links: "links"
|
|
1096
1195
|
};
|
|
1097
1196
|
var TopicTypeLearningModelFieldsAll = Object.values(TopicTypeLearningModelFields);
|
|
@@ -1105,6 +1204,7 @@ var TopicTypeModelFields = {
|
|
|
1105
1204
|
descriptions: "descriptions",
|
|
1106
1205
|
synonyms: "synonyms",
|
|
1107
1206
|
packages: "packages",
|
|
1207
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1108
1208
|
links: "links"
|
|
1109
1209
|
};
|
|
1110
1210
|
var TopicTypeModelFieldsAll = Object.values(TopicTypeModelFields);
|
|
@@ -1118,6 +1218,7 @@ var TopicTypeReferenceModelFields = {
|
|
|
1118
1218
|
descriptions: "descriptions",
|
|
1119
1219
|
synonyms: "synonyms",
|
|
1120
1220
|
packages: "packages",
|
|
1221
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1121
1222
|
links: "links"
|
|
1122
1223
|
};
|
|
1123
1224
|
var TopicTypeReferenceModelFieldsAll = Object.values(TopicTypeReferenceModelFields);
|
|
@@ -1131,6 +1232,7 @@ var TopicTypeTaskModelFields = {
|
|
|
1131
1232
|
descriptions: "descriptions",
|
|
1132
1233
|
synonyms: "synonyms",
|
|
1133
1234
|
packages: "packages",
|
|
1235
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1134
1236
|
links: "links"
|
|
1135
1237
|
};
|
|
1136
1238
|
var TopicTypeTaskModelFieldsAll = Object.values(TopicTypeTaskModelFields);
|
|
@@ -1144,6 +1246,7 @@ var TopicTypeTroubleShootingModelFields = {
|
|
|
1144
1246
|
descriptions: "descriptions",
|
|
1145
1247
|
synonyms: "synonyms",
|
|
1146
1248
|
packages: "packages",
|
|
1249
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1147
1250
|
links: "links"
|
|
1148
1251
|
};
|
|
1149
1252
|
var TopicTypeTroubleShootingModelFieldsAll = Object.values(TopicTypeTroubleShootingModelFields);
|
|
@@ -1157,6 +1260,7 @@ var VCardCalendarModelFields = {
|
|
|
1157
1260
|
descriptions: "descriptions",
|
|
1158
1261
|
synonyms: "synonyms",
|
|
1159
1262
|
packages: "packages",
|
|
1263
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1160
1264
|
source: "source"
|
|
1161
1265
|
};
|
|
1162
1266
|
var VCardCalendarModelFieldsAll = Object.values(VCardCalendarModelFields);
|
|
@@ -1170,6 +1274,7 @@ var VCardGroupModelFields = {
|
|
|
1170
1274
|
descriptions: "descriptions",
|
|
1171
1275
|
synonyms: "synonyms",
|
|
1172
1276
|
packages: "packages",
|
|
1277
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1173
1278
|
links: "links",
|
|
1174
1279
|
fullName: "fullName",
|
|
1175
1280
|
photos: "photos",
|
|
@@ -1191,6 +1296,7 @@ var VCardImageModelFields = {
|
|
|
1191
1296
|
descriptions: "descriptions",
|
|
1192
1297
|
synonyms: "synonyms",
|
|
1193
1298
|
packages: "packages",
|
|
1299
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1194
1300
|
classes: "classes",
|
|
1195
1301
|
value: "value",
|
|
1196
1302
|
source: "source"
|
|
@@ -1206,6 +1312,7 @@ var VCardIndividualModelFields = {
|
|
|
1206
1312
|
descriptions: "descriptions",
|
|
1207
1313
|
synonyms: "synonyms",
|
|
1208
1314
|
packages: "packages",
|
|
1315
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1209
1316
|
links: "links",
|
|
1210
1317
|
fullName: "fullName",
|
|
1211
1318
|
photos: "photos",
|
|
@@ -1224,6 +1331,7 @@ var VCardInfoModelFields = {
|
|
|
1224
1331
|
shortId: "shortId",
|
|
1225
1332
|
score: "score",
|
|
1226
1333
|
classes: "classes",
|
|
1334
|
+
types: "types",
|
|
1227
1335
|
value: "value",
|
|
1228
1336
|
countryName: "countryName",
|
|
1229
1337
|
locality: "locality",
|
|
@@ -1241,6 +1349,7 @@ var VCardLocationModelFields = {
|
|
|
1241
1349
|
descriptions: "descriptions",
|
|
1242
1350
|
synonyms: "synonyms",
|
|
1243
1351
|
packages: "packages",
|
|
1352
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1244
1353
|
links: "links",
|
|
1245
1354
|
fullName: "fullName",
|
|
1246
1355
|
photos: "photos",
|
|
@@ -1262,6 +1371,7 @@ var VCardModelFields = {
|
|
|
1262
1371
|
descriptions: "descriptions",
|
|
1263
1372
|
synonyms: "synonyms",
|
|
1264
1373
|
packages: "packages",
|
|
1374
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1265
1375
|
links: "links",
|
|
1266
1376
|
fullName: "fullName",
|
|
1267
1377
|
photos: "photos",
|
|
@@ -1282,6 +1392,7 @@ var VCardOrganizationModelFields = {
|
|
|
1282
1392
|
descriptions: "descriptions",
|
|
1283
1393
|
synonyms: "synonyms",
|
|
1284
1394
|
packages: "packages",
|
|
1395
|
+
hasInformationUnits: "hasInformationUnits",
|
|
1285
1396
|
links: "links",
|
|
1286
1397
|
fullName: "fullName",
|
|
1287
1398
|
photos: "photos",
|
|
@@ -1325,14 +1436,33 @@ var formatDateToLocale = (date, locale) => {
|
|
|
1325
1436
|
year: "numeric"
|
|
1326
1437
|
}).format(dateAux);
|
|
1327
1438
|
};
|
|
1328
|
-
var createAvailableVersionList = (versions,
|
|
1329
|
-
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) => {
|
|
1330
1460
|
return {
|
|
1331
1461
|
shortId: item.shortId,
|
|
1332
|
-
active: item.
|
|
1333
|
-
lang: item.
|
|
1334
|
-
country: item.
|
|
1335
|
-
link:
|
|
1462
|
+
active: item.active,
|
|
1463
|
+
lang: item.lang,
|
|
1464
|
+
country: item.country,
|
|
1465
|
+
link: item.link
|
|
1336
1466
|
};
|
|
1337
1467
|
}).sort((a, b) => {
|
|
1338
1468
|
if (a.lang < b.lang) return -1;
|
|
@@ -1351,7 +1481,7 @@ var replacePathParams = (endpointTemplate, pathParams) => {
|
|
|
1351
1481
|
}
|
|
1352
1482
|
return endpoint;
|
|
1353
1483
|
};
|
|
1354
|
-
var processDataToLabelValuePairs = (data, excludeKeys = ["shortId", "id", "labels"]) => {
|
|
1484
|
+
var processDataToLabelValuePairs = (data, excludeKeys = ["shortId", "id", "labels", "score"]) => {
|
|
1355
1485
|
const result = [];
|
|
1356
1486
|
Object.entries(data).forEach(([key, value]) => {
|
|
1357
1487
|
if (excludeKeys.includes(key) || value === null || value === void 0) {
|
|
@@ -1474,20 +1604,49 @@ var call = async (method, params) => {
|
|
|
1474
1604
|
};
|
|
1475
1605
|
|
|
1476
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
|
+
};
|
|
1477
1640
|
var transformLanguageData = (data) => {
|
|
1478
1641
|
const countryCodeList = data.map((item) => {
|
|
1479
|
-
const
|
|
1642
|
+
const normalizedValue = normalizeLanguageCode(item.value);
|
|
1643
|
+
const splittedValue = normalizedValue.split("-");
|
|
1480
1644
|
const lang = splittedValue[0];
|
|
1481
|
-
|
|
1482
|
-
if (splittedValue.length > 1) {
|
|
1483
|
-
country = splittedValue[1];
|
|
1484
|
-
} else {
|
|
1485
|
-
country = getCountryCodeByLang(lang);
|
|
1486
|
-
}
|
|
1645
|
+
const country = extractCountryCodeFromLanguage(normalizedValue);
|
|
1487
1646
|
return {
|
|
1488
1647
|
country,
|
|
1489
1648
|
lang,
|
|
1490
|
-
value:
|
|
1649
|
+
value: normalizedValue
|
|
1491
1650
|
};
|
|
1492
1651
|
});
|
|
1493
1652
|
return countryCodeList.sort((a, b) => {
|
|
@@ -1495,7 +1654,7 @@ var transformLanguageData = (data) => {
|
|
|
1495
1654
|
});
|
|
1496
1655
|
};
|
|
1497
1656
|
|
|
1498
|
-
// src/
|
|
1657
|
+
// src/metadata.ts
|
|
1499
1658
|
var isDate = (value) => {
|
|
1500
1659
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(value);
|
|
1501
1660
|
};
|
|
@@ -1504,35 +1663,83 @@ var isLanguage = (label) => {
|
|
|
1504
1663
|
};
|
|
1505
1664
|
var filteredItems = (items) => {
|
|
1506
1665
|
const hasTitle = items.some((item) => item.label === "titles");
|
|
1507
|
-
return items.filter((item) => hasTitle ?
|
|
1666
|
+
return items.filter((item) => hasTitle ? item.label !== "labels" : true);
|
|
1508
1667
|
};
|
|
1509
1668
|
var getType = (classObj) => {
|
|
1510
|
-
const
|
|
1511
|
-
return
|
|
1669
|
+
const type = classObj?.labels?.find((item) => item.language === EN_LANG)?.value?.toUpperCase();
|
|
1670
|
+
return type;
|
|
1512
1671
|
};
|
|
1513
1672
|
var getTitle = (titles, labels) => {
|
|
1514
|
-
let title = "NO TITLE";
|
|
1515
1673
|
if (titles) {
|
|
1516
|
-
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1674
|
+
return titles[0]?.value;
|
|
1675
|
+
}
|
|
1676
|
+
if (labels) {
|
|
1677
|
+
return labels[0]?.value;
|
|
1519
1678
|
}
|
|
1520
|
-
return
|
|
1679
|
+
return "NO TITLE";
|
|
1680
|
+
};
|
|
1681
|
+
var getLabelByLang = (labels, lang = EN_LANG) => {
|
|
1682
|
+
if (!labels) {
|
|
1683
|
+
return "NO TITLE";
|
|
1684
|
+
}
|
|
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";
|
|
1521
1694
|
};
|
|
1522
1695
|
var getLanguage = (languages) => {
|
|
1523
|
-
let language = "NO LANGUAGE";
|
|
1524
1696
|
if (languages && languages.length > 0) {
|
|
1525
|
-
|
|
1697
|
+
return languages[0];
|
|
1526
1698
|
}
|
|
1527
|
-
return
|
|
1699
|
+
return "NO LANGUAGE";
|
|
1528
1700
|
};
|
|
1529
1701
|
var getVersions = (versionOf) => {
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
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
|
+
};
|
|
1536
1743
|
};
|
|
1537
1744
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1538
1745
|
0 && (module.exports = {
|
|
@@ -1540,20 +1747,28 @@ var getVersions = (versionOf) => {
|
|
|
1540
1747
|
cn,
|
|
1541
1748
|
createAvailableVersionList,
|
|
1542
1749
|
createParams,
|
|
1750
|
+
extractCountryCodeFromLanguage,
|
|
1543
1751
|
filteredItems,
|
|
1544
1752
|
formatDateToLocale,
|
|
1545
1753
|
generateBreadcrumbItems,
|
|
1546
1754
|
generateQueryParams,
|
|
1547
1755
|
getCountryCodeByLang,
|
|
1548
1756
|
getFileRenditions,
|
|
1757
|
+
getHtmlRenditionViewUrl,
|
|
1758
|
+
getLabelByLang,
|
|
1549
1759
|
getLanguage,
|
|
1550
1760
|
getTitle,
|
|
1551
1761
|
getType,
|
|
1552
1762
|
getVersions,
|
|
1553
1763
|
isDate,
|
|
1554
1764
|
isLanguage,
|
|
1765
|
+
metaTagsToMetadata,
|
|
1766
|
+
normalizeLanguageCode,
|
|
1767
|
+
parseHtmlContent,
|
|
1555
1768
|
processDataToLabelValuePairs,
|
|
1556
1769
|
replacePathParams,
|
|
1770
|
+
resolvePreferredLanguage,
|
|
1771
|
+
sortAndDeduplicateLanguages,
|
|
1557
1772
|
transformLanguageData
|
|
1558
1773
|
});
|
|
1559
1774
|
//# sourceMappingURL=index.js.map
|