@rxap/schematics-xml-parser 13.0.1-next.3 → 13.0.1
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/CHANGELOG.md +2 -5
- package/package.json +3 -3
- package/src/index.js +9 -6
- package/src/index.js.map +1 -1
- package/src/lib/elements/methods/method.element.js +31 -28
- package/src/lib/elements/methods/method.element.js.map +1 -1
- package/src/lib/elements/methods/methods.js +8 -5
- package/src/lib/elements/methods/methods.js.map +1 -1
- package/src/lib/elements/methods/open-api-remote-method.element.js +19 -16
- package/src/lib/elements/methods/open-api-remote-method.element.js.map +1 -1
- package/src/lib/elements/module.element.js +19 -16
- package/src/lib/elements/module.element.js.map +1 -1
- package/src/lib/elements/type.element.js +22 -19
- package/src/lib/elements/type.element.js.map +1 -1
- package/src/lib/parse-template.js +15 -10
- package/src/lib/parse-template.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [13.0.1
|
|
6
|
+
## [13.0.1](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@13.0.1-next.2...@rxap/schematics-xml-parser@13.0.1) (2022-09-11)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* support node16 module resolution ([f8975a1](https://gitlab.com/rxap/packages/commit/f8975a160b07276e72db3f6745c207ac4b4632f4))
|
|
8
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/schematics-xml-parser",
|
|
3
|
-
"version": "13.0.1
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.1",
|
|
6
6
|
"semver": "^7.3.5"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"migrations": "./migration.json"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@rxap/schematics-ts-morph": "^13.0.0
|
|
42
|
-
"@rxap/schematics-utilities": "^13.0.0
|
|
41
|
+
"@rxap/schematics-ts-morph": "^13.0.0",
|
|
42
|
+
"@rxap/schematics-utilities": "^13.0.0",
|
|
43
43
|
"@rxap/xml-parser": "^12.1.1",
|
|
44
44
|
"ts-morph": "^13.0.3"
|
|
45
45
|
},
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/parse-template"), exports);
|
|
2
5
|
// region elements
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
tslib_1.__exportStar(require("./lib/elements/module.element"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/elements/type.element"), exports);
|
|
5
8
|
// region methods
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
tslib_1.__exportStar(require("./lib/elements/methods/methods"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/elements/methods/open-api-remote-method.element"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/elements/methods/method.element"), exports);
|
|
9
12
|
// endregion
|
|
10
13
|
// endregion
|
|
11
14
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/xml-parser/src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/xml-parser/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AAErC,kBAAkB;AAElB,wEAA8C;AAC9C,sEAA4C;AAE5C,iBAAiB;AACjB,yEAA+C;AAC/C,gGAAsE;AACtE,gFAAsD;AACtD,YAAY;AAEZ,YAAY"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const decorators_1 = require("@rxap/xml-parser/decorators");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const core_1 = require("@angular-devkit/core");
|
|
8
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
9
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
10
|
+
const type_element_1 = require("../type.element");
|
|
11
|
+
const { dasherize, classify, camelize } = core_1.strings;
|
|
9
12
|
let MethodElement = class MethodElement {
|
|
10
13
|
toValue({ sourceFile, project }) {
|
|
11
14
|
if (this.from) {
|
|
@@ -16,39 +19,39 @@ let MethodElement = class MethodElement {
|
|
|
16
19
|
return this.name;
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
|
-
const methodName = CoerceSuffix(classify(this.name), 'Method');
|
|
20
|
-
const methodFilePath = join('/methods', `${dasherize(this.name.replace(/[-_\s]?[m|M]ethod$/, ''))}.method.ts`);
|
|
21
|
-
const methodSourceFile = CoerceSourceFile(project, methodFilePath);
|
|
22
|
+
const methodName = schematics_utilities_1.CoerceSuffix(classify(this.name), 'Method');
|
|
23
|
+
const methodFilePath = path_1.join('/methods', `${dasherize(this.name.replace(/[-_\s]?[m|M]ethod$/, ''))}.method.ts`);
|
|
24
|
+
const methodSourceFile = schematics_ts_morph_1.CoerceSourceFile(project, methodFilePath);
|
|
22
25
|
const methodOptions = {
|
|
23
26
|
statements: [`console.log('${dasherize(methodName)}', parameters);`],
|
|
24
27
|
};
|
|
25
28
|
if (this.parameterType) {
|
|
26
29
|
methodOptions.parameterType = this.parameterType.toValue({ sourceFile: methodSourceFile });
|
|
27
30
|
}
|
|
28
|
-
CoerceMethodClass(methodSourceFile, methodName, methodOptions);
|
|
31
|
+
schematics_ts_morph_1.CoerceMethodClass(methodSourceFile, methodName, methodOptions);
|
|
29
32
|
return methodName;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
};
|
|
33
|
-
__decorate([
|
|
34
|
-
ElementTextContent(),
|
|
35
|
-
ElementRequired(),
|
|
36
|
-
__metadata("design:type", String)
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
decorators_1.ElementTextContent(),
|
|
38
|
+
decorators_1.ElementRequired(),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
37
40
|
], MethodElement.prototype, "name", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
ElementAttribute(),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
decorators_1.ElementAttribute(),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
41
44
|
], MethodElement.prototype, "from", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
ElementAttribute(),
|
|
44
|
-
__metadata("design:type", Boolean)
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
decorators_1.ElementAttribute(),
|
|
47
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
45
48
|
], MethodElement.prototype, "mock", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
ElementChild(TypeElement),
|
|
48
|
-
__metadata("design:type", TypeElement)
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
decorators_1.ElementChild(type_element_1.TypeElement),
|
|
51
|
+
tslib_1.__metadata("design:type", type_element_1.TypeElement)
|
|
49
52
|
], MethodElement.prototype, "parameterType", void 0);
|
|
50
|
-
MethodElement = __decorate([
|
|
51
|
-
ElementDef('method')
|
|
53
|
+
MethodElement = tslib_1.__decorate([
|
|
54
|
+
decorators_1.ElementDef('method')
|
|
52
55
|
], MethodElement);
|
|
53
|
-
|
|
56
|
+
exports.MethodElement = MethodElement;
|
|
54
57
|
//# sourceMappingURL=method.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":";;;;AACA,4DAMqC;AAErC,+BAA4B;AAC5B,+CAA+C;AAC/C,qEAA0D;AAC1D,mEAAuH;AACvH,kDAA8C;AAE9C,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAO,CAAC;AAOlD,IAAa,aAAa,GAA1B,MAAa,aAAa;IAejB,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,EAA+C;QACjF,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,UAAU,CAAC,oBAAoB,CAAC;gBAC9B,YAAY,EAAE,CAAE,IAAI,CAAC,IAAI,CAAE;gBAC3B,eAAe,EAAE,IAAI,CAAC,IAAI;aAC3B,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB;aAAM;YACL,MAAM,UAAU,GAAG,mCAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC/D,MAAM,cAAc,GAAG,WAAI,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;YAC/G,MAAM,gBAAgB,GAAG,sCAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACnE,MAAM,aAAa,GAA0B;gBAC3C,UAAU,EAAE,CAAE,gBAAgB,SAAS,CAAC,UAAU,CAAC,iBAAiB,CAAE;aACvE,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,aAAa,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC;aAC5F;YACD,uCAAiB,CAAC,gBAAgB,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;YAC/D,OAAO,UAAU,CAAC;SACnB;IACH,CAAC;CAEF,CAAA;AAjCC;IAFC,+BAAkB,EAAE;IACpB,4BAAe,EAAE;;2CACG;AAGrB;IADC,6BAAgB,EAAE;;2CACE;AAGrB;IADC,6BAAgB,EAAE;;2CACG;AAGtB;IADC,yBAAY,CAAC,0BAAW,CAAC;sCACH,0BAAW;oDAAA;AAbvB,aAAa;IADzB,uBAAU,CAAC,QAAQ,CAAC;GACR,aAAa,CAqCzB;AArCY,sCAAa"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Methods = void 0;
|
|
4
|
+
const method_element_1 = require("./method.element");
|
|
5
|
+
const open_api_remote_method_element_1 = require("./open-api-remote-method.element");
|
|
6
|
+
exports.Methods = [
|
|
7
|
+
method_element_1.MethodElement,
|
|
8
|
+
open_api_remote_method_element_1.OpenApiRemoteMethodElement
|
|
6
9
|
];
|
|
7
10
|
//# sourceMappingURL=methods.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/methods.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/methods.ts"],"names":[],"mappings":";;;AAEA,qDAAiD;AACjD,qFAA8E;AAEjE,QAAA,OAAO,GAAsC;IACxD,8BAAa;IACb,2DAA0B;CAC3B,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenApiRemoteMethodElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const decorators_1 = require("@rxap/xml-parser/decorators");
|
|
6
|
+
const core_1 = require("@angular-devkit/core");
|
|
7
|
+
const method_element_1 = require("./method.element");
|
|
8
|
+
const { dasherize, classify, camelize } = core_1.strings;
|
|
6
9
|
let OpenApiRemoteMethodElement = class OpenApiRemoteMethodElement {
|
|
7
10
|
toValue({ sourceFile, options }) {
|
|
8
11
|
const openApiRemoteMethodName = classify(this.name) + 'RemoteMethod';
|
|
@@ -16,18 +19,18 @@ let OpenApiRemoteMethodElement = class OpenApiRemoteMethodElement {
|
|
|
16
19
|
return openApiRemoteMethodName;
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
|
-
__decorate([
|
|
20
|
-
ElementTextContent(),
|
|
21
|
-
ElementRequired(),
|
|
22
|
-
__metadata("design:type", String)
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
decorators_1.ElementTextContent(),
|
|
24
|
+
decorators_1.ElementRequired(),
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
23
26
|
], OpenApiRemoteMethodElement.prototype, "name", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
ElementAttribute(),
|
|
26
|
-
__metadata("design:type", Boolean)
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
decorators_1.ElementAttribute(),
|
|
29
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
27
30
|
], OpenApiRemoteMethodElement.prototype, "mock", void 0);
|
|
28
|
-
OpenApiRemoteMethodElement = __decorate([
|
|
29
|
-
ElementExtends(MethodElement),
|
|
30
|
-
ElementDef('open-api-remote-method')
|
|
31
|
+
OpenApiRemoteMethodElement = tslib_1.__decorate([
|
|
32
|
+
decorators_1.ElementExtends(method_element_1.MethodElement),
|
|
33
|
+
decorators_1.ElementDef('open-api-remote-method')
|
|
31
34
|
], OpenApiRemoteMethodElement);
|
|
32
|
-
|
|
35
|
+
exports.OpenApiRemoteMethodElement = OpenApiRemoteMethodElement;
|
|
33
36
|
//# sourceMappingURL=open-api-remote-method.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-remote-method.element.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/open-api-remote-method.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-api-remote-method.element.js","sourceRoot":"","sources":["../../../../../../../libs/xml-parser/src/lib/elements/methods/open-api-remote-method.element.ts"],"names":[],"mappings":";;;;AAAA,4DAMqC;AAGrC,+CAA+C;AAC/C,qDAG0B;AAE1B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAO,CAAC;AAIlD,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAS9B,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,EAAmE;QAErG,MAAM,uBAAuB,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC;QAErE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;QAED,UAAU,CAAC,oBAAoB,CAAC;YAC9B,YAAY,EAAK,CAAE,uBAAuB,CAAE;YAC5C,eAAe,EAAE,GAAG,OAAO,CAAC,aAAa,mBAAmB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB;SACjG,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;IAEjC,CAAC;CAEF,CAAA;AAtBC;IAFC,+BAAkB,EAAE;IACpB,4BAAe,EAAE;;wDACG;AAGrB;IADC,6BAAgB,EAAE;;wDACG;AAPX,0BAA0B;IAFtC,2BAAc,CAAC,8BAAa,CAAC;IAC7B,uBAAU,CAAC,wBAAwB,CAAC;GACxB,0BAA0B,CA0BtC;AA1BY,gEAA0B"}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const decorators_1 = require("@rxap/xml-parser/decorators");
|
|
7
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
5
8
|
let ModuleElement = class ModuleElement {
|
|
6
9
|
handleComponentModule({ sourceFile, project, options }) {
|
|
7
|
-
AddNgModuleImport(sourceFile, this.name, this.form);
|
|
10
|
+
schematics_ts_morph_1.AddNgModuleImport(sourceFile, this.name, this.form);
|
|
8
11
|
}
|
|
9
12
|
toValue({ project, options }) {
|
|
10
|
-
return noop();
|
|
13
|
+
return schematics_1.noop();
|
|
11
14
|
}
|
|
12
15
|
};
|
|
13
|
-
__decorate([
|
|
14
|
-
ElementChildTextContent(),
|
|
15
|
-
ElementRequired(),
|
|
16
|
-
__metadata("design:type", String)
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
decorators_1.ElementChildTextContent(),
|
|
18
|
+
decorators_1.ElementRequired(),
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
17
20
|
], ModuleElement.prototype, "name", void 0);
|
|
18
|
-
__decorate([
|
|
19
|
-
ElementChildTextContent(),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
decorators_1.ElementChildTextContent(),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
21
24
|
], ModuleElement.prototype, "form", void 0);
|
|
22
|
-
ModuleElement = __decorate([
|
|
23
|
-
ElementDef('module')
|
|
25
|
+
ModuleElement = tslib_1.__decorate([
|
|
26
|
+
decorators_1.ElementDef('module')
|
|
24
27
|
], ModuleElement);
|
|
25
|
-
|
|
28
|
+
exports.ModuleElement = ModuleElement;
|
|
26
29
|
//# sourceMappingURL=module.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../libs/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../libs/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":";;;;AACA,2DAAwD;AACxD,4DAIqC;AAErC,mEAImC;AAGnC,IAAa,aAAa,GAA1B,MAAa,aAAa;IASjB,qBAAqB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAA+C;QACxG,uCAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAkB;QACjD,OAAO,iBAAI,EAAE,CAAC;IAChB,CAAC;CAEF,CAAA;AAbC;IAFC,oCAAuB,EAAE;IACzB,4BAAe,EAAE;;2CACG;AAGrB;IADC,oCAAuB,EAAE;;2CACL;AAPV,aAAa;IADzB,uBAAU,CAAC,QAAQ,CAAC;GACR,aAAa,CAiBzB;AAjBY,sCAAa"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringTypeElement = exports.TypeElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const decorators_1 = require("@rxap/xml-parser/decorators");
|
|
3
6
|
let TypeElement = class TypeElement {
|
|
4
7
|
get type() {
|
|
5
8
|
if (this.nullable) {
|
|
@@ -17,32 +20,32 @@ let TypeElement = class TypeElement {
|
|
|
17
20
|
return this.type;
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
|
-
__decorate([
|
|
21
|
-
ElementChildTextContent(),
|
|
22
|
-
ElementRequired(),
|
|
23
|
-
__metadata("design:type", String)
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
decorators_1.ElementChildTextContent(),
|
|
25
|
+
decorators_1.ElementRequired(),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
24
27
|
], TypeElement.prototype, "name", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
ElementChildTextContent(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
decorators_1.ElementChildTextContent(),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
28
31
|
], TypeElement.prototype, "from", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
ElementAttribute(),
|
|
31
|
-
__metadata("design:type", Boolean)
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
decorators_1.ElementAttribute(),
|
|
34
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
32
35
|
], TypeElement.prototype, "nullable", void 0);
|
|
33
|
-
TypeElement = __decorate([
|
|
34
|
-
ElementDef('type')
|
|
36
|
+
TypeElement = tslib_1.__decorate([
|
|
37
|
+
decorators_1.ElementDef('type')
|
|
35
38
|
], TypeElement);
|
|
36
|
-
|
|
39
|
+
exports.TypeElement = TypeElement;
|
|
37
40
|
let StringTypeElement = class StringTypeElement extends TypeElement {
|
|
38
41
|
constructor() {
|
|
39
42
|
super(...arguments);
|
|
40
43
|
this.name = 'string';
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
|
-
StringTypeElement = __decorate([
|
|
44
|
-
ElementExtends(TypeElement),
|
|
45
|
-
ElementDef('string-type')
|
|
46
|
+
StringTypeElement = tslib_1.__decorate([
|
|
47
|
+
decorators_1.ElementExtends(TypeElement),
|
|
48
|
+
decorators_1.ElementDef('string-type')
|
|
46
49
|
], StringTypeElement);
|
|
47
|
-
|
|
50
|
+
exports.StringTypeElement = StringTypeElement;
|
|
48
51
|
//# sourceMappingURL=type.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../libs/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../libs/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":";;;;AAAA,4DAMqC;AAKrC,IAAa,WAAW,GAAxB,MAAa,WAAW;IAYtB,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,CAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,OAAO,CAAC,EAAE,UAAU,EAA8B;QACvD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,UAAU,CAAC,oBAAoB,CAAC;gBAC9B,YAAY,EAAE,CAAE,IAAI,CAAC,IAAI,CAAE;gBAC3B,eAAe,EAAE,IAAI,CAAC,IAAI;aAC3B,CAAC,CAAC;SACJ;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CAEF,CAAA;AAzBC;IAFC,oCAAuB,EAAE;IACzB,4BAAe,EAAE;;yCACG;AAGrB;IADC,oCAAuB,EAAE;;yCACL;AAGrB;IADC,6BAAgB,EAAE;;6CACO;AAVf,WAAW;IADvB,uBAAU,CAAC,MAAM,CAAC;GACN,WAAW,CA6BvB;AA7BY,kCAAW;AAiCxB,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,WAAW;IAAlD;;QAES,SAAI,GAAG,QAAQ,CAAC;IAEzB,CAAC;CAAA,CAAA;AAJY,iBAAiB;IAF7B,2BAAc,CAAC,WAAW,CAAC;IAC3B,uBAAU,CAAC,aAAa,CAAC;GACb,iBAAiB,CAI7B;AAJY,8CAAiB"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParseTemplate = exports.FindTemplate = void 0;
|
|
4
|
+
const xml_parser_1 = require("@rxap/xml-parser");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('templates')) {
|
|
5
8
|
if (basePath) {
|
|
6
|
-
const path = join(baseDirEntry.path, basePath, template);
|
|
9
|
+
const path = path_1.join(baseDirEntry.path, basePath, template);
|
|
7
10
|
if (host.exists(path)) {
|
|
8
11
|
return path;
|
|
9
12
|
}
|
|
@@ -12,7 +15,7 @@ export function FindTemplate(template, host, basePath, baseDirEntry = host.getDi
|
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
else {
|
|
15
|
-
const path = join(baseDirEntry.path, template);
|
|
18
|
+
const path = path_1.join(baseDirEntry.path, template);
|
|
16
19
|
if (host.exists(path)) {
|
|
17
20
|
return path;
|
|
18
21
|
}
|
|
@@ -21,7 +24,7 @@ export function FindTemplate(template, host, basePath, baseDirEntry = host.getDi
|
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
{
|
|
24
|
-
const path = join(baseDirEntry.path, 'shared', template);
|
|
27
|
+
const path = path_1.join(baseDirEntry.path, 'shared', template);
|
|
25
28
|
if (host.exists(path)) {
|
|
26
29
|
return path;
|
|
27
30
|
}
|
|
@@ -31,6 +34,7 @@ export function FindTemplate(template, host, basePath, baseDirEntry = host.getDi
|
|
|
31
34
|
}
|
|
32
35
|
return null;
|
|
33
36
|
}
|
|
37
|
+
exports.FindTemplate = FindTemplate;
|
|
34
38
|
/**
|
|
35
39
|
* Parse the template and returns the ParsedElement object
|
|
36
40
|
*
|
|
@@ -67,11 +71,11 @@ export function FindTemplate(template, host, basePath, baseDirEntry = host.getDi
|
|
|
67
71
|
* @param basePath the basePath for the search
|
|
68
72
|
* @param elements a collection of ParsedElement class constructors that should be include in the xml parsing
|
|
69
73
|
*/
|
|
70
|
-
|
|
74
|
+
function ParseTemplate(host, template, basePath, ...elements) {
|
|
71
75
|
let templateFile;
|
|
72
76
|
let filename = '__inline__';
|
|
73
77
|
let templateFilePath = template;
|
|
74
|
-
const basePathList = coerceArray(basePath);
|
|
78
|
+
const basePathList = schematics_utilities_1.coerceArray(basePath);
|
|
75
79
|
if (template.match(/\.xml$/)) {
|
|
76
80
|
if (!host.exists(template)) {
|
|
77
81
|
for (const bp of basePathList) {
|
|
@@ -100,11 +104,12 @@ export function ParseTemplate(host, template, basePath, ...elements) {
|
|
|
100
104
|
else {
|
|
101
105
|
templateFile = template;
|
|
102
106
|
}
|
|
103
|
-
const parser = new XmlParserService();
|
|
107
|
+
const parser = new xml_parser_1.XmlParserService();
|
|
104
108
|
parser.register(...elements);
|
|
105
109
|
if (!templateFile) {
|
|
106
110
|
throw new Error('The template for the xml parser is not defined');
|
|
107
111
|
}
|
|
108
112
|
return parser.parseFromXml(templateFile, filename, templateFilePath);
|
|
109
113
|
}
|
|
114
|
+
exports.ParseTemplate = ParseTemplate;
|
|
110
115
|
//# sourceMappingURL=parse-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../libs/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../libs/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AACnE,q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