trm-core 6.1.16 → 6.1.18
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/manifest/Manifest.js +57 -8
- package/package.json +5 -3
|
@@ -136,6 +136,35 @@ class Manifest {
|
|
|
136
136
|
oAbapXml['asx:abap']['asx:values']['TRM_MANIFEST']['REPLICENSE'] = {
|
|
137
137
|
"_text": manifest.namespace.replicense
|
|
138
138
|
};
|
|
139
|
+
if (Array.isArray(manifest.namespace.texts)) {
|
|
140
|
+
var texts = [];
|
|
141
|
+
manifest.namespace.texts.forEach(o => {
|
|
142
|
+
var obj = {};
|
|
143
|
+
if (o.description) {
|
|
144
|
+
obj['DESCRIPTION'] = {
|
|
145
|
+
"_text": o.description
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (o.language) {
|
|
149
|
+
obj['LANGUAGE'] = {
|
|
150
|
+
"_text": o.language
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (o.owner) {
|
|
154
|
+
obj['OWNER'] = {
|
|
155
|
+
"_text": o.owner
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (Object.keys(obj).length > 0) {
|
|
159
|
+
texts.push(obj);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
if (texts.length > 0) {
|
|
163
|
+
oAbapXml['asx:abap']['asx:values']['TRM_MANIFEST']['REPLICENSE_T'] = {
|
|
164
|
+
"item": texts
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
139
168
|
}
|
|
140
169
|
if (manifest.authors) {
|
|
141
170
|
var authors = [];
|
|
@@ -470,8 +499,9 @@ class Manifest {
|
|
|
470
499
|
return manifestClone;
|
|
471
500
|
}
|
|
472
501
|
static fromAbapXml(sXml) {
|
|
473
|
-
var _a, _b, _c, _d, _e, _f;
|
|
502
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
474
503
|
var manifest;
|
|
504
|
+
sXml = sXml.replace(/&/g, "&").replace(/-/g, "-");
|
|
475
505
|
const oAbapXml = xml.xml2js(sXml, { compact: true });
|
|
476
506
|
var oAbapManifest;
|
|
477
507
|
var sapEntries;
|
|
@@ -516,11 +546,30 @@ class Manifest {
|
|
|
516
546
|
if (oAbapManifest.license && oAbapManifest.license.text) {
|
|
517
547
|
manifest.license = oAbapManifest.license.text;
|
|
518
548
|
}
|
|
519
|
-
if (oAbapManifest.replicense
|
|
549
|
+
if (oAbapManifest.replicense) {
|
|
520
550
|
manifest.namespace = {
|
|
521
551
|
replicense: oAbapManifest.replicense.text,
|
|
522
552
|
texts: []
|
|
523
553
|
};
|
|
554
|
+
if (oAbapManifest.replicenseT && oAbapManifest.replicenseT.item) {
|
|
555
|
+
if (Array.isArray(oAbapManifest.replicenseT.item)) {
|
|
556
|
+
manifest.namespace.texts = oAbapManifest.replicenseT.item.map(o => {
|
|
557
|
+
var _a, _b, _c;
|
|
558
|
+
return {
|
|
559
|
+
description: (_a = o.description) === null || _a === void 0 ? void 0 : _a.text,
|
|
560
|
+
language: (_b = o.language) === null || _b === void 0 ? void 0 : _b.text,
|
|
561
|
+
owner: (_c = o.owner) === null || _c === void 0 ? void 0 : _c.text
|
|
562
|
+
};
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
manifest.namespace.texts = [{
|
|
567
|
+
description: (_a = oAbapManifest.replicenseT.item.description) === null || _a === void 0 ? void 0 : _a.text,
|
|
568
|
+
language: (_b = oAbapManifest.replicenseT.item.language) === null || _b === void 0 ? void 0 : _b.text,
|
|
569
|
+
owner: (_c = oAbapManifest.replicenseT.item.owner) === null || _c === void 0 ? void 0 : _c.text
|
|
570
|
+
}];
|
|
571
|
+
}
|
|
572
|
+
}
|
|
524
573
|
}
|
|
525
574
|
if (oAbapManifest.keywords && oAbapManifest.keywords.item) {
|
|
526
575
|
if (Array.isArray(oAbapManifest.keywords.item)) {
|
|
@@ -542,8 +591,8 @@ class Manifest {
|
|
|
542
591
|
}
|
|
543
592
|
else {
|
|
544
593
|
manifest.authors = [{
|
|
545
|
-
name: (
|
|
546
|
-
email: (
|
|
594
|
+
name: (_d = oAbapManifest.authors.item.name) === null || _d === void 0 ? void 0 : _d.text,
|
|
595
|
+
email: (_e = oAbapManifest.authors.item.email) === null || _e === void 0 ? void 0 : _e.text
|
|
547
596
|
}];
|
|
548
597
|
}
|
|
549
598
|
}
|
|
@@ -561,10 +610,10 @@ class Manifest {
|
|
|
561
610
|
}
|
|
562
611
|
else {
|
|
563
612
|
manifest.dependencies = [{
|
|
564
|
-
name: (
|
|
565
|
-
integrity: (
|
|
566
|
-
version: (
|
|
567
|
-
registry: (
|
|
613
|
+
name: (_f = oAbapManifest.dependencies.item.name) === null || _f === void 0 ? void 0 : _f.text,
|
|
614
|
+
integrity: (_g = oAbapManifest.dependencies.item.integrity) === null || _g === void 0 ? void 0 : _g.text,
|
|
615
|
+
version: (_h = oAbapManifest.dependencies.item.version) === null || _h === void 0 ? void 0 : _h.text,
|
|
616
|
+
registry: (_j = oAbapManifest.dependencies.item.registry) === null || _j === void 0 ? void 0 : _j.text
|
|
568
617
|
}];
|
|
569
618
|
}
|
|
570
619
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trm-core",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.18",
|
|
4
4
|
"description": "TRM (Transport Request Manager) Core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"!dist/test.*"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
12
|
+
"cleanBuild": "rimraf dist/",
|
|
13
|
+
"build": "npm run cleanBuild && tsc --sourceMap false",
|
|
13
14
|
"test": "jest",
|
|
14
15
|
"prepublishOnly": "npm run build"
|
|
15
16
|
},
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"@types/xmldom": "^0.1.32",
|
|
74
75
|
"jest": "^29.7.0",
|
|
75
76
|
"ts-jest": "^29.1.2",
|
|
76
|
-
"ts-node": "^10.9.2"
|
|
77
|
+
"ts-node": "^10.9.2",
|
|
78
|
+
"rimraf": "^6.0.1"
|
|
77
79
|
}
|
|
78
80
|
}
|