@ama-sdk/schematics 0.0.0-placeholder

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.
Files changed (144) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +72 -0
  3. package/collection.json +42 -0
  4. package/package.json +148 -0
  5. package/schematics/api-extension/index.d.ts +9 -0
  6. package/schematics/api-extension/index.d.ts.map +1 -0
  7. package/schematics/api-extension/index.js +21 -0
  8. package/schematics/api-extension/index.js.map +1 -0
  9. package/schematics/api-extension/schema.d.ts +10 -0
  10. package/schematics/api-extension/schema.d.ts.map +1 -0
  11. package/schematics/api-extension/schema.js +3 -0
  12. package/schematics/api-extension/schema.js.map +1 -0
  13. package/schematics/api-extension/schema.json +37 -0
  14. package/schematics/api-extension/templates/.gitignore.template +38 -0
  15. package/schematics/api-extension/templates/.npmrc.template +4 -0
  16. package/schematics/api-extension/templates/package.json.template +16 -0
  17. package/schematics/api-extension/templates/src/API_swagger_template.yaml +269 -0
  18. package/schematics/api-extension/templates/src/definitions/__name__ExampleReply.yaml +20 -0
  19. package/schematics/api-extension/templates/src/generate.config.json +10 -0
  20. package/schematics/api-extension/templates/src/override/.gitkeep +0 -0
  21. package/schematics/api-extension/templates/src/products/Additional Products.yaml +25 -0
  22. package/schematics/helpers/execute-jars.d.ts +14 -0
  23. package/schematics/helpers/execute-jars.d.ts.map +1 -0
  24. package/schematics/helpers/execute-jars.js +62 -0
  25. package/schematics/helpers/execute-jars.js.map +1 -0
  26. package/schematics/helpers/generator-java.task.d.ts +59 -0
  27. package/schematics/helpers/generator-java.task.d.ts.map +1 -0
  28. package/schematics/helpers/generator-java.task.js +83 -0
  29. package/schematics/helpers/generator-java.task.js.map +1 -0
  30. package/schematics/helpers/read-package.d.ts +4 -0
  31. package/schematics/helpers/read-package.d.ts.map +1 -0
  32. package/schematics/helpers/read-package.js +12 -0
  33. package/schematics/helpers/read-package.js.map +1 -0
  34. package/schematics/helpers/tree-glob.d.ts +9 -0
  35. package/schematics/helpers/tree-glob.d.ts.map +1 -0
  36. package/schematics/helpers/tree-glob.js +27 -0
  37. package/schematics/helpers/tree-glob.js.map +1 -0
  38. package/schematics/java/client-core/index.d.ts +9 -0
  39. package/schematics/java/client-core/index.d.ts.map +1 -0
  40. package/schematics/java/client-core/index.js +74 -0
  41. package/schematics/java/client-core/index.js.map +1 -0
  42. package/schematics/java/client-core/schema.d.ts +8 -0
  43. package/schematics/java/client-core/schema.d.ts.map +1 -0
  44. package/schematics/java/client-core/schema.js +3 -0
  45. package/schematics/java/client-core/schema.js.map +1 -0
  46. package/schematics/java/client-core/schema.json +26 -0
  47. package/schematics/ng-add/index.d.ts +15 -0
  48. package/schematics/ng-add/index.d.ts.map +1 -0
  49. package/schematics/ng-add/index.js +106 -0
  50. package/schematics/ng-add/index.js.map +1 -0
  51. package/schematics/ng-add/schema.d.ts +6 -0
  52. package/schematics/ng-add/schema.d.ts.map +1 -0
  53. package/schematics/ng-add/schema.js +3 -0
  54. package/schematics/ng-add/schema.js.map +1 -0
  55. package/schematics/ng-add/schema.json +18 -0
  56. package/schematics/resources/swagger-codegen-cli.jar +0 -0
  57. package/schematics/typescript/core/index.d.ts +9 -0
  58. package/schematics/typescript/core/index.d.ts.map +1 -0
  59. package/schematics/typescript/core/index.js +109 -0
  60. package/schematics/typescript/core/index.js.map +1 -0
  61. package/schematics/typescript/core/schema.d.ts +6 -0
  62. package/schematics/typescript/core/schema.d.ts.map +1 -0
  63. package/schematics/typescript/core/schema.js +3 -0
  64. package/schematics/typescript/core/schema.js.map +1 -0
  65. package/schematics/typescript/core/schema.json +21 -0
  66. package/schematics/typescript/core/templates/src/spec/operation-adapter.ts.template +5 -0
  67. package/schematics/typescript/create/index.d.ts +9 -0
  68. package/schematics/typescript/create/index.d.ts.map +1 -0
  69. package/schematics/typescript/create/index.js +17 -0
  70. package/schematics/typescript/create/index.js.map +1 -0
  71. package/schematics/typescript/create/schema.d.ts +5 -0
  72. package/schematics/typescript/create/schema.d.ts.map +1 -0
  73. package/schematics/typescript/create/schema.js +3 -0
  74. package/schematics/typescript/create/schema.js.map +1 -0
  75. package/schematics/typescript/create/schema.json +40 -0
  76. package/schematics/typescript/mock/index.d.ts +15 -0
  77. package/schematics/typescript/mock/index.d.ts.map +1 -0
  78. package/schematics/typescript/mock/index.js +84 -0
  79. package/schematics/typescript/mock/index.js.map +1 -0
  80. package/schematics/typescript/mock/schema.d.ts +12 -0
  81. package/schematics/typescript/mock/schema.d.ts.map +1 -0
  82. package/schematics/typescript/mock/schema.js +3 -0
  83. package/schematics/typescript/mock/schema.js.map +1 -0
  84. package/schematics/typescript/mock/schema.json +42 -0
  85. package/schematics/typescript/mock/templates/__dasherizeModelName__.mock.ts +85 -0
  86. package/schematics/typescript/mock/templates/__dasherizeModelName__.spec.ts +51 -0
  87. package/schematics/typescript/mock/templates/index.ts +1 -0
  88. package/schematics/typescript/shell/index.d.ts +7 -0
  89. package/schematics/typescript/shell/index.d.ts.map +1 -0
  90. package/schematics/typescript/shell/index.js +54 -0
  91. package/schematics/typescript/shell/index.js.map +1 -0
  92. package/schematics/typescript/shell/schema.d.ts +10 -0
  93. package/schematics/typescript/shell/schema.d.ts.map +1 -0
  94. package/schematics/typescript/shell/schema.js +3 -0
  95. package/schematics/typescript/shell/schema.js.map +1 -0
  96. package/schematics/typescript/shell/schema.json +30 -0
  97. package/schematics/typescript/shell/templates/base/.commitlintrc.json +37 -0
  98. package/schematics/typescript/shell/templates/base/.editorconfig +13 -0
  99. package/schematics/typescript/shell/templates/base/.eslintignore +9 -0
  100. package/schematics/typescript/shell/templates/base/.eslintrc.js +46 -0
  101. package/schematics/typescript/shell/templates/base/.husky/commit-msg +4 -0
  102. package/schematics/typescript/shell/templates/base/.husky/pre-commit +4 -0
  103. package/schematics/typescript/shell/templates/base/.renovaterc.json +93 -0
  104. package/schematics/typescript/shell/templates/base/.swagger-codegen-ignore +1 -0
  105. package/schematics/typescript/shell/templates/base/.swcrc +16 -0
  106. package/schematics/typescript/shell/templates/base/.versionrc.json +9 -0
  107. package/schematics/typescript/shell/templates/base/.yarnrc.yml +6 -0
  108. package/schematics/typescript/shell/templates/base/CONTRIBUTING.md +4 -0
  109. package/schematics/typescript/shell/templates/base/configs/tsconfig.test.json +21 -0
  110. package/schematics/typescript/shell/templates/base/jest.config.js +23 -0
  111. package/schematics/typescript/shell/templates/base/package.json +119 -0
  112. package/schematics/typescript/shell/templates/base/readme.md +134 -0
  113. package/schematics/typescript/shell/templates/base/scripts/clear-index.js +30 -0
  114. package/schematics/typescript/shell/templates/base/scripts/files-pack.js +74 -0
  115. package/schematics/typescript/shell/templates/base/scripts/override-readme.js +15 -0
  116. package/schematics/typescript/shell/templates/base/scripts/restore-readme.js +14 -0
  117. package/schematics/typescript/shell/templates/base/src/fixtures/jest/index.ts +1 -0
  118. package/schematics/typescript/shell/templates/base/src/fixtures/jest/package.json +10 -0
  119. package/schematics/typescript/shell/templates/base/src/helpers/index.ts +1 -0
  120. package/schematics/typescript/shell/templates/base/src/helpers/package.json +10 -0
  121. package/schematics/typescript/shell/templates/base/src/index.ts +4 -0
  122. package/schematics/typescript/shell/templates/base/src/models/base/index.ts +0 -0
  123. package/schematics/typescript/shell/templates/base/src/models/core/enums.ts +2 -0
  124. package/schematics/typescript/shell/templates/base/src/models/core/index.ts +2 -0
  125. package/schematics/typescript/shell/templates/base/src/models/core/patterns.ts +2 -0
  126. package/schematics/typescript/shell/templates/base/src/models/custom/enums.ts +2 -0
  127. package/schematics/typescript/shell/templates/base/src/models/custom/index.ts +1 -0
  128. package/schematics/typescript/shell/templates/base/src/models/custom/patterns.ts +2 -0
  129. package/schematics/typescript/shell/templates/base/src/models/enums.ts +4 -0
  130. package/schematics/typescript/shell/templates/base/src/models/index.ts +6 -0
  131. package/schematics/typescript/shell/templates/base/src/models/patterns.ts +4 -0
  132. package/schematics/typescript/shell/templates/base/src/spec/index.ts +3 -0
  133. package/schematics/typescript/shell/templates/base/src/spec/mock-factory/index.ts +2 -0
  134. package/schematics/typescript/shell/templates/base/src/spec/package.json +10 -0
  135. package/schematics/typescript/shell/templates/base/testing/tsconfig.spec.json +24 -0
  136. package/schematics/typescript/shell/templates/base/tsconfig.build.json +44 -0
  137. package/schematics/typescript/shell/templates/base/tsconfig.doc.json +20 -0
  138. package/schematics/typescript/shell/templates/base/tsconfig.json +14 -0
  139. package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.jest.json +16 -0
  140. package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.json +10 -0
  141. package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.source.json +11 -0
  142. package/schematics/typescript/shell/templates/base/tsconfigs/tsconfig.jest.json +20 -0
  143. package/schematics/typescript/shell/templates/base/tsconfigs/tsconfig.source.json +13 -0
  144. package/schematics/typescript/shell/templates/base/typedoc.json +12 -0
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright Amadeus SAS
2
+
3
+ Redistribution and use in source and binary forms, with or without modification,
4
+ are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this
7
+ list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation and/or
11
+ other materials provided with the distribution.
12
+
13
+ 3. Neither the name of the copyright holder nor the names of its contributors
14
+ may be used to endorse or promote products derived from this software without
15
+ specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # SDK Generator
2
+
3
+ This package provides `schematics` generators to create an SDK based on an API swagger spec.
4
+
5
+ ## Setup
6
+
7
+ The Angular schematics package is required to use these generators:
8
+
9
+ if you are in an Angular project
10
+
11
+ ```shell
12
+ yarn ng add @ama-sdk/schematics
13
+ yarn ng add @ama-sdk/core
14
+ ```
15
+ or
16
+ ```shell
17
+ npx -p @angular/cli ng add @ama-sdk/schematics
18
+ npx -p @angular/cli ng add @ama-sdk/core
19
+ ```
20
+
21
+ else
22
+
23
+ ```shell
24
+ # Install @angular-devkit/schematics-cli, @ama-sdk/core and the SDK generator
25
+ yarn add --dev @angular-devkit/schematics-cli @ama-sdk/schematics @ama-sdk/core
26
+ yarn schematics @ama-sdk/schematics:install
27
+ yarn schematics @ama-sdk/core:install
28
+ ```
29
+ or
30
+ ```shell
31
+ npm i -D @angular-devkit/schematics-cli @ama-sdk/schematics @ama-sdk/core
32
+ npx -p @angular-devkit/schematics-cli schematics @ama-sdk/schematics:install
33
+ npx -p @angular-devkit/schematics-cli schematics @ama-sdk/core:install
34
+ ```
35
+
36
+ ## How to use?
37
+
38
+ ### Typescript SDK
39
+
40
+ The typescript generator provides 2 generators:
41
+
42
+ - **shell**: To generate the "shell" of an SDK package
43
+ - **core**: To (re)generate the SDK based on a specified Swagger spec
44
+ - **create**: To create a new SDK from scratch (i.e. chain **shell** and **core**)
45
+
46
+ To generate the `shell` you can run:
47
+
48
+ ```shell
49
+ yarn schematics @ama-sdk/schematics:typescript-shell
50
+ ```
51
+
52
+ If you use `Yarn2+`, you can use the following `scripts` in `package.json`:
53
+
54
+ ```json
55
+ "resolve": "node -e 'process.stdout.write(require.resolve(process.argv[1]));'",
56
+ "generate": "yarn schematics @ama-sdk/schematics:typescript-core --swagger-spec-path ./swagger-spec.yaml",
57
+ "upgrade:repository": "yarn schematics @ama-sdk/schematics:typescript-shell",
58
+ ```
59
+
60
+ Use `generate` to (re)generate your SDK based on the content of `./swagger-spec.yaml` (make sure you have this file at the root of your project) and `upgrade:repository` to regenerate the structure of your project.
61
+
62
+ ### Java Client Core SDK
63
+
64
+ Generate a Java Client Core SDK:
65
+
66
+ Make sure to have a `./swagger-spec.yaml` file at the root of your project and run:
67
+
68
+ ```shell
69
+ yarn schematics @ama-sdk/schematics:java-client-core --swagger-spec-path ./swagger-spec.yaml --swagger-config-path ./swagger-codegen-config.json
70
+ ```
71
+
72
+ [Default swagger config](./schematics/java/client-core/swagger-codegen-java-client/config/swagger-codegen-config.json) will be used if `--swagger-config-path` is not provided.
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Add Otter ama-sdk-schematics to the project.",
6
+ "factory": "./schematics/ng-add/index#ngAdd",
7
+ "schema": "./schematics/ng-add/schema.json",
8
+ "aliases": ["install", "i"]
9
+ },
10
+ "typescript-mock": {
11
+ "description": "Generate an api mock into the project.",
12
+ "factory": "./schematics/typescript/mock/index#ngGenerateMock",
13
+ "schema": "./schematics/typescript/mock/schema.json"
14
+ },
15
+ "api-extension": {
16
+ "description": "Generate a api specification extension.",
17
+ "factory": "./schematics/api-extension/index#ngGenerateApiExtension",
18
+ "schema": "./schematics/api-extension/schema.json"
19
+ },
20
+ "typescript-core": {
21
+ "description": "Generate a typescript SDK source code based on swagger specification",
22
+ "factory": "./schematics/typescript/core/index#ngGenerateTypescriptSDK",
23
+ "schema": "./schematics/typescript/core/schema.json"
24
+ },
25
+ "typescript-shell": {
26
+ "description": "Generate a typescript SDK repository shell",
27
+ "factory": "./schematics/typescript/shell/index#ngGenerateTypescriptSDK",
28
+ "schema": "./schematics/typescript/shell/schema.json"
29
+ },
30
+ "typescript-sdk": {
31
+ "alias": ["typescript-create"],
32
+ "description": "Generate a typescript SDK repository with code based on swagger specification",
33
+ "factory": "./schematics/typescript/create/index#ngGenerateTypescriptSDK",
34
+ "schema": "./schematics/typescript/create/schema.json"
35
+ },
36
+ "java-client-core": {
37
+ "description": "Generate a Java SDK source code based on swagger specification",
38
+ "factory": "./schematics/java/client-core/index#ngGenerateJavaClientCore",
39
+ "schema": "./schematics/java/client-core/schema.json"
40
+ }
41
+ }
42
+ }
package/package.json ADDED
@@ -0,0 +1,148 @@
1
+ {
2
+ "name": "@ama-sdk/schematics",
3
+ "version": "0.0.0-placeholder",
4
+ "description": "Swagger specification SDK Generator by schematics",
5
+ "scripts": {
6
+ "nx": "nx",
7
+ "ng": "yarn nx",
8
+ "test": "yarn nx test ama-sdk-schematics",
9
+ "prepare:build:builders": "yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' 'schematics/**/*.jar' dist/schematics && yarn cpy '{package,collection}.json' dist",
10
+ "build": "yarn nx build ama-sdk-schematics",
11
+ "build:builders": "tsc -b tsconfig.builders.json --pretty",
12
+ "install-swagger-cli": "mvn install:install-file -DgroupId=io.swagger -DartifactId=swagger-codegen-cli -Dversion=2.4.0-AMADEUS -Dpackaging=jar -Dfile=./schematics/resources/swagger-codegen-cli.jar",
13
+ "build:swagger": "yarn install-swagger-cli && run-p 'build:swagger-*'",
14
+ "build:swagger-typescript-gen": "mvn clean package -f ./schematics/typescript/core/swagger-codegen-typescript/pom.xml",
15
+ "build:swagger-java-client-gen": "mvn clean package -f ./schematics/java/client-core/swagger-codegen-java-client/pom.xml",
16
+ "prepare:publish": "prepare-publish ./dist"
17
+ },
18
+ "schematics": "./collection.json",
19
+ "keywords": [
20
+ "schematics",
21
+ "sdk"
22
+ ],
23
+ "peerDependenciesMeta": {
24
+ "@ama-sdk/core": {
25
+ "optional": true
26
+ },
27
+ "@angular-devkit/schematics-cli": {
28
+ "optional": true
29
+ },
30
+ "@angular/cli": {
31
+ "optional": true
32
+ },
33
+ "@angular/compiler": {
34
+ "optional": true
35
+ }
36
+ },
37
+ "peerDependencies": {
38
+ "@ama-sdk/core": "workspace:^",
39
+ "@angular-devkit/core": "~15.2.0",
40
+ "@angular-devkit/schematics": "~15.2.0",
41
+ "@angular-devkit/schematics-cli": "~15.2.0",
42
+ "@angular/cli": "~15.2.0",
43
+ "@schematics/angular": "~15.2.0"
44
+ },
45
+ "dependencies": {
46
+ "@angular-devkit/core": "~15.2.0",
47
+ "@angular-devkit/schematics": "~15.2.0",
48
+ "@o3r/dev-tools": "workspace:^",
49
+ "minimatch": "^6.1.6",
50
+ "rxjs": "^7.4.0",
51
+ "sway": "^2.0.6",
52
+ "tslib": "^2.4.1"
53
+ },
54
+ "devDependencies": {
55
+ "@ama-sdk/core": "workspace:^",
56
+ "@angular-devkit/schematics-cli": "~15.2.0",
57
+ "@angular-eslint/eslint-plugin": "~15.2.0",
58
+ "@angular/cli": "~15.2.0",
59
+ "@nrwl/jest": "~15.9.0",
60
+ "@o3r/build-helpers": "workspace:^",
61
+ "@o3r/eslint-plugin": "workspace:^",
62
+ "@schematics/angular": "~15.2.0",
63
+ "@types/jest": "~28.1.2",
64
+ "@types/minimatch": "^5.1.2",
65
+ "@types/node": "^17.0.45",
66
+ "@types/pid-from-port": "^1.1.0",
67
+ "@types/semver": "^7.3.13",
68
+ "@typescript-eslint/eslint-plugin": "^5.19.0",
69
+ "@typescript-eslint/parser": "^5.19.0",
70
+ "copyfiles": "^2.4.1",
71
+ "cpy-cli": "^4.2.0",
72
+ "eslint": "^8.22.0",
73
+ "eslint-import-resolver-node": "^0.3.4",
74
+ "eslint-plugin-jest": "^26.1.4",
75
+ "eslint-plugin-jsdoc": "^39.3.6",
76
+ "eslint-plugin-prefer-arrow": "^1.2.3",
77
+ "eslint-plugin-unicorn": "^45.0.2",
78
+ "isomorphic-fetch": "~2.2.1",
79
+ "jest": "~28.1.1",
80
+ "mem-fs": "^2.2.1",
81
+ "npm-run-all": "^4.1.5",
82
+ "nx": "~15.9.0",
83
+ "onchange": "^7.0.2",
84
+ "pid-from-port": "^1.1.3",
85
+ "semver": "^7.3.2",
86
+ "ts-jest": "^28.0.5",
87
+ "type-fest": "^3.6.1",
88
+ "typescript": "~4.9.4"
89
+ },
90
+ "engines": {
91
+ "node": ">=16.0.0",
92
+ "npm": ">=4",
93
+ "yarn": "<4.0.0"
94
+ },
95
+ "contributors": [
96
+ {
97
+ "name": "Yannick Adam",
98
+ "email": "yannickadam@users.noreply.github.com"
99
+ },
100
+ {
101
+ "name": "Kilian Panot",
102
+ "email": "kpanot@users.noreply.github.com"
103
+ },
104
+ {
105
+ "name": "Jeremy Bourgeois",
106
+ "email": "jbourgeois-1A@users.noreply.github.com"
107
+ },
108
+ {
109
+ "name": "Pierre Henri Ginoux",
110
+ "email": "pginoux-1A@users.noreply.github.com"
111
+ },
112
+ {
113
+ "name": "Mircea Vasile Rednic",
114
+ "email": "mrednic-1A@users.noreply.github.com"
115
+ },
116
+ {
117
+ "name": "Stephane Dalle",
118
+ "email": "sdalle-1A@users.noreply.github.com"
119
+ },
120
+ {
121
+ "name": "Nicolas Hoffmann",
122
+ "email": "nhoffmann-1A@users.noreply.github.com"
123
+ },
124
+ {
125
+ "name": "Victor Scaiceanu",
126
+ "email": "vscaiceanu-1A@users.noreply.github.com"
127
+ },
128
+ {
129
+ "name": "Florian Paul",
130
+ "email": "fpaul-1A@users.noreply.github.com"
131
+ },
132
+ {
133
+ "name": "Corinne Paulve",
134
+ "email": "cpaulve-1A@users.noreply.github.com"
135
+ },
136
+ {
137
+ "name": "Matthieu Crouzet",
138
+ "email": "matthieu-crouzet@users.noreply.github.com"
139
+ },
140
+ {
141
+ "name": "Salome Do",
142
+ "email": "sdo-1A@users.noreply.github.com"
143
+ }
144
+ ],
145
+ "bugs": "https://github.com/AmadeusITGroup/otter/issues",
146
+ "repository": "https://github.com/AmadeusITGroup/otter",
147
+ "license": "BSD-3-Clause"
148
+ }
@@ -0,0 +1,9 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { NgGenerateApiExtensionSchematicsSchema } from './schema';
3
+ /**
4
+ * Generate a Extension of a API core definition
5
+ *
6
+ * @param options
7
+ */
8
+ export declare function ngGenerateApiExtension(options: NgGenerateApiExtensionSchematicsSchema): Rule;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sCAAsC,EAAE,MAAM,UAAU,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,sCAAsC,GAAG,IAAI,CAW5F"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngGenerateApiExtension = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ /**
6
+ * Generate a Extension of a API core definition
7
+ *
8
+ * @param options
9
+ */
10
+ function ngGenerateApiExtension(options) {
11
+ return (tree) => (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
12
+ (0, schematics_1.template)({
13
+ ...options,
14
+ empty: ''
15
+ }),
16
+ (0, schematics_1.move)(tree.root.path),
17
+ (0, schematics_1.renameTemplateFiles)()
18
+ ]), schematics_1.MergeStrategy.Overwrite);
19
+ }
20
+ exports.ngGenerateApiExtension = ngGenerateApiExtension;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":";;;AAAA,2DASoC;AAGpC;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,OAA+C;IAEpF,OAAO,CAAC,IAAU,EAAE,EAAE,CAAC,IAAA,sBAAS,EAAC,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,aAAa,CAAC,EAAE;QACzD,IAAA,qBAAQ,EAAC;YACP,GAAG,OAAO;YACV,KAAK,EAAE,EAAE;SACV,CAAC;QACF,IAAA,iBAAI,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACpB,IAAA,gCAAmB,GAAE;KACtB,CAAC,EAAE,0BAAa,CAAC,SAAS,CAAC,CAAC;AAE/B,CAAC;AAXD,wDAWC"}
@@ -0,0 +1,10 @@
1
+ import { JsonObject } from '@angular-devkit/core';
2
+ export interface NgGenerateApiExtensionSchematicsSchema extends JsonObject {
3
+ /** Extension Name */
4
+ name: string;
5
+ /** Type of the core API to extend */
6
+ coreType: 'private' | 'public';
7
+ /** Version of the core API to extend */
8
+ coreVersion: string;
9
+ }
10
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,WAAW,sCAAuC,SAAQ,UAAU;IACxE,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/api-extension/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "NgGenerateApiExtensionSchematicsSchema",
4
+ "title": "Generate Api Extension",
5
+ "description": "ng generate api-extension",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "Extension Name",
10
+ "x-prompt": "Extension Name?",
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ }
15
+ },
16
+ "coreType": {
17
+ "type": "string",
18
+ "description": "Type of the core API to extend",
19
+ "x-prompt": "Type of the core API to extend?",
20
+ "enum": [
21
+ "private",
22
+ "public"
23
+ ]
24
+ },
25
+ "coreVersion": {
26
+ "type": "string",
27
+ "description": "Version of the core API to extend",
28
+ "x-prompt": "Version of the core API to extend?"
29
+ }
30
+ },
31
+ "additionalProperties": true,
32
+ "required": [
33
+ "name",
34
+ "coreType",
35
+ "coreVersion"
36
+ ]
37
+ }
@@ -0,0 +1,38 @@
1
+ # IDE project files
2
+ .classpath
3
+ .project
4
+ .settings/
5
+ dist/
6
+ /swagger-spec/src/
7
+ .idea
8
+ *.iml
9
+
10
+
11
+ # sublime text
12
+ *.sublime-project
13
+ *.sublime-workspace
14
+
15
+ # ADK
16
+ adkprj.json
17
+
18
+ # Version control and merge
19
+ *.orig
20
+
21
+ # reports / logs / runtime generated files
22
+ **/target
23
+
24
+ # Dependency directories
25
+ node_modules
26
+
27
+ # Bundled files
28
+ swagger-spec/src/bundles
29
+ swagger-spec/src/main
30
+
31
+ # NPM
32
+ .npm
33
+ package-lock.json
34
+
35
+ # Logs
36
+ logs
37
+ *.log
38
+ npm-debug.log*
@@ -0,0 +1,4 @@
1
+ # Please contact the Otter Team to get your access to the de specific API to extend
2
+
3
+ always-auth=true
4
+ package-lock=false
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@<%= name %>-spec/<%= coreType %>",
3
+ "version": "0.0.0",
4
+ "main": "dist/API_<%= name %>_<%= coreType %>.yaml",
5
+ "description": "<%= name %> API",
6
+ "scripts": {
7
+ "build": "swagger-build @api-spec/core-<%= coreType %> ./src/generate.config.json -o ./dist/API_<%= name %>_<%= coreType %>.yaml -u"
8
+ },
9
+ "devDependencies": {
10
+ "@ama-sdk/swagger-builder": "^<%= myVersion %>",
11
+ "@api-spec/core-<%= coreType %>": "^<%= coreVersion %>"
12
+ },
13
+ "files": [
14
+ "dist/"
15
+ ]
16
+ }