@rxap/schematics-xml-parser 16.0.0-dev.8 → 16.0.0
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 +63 -0
- package/README.md +1 -1
- package/package.json +44 -42
- package/src/index.js +6 -3
- package/src/index.js.map +1 -1
- package/src/lib/elements/index.js +5 -2
- package/src/lib/elements/index.js.map +1 -1
- package/src/lib/elements/methods/index.js +6 -3
- package/src/lib/elements/methods/index.js.map +1 -1
- package/src/lib/elements/methods/method.element.js +32 -29
- 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 +21 -18
- 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 +24 -21
- package/src/lib/elements/type.element.js.map +1 -1
- package/src/lib/index.js +4 -1
- package/src/lib/index.js.map +1 -1
- package/src/lib/parse-template.d.ts +4 -3
- package/src/lib/parse-template.js +16 -10
- package/src/lib/parse-template.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,69 @@
|
|
|
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
|
+
# [16.0.0](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.18...@rxap/schematics-xml-parser@16.0.0) (2024-02-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
9
|
+
|
|
10
|
+
# [16.0.0-dev.18](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.5...@rxap/schematics-xml-parser@16.0.0-dev.18) (2023-10-11)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- add licence file to publishable packages ([d7de1cb](https://gitlab.com/rxap/packages/commit/d7de1cb9db1bd1628f37084e3b0ffd1755aa75f6))
|
|
15
|
+
- change from commonjs to es2022 ([cf675a7](https://gitlab.com/rxap/packages/commit/cf675a7254de9ce4b269264df59794dd42fcbd8b))
|
|
16
|
+
- compile package in commonjs format ([48a60d4](https://gitlab.com/rxap/packages/commit/48a60d4726a479f01b74746df570154237c90abb))
|
|
17
|
+
- ensure the project name is not included in the project tag list ([46d4479](https://gitlab.com/rxap/packages/commit/46d44798258ea1b20df9d4408b9c0809f55027b2))
|
|
18
|
+
- generate readme with peer dependencies to install ([27c2cd7](https://gitlab.com/rxap/packages/commit/27c2cd7d98f0c8a499b8c30719f49d69e4970ae9))
|
|
19
|
+
- peer dependency issue ([ee95415](https://gitlab.com/rxap/packages/commit/ee95415370d9ef2396916d6c25061a0df791034a))
|
|
20
|
+
|
|
21
|
+
### Reverts
|
|
22
|
+
|
|
23
|
+
- change from commonjs to es2022 ([50eca61](https://gitlab.com/rxap/packages/commit/50eca61e9a89388d1cfeefb8b1029b302b6f307e))
|
|
24
|
+
|
|
25
|
+
# [16.0.0-dev.17](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.16...@rxap/schematics-xml-parser@16.0.0-dev.17) (2023-10-09)
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- compile package in commonjs format ([3b4f38c](https://gitlab.com/rxap/packages/commit/3b4f38cd758b780fd2ec7c943d441bc42e2860f8))
|
|
30
|
+
|
|
31
|
+
# [16.0.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.15...@rxap/schematics-xml-parser@16.0.0-dev.16) (2023-09-27)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
34
|
+
|
|
35
|
+
# [16.0.0-dev.15](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.14...@rxap/schematics-xml-parser@16.0.0-dev.15) (2023-09-12)
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- peer dependency issue ([e67e2b8](https://gitlab.com/rxap/packages/commit/e67e2b8eb884b598536d16c2c544a9ad9be5b53e))
|
|
40
|
+
|
|
41
|
+
# [16.0.0-dev.14](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.13...@rxap/schematics-xml-parser@16.0.0-dev.14) (2023-09-12)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
44
|
+
|
|
45
|
+
# [16.0.0-dev.13](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.12...@rxap/schematics-xml-parser@16.0.0-dev.13) (2023-09-07)
|
|
46
|
+
|
|
47
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
48
|
+
|
|
49
|
+
# [16.0.0-dev.12](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.11...@rxap/schematics-xml-parser@16.0.0-dev.12) (2023-09-03)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
52
|
+
|
|
53
|
+
# [16.0.0-dev.11](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.10...@rxap/schematics-xml-parser@16.0.0-dev.11) (2023-09-03)
|
|
54
|
+
|
|
55
|
+
**Note:** Version bump only for package @rxap/schematics-xml-parser
|
|
56
|
+
|
|
57
|
+
# [16.0.0-dev.10](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.9...@rxap/schematics-xml-parser@16.0.0-dev.10) (2023-08-31)
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
- ensure the project name is not included in the project tag list ([b131ac3](https://gitlab.com/rxap/packages/commit/b131ac3bd92b3b8799d62f15bbd30a1997d7c753))
|
|
62
|
+
|
|
63
|
+
# [16.0.0-dev.9](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.8...@rxap/schematics-xml-parser@16.0.0-dev.9) (2023-08-17)
|
|
64
|
+
|
|
65
|
+
### Reverts
|
|
66
|
+
|
|
67
|
+
- change from commonjs to es2022 ([747a381](https://gitlab.com/rxap/packages/commit/747a381a090f0a276cf363da61bb19ed0c9cb5b7))
|
|
68
|
+
|
|
6
69
|
# [16.0.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.7...@rxap/schematics-xml-parser@16.0.0-dev.8) (2023-08-16)
|
|
7
70
|
|
|
8
71
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -17,5 +17,5 @@ yarn add @rxap/schematics-xml-parser
|
|
|
17
17
|
```
|
|
18
18
|
**Install peer dependencies:**
|
|
19
19
|
```bash
|
|
20
|
-
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-ts-morph@^16.0.0-dev.
|
|
20
|
+
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-ts-morph@^16.0.0-dev.27 @rxap/schematics-utilities@^16.0.0-dev.20 @rxap/xml-parser@^16.0.0-dev.25 ts-morph@^18.0.0 tslib@2.6.2
|
|
21
21
|
```
|
package/package.json
CHANGED
|
@@ -1,73 +1,75 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "16.0.0",
|
|
2
3
|
"name": "@rxap/schematics-xml-parser",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
4
|
+
"license": "GPL-3.0-or-later",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"ignore": "5.2.4",
|
|
7
|
+
"process": "0.11.10",
|
|
8
|
+
"reflect-metadata": "0.1.13",
|
|
9
|
+
"semver": "7.5.3",
|
|
10
|
+
"tslib": "2.6.2",
|
|
11
|
+
"xmldom": "0.6.0",
|
|
12
|
+
"yaml": "2.3.1"
|
|
13
|
+
},
|
|
5
14
|
"peerDependencies": {
|
|
6
15
|
"@angular-devkit/core": "^16.1.4",
|
|
7
16
|
"@angular-devkit/schematics": "^16.1.4",
|
|
8
|
-
"@rxap/schematics-ts-morph": "^16.0.0
|
|
9
|
-
"@rxap/schematics-utilities": "^16.0.0
|
|
10
|
-
"@rxap/xml-parser": "^16.0.0
|
|
17
|
+
"@rxap/schematics-ts-morph": "^16.0.0",
|
|
18
|
+
"@rxap/schematics-utilities": "^16.0.0",
|
|
19
|
+
"@rxap/xml-parser": "^16.0.0",
|
|
11
20
|
"ts-morph": "^18.0.0",
|
|
12
|
-
"
|
|
13
|
-
"@rxap/
|
|
14
|
-
"@rxap/
|
|
15
|
-
"@rxap/
|
|
16
|
-
"@rxap/
|
|
17
|
-
"@rxap/
|
|
18
|
-
"@
|
|
21
|
+
"tslib": "2.6.2",
|
|
22
|
+
"@rxap/mixin": "16.0.0",
|
|
23
|
+
"@rxap/node-utilities": "1.1.0",
|
|
24
|
+
"@rxap/reflect-metadata": "1.0.1",
|
|
25
|
+
"@rxap/ts-morph": "1.0.1",
|
|
26
|
+
"@rxap/utilities": "16.0.0",
|
|
27
|
+
"@rxap/workspace-ts-morph": "16.0.1",
|
|
28
|
+
"@rxap/workspace-utilities": "16.0.1",
|
|
19
29
|
"handlebars": "4.7.7"
|
|
20
30
|
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"reflect-metadata": "^0.1.13",
|
|
25
|
-
"semver": "^7.3.5",
|
|
26
|
-
"tslib": "2.5.3",
|
|
27
|
-
"xmldom": "0.6.0"
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "Merzough Münker",
|
|
33
|
+
"email": "mmuenker@digitaix.com"
|
|
28
34
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://gitlab.com/rxap/packages/-/issues",
|
|
37
|
+
"email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
|
|
32
38
|
},
|
|
39
|
+
"homepage": "https:/gitlab.com/rxap/packages/packages/schematic/xml-parser",
|
|
33
40
|
"keywords": [
|
|
34
|
-
"rxap",
|
|
35
41
|
"packages",
|
|
42
|
+
"rxap",
|
|
36
43
|
"schematic",
|
|
44
|
+
"schematic-xml-parser",
|
|
37
45
|
"xml-parser"
|
|
38
46
|
],
|
|
39
|
-
"homepage": "https:/gitlab.com/rxap/packages/packages/schematic/xml-parser",
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://gitlab.com/rxap/packages/-/issues",
|
|
42
|
-
"email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
|
|
43
|
-
},
|
|
44
|
-
"license": "GPL-3.0-or-later",
|
|
45
|
-
"repository": {
|
|
46
|
-
"type": "git",
|
|
47
|
-
"url": "https://gitlab.com/rxap/packages.git",
|
|
48
|
-
"directory": "packages/schematic/xml-parser"
|
|
49
|
-
},
|
|
50
|
-
"author": {
|
|
51
|
-
"name": "Merzough Münker",
|
|
52
|
-
"email": "mmuenker@digitaix.com"
|
|
53
|
-
},
|
|
54
47
|
"nx-migrations": {
|
|
55
48
|
"packageGroup": [
|
|
56
49
|
{
|
|
57
50
|
"package": "@rxap/schematics-ts-morph",
|
|
58
|
-
"version": "16.0.0
|
|
51
|
+
"version": "16.0.0"
|
|
59
52
|
},
|
|
60
53
|
{
|
|
61
54
|
"package": "@rxap/schematics-utilities",
|
|
62
|
-
"version": "16.0.0
|
|
55
|
+
"version": "16.0.0"
|
|
63
56
|
},
|
|
64
57
|
{
|
|
65
58
|
"package": "@rxap/xml-parser",
|
|
66
|
-
"version": "16.0.0
|
|
59
|
+
"version": "16.0.0"
|
|
67
60
|
}
|
|
68
61
|
]
|
|
69
62
|
},
|
|
70
|
-
"
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public",
|
|
65
|
+
"directory": "../../../dist/packages/schematic/xml-parser"
|
|
66
|
+
},
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "https://gitlab.com/rxap/packages.git",
|
|
70
|
+
"directory": "packages/schematic/xml-parser"
|
|
71
|
+
},
|
|
72
|
+
"type": "commonjs",
|
|
71
73
|
"main": "./src/index.js",
|
|
72
74
|
"types": "./src/index.d.ts"
|
|
73
75
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/elements"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/elements/methods"), exports);
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematic/xml-parser/src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematic/xml-parser/src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,yDAA+B;AAC/B,iEAAuC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./module.element"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./type.element"), exports);
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,yDAA+B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./method.element"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./methods"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./open-api-remote-method.element"), exports);
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,oDAA0B;AAC1B,2EAAiD"}
|
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const xml_parser_1 = require("@rxap/xml-parser");
|
|
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;
|
|
12
|
+
let MethodElement = exports.MethodElement = class MethodElement {
|
|
10
13
|
toValue({ sourceFile, project, }) {
|
|
11
14
|
if (this.from) {
|
|
12
|
-
CoerceImports(sourceFile, {
|
|
15
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
13
16
|
namedImports: [this.name],
|
|
14
17
|
moduleSpecifier: this.from,
|
|
15
18
|
});
|
|
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 = (0, schematics_utilities_1.CoerceSuffix)(classify(this.name), 'Method');
|
|
23
|
+
const methodFilePath = (0, path_1.join)('/methods', `${dasherize(this.name.replace(/[-_\s]?[m|M]ethod$/, ''))}.method.ts`);
|
|
24
|
+
const methodSourceFile = (0, 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
|
-
CoerceMethodClassLegacy(methodSourceFile, methodName, methodOptions);
|
|
31
|
+
(0, schematics_ts_morph_1.CoerceMethodClassLegacy)(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
|
+
(0, xml_parser_1.ElementTextContent)(),
|
|
38
|
+
(0, xml_parser_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
|
+
(0, xml_parser_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
|
+
(0, xml_parser_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
|
+
(0, xml_parser_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
|
+
exports.MethodElement = MethodElement = tslib_1.__decorate([
|
|
54
|
+
(0, xml_parser_1.ElementDef)('method')
|
|
52
55
|
], MethodElement);
|
|
53
56
|
//# sourceMappingURL=method.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":";;;;AAAA,iDAO0B;AAE1B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AAe,GAAE;;2CACG;AAGd;IADN,IAAA,6BAAgB,GAAE;;2CACE;AAGd;IADN,IAAA,6BAAgB,GAAE;;2CACG;AAGf;IADN,IAAA,yBAAY,EAAC,0BAAW,CAAC;sCACH,0BAAW;oDAAC;wBAbxB,aAAa;IADzB,IAAA,uBAAU,EAAC,QAAQ,CAAC;GACR,aAAa,CAwCzB"}
|
|
@@ -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":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/methods.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/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,33 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenApiRemoteMethodElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const xml_parser_1 = require("@rxap/xml-parser");
|
|
6
|
+
const core_1 = require("@angular-devkit/core");
|
|
7
|
+
const method_element_1 = require("./method.element");
|
|
8
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
9
|
+
const { dasherize, classify, camelize, } = core_1.strings;
|
|
10
|
+
let OpenApiRemoteMethodElement = exports.OpenApiRemoteMethodElement = class OpenApiRemoteMethodElement {
|
|
8
11
|
toValue({ sourceFile, options, }) {
|
|
9
12
|
const openApiRemoteMethodName = classify(this.name) + 'RemoteMethod';
|
|
10
13
|
if (!options.openApiModule) {
|
|
11
14
|
throw new Error('The open api module is not defined!');
|
|
12
15
|
}
|
|
13
|
-
CoerceImports(sourceFile, {
|
|
16
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
14
17
|
namedImports: [openApiRemoteMethodName],
|
|
15
18
|
moduleSpecifier: `${options.openApiModule}/remote-methods/${dasherize(this.name)}.remote-method`,
|
|
16
19
|
});
|
|
17
20
|
return openApiRemoteMethodName;
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
|
-
__decorate([
|
|
21
|
-
ElementTextContent(),
|
|
22
|
-
ElementRequired(),
|
|
23
|
-
__metadata("design:type", String)
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, xml_parser_1.ElementTextContent)(),
|
|
25
|
+
(0, xml_parser_1.ElementRequired)(),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
24
27
|
], OpenApiRemoteMethodElement.prototype, "name", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
ElementAttribute(),
|
|
27
|
-
__metadata("design:type", Boolean)
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, xml_parser_1.ElementAttribute)(),
|
|
30
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
28
31
|
], OpenApiRemoteMethodElement.prototype, "mock", void 0);
|
|
29
|
-
OpenApiRemoteMethodElement = __decorate([
|
|
30
|
-
ElementExtends(MethodElement),
|
|
31
|
-
ElementDef('open-api-remote-method')
|
|
32
|
+
exports.OpenApiRemoteMethodElement = OpenApiRemoteMethodElement = tslib_1.__decorate([
|
|
33
|
+
(0, xml_parser_1.ElementExtends)(method_element_1.MethodElement),
|
|
34
|
+
(0, xml_parser_1.ElementDef)('open-api-remote-method')
|
|
32
35
|
], 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":["../../../../../../../../packages/schematic/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":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/open-api-remote-method.element.ts"],"names":[],"mappings":";;;;AAAA,iDAO0B;AAE1B,+CAA+C;AAC/C,qDAG0B;AAC1B,mEAA0D;AAE1D,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,GAAG,cAAO,CAAC;AAIL,IAAM,0BAA0B,wCAAhC,MAAM,0BAA0B;IAS9B,OAAO,CAAC,EACE,UAAU,EACV,OAAO,GACyD;QAE/E,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,IAAA,mCAAa,EAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,uBAAuB,CAAE;YACzC,eAAe,EAAE,GAAI,OAAO,CAAC,aAAc,mBAAoB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,gBAAgB;SACrG,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;IAEjC,CAAC;CAEF,CAAA;AAzBQ;IAFN,IAAA,+BAAkB,GAAE;IACpB,IAAA,4BAAe,GAAE;;wDACG;AAGd;IADN,IAAA,6BAAgB,GAAE;;wDACG;qCAPX,0BAA0B;IAFtC,IAAA,2BAAc,EAAC,8BAAa,CAAC;IAC7B,IAAA,uBAAU,EAAC,wBAAwB,CAAC;GACxB,0BAA0B,CA6BtC"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const xml_parser_1 = require("@rxap/xml-parser");
|
|
6
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
8
|
+
let ModuleElement = exports.ModuleElement = class ModuleElement {
|
|
6
9
|
handleComponentModule({ sourceFile, project, options, }) {
|
|
7
|
-
AddNgModuleImport(sourceFile, this.name, this.form);
|
|
10
|
+
(0, schematics_ts_morph_1.AddNgModuleImport)(sourceFile, this.name, this.form);
|
|
8
11
|
}
|
|
9
12
|
toValue({ project, options, }) {
|
|
10
|
-
return noop();
|
|
13
|
+
return (0, schematics_1.noop)();
|
|
11
14
|
}
|
|
12
15
|
};
|
|
13
|
-
__decorate([
|
|
14
|
-
ElementChildTextContent(),
|
|
15
|
-
ElementRequired(),
|
|
16
|
-
__metadata("design:type", String)
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, xml_parser_1.ElementChildTextContent)(),
|
|
18
|
+
(0, xml_parser_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
|
+
(0, xml_parser_1.ElementChildTextContent)(),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
21
24
|
], ModuleElement.prototype, "form", void 0);
|
|
22
|
-
ModuleElement = __decorate([
|
|
23
|
-
ElementDef('module')
|
|
25
|
+
exports.ModuleElement = ModuleElement = tslib_1.__decorate([
|
|
26
|
+
(0, xml_parser_1.ElementDef)('module')
|
|
24
27
|
], ModuleElement);
|
|
25
28
|
//# sourceMappingURL=module.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":";;;;AAAA,iDAK0B;AAC1B,2DAGoC;AAEpC,mEAImC;AAG5B,IAAM,aAAa,2BAAnB,MAAM,aAAa;IASjB,qBAAqB,CAAC,EACE,UAAU,EACV,OAAO,EACP,OAAO,GACqC;QACzE,IAAA,uCAAiB,EAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,OAAO,CAAC,EACE,OAAO,EACP,OAAO,GACQ;QAC9B,OAAO,IAAA,iBAAI,GAAE,CAAC;IAChB,CAAC;CAEF,CAAA;AApBQ;IAFN,IAAA,oCAAuB,GAAE;IACzB,IAAA,4BAAe,GAAE;;2CACG;AAGd;IADN,IAAA,oCAAuB,GAAE;;2CACL;wBAPV,aAAa;IADzB,IAAA,uBAAU,EAAC,QAAQ,CAAC;GACR,aAAa,CAwBzB"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 xml_parser_1 = require("@rxap/xml-parser");
|
|
6
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
7
|
+
let TypeElement = exports.TypeElement = class TypeElement {
|
|
5
8
|
get type() {
|
|
6
9
|
if (this.nullable) {
|
|
7
10
|
return [this.name, 'null'].join(' | ');
|
|
@@ -10,7 +13,7 @@ export let TypeElement = class TypeElement {
|
|
|
10
13
|
}
|
|
11
14
|
toValue({ sourceFile }) {
|
|
12
15
|
if (this.from) {
|
|
13
|
-
CoerceImports(sourceFile, {
|
|
16
|
+
(0, schematics_ts_morph_1.CoerceImports)(sourceFile, {
|
|
14
17
|
namedImports: [this.name],
|
|
15
18
|
moduleSpecifier: this.from,
|
|
16
19
|
});
|
|
@@ -18,30 +21,30 @@ export let TypeElement = class TypeElement {
|
|
|
18
21
|
return this.type;
|
|
19
22
|
}
|
|
20
23
|
};
|
|
21
|
-
__decorate([
|
|
22
|
-
ElementChildTextContent(),
|
|
23
|
-
ElementRequired(),
|
|
24
|
-
__metadata("design:type", String)
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, xml_parser_1.ElementChildTextContent)(),
|
|
26
|
+
(0, xml_parser_1.ElementRequired)(),
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
25
28
|
], TypeElement.prototype, "name", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
ElementChildTextContent(),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, xml_parser_1.ElementChildTextContent)(),
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
29
32
|
], TypeElement.prototype, "from", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
ElementAttribute(),
|
|
32
|
-
__metadata("design:type", Boolean)
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, xml_parser_1.ElementAttribute)(),
|
|
35
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
33
36
|
], TypeElement.prototype, "nullable", void 0);
|
|
34
|
-
TypeElement = __decorate([
|
|
35
|
-
ElementDef('type')
|
|
37
|
+
exports.TypeElement = TypeElement = tslib_1.__decorate([
|
|
38
|
+
(0, xml_parser_1.ElementDef)('type')
|
|
36
39
|
], TypeElement);
|
|
37
|
-
|
|
40
|
+
let StringTypeElement = exports.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
|
+
exports.StringTypeElement = StringTypeElement = tslib_1.__decorate([
|
|
47
|
+
(0, xml_parser_1.ElementExtends)(TypeElement),
|
|
48
|
+
(0, xml_parser_1.ElementDef)('string-type')
|
|
46
49
|
], StringTypeElement);
|
|
47
50
|
//# sourceMappingURL=type.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":";;;;AAAA,iDAO0B;AAE1B,mEAA0D;AAGnD,IAAM,WAAW,yBAAjB,MAAM,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,IAAA,mCAAa,EAAC,UAAU,EAAE;gBACxB,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;AAzBQ;IAFN,IAAA,oCAAuB,GAAE;IACzB,IAAA,4BAAe,GAAE;;yCACG;AAGd;IADN,IAAA,oCAAuB,GAAE;;yCACL;AAGd;IADN,IAAA,6BAAgB,GAAE;;6CACO;sBAVf,WAAW;IADvB,IAAA,uBAAU,EAAC,MAAM,CAAC;GACN,WAAW,CA6BvB;AAIM,IAAM,iBAAiB,+BAAvB,MAAM,iBAAkB,SAAQ,WAAW;IAA3C;;QAEW,SAAI,GAAG,QAAQ,CAAC;IAElC,CAAC;CAAA,CAAA;4BAJY,iBAAiB;IAF7B,IAAA,2BAAc,EAAC,WAAW,CAAC;IAC3B,IAAA,uBAAU,EAAC,aAAa,CAAC;GACb,iBAAiB,CAI7B"}
|
package/src/lib/index.js
CHANGED
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ParsedElement } from '@rxap/xml-parser';
|
|
2
|
-
import { Constructor } from '@rxap/schematics-utilities';
|
|
3
1
|
import { DirEntry, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { Constructor } from '@rxap/schematics-utilities';
|
|
3
|
+
import { ParsedElement } from '@rxap/xml-parser';
|
|
4
4
|
export declare function FindTemplate(template: string, host: Tree, basePath: string | undefined, baseDirEntry?: DirEntry): string | null;
|
|
5
5
|
/**
|
|
6
6
|
* Parse the template and returns the ParsedElement object
|
|
@@ -33,9 +33,10 @@ export declare function FindTemplate(template: string, host: Tree, basePath: str
|
|
|
33
33
|
* - templates/feature/product/views/tables/product.xml
|
|
34
34
|
* - templates/shared/views/tables/product.xml
|
|
35
35
|
*
|
|
36
|
+
* @param DOMParser
|
|
36
37
|
* @param host a schematic Tree instance
|
|
37
38
|
* @param template the path to the template xml document or a xml document
|
|
38
39
|
* @param basePath the basePath for the search
|
|
39
40
|
* @param elements a collection of ParsedElement class constructors that should be include in the xml parsing
|
|
40
41
|
*/
|
|
41
|
-
export declare function ParseTemplate<T extends ParsedElement>(host: Tree, template: string, basePath: string | string[] | undefined, ...elements: Array<Constructor<ParsedElement>>): T;
|
|
42
|
+
export declare function ParseTemplate<T extends ParsedElement>(DOMParser: typeof window.DOMParser, host: Tree, template: string, basePath: string | string[] | undefined, ...elements: Array<Constructor<ParsedElement>>): T;
|
|
@@ -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 schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const xml_parser_1 = require("@rxap/xml-parser");
|
|
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 = (0, 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 = (0, 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 = (0, 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
|
*
|
|
@@ -62,16 +66,17 @@ export function FindTemplate(template, host, basePath, baseDirEntry = host.getDi
|
|
|
62
66
|
* - templates/feature/product/views/tables/product.xml
|
|
63
67
|
* - templates/shared/views/tables/product.xml
|
|
64
68
|
*
|
|
69
|
+
* @param DOMParser
|
|
65
70
|
* @param host a schematic Tree instance
|
|
66
71
|
* @param template the path to the template xml document or a xml document
|
|
67
72
|
* @param basePath the basePath for the search
|
|
68
73
|
* @param elements a collection of ParsedElement class constructors that should be include in the xml parsing
|
|
69
74
|
*/
|
|
70
|
-
|
|
75
|
+
function ParseTemplate(DOMParser, host, template, basePath, ...elements) {
|
|
71
76
|
let templateFile;
|
|
72
77
|
let filename = '__inline__';
|
|
73
78
|
let templateFilePath = template;
|
|
74
|
-
const basePathList = coerceArray(basePath);
|
|
79
|
+
const basePathList = (0, schematics_utilities_1.coerceArray)(basePath);
|
|
75
80
|
if (template.match(/\.xml$/)) {
|
|
76
81
|
if (!host.exists(template)) {
|
|
77
82
|
for (const bp of basePathList) {
|
|
@@ -100,11 +105,12 @@ export function ParseTemplate(host, template, basePath, ...elements) {
|
|
|
100
105
|
else {
|
|
101
106
|
templateFile = template;
|
|
102
107
|
}
|
|
103
|
-
const parser = new XmlParserService();
|
|
108
|
+
const parser = new xml_parser_1.XmlParserService(DOMParser);
|
|
104
109
|
parser.register(...elements);
|
|
105
110
|
if (!templateFile) {
|
|
106
111
|
throw new Error('The template for the xml parser is not defined');
|
|
107
112
|
}
|
|
108
113
|
return parser.parseFromXml(templateFile, filename, templateFilePath);
|
|
109
114
|
}
|
|
115
|
+
exports.ParseTemplate = ParseTemplate;
|
|
110
116
|
//# sourceMappingURL=parse-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":";;;AAIA,qEAGoC;AACpC,iDAG0B;AAC1B,+BAA4B;AAE5B,SAAgB,YAAY,CAC1B,QAAgB,EAChB,IAAU,EACV,QAA4B,EAC5B,eAAyB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IAGjD,IAAI,QAAQ,EAAE;QACZ,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,0DAA2D,IAAK,EAAE,CAAC,CAAC;SAClF;KACF;SAAM;QACL,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,oDAAq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