@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.
- package/LICENSE +26 -0
- package/README.md +72 -0
- package/collection.json +42 -0
- package/package.json +148 -0
- package/schematics/api-extension/index.d.ts +9 -0
- package/schematics/api-extension/index.d.ts.map +1 -0
- package/schematics/api-extension/index.js +21 -0
- package/schematics/api-extension/index.js.map +1 -0
- package/schematics/api-extension/schema.d.ts +10 -0
- package/schematics/api-extension/schema.d.ts.map +1 -0
- package/schematics/api-extension/schema.js +3 -0
- package/schematics/api-extension/schema.js.map +1 -0
- package/schematics/api-extension/schema.json +37 -0
- package/schematics/api-extension/templates/.gitignore.template +38 -0
- package/schematics/api-extension/templates/.npmrc.template +4 -0
- package/schematics/api-extension/templates/package.json.template +16 -0
- package/schematics/api-extension/templates/src/API_swagger_template.yaml +269 -0
- package/schematics/api-extension/templates/src/definitions/__name__ExampleReply.yaml +20 -0
- package/schematics/api-extension/templates/src/generate.config.json +10 -0
- package/schematics/api-extension/templates/src/override/.gitkeep +0 -0
- package/schematics/api-extension/templates/src/products/Additional Products.yaml +25 -0
- package/schematics/helpers/execute-jars.d.ts +14 -0
- package/schematics/helpers/execute-jars.d.ts.map +1 -0
- package/schematics/helpers/execute-jars.js +62 -0
- package/schematics/helpers/execute-jars.js.map +1 -0
- package/schematics/helpers/generator-java.task.d.ts +59 -0
- package/schematics/helpers/generator-java.task.d.ts.map +1 -0
- package/schematics/helpers/generator-java.task.js +83 -0
- package/schematics/helpers/generator-java.task.js.map +1 -0
- package/schematics/helpers/read-package.d.ts +4 -0
- package/schematics/helpers/read-package.d.ts.map +1 -0
- package/schematics/helpers/read-package.js +12 -0
- package/schematics/helpers/read-package.js.map +1 -0
- package/schematics/helpers/tree-glob.d.ts +9 -0
- package/schematics/helpers/tree-glob.d.ts.map +1 -0
- package/schematics/helpers/tree-glob.js +27 -0
- package/schematics/helpers/tree-glob.js.map +1 -0
- package/schematics/java/client-core/index.d.ts +9 -0
- package/schematics/java/client-core/index.d.ts.map +1 -0
- package/schematics/java/client-core/index.js +74 -0
- package/schematics/java/client-core/index.js.map +1 -0
- package/schematics/java/client-core/schema.d.ts +8 -0
- package/schematics/java/client-core/schema.d.ts.map +1 -0
- package/schematics/java/client-core/schema.js +3 -0
- package/schematics/java/client-core/schema.js.map +1 -0
- package/schematics/java/client-core/schema.json +26 -0
- package/schematics/ng-add/index.d.ts +15 -0
- package/schematics/ng-add/index.d.ts.map +1 -0
- package/schematics/ng-add/index.js +106 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +6 -0
- package/schematics/ng-add/schema.d.ts.map +1 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +18 -0
- package/schematics/resources/swagger-codegen-cli.jar +0 -0
- package/schematics/typescript/core/index.d.ts +9 -0
- package/schematics/typescript/core/index.d.ts.map +1 -0
- package/schematics/typescript/core/index.js +109 -0
- package/schematics/typescript/core/index.js.map +1 -0
- package/schematics/typescript/core/schema.d.ts +6 -0
- package/schematics/typescript/core/schema.d.ts.map +1 -0
- package/schematics/typescript/core/schema.js +3 -0
- package/schematics/typescript/core/schema.js.map +1 -0
- package/schematics/typescript/core/schema.json +21 -0
- package/schematics/typescript/core/templates/src/spec/operation-adapter.ts.template +5 -0
- package/schematics/typescript/create/index.d.ts +9 -0
- package/schematics/typescript/create/index.d.ts.map +1 -0
- package/schematics/typescript/create/index.js +17 -0
- package/schematics/typescript/create/index.js.map +1 -0
- package/schematics/typescript/create/schema.d.ts +5 -0
- package/schematics/typescript/create/schema.d.ts.map +1 -0
- package/schematics/typescript/create/schema.js +3 -0
- package/schematics/typescript/create/schema.js.map +1 -0
- package/schematics/typescript/create/schema.json +40 -0
- package/schematics/typescript/mock/index.d.ts +15 -0
- package/schematics/typescript/mock/index.d.ts.map +1 -0
- package/schematics/typescript/mock/index.js +84 -0
- package/schematics/typescript/mock/index.js.map +1 -0
- package/schematics/typescript/mock/schema.d.ts +12 -0
- package/schematics/typescript/mock/schema.d.ts.map +1 -0
- package/schematics/typescript/mock/schema.js +3 -0
- package/schematics/typescript/mock/schema.js.map +1 -0
- package/schematics/typescript/mock/schema.json +42 -0
- package/schematics/typescript/mock/templates/__dasherizeModelName__.mock.ts +85 -0
- package/schematics/typescript/mock/templates/__dasherizeModelName__.spec.ts +51 -0
- package/schematics/typescript/mock/templates/index.ts +1 -0
- package/schematics/typescript/shell/index.d.ts +7 -0
- package/schematics/typescript/shell/index.d.ts.map +1 -0
- package/schematics/typescript/shell/index.js +54 -0
- package/schematics/typescript/shell/index.js.map +1 -0
- package/schematics/typescript/shell/schema.d.ts +10 -0
- package/schematics/typescript/shell/schema.d.ts.map +1 -0
- package/schematics/typescript/shell/schema.js +3 -0
- package/schematics/typescript/shell/schema.js.map +1 -0
- package/schematics/typescript/shell/schema.json +30 -0
- package/schematics/typescript/shell/templates/base/.commitlintrc.json +37 -0
- package/schematics/typescript/shell/templates/base/.editorconfig +13 -0
- package/schematics/typescript/shell/templates/base/.eslintignore +9 -0
- package/schematics/typescript/shell/templates/base/.eslintrc.js +46 -0
- package/schematics/typescript/shell/templates/base/.husky/commit-msg +4 -0
- package/schematics/typescript/shell/templates/base/.husky/pre-commit +4 -0
- package/schematics/typescript/shell/templates/base/.renovaterc.json +93 -0
- package/schematics/typescript/shell/templates/base/.swagger-codegen-ignore +1 -0
- package/schematics/typescript/shell/templates/base/.swcrc +16 -0
- package/schematics/typescript/shell/templates/base/.versionrc.json +9 -0
- package/schematics/typescript/shell/templates/base/.yarnrc.yml +6 -0
- package/schematics/typescript/shell/templates/base/CONTRIBUTING.md +4 -0
- package/schematics/typescript/shell/templates/base/configs/tsconfig.test.json +21 -0
- package/schematics/typescript/shell/templates/base/jest.config.js +23 -0
- package/schematics/typescript/shell/templates/base/package.json +119 -0
- package/schematics/typescript/shell/templates/base/readme.md +134 -0
- package/schematics/typescript/shell/templates/base/scripts/clear-index.js +30 -0
- package/schematics/typescript/shell/templates/base/scripts/files-pack.js +74 -0
- package/schematics/typescript/shell/templates/base/scripts/override-readme.js +15 -0
- package/schematics/typescript/shell/templates/base/scripts/restore-readme.js +14 -0
- package/schematics/typescript/shell/templates/base/src/fixtures/jest/index.ts +1 -0
- package/schematics/typescript/shell/templates/base/src/fixtures/jest/package.json +10 -0
- package/schematics/typescript/shell/templates/base/src/helpers/index.ts +1 -0
- package/schematics/typescript/shell/templates/base/src/helpers/package.json +10 -0
- package/schematics/typescript/shell/templates/base/src/index.ts +4 -0
- package/schematics/typescript/shell/templates/base/src/models/base/index.ts +0 -0
- package/schematics/typescript/shell/templates/base/src/models/core/enums.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/models/core/index.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/models/core/patterns.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/models/custom/enums.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/models/custom/index.ts +1 -0
- package/schematics/typescript/shell/templates/base/src/models/custom/patterns.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/models/enums.ts +4 -0
- package/schematics/typescript/shell/templates/base/src/models/index.ts +6 -0
- package/schematics/typescript/shell/templates/base/src/models/patterns.ts +4 -0
- package/schematics/typescript/shell/templates/base/src/spec/index.ts +3 -0
- package/schematics/typescript/shell/templates/base/src/spec/mock-factory/index.ts +2 -0
- package/schematics/typescript/shell/templates/base/src/spec/package.json +10 -0
- package/schematics/typescript/shell/templates/base/testing/tsconfig.spec.json +24 -0
- package/schematics/typescript/shell/templates/base/tsconfig.build.json +44 -0
- package/schematics/typescript/shell/templates/base/tsconfig.doc.json +20 -0
- package/schematics/typescript/shell/templates/base/tsconfig.json +14 -0
- package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.jest.json +16 -0
- package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.json +10 -0
- package/schematics/typescript/shell/templates/base/tsconfigs/esm2020/tsconfig.source.json +11 -0
- package/schematics/typescript/shell/templates/base/tsconfigs/tsconfig.jest.json +20 -0
- package/schematics/typescript/shell/templates/base/tsconfigs/tsconfig.source.json +13 -0
- package/schematics/typescript/shell/templates/base/typedoc.json +12 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
swagger: '2.0'
|
|
2
|
+
info:
|
|
3
|
+
version: 0.0.0
|
|
4
|
+
title: API information
|
|
5
|
+
description: >
|
|
6
|
+
# API information
|
|
7
|
+
|
|
8
|
+
## CRUD operations
|
|
9
|
+
|
|
10
|
+
We do our best to have all our URLs be
|
|
11
|
+
[RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer).
|
|
12
|
+
|
|
13
|
+
Every endpoint (URL) may support one of five different http verbs. GET
|
|
14
|
+
requests fetch information about an object, POST requests create objects.
|
|
15
|
+
|
|
16
|
+
PATCH [JSON Merge Patch](https://tools.ietf.org/html/rfc7396) requests
|
|
17
|
+
perform partial updates.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Structure
|
|
21
|
+
|
|
22
|
+
### The envelope
|
|
23
|
+
|
|
24
|
+
Every response is contained by an envelope. That is, each response has a
|
|
25
|
+
predictable set of keys with which you can expect to interact:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
"warnings": [
|
|
31
|
+
...
|
|
32
|
+
],
|
|
33
|
+
"data": {
|
|
34
|
+
...
|
|
35
|
+
},
|
|
36
|
+
"dictionaries": {
|
|
37
|
+
...
|
|
38
|
+
},
|
|
39
|
+
"errors": [
|
|
40
|
+
...
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### ERRORS
|
|
47
|
+
|
|
48
|
+
Error messages corresponding to functional blocking issues encountered when
|
|
49
|
+
processing an operation.
|
|
50
|
+
|
|
51
|
+
When at least one message has a level 'error' nothing has been processed so
|
|
52
|
+
no 'data' are returned.
|
|
53
|
+
|
|
54
|
+
In this case the HTTP status become 200 for POST (instead of 201) and DELETE
|
|
55
|
+
(instead of 204).
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#### WARNINGS
|
|
59
|
+
|
|
60
|
+
Warning messages corresponding to non blocking issues encountered when
|
|
61
|
+
processing an operation.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
#### DATA
|
|
65
|
+
|
|
66
|
+
The data key is the meat of the response. It contains all information
|
|
67
|
+
regarding the resource requested.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
#### DICTIONARIES
|
|
71
|
+
|
|
72
|
+
Each dictionary contains:
|
|
73
|
+
|
|
74
|
+
- localized data: it's possible to request for a specific code (e.g.
|
|
75
|
+
location code) the translation in the language code specified as query
|
|
76
|
+
parameter. The translation applies as well to the related information: in
|
|
77
|
+
case of location code, type of location (country or city), corresponding
|
|
78
|
+
city, state, country, etc.
|
|
79
|
+
|
|
80
|
+
- dictionarized data: information used on different parts of the message
|
|
81
|
+
can be defined once and referenced via an ID. It that case, the id makes the
|
|
82
|
+
connection between dictionary and data information
|
|
83
|
+
|
|
84
|
+
### Example of request/response
|
|
85
|
+
|
|
86
|
+
When triggering an API operation it is interesting to evaluate the response
|
|
87
|
+
(or the data model corresponding to the input body in case of POST).
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
GET /carts/{cartId}/product/{productId} HTTP/1.1
|
|
92
|
+
|
|
93
|
+
Accept: application/json
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
Multiple errors can occur in response to a single request. The list of error
|
|
99
|
+
messages is provided by the server:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
|
|
103
|
+
HTTP/1.1 400 Bad Request
|
|
104
|
+
|
|
105
|
+
Content-Type: application/json
|
|
106
|
+
|
|
107
|
+
{
|
|
108
|
+
"errors": [
|
|
109
|
+
{
|
|
110
|
+
"code": "04926",
|
|
111
|
+
"source": { "pointer": "/names/0/lastName" },
|
|
112
|
+
"title": "INVALID DATA RECEIVED"
|
|
113
|
+
"detail": "must match \"^[A-Za-zÀ-ÿ][A-Za-zÀ-ÿ -.]{1,69}$\"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"code": "36986",
|
|
117
|
+
"source": { "pointer": "/0/dateOfBirth" },
|
|
118
|
+
"detail": "Date of birth '2042-07-01' should be in the past",
|
|
119
|
+
"title": "INVALID DATA RECEIVED"
|
|
120
|
+
},
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Note: example added for illustration only.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
A few considerations on the error message structure:
|
|
130
|
+
|
|
131
|
+
- The title communicates the type of problem encountered.
|
|
132
|
+
|
|
133
|
+
- The code refers to an application-specific code representing the type of
|
|
134
|
+
problem encountered. Code and title have a similar behaviour, since they
|
|
135
|
+
communicate which is the problem type. However, it is suggested to rely on
|
|
136
|
+
the code as a unique identifier.
|
|
137
|
+
|
|
138
|
+
- The detail is used to provide information specific to this occurrence of
|
|
139
|
+
the problem.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
Message may use source to point to the top-level of the document ("").
|
|
143
|
+
|
|
144
|
+
The source member can also be used to indicate that the error originated
|
|
145
|
+
from a problem with a URI query parameter (parameter field used instead of
|
|
146
|
+
pointer in that case).
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Standard [HTTP response status
|
|
150
|
+
codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) apply. As
|
|
151
|
+
such they are not all mentioned below.
|
|
152
|
+
|
|
153
|
+
## Miscellaneous
|
|
154
|
+
|
|
155
|
+
### Temporary id (tid)
|
|
156
|
+
|
|
157
|
+
A temporary id (``tid``) can be used to:
|
|
158
|
+
|
|
159
|
+
- identify an object in the request of a POST operation when the id of the
|
|
160
|
+
object is not known yet.
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
- identify an object in the response of a PUT operation when the id of the
|
|
164
|
+
object is changing.
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
In all cases, a tid is only valid for the time of the transaction
|
|
168
|
+
|
|
169
|
+
### Output filtering
|
|
170
|
+
|
|
171
|
+
JSON output can be filtered using ``-fields`` and ``fields`` query
|
|
172
|
+
parameters, followed by the fully qualified name of the attribute to
|
|
173
|
+
filter/keep.
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
Optionally the ``keepRequiredFields`` boolean query parameter can be used to
|
|
177
|
+
avoid filtering required fields out.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
Examples:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
GET /carts/{cartId}?-fields=data.products
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
will filter all products out of the response
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
GET /carts/{cartId}?fields=data.products.price
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
will keep only the price of the products in response
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
Any questions, suggestions or feedbacks, thank you for contacting the API
|
|
200
|
+
team
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Traceability token
|
|
204
|
+
|
|
205
|
+
For better traceability of requests, a traceability token can and should
|
|
206
|
+
be added to every call to the API.
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
This token is composed of both a session part and a request part resulting
|
|
210
|
+
in a unique ID for a single request.
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
This opens the door for:
|
|
214
|
+
|
|
215
|
+
- Easy retrieval of information regarding that request.
|
|
216
|
+
|
|
217
|
+
- Linking the request to other requests performed in the same user session.
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
This traceability token is materialized by an ``Ama-Client-Ref`` header
|
|
221
|
+
to be sent in each and every request.
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
This header must be formatted as following: ``${SESSION_ID}:${REQUEST_ID}``.
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
Where:
|
|
228
|
+
|
|
229
|
+
- ``SESSION_ID``: is a client-side generated token identifying the client-side user session
|
|
230
|
+
matching following regular expression ``[a-zA-Z0-9-]{10,48}``.
|
|
231
|
+
A recommended way is to implement it as an
|
|
232
|
+
[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
|
|
233
|
+
in [RFC 4122](https://tools.ietf.org/html/rfc4122) format.
|
|
234
|
+
|
|
235
|
+
- For example: ``123e4567-e89b-12d3-a456-426655440000``
|
|
236
|
+
|
|
237
|
+
- ``REQUEST_ID`` is a client-side request id within the client-side user session matching
|
|
238
|
+
the ``[a-zA-Z0-9]{1,10}`` format.
|
|
239
|
+
|
|
240
|
+
- For example: ``1``, ``42``, ``5fa2``, ``Px2z5``, ...
|
|
241
|
+
|
|
242
|
+
- There is no notion of order between two ``REQUEST_ID``
|
|
243
|
+
|
|
244
|
+
- ``REQUEST_ID`` must be unique within a session.
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
Examples:
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
- Request ``2fc0`` within session ``123e4567-e89b-12d3-a456-426655440000``
|
|
251
|
+
traceability token:
|
|
252
|
+
``Ama-Client-Ref: 123e4567-e89b-12d3-a456-426655440000:2fc0``
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
- Request ``7ba19e`` within session ``123e4567-e89b-12d3-a456-426655440000``
|
|
256
|
+
traceability token:
|
|
257
|
+
``Ama-Client-Ref: 123e4567-e89b-12d3-a456-426655440000:7ba19e``
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
contact:
|
|
261
|
+
email: noreply@<%= name %>.com
|
|
262
|
+
host: your.api.endpoint.com
|
|
263
|
+
basePath: /v2
|
|
264
|
+
schemes:
|
|
265
|
+
- https
|
|
266
|
+
consumes:
|
|
267
|
+
- application/json
|
|
268
|
+
produces:
|
|
269
|
+
- application/json
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
swagger: '2.0'
|
|
2
|
+
info:
|
|
3
|
+
version: 0.0.0
|
|
4
|
+
title: <%= name %>ExampleReply
|
|
5
|
+
description: Definition for the API model <%= name %>ExampleReply
|
|
6
|
+
paths: {}
|
|
7
|
+
definitions:
|
|
8
|
+
<%= name %>ExampleReply:
|
|
9
|
+
type: object
|
|
10
|
+
allOf:
|
|
11
|
+
- $ref: '@api-spec/core-<%= coreType %>#/definitions/CommonReply'
|
|
12
|
+
- type: object
|
|
13
|
+
required:
|
|
14
|
+
- data
|
|
15
|
+
properties:
|
|
16
|
+
data:
|
|
17
|
+
type: object
|
|
18
|
+
properties:
|
|
19
|
+
example:
|
|
20
|
+
type: string
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
swagger: '2.0'
|
|
2
|
+
info:
|
|
3
|
+
version: 0.0.0
|
|
4
|
+
title: <%= name %> Additional products
|
|
5
|
+
description: >-
|
|
6
|
+
TODO: Add description
|
|
7
|
+
tags:
|
|
8
|
+
- name: <%= name %>
|
|
9
|
+
description: <%= name %> Specific routes
|
|
10
|
+
securityDefinitions:
|
|
11
|
+
basicAuth:
|
|
12
|
+
type: basic
|
|
13
|
+
description: HTTP Basic Authentication. Works over `HTTP` and `HTTPS`
|
|
14
|
+
paths:
|
|
15
|
+
/<%= name %>/example:
|
|
16
|
+
get:
|
|
17
|
+
description: Example of GET request
|
|
18
|
+
operationId: <%= name %>RequestExample
|
|
19
|
+
responses:
|
|
20
|
+
'200':
|
|
21
|
+
description: OK
|
|
22
|
+
schema:
|
|
23
|
+
$ref: '../definitions/<%= name %>ExampleReply.yaml#/definitions/<%= name %>ExampleReply'
|
|
24
|
+
tags:
|
|
25
|
+
- <%= name %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Execute the Swagger CLI and codeGen rule factory
|
|
4
|
+
*
|
|
5
|
+
* @param targetFolder folder where to download the jars
|
|
6
|
+
* @param swaggerSpecPath path to the swagger specification
|
|
7
|
+
* @param codegenLanguage codegen template language
|
|
8
|
+
* @param apiTests
|
|
9
|
+
* @param codegenFileName Name of the codeGen jar
|
|
10
|
+
* @param cliFilename Name of the codeGen CLI jar
|
|
11
|
+
* @param swaggerConfigPath path to the swagger configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare const executeSwaggerJarsRuleFactory: (targetFolder: string, swaggerSpecPath: string, codegenLanguage: string, apiTests?: boolean, swaggerConfigPath?: string | null, codegenFileName?: string, cliFilename?: string) => Rule;
|
|
14
|
+
//# sourceMappingURL=execute-jars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-jars.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/execute-jars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAyE,MAAM,4BAA4B,CAAC;AA8ChI;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,iBAC1B,MAAM,mBACH,MAAM,mBACN,MAAM,0CAEH,MAAM,GAAG,IAAI,qDAGhC,IAUF,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeSwaggerJarsRuleFactory = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const generator_java_task_1 = require("./generator-java.task");
|
|
7
|
+
class JavaGeneratorTask {
|
|
8
|
+
/**
|
|
9
|
+
* @param targetFolder folder where to download the jars
|
|
10
|
+
* @param swaggerSpecPath
|
|
11
|
+
* @param codegenLanguage
|
|
12
|
+
* @param apiTests
|
|
13
|
+
* @param cliFilename
|
|
14
|
+
* @param codegenFileName Name of the codeGen jar
|
|
15
|
+
* @param workingDirectory
|
|
16
|
+
*/
|
|
17
|
+
constructor(targetFolder, swaggerSpecPath, codegenLanguage, apiTests = true, swaggerConfigPath, cliFilename = 'swagger-codegen-cli.jar', codegenFileName = 'swagger-codegen.jar', workingDirectory) {
|
|
18
|
+
this.swaggerSpecPath = swaggerSpecPath;
|
|
19
|
+
this.codegenLanguage = codegenLanguage;
|
|
20
|
+
this.apiTests = apiTests;
|
|
21
|
+
this.swaggerConfigPath = swaggerConfigPath;
|
|
22
|
+
this.workingDirectory = workingDirectory;
|
|
23
|
+
this.codegenPath = path.posix.join(targetFolder, `${codegenLanguage}-${codegenFileName}`);
|
|
24
|
+
this.cliPath = path.resolve(__dirname, '..', 'resources', cliFilename);
|
|
25
|
+
}
|
|
26
|
+
toConfiguration() {
|
|
27
|
+
return {
|
|
28
|
+
name: generator_java_task_1.javaGeneratorName,
|
|
29
|
+
options: {
|
|
30
|
+
codegenPath: this.codegenPath,
|
|
31
|
+
codegenLanguage: this.codegenLanguage,
|
|
32
|
+
cliPath: this.cliPath,
|
|
33
|
+
apiTests: this.apiTests,
|
|
34
|
+
swaggerSpecPath: this.swaggerSpecPath,
|
|
35
|
+
swaggerConfigPath: this.swaggerConfigPath
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Execute the Swagger CLI and codeGen rule factory
|
|
42
|
+
*
|
|
43
|
+
* @param targetFolder folder where to download the jars
|
|
44
|
+
* @param swaggerSpecPath path to the swagger specification
|
|
45
|
+
* @param codegenLanguage codegen template language
|
|
46
|
+
* @param apiTests
|
|
47
|
+
* @param codegenFileName Name of the codeGen jar
|
|
48
|
+
* @param cliFilename Name of the codeGen CLI jar
|
|
49
|
+
* @param swaggerConfigPath path to the swagger configuration
|
|
50
|
+
*/
|
|
51
|
+
const executeSwaggerJarsRuleFactory = (targetFolder, swaggerSpecPath, codegenLanguage, apiTests = true, swaggerConfigPath, codegenFileName = 'swagger-codegen.jar', cliFilename = 'swagger-codegen-cli.jar') => {
|
|
52
|
+
const scheduleTask = (tree, context) => {
|
|
53
|
+
context.addTask(new JavaGeneratorTask(targetFolder, swaggerSpecPath, codegenLanguage, apiTests, swaggerConfigPath, cliFilename, codegenFileName));
|
|
54
|
+
return tree;
|
|
55
|
+
};
|
|
56
|
+
return (0, schematics_1.chain)([
|
|
57
|
+
generator_java_task_1.registerJavaGeneratorExecutor,
|
|
58
|
+
scheduleTask
|
|
59
|
+
]);
|
|
60
|
+
};
|
|
61
|
+
exports.executeSwaggerJarsRuleFactory = executeSwaggerJarsRuleFactory;
|
|
62
|
+
//# sourceMappingURL=execute-jars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-jars.js","sourceRoot":"","sources":["../../../schematics/helpers/execute-jars.ts"],"names":[],"mappings":";;;AAAA,2DAAgI;AAChI,kCAAkC;AAClC,+DAAmH;AAGnH,MAAM,iBAAiB;IAKrB;;;;;;;;OAQG;IACH,YAAY,YAAoB,EACrB,eAAuB,EACvB,eAAuB,EACvB,WAAW,IAAI,EACf,iBAAiC,EACxC,WAAW,GAAG,yBAAyB,EACvC,eAAe,GAAG,qBAAqB,EAChC,gBAAyB;QANzB,oBAAe,GAAf,eAAe,CAAQ;QACvB,oBAAe,GAAf,eAAe,CAAQ;QACvB,aAAQ,GAAR,QAAQ,CAAO;QACf,sBAAiB,GAAjB,iBAAiB,CAAgB;QAGjC,qBAAgB,GAAhB,gBAAgB,CAAS;QAClC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,eAAe,IAAI,eAAe,EAAE,CAAC,CAAC;QAC1F,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;IAEM,eAAe;QACpB,OAAO;YACL,IAAI,EAAE,uCAAiB;YACvB,OAAO,EAAE;gBACP,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;aAC1C;SACF,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACI,MAAM,6BAA6B,GAAG,CAC3C,YAAoB,EACpB,eAAuB,EACvB,eAAuB,EACvB,QAAQ,GAAG,IAAI,EACf,iBAAiC,EACjC,eAAe,GAAG,qBAAqB,EACvC,WAAW,GAAG,yBAAyB,EACjC,EAAE;IACR,MAAM,YAAY,GAAG,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC7D,OAAO,CAAC,OAAO,CAAC,IAAI,iBAAiB,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;QAClJ,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC;QACX,mDAA6B;QAC7B,YAAY;KACb,CAAC,CAAC;AACL,CAAC,CAAC;AAlBW,QAAA,6BAA6B,iCAkBxC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SchematicContext, TaskExecutor, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the generator-java task.
|
|
4
|
+
*/
|
|
5
|
+
export interface JavaGeneratorTaskOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Enable API testing in Swagger Codegen
|
|
8
|
+
*
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
apiTests: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Path to the Swagger CLI
|
|
14
|
+
*
|
|
15
|
+
* @default 'swagger-codegen-cli.jar'
|
|
16
|
+
*/
|
|
17
|
+
cliPath: string;
|
|
18
|
+
/**
|
|
19
|
+
* Path to the Swagger Codegen
|
|
20
|
+
*
|
|
21
|
+
* @default 'swagger-codegen.jar'
|
|
22
|
+
*/
|
|
23
|
+
codegenPath: string;
|
|
24
|
+
/**
|
|
25
|
+
* Template language use for the codegen
|
|
26
|
+
*
|
|
27
|
+
* @default 'default'
|
|
28
|
+
*/
|
|
29
|
+
codegenLanguage: string;
|
|
30
|
+
/**
|
|
31
|
+
* Path to the Swagger specification
|
|
32
|
+
*
|
|
33
|
+
* @default 'swagger-spec.yaml'
|
|
34
|
+
*/
|
|
35
|
+
swaggerSpecPath: string;
|
|
36
|
+
/**
|
|
37
|
+
* Path to the swagger configuration
|
|
38
|
+
*/
|
|
39
|
+
swaggerConfigPath?: string | null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Java swagger generator task factory
|
|
43
|
+
*
|
|
44
|
+
* @param factoryOptions.rootDirectory The root directory of the process execution
|
|
45
|
+
* @param factoryOptions
|
|
46
|
+
*/
|
|
47
|
+
export declare const javaGeneratorFactory: (factoryOptions?: {
|
|
48
|
+
rootDirectory?: string;
|
|
49
|
+
}) => TaskExecutor<Partial<JavaGeneratorTaskOptions>>;
|
|
50
|
+
/** Name of the Java codegen task */
|
|
51
|
+
export declare const javaGeneratorName = "java-generator";
|
|
52
|
+
/**
|
|
53
|
+
* Rule to register the Java generator task
|
|
54
|
+
*
|
|
55
|
+
* @param tree
|
|
56
|
+
* @param context
|
|
57
|
+
*/
|
|
58
|
+
export declare const registerJavaGeneratorExecutor: (tree: Tree, context: SchematicContext) => import("@angular-devkit/schematics/src/tree/interface").Tree;
|
|
59
|
+
//# sourceMappingURL=generator-java.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-java.task.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/generator-java.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAKlF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAUD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,oBAAoB;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,KAAQ,aAAa,QAAQ,wBAAwB,CAAC,CAgDlI,CAAC;AAEF,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,SAAU,IAAI,4FAUvD,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerJavaGeneratorExecutor = exports.javaGeneratorName = exports.javaGeneratorFactory = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const defaultOptions = {
|
|
7
|
+
apiTests: true,
|
|
8
|
+
cliPath: 'swagger-codegen-cli.jar',
|
|
9
|
+
codegenPath: 'swagger-codegen.jar',
|
|
10
|
+
codegenLanguage: 'default',
|
|
11
|
+
swaggerSpecPath: 'swagger-spec.yaml'
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Java swagger generator task factory
|
|
15
|
+
*
|
|
16
|
+
* @param factoryOptions.rootDirectory The root directory of the process execution
|
|
17
|
+
* @param factoryOptions
|
|
18
|
+
*/
|
|
19
|
+
const javaGeneratorFactory = (factoryOptions = {}) => {
|
|
20
|
+
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
|
21
|
+
return (options = {}) => {
|
|
22
|
+
const opts = {
|
|
23
|
+
...defaultOptions,
|
|
24
|
+
...options
|
|
25
|
+
};
|
|
26
|
+
const args = [
|
|
27
|
+
'-cp',
|
|
28
|
+
opts.codegenPath + path.delimiter + opts.cliPath,
|
|
29
|
+
'io.swagger.codegen.SwaggerCodegen',
|
|
30
|
+
'generate',
|
|
31
|
+
'-l',
|
|
32
|
+
opts.codegenLanguage,
|
|
33
|
+
'-i',
|
|
34
|
+
opts.swaggerSpecPath,
|
|
35
|
+
'-o',
|
|
36
|
+
'.'
|
|
37
|
+
];
|
|
38
|
+
if (!opts.apiTests) {
|
|
39
|
+
args.push('-DapiTests=false');
|
|
40
|
+
}
|
|
41
|
+
if (opts.swaggerConfigPath) {
|
|
42
|
+
args.push(`-c=${opts.swaggerConfigPath}`);
|
|
43
|
+
}
|
|
44
|
+
const spawnOptions = {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
shell: true,
|
|
47
|
+
env: process.env,
|
|
48
|
+
cwd: rootDirectory
|
|
49
|
+
};
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
(0, node_child_process_1.spawn)('java', args, spawnOptions)
|
|
52
|
+
.on('close', (code) => {
|
|
53
|
+
if (code === 0) {
|
|
54
|
+
resolve();
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
reject(new Error(`Java generator failed with status ${code}`));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.javaGeneratorFactory = javaGeneratorFactory;
|
|
64
|
+
/** Name of the Java codegen task */
|
|
65
|
+
exports.javaGeneratorName = 'java-generator';
|
|
66
|
+
/**
|
|
67
|
+
* Rule to register the Java generator task
|
|
68
|
+
*
|
|
69
|
+
* @param tree
|
|
70
|
+
* @param context
|
|
71
|
+
*/
|
|
72
|
+
const registerJavaGeneratorExecutor = (tree, context) => {
|
|
73
|
+
// workaround for issue https://github.com/angular/angular-cli/issues/12678
|
|
74
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
75
|
+
const host = context.engine._host;
|
|
76
|
+
host.registerTaskExecutor({
|
|
77
|
+
name: exports.javaGeneratorName,
|
|
78
|
+
create: () => Promise.resolve((0, exports.javaGeneratorFactory)())
|
|
79
|
+
});
|
|
80
|
+
return tree;
|
|
81
|
+
};
|
|
82
|
+
exports.registerJavaGeneratorExecutor = registerJavaGeneratorExecutor;
|
|
83
|
+
//# sourceMappingURL=generator-java.task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-java.task.js","sourceRoot":"","sources":["../../../schematics/helpers/generator-java.task.ts"],"names":[],"mappings":";;;AAEA,2DAAyD;AACzD,kCAAkC;AA0ClC,MAAM,cAAc,GAA6B;IAC/C,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,qBAAqB;IAClC,eAAe,EAAE,SAAS;IAC1B,eAAe,EAAE,mBAAmB;CACrC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAC,iBAA2C,EAAE,EAAmD,EAAE;IACrI,MAAM,aAAa,GAAG,cAAc,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEpE,OAAO,CAAC,UAA6C,EAAE,EAAE,EAAE;QACzD,MAAM,IAAI,GAA6B;YACrC,GAAG,cAAc;YACjB,GAAG,OAAO;SACX,CAAC;QAEF,MAAM,IAAI,GAAG;YACX,KAAK;YACL,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO;YAChD,mCAAmC;YACnC,UAAU;YACV,IAAI;YACJ,IAAI,CAAC,eAAe;YACpB,IAAI;YACJ,IAAI,CAAC,eAAe;YACpB,IAAI;YACJ,GAAG;SACJ,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SAC/B;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;SAC3C;QAED,MAAM,YAAY,GAAiB;YACjC,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;YACX,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,aAAa;SACnB,CAAC;QAEF,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,IAAA,0BAAK,EAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC;iBAC9B,EAAE,CAAC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC5B,IAAI,IAAI,KAAK,CAAC,EAAE;oBACd,OAAO,EAAE,CAAC;iBACX;qBAAM;oBACL,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,IAAI,EAAE,CAAC,CAAC,CAAC;iBAChE;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAhDW,QAAA,oBAAoB,wBAgD/B;AAEF,oCAAoC;AACvB,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AAElD;;;;;GAKG;AACI,MAAM,6BAA6B,GAAG,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;IACrF,2EAA2E;IAC3E,gDAAgD;IAChD,MAAM,IAAI,GAAI,OAAO,CAAC,MAAc,CAAC,KAA8B,CAAC;IACpE,IAAI,CAAC,oBAAoB,CAAC;QACxB,IAAI,EAAE,yBAAiB;QACvB,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAA,4BAAoB,GAAE,CAAC;KACtD,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAVW,QAAA,6BAA6B,iCAUxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-package.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/read-package.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,iCAAiC;AACjC,eAAO,MAAM,eAAe,yCAI3B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readPackageJson = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
/** Get generator package.json */
|
|
7
|
+
const readPackageJson = async () => {
|
|
8
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
9
|
+
return JSON.parse(await node_fs_1.promises.readFile(packageJsonPath, { encoding: 'utf-8' }));
|
|
10
|
+
};
|
|
11
|
+
exports.readPackageJson = readPackageJson;
|
|
12
|
+
//# sourceMappingURL=read-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-package.js","sourceRoot":"","sources":["../../../schematics/helpers/read-package.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,kCAAkC;AAGlC,iCAAiC;AAC1B,MAAM,eAAe,GAAG,KAAK,IAAuC,EAAE;IAC3E,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAE5E,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;AAC7E,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Glob function for schematics tree
|
|
4
|
+
*
|
|
5
|
+
* @param tree File tree
|
|
6
|
+
* @param pattern Pattern to match files or folders
|
|
7
|
+
*/
|
|
8
|
+
export declare const treeGlob: (tree: Tree, pattern: string) => string[];
|
|
9
|
+
//# sourceMappingURL=tree-glob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-glob.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/tree-glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA4B5D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,SAAU,IAAI,WAAW,MAAM,aAOnD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.treeGlob = void 0;
|
|
4
|
+
const minimatch = require("minimatch");
|
|
5
|
+
const walkThroughDir = (tree, dir, filterFunction, parents = '') => {
|
|
6
|
+
const folders = dir.subdirs.map((d) => `${parents}/${d}`);
|
|
7
|
+
const matchingFolders = folders.filter(filterFunction);
|
|
8
|
+
return [
|
|
9
|
+
...dir.subfiles.map((f) => `${parents}/${f}`).filter(filterFunction),
|
|
10
|
+
...matchingFolders,
|
|
11
|
+
...folders
|
|
12
|
+
.filter((item) => !(item in matchingFolders))
|
|
13
|
+
.reduce((acc, d) => acc.concat(walkThroughDir(tree, tree.getDir(d), filterFunction, d)), [])
|
|
14
|
+
];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Glob function for schematics tree
|
|
18
|
+
*
|
|
19
|
+
* @param tree File tree
|
|
20
|
+
* @param pattern Pattern to match files or folders
|
|
21
|
+
*/
|
|
22
|
+
const treeGlob = (tree, pattern) => {
|
|
23
|
+
const filterFunction = minimatch.filter('/' + pattern.replace(/[\\/]+/g, '/'), { dot: true });
|
|
24
|
+
return walkThroughDir(tree, tree.root, filterFunction);
|
|
25
|
+
};
|
|
26
|
+
exports.treeGlob = treeGlob;
|
|
27
|
+
//# sourceMappingURL=tree-glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-glob.js","sourceRoot":"","sources":["../../../schematics/helpers/tree-glob.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AAEvC,MAAM,cAAc,GAAG,CACrB,IAAU,EACV,GAAa,EACb,cAIY,EACZ,OAAO,GAAG,EAAE,EACF,EAAE;IACZ,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACvD,OAAO;QACL,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC;QACpE,GAAG,eAAe;QAClB,GAAG,OAAO;aACP,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,CAAC;aAC5C,MAAM,CACL,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACT,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EACrE,EAAE,CACH;KACJ,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,QAAQ,GAAG,CAAC,IAAU,EAAE,OAAe,EAAE,EAAE;IACtD,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CACrC,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,EACrC,EAAE,GAAG,EAAE,IAAI,EAAE,CACd,CAAC;IAEF,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACzD,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import { NgGenerateJavaClientCoreSchematicsSchema } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Generate a Java client SDK source code base on swagger specification
|
|
5
|
+
*
|
|
6
|
+
* @param options
|
|
7
|
+
*/
|
|
8
|
+
export declare function ngGenerateJavaClientCore(options: NgGenerateJavaClientCoreSchematicsSchema): Rule;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/java/client-core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEC,MAAM,4BAA4B,CAAC;AAK1C,OAAO,EAAE,wCAAwC,EAAE,MAAM,UAAU,CAAC;AAKpE;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wCAAwC,GAAG,IAAI,CA+DhG"}
|