trm-core 6.2.3 → 6.2.5
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.
|
@@ -27,7 +27,7 @@ exports.generateLangTransport = {
|
|
|
27
27
|
logger_1.Logger.log('Generate LANG transport step', true);
|
|
28
28
|
logger_1.Logger.loading(`Generating transports...`);
|
|
29
29
|
logger_1.Logger.loading(`Generating LANG transport...`, true);
|
|
30
|
-
const
|
|
30
|
+
const aDevc = context.runtime.packageData.tadir.filter(o => o.pgmid === 'R3TR' && o.object === 'DEVC');
|
|
31
31
|
context.runtime.systemData.langTransport = yield transport_1.Transport.createToc({
|
|
32
32
|
trmIdentifier: transport_1.TrmTransportIdentifier.LANG,
|
|
33
33
|
target: context.rawInput.systemData.transportTarget,
|
|
@@ -35,7 +35,7 @@ exports.generateLangTransport = {
|
|
|
35
35
|
});
|
|
36
36
|
var iLanguageObjects = 0;
|
|
37
37
|
try {
|
|
38
|
-
yield context.runtime.systemData.langTransport.addTranslations(
|
|
38
|
+
yield context.runtime.systemData.langTransport.addTranslations(aDevc.map(o => o.objName));
|
|
39
39
|
iLanguageObjects = (yield context.runtime.systemData.langTransport.getE071()).length;
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
@@ -7,10 +7,13 @@ export declare class TrmArtifact {
|
|
|
7
7
|
private _distFolder?;
|
|
8
8
|
private _manifest?;
|
|
9
9
|
private _zip;
|
|
10
|
+
private _binaries;
|
|
11
|
+
private _content;
|
|
10
12
|
constructor(binary: Buffer, _distFolder?: string, _manifest?: Manifest);
|
|
11
13
|
getManifest(): Manifest | null;
|
|
12
14
|
replaceManifest(oManifest: Manifest): void;
|
|
13
15
|
getDistFolder(): string | null;
|
|
14
16
|
getTransportBinaries(r3transOption?: R3transOptions): Promise<TransportBinary[]>;
|
|
17
|
+
getContent(r3transConfig?: R3transOptions): Promise<any>;
|
|
15
18
|
static create(transports: Transport[], manifest: Manifest, distFolder?: string): Promise<TrmArtifact>;
|
|
16
19
|
}
|
|
@@ -92,37 +92,71 @@ class TrmArtifact {
|
|
|
92
92
|
getTransportBinaries(r3transOption) {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
94
|
var _a, _b;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (!this._binaries) {
|
|
96
|
+
const distFolder = this.getDistFolder();
|
|
97
|
+
if (!distFolder) {
|
|
98
|
+
throw new Error(`Couldn't locate dist folder.`);
|
|
99
|
+
}
|
|
100
|
+
const zipEntries = this._zip.getEntries();
|
|
101
|
+
const aTransportEntries = zipEntries.filter(o => (new RegExp(`^${distFolder}(/|\\\\)`)).test(o.entryName.trim().toLowerCase()));
|
|
102
|
+
var aResult = [];
|
|
103
|
+
const r3trans = new node_r3trans_1.R3trans(r3transOption);
|
|
104
|
+
for (const entry of aTransportEntries) {
|
|
105
|
+
try {
|
|
106
|
+
const type = entry.comment;
|
|
107
|
+
const oPackedTransport = new AdmZip.default(entry.getData());
|
|
108
|
+
const aPackedTransportEntries = oPackedTransport.getEntries();
|
|
109
|
+
const oHeader = (_a = aPackedTransportEntries.find(o => o.comment === 'header')) === null || _a === void 0 ? void 0 : _a.getData();
|
|
110
|
+
const oData = (_b = aPackedTransportEntries.find(o => o.comment === 'data')) === null || _b === void 0 ? void 0 : _b.getData();
|
|
111
|
+
if (oHeader && oData) {
|
|
112
|
+
const trkorr = yield r3trans.getTransportTrkorr(oData);
|
|
113
|
+
aResult.push({
|
|
114
|
+
trkorr,
|
|
115
|
+
type: type,
|
|
116
|
+
binaries: {
|
|
117
|
+
header: oHeader,
|
|
118
|
+
data: oData
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (e) { }
|
|
124
|
+
}
|
|
125
|
+
;
|
|
126
|
+
this._binaries = aResult;
|
|
98
127
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
return this._binaries || [];
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
getContent(r3transConfig) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
if (!this._content) {
|
|
134
|
+
this._content = {};
|
|
104
135
|
try {
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
136
|
+
const transportBinaries = yield this.getTransportBinaries();
|
|
137
|
+
const r3trans = new node_r3trans_1.R3trans(r3transConfig);
|
|
138
|
+
for (const transportBinary of transportBinaries) {
|
|
139
|
+
const tableEntries = yield r3trans.getTableEntries(transportBinary.binaries.data);
|
|
140
|
+
if (!this._content[transportBinary.type]) {
|
|
141
|
+
this._content[transportBinary.type] = {
|
|
142
|
+
trkorr: transportBinary.trkorr,
|
|
143
|
+
content: {}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
Object.keys(tableEntries).forEach(table => {
|
|
147
|
+
if (!this._content[transportBinary.type].content[table]) {
|
|
148
|
+
this._content[transportBinary.type].content[table] = [];
|
|
118
149
|
}
|
|
150
|
+
this._content[transportBinary.type].content[table] = this._content[transportBinary.type].content[table].concat(tableEntries[table]);
|
|
119
151
|
});
|
|
120
152
|
}
|
|
121
153
|
}
|
|
122
|
-
catch (e) {
|
|
154
|
+
catch (e) {
|
|
155
|
+
delete this._content;
|
|
156
|
+
throw e;
|
|
157
|
+
}
|
|
123
158
|
}
|
|
124
|
-
;
|
|
125
|
-
return aResult;
|
|
159
|
+
return this._content || {};
|
|
126
160
|
});
|
|
127
161
|
}
|
|
128
162
|
static create(transports_1, manifest_2) {
|
|
@@ -2,6 +2,7 @@ import { Manifest } from "../manifest";
|
|
|
2
2
|
import { Registry } from "../registry";
|
|
3
3
|
import { TrmArtifact } from "./TrmArtifact";
|
|
4
4
|
import { DEVCLASS } from "../client";
|
|
5
|
+
import { R3transOptions } from "node-r3trans";
|
|
5
6
|
export declare const DEFAULT_VERSION: string;
|
|
6
7
|
export declare class TrmPackage {
|
|
7
8
|
packageName: string;
|
|
@@ -10,6 +11,7 @@ export declare class TrmPackage {
|
|
|
10
11
|
private _userAuthorizations;
|
|
11
12
|
private _canPublishReleasesCause;
|
|
12
13
|
private _remoteArtifacts;
|
|
14
|
+
private _remoteContent;
|
|
13
15
|
private _devclass;
|
|
14
16
|
constructor(packageName: string, registry: Registry, manifest?: Manifest);
|
|
15
17
|
setDevclass(devclass: DEVCLASS): TrmPackage;
|
|
@@ -19,8 +21,9 @@ export declare class TrmPackage {
|
|
|
19
21
|
canPublishReleases: boolean;
|
|
20
22
|
cause?: string;
|
|
21
23
|
}>;
|
|
22
|
-
fetchRemoteManifest(version?: string): Promise<Manifest>;
|
|
23
24
|
fetchRemoteArtifact(version?: string): Promise<TrmArtifact>;
|
|
25
|
+
fetchRemoteManifest(version?: string): Promise<Manifest>;
|
|
26
|
+
fetchRemoteContent(version?: string, r3transConfig?: R3transOptions): Promise<any>;
|
|
24
27
|
publish(data: {
|
|
25
28
|
artifact: TrmArtifact;
|
|
26
29
|
readme?: string;
|
|
@@ -54,6 +54,7 @@ class TrmPackage {
|
|
|
54
54
|
this.registry = registry;
|
|
55
55
|
this.manifest = manifest;
|
|
56
56
|
this._remoteArtifacts = {};
|
|
57
|
+
this._remoteContent = {};
|
|
57
58
|
}
|
|
58
59
|
setDevclass(devclass) {
|
|
59
60
|
this._devclass = devclass;
|
|
@@ -91,21 +92,30 @@ class TrmPackage {
|
|
|
91
92
|
};
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
+
fetchRemoteArtifact() {
|
|
95
96
|
return __awaiter(this, arguments, void 0, function* (version = 'latest') {
|
|
96
97
|
if (!this._remoteArtifacts[version]) {
|
|
97
|
-
|
|
98
|
-
this._remoteArtifacts[version] = artifact;
|
|
98
|
+
this._remoteArtifacts[version] = yield this.registry.getArtifact(this.packageName, version);
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
return this._remoteArtifacts[version];
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
fetchRemoteManifest() {
|
|
104
|
+
return __awaiter(this, arguments, void 0, function* (version = 'latest') {
|
|
105
|
+
const artifact = yield this.fetchRemoteArtifact(version);
|
|
106
|
+
this.manifest = artifact.getManifest();
|
|
101
107
|
this._remoteArtifacts[this.manifest.get().version] = this._remoteArtifacts[version];
|
|
102
108
|
return this._remoteArtifacts[version].getManifest();
|
|
103
109
|
});
|
|
104
110
|
}
|
|
105
|
-
|
|
106
|
-
return __awaiter(this, arguments, void 0, function* (version = 'latest') {
|
|
107
|
-
if (!this.
|
|
108
|
-
|
|
111
|
+
fetchRemoteContent() {
|
|
112
|
+
return __awaiter(this, arguments, void 0, function* (version = 'latest', r3transConfig) {
|
|
113
|
+
if (!this._remoteContent[version]) {
|
|
114
|
+
const artifact = yield this.fetchRemoteArtifact(version);
|
|
115
|
+
const manifest = artifact.getManifest();
|
|
116
|
+
const actualVersion = manifest.get().version;
|
|
117
|
+
this._remoteArtifacts[version] = yield artifact.getContent(r3transConfig);
|
|
118
|
+
this._remoteArtifacts[actualVersion] = this._remoteArtifacts[version];
|
|
109
119
|
}
|
|
110
120
|
return this._remoteArtifacts[version];
|
|
111
121
|
});
|