@asyncapi/generator 1.14.0 β†’ 1.14.2

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 (3) hide show
  1. package/README.md +25 -20
  2. package/docs/api.md +130 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -58,26 +58,31 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
58
58
  <!-- prettier-ignore-start -->
59
59
  <!-- markdownlint-disable -->
60
60
  <table>
61
- <tr>
62
- <td align="center"><a href="http://www.fmvilas.com"><img src="https://avatars3.githubusercontent.com/u/242119?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fran MΓ©ndez</b></sub></a><br /><a href="#question-fmvilas" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Afmvilas" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Documentation">πŸ“–</a> <a href="#ideas-fmvilas" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#maintenance-fmvilas" title="Maintenance">🚧</a> <a href="#plugin-fmvilas" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Afmvilas" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Tests">⚠️</a> <a href="#tutorial-fmvilas" title="Tutorials">βœ…</a></td>
63
- <td align="center"><a href="https://github.com/jonaslagoni"><img src="https://avatars1.githubusercontent.com/u/13396189?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jonas Lagoni</b></sub></a><br /><a href="#question-jonaslagoni" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Ajonaslagoni" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Documentation">πŸ“–</a> <a href="#ideas-jonaslagoni" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#plugin-jonaslagoni" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Ajonaslagoni" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Tests">⚠️</a></td>
64
- <td align="center"><a href="https://resume.github.io/?derberg"><img src="https://avatars1.githubusercontent.com/u/6995927?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lukasz Gornicki</b></sub></a><br /><a href="#question-derberg" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Aderberg" title="Bug reports">πŸ›</a> <a href="#blog-derberg" title="Blogposts">πŸ“</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Documentation">πŸ“–</a> <a href="#ideas-derberg" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#maintenance-derberg" title="Maintenance">🚧</a> <a href="#plugin-derberg" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Aderberg" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Tests">⚠️</a> <a href="#tutorial-derberg" title="Tutorials">βœ…</a> <a href="#infra-derberg" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a></td>
65
- </tr>
66
- <tr>
67
- <td align="center"><a href="https://twitter.com/treeder"><img src="https://avatars3.githubusercontent.com/u/75826?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Travis Reeder</b></sub></a><br /><a href="#infra-treeder" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="https://github.com/asyncapi/generator/commits?author=treeder" title="Documentation">πŸ“–</a></td>
68
- <td align="center"><a href="https://github.com/Tenischev"><img src="https://avatars1.githubusercontent.com/u/4137916?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Semen</b></sub></a><br /><a href="https://github.com/asyncapi/generator/issues?q=author%3ATenischev" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Documentation">πŸ“–</a> <a href="#ideas-Tenischev" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#plugin-Tenischev" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3ATenischev" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Tests">⚠️</a></td>
69
- <td align="center"><a href="https://waleedashraf.me/"><img src="https://avatars0.githubusercontent.com/u/8335457?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Waleed Ashraf</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=WaleedAshraf" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3AWaleedAshraf" title="Bug reports">πŸ›</a></td>
70
- </tr>
71
- <tr>
72
- <td align="center"><a href="https://github.com/sebastian-palma"><img src="https://avatars2.githubusercontent.com/u/11888191?v=4?s=100" width="100px;" alt=""/><br /><sub><b>SebastiΓ‘n</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=sebastian-palma" title="Code">πŸ’»</a></td>
73
- <td align="center"><a href="https://github.com/muenchhausen"><img src="https://avatars.githubusercontent.com/u/1210783?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Derk Muenchhausen</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=muenchhausen" title="Code">πŸ’»</a></td>
74
- <td align="center"><a href="http://ben.timby.com/"><img src="https://avatars.githubusercontent.com/u/669270?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ben Timby</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=btimby" title="Code">πŸ’»</a></td>
75
- </tr>
76
- <tr>
77
- <td align="center"><a href="https://github.com/lkmandy"><img src="https://avatars.githubusercontent.com/u/17765231?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amanda Shafack </b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=lkmandy" title="Documentation">πŸ“–</a></td>
78
- <td align="center"><a href="https://github.com/Florence-Njeri"><img src="https://avatars.githubusercontent.com/u/40742916?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Florence Njeri</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=Florence-Njeri" title="Documentation">πŸ“–</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3AFlorence-Njeri" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#infra-Florence-Njeri" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#maintenance-Florence-Njeri" title="Maintenance">🚧</a></td>
79
- <td align="center"><a href="https://unruffled-goodall-dd424e.netlify.app/"><img src="https://avatars.githubusercontent.com/u/77961530?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pratik Haldankar</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=pratik2315" title="Documentation">πŸ“–</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Apratik2315" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#maintenance-pratik2315" title="Maintenance">🚧</a> <a href="#talk-pratik2315" title="Talks">πŸ“’</a></td>
80
- </tr>
61
+ <tbody>
62
+ <tr>
63
+ <td align="center" valign="top" width="33.33%"><a href="http://www.fmvilas.com"><img src="https://avatars3.githubusercontent.com/u/242119?v=4?s=100" width="100px;" alt="Fran MΓ©ndez"/><br /><sub><b>Fran MΓ©ndez</b></sub></a><br /><a href="#question-fmvilas" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Afmvilas" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Documentation">πŸ“–</a> <a href="#ideas-fmvilas" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#maintenance-fmvilas" title="Maintenance">🚧</a> <a href="#plugin-fmvilas" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Afmvilas" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=fmvilas" title="Tests">⚠️</a> <a href="#tutorial-fmvilas" title="Tutorials">βœ…</a></td>
64
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/jonaslagoni"><img src="https://avatars1.githubusercontent.com/u/13396189?v=4?s=100" width="100px;" alt="Jonas Lagoni"/><br /><sub><b>Jonas Lagoni</b></sub></a><br /><a href="#question-jonaslagoni" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Ajonaslagoni" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Documentation">πŸ“–</a> <a href="#ideas-jonaslagoni" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#plugin-jonaslagoni" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Ajonaslagoni" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=jonaslagoni" title="Tests">⚠️</a></td>
65
+ <td align="center" valign="top" width="33.33%"><a href="https://resume.github.io/?derberg"><img src="https://avatars1.githubusercontent.com/u/6995927?v=4?s=100" width="100px;" alt="Lukasz Gornicki"/><br /><sub><b>Lukasz Gornicki</b></sub></a><br /><a href="#question-derberg" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3Aderberg" title="Bug reports">πŸ›</a> <a href="#blog-derberg" title="Blogposts">πŸ“</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Documentation">πŸ“–</a> <a href="#ideas-derberg" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#maintenance-derberg" title="Maintenance">🚧</a> <a href="#plugin-derberg" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Aderberg" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=derberg" title="Tests">⚠️</a> <a href="#tutorial-derberg" title="Tutorials">βœ…</a> <a href="#infra-derberg" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a></td>
66
+ </tr>
67
+ <tr>
68
+ <td align="center" valign="top" width="33.33%"><a href="https://twitter.com/treeder"><img src="https://avatars3.githubusercontent.com/u/75826?v=4?s=100" width="100px;" alt="Travis Reeder"/><br /><sub><b>Travis Reeder</b></sub></a><br /><a href="#infra-treeder" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="https://github.com/asyncapi/generator/commits?author=treeder" title="Documentation">πŸ“–</a></td>
69
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/Tenischev"><img src="https://avatars1.githubusercontent.com/u/4137916?v=4?s=100" width="100px;" alt="Semen"/><br /><sub><b>Semen</b></sub></a><br /><a href="https://github.com/asyncapi/generator/issues?q=author%3ATenischev" title="Bug reports">πŸ›</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Documentation">πŸ“–</a> <a href="#ideas-Tenischev" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#plugin-Tenischev" title="Plugin/utility libraries">πŸ”Œ</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3ATenischev" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/asyncapi/generator/commits?author=Tenischev" title="Tests">⚠️</a></td>
70
+ <td align="center" valign="top" width="33.33%"><a href="https://waleedashraf.me/"><img src="https://avatars0.githubusercontent.com/u/8335457?v=4?s=100" width="100px;" alt="Waleed Ashraf"/><br /><sub><b>Waleed Ashraf</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=WaleedAshraf" title="Code">πŸ’»</a> <a href="https://github.com/asyncapi/generator/issues?q=author%3AWaleedAshraf" title="Bug reports">πŸ›</a></td>
71
+ </tr>
72
+ <tr>
73
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/sebastian-palma"><img src="https://avatars2.githubusercontent.com/u/11888191?v=4?s=100" width="100px;" alt="SebastiΓ‘n"/><br /><sub><b>SebastiΓ‘n</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=sebastian-palma" title="Code">πŸ’»</a></td>
74
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/muenchhausen"><img src="https://avatars.githubusercontent.com/u/1210783?v=4?s=100" width="100px;" alt="Derk Muenchhausen"/><br /><sub><b>Derk Muenchhausen</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=muenchhausen" title="Code">πŸ’»</a></td>
75
+ <td align="center" valign="top" width="33.33%"><a href="http://ben.timby.com/"><img src="https://avatars.githubusercontent.com/u/669270?v=4?s=100" width="100px;" alt="Ben Timby"/><br /><sub><b>Ben Timby</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=btimby" title="Code">πŸ’»</a></td>
76
+ </tr>
77
+ <tr>
78
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/lkmandy"><img src="https://avatars.githubusercontent.com/u/17765231?v=4?s=100" width="100px;" alt="Amanda Shafack "/><br /><sub><b>Amanda Shafack </b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=lkmandy" title="Documentation">πŸ“–</a></td>
79
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/Florence-Njeri"><img src="https://avatars.githubusercontent.com/u/40742916?v=4?s=100" width="100px;" alt="Florence Njeri"/><br /><sub><b>Florence Njeri</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=Florence-Njeri" title="Documentation">πŸ“–</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3AFlorence-Njeri" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#infra-Florence-Njeri" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#maintenance-Florence-Njeri" title="Maintenance">🚧</a></td>
80
+ <td align="center" valign="top" width="33.33%"><a href="https://unruffled-goodall-dd424e.netlify.app/"><img src="https://avatars.githubusercontent.com/u/77961530?v=4?s=100" width="100px;" alt="Pratik Haldankar"/><br /><sub><b>Pratik Haldankar</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=pratik2315" title="Documentation">πŸ“–</a> <a href="https://github.com/asyncapi/generator/pulls?q=is%3Apr+reviewed-by%3Apratik2315" title="Reviewed Pull Requests">πŸ‘€</a> <a href="#maintenance-pratik2315" title="Maintenance">🚧</a> <a href="#talk-pratik2315" title="Talks">πŸ“’</a></td>
81
+ </tr>
82
+ <tr>
83
+ <td align="center" valign="top" width="33.33%"><a href="https://github.com/swastiksuvam55"><img src="https://avatars.githubusercontent.com/u/90003260?v=4?s=100" width="100px;" alt="swastik suvam singh"/><br /><sub><b>swastik suvam singh</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=swastiksuvam55" title="Code">πŸ’»</a></td>
84
+ </tr>
85
+ </tbody>
81
86
  </table>
82
87
 
83
88
  <!-- markdownlint-restore -->
package/docs/api.md CHANGED
@@ -26,7 +26,15 @@ Reference API documentation for AsyncAPI Generator library.
26
26
  * [.hooks](#Generator+hooks) : `Object`
27
27
  * [.mapBaseUrlToFolder](#Generator+mapBaseUrlToFolder) : `Object`
28
28
  * [.templateParams](#Generator+templateParams) : `Object`
29
- * [.generate(asyncapiDocument, [parseOptions])](#Generator+generate) β‡’ `Promise`
29
+ * [.generate(asyncapiDocument, [parseOptions])](#Generator+generate) β‡’ `Promise.<void>`
30
+ * [.validateAsyncAPIDocument(asyncapiDocument)](#Generator+validateAsyncAPIDocument)
31
+ * [.setupOutput()](#Generator+setupOutput)
32
+ * [.setupFSOutput()](#Generator+setupFSOutput) β‡’ `Promise.<void>`
33
+ * [.setLogLevel()](#Generator+setLogLevel) β‡’ `void`
34
+ * [.installAndSetupTemplate()](#Generator+installAndSetupTemplate) β‡’ `Promise.<{templatePkgName: string, templatePkgPath: string}>`
35
+ * [.configureTemplateWorkflow(parseOptions)](#Generator+configureTemplateWorkflow) β‡’ `Promise.<void>`
36
+ * [.handleEntrypoint()](#Generator+handleEntrypoint) β‡’ `Promise.<void>`
37
+ * [.executeAfterHook()](#Generator+executeAfterHook) β‡’ `Promise.<void>`
30
38
  * [.parseInput()](#Generator+parseInput)
31
39
  * [.configureTemplate()](#Generator+configureTemplate)
32
40
  * ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) β‡’ `Promise`~~
@@ -169,11 +177,19 @@ The template parameters. The structure for this object is based on each individu
169
177
  Generates files from a given template and an AsyncAPIDocument object.
170
178
 
171
179
  **Kind**: instance method of [`Generator`](#Generator)
180
+ **Returns**: `Promise.<void>` - A Promise that resolves when the generation is completed.
172
181
  **Params**
173
182
 
174
183
  - asyncapiDocument `AsyncAPIDocument` | `string` - AsyncAPIDocument object to use as source.
175
- - [parseOptions] `Object` ` = {}` - AsyncAPI Parser parse options. Check out [@asyncapi/parser](https://www.github.com/asyncapi/parser-js) for more information. Remember to use the right options to the right parser depending on the template you are using.
184
+ - [parseOptions] `Object` ` = {}` - AsyncAPI Parser parse options.
185
+ Check out [@asyncapi/parser](https://www.github.com/asyncapi/parser-js) for more information.
186
+ Remember to use the right options for the right parser depending on the template you are using.
176
187
 
188
+ **Example**
189
+ ```js
190
+ await generator.generate(myAsyncAPIdocument);
191
+ console.log('Done!');
192
+ ```
177
193
  **Example**
178
194
  ```js
179
195
  generator
@@ -193,6 +209,118 @@ try {
193
209
  }
194
210
  ```
195
211
 
212
+ <a name="Generator+validateAsyncAPIDocument"></a>
213
+
214
+ ### generator.validateAsyncAPIDocument
215
+ Validates the provided AsyncAPI document.
216
+
217
+ **Kind**: instance method of [`Generator`](#Generator)
218
+ **Throws**:
219
+
220
+ - `Error` Throws an error if the document is not valid.
221
+
222
+ **Since**: 10/9/2023 - 4:26:33 PM
223
+ **Params**
224
+
225
+ - asyncapiDocument `*` - The AsyncAPI document to be validated.
226
+
227
+
228
+ <a name="Generator+setupOutput"></a>
229
+
230
+ * generator.setupOutput()** :
231
+ Sets up the output configuration based on the specified output type.
232
+
233
+ **Kind**: instance method of [`Generator`](#Generator)
234
+ **Throws**:
235
+
236
+ - `Error` If 'output' is set to 'string' without providing 'entrypoint'.
237
+
238
+ **Example**
239
+ ```js
240
+ const generator = new Generator();
241
+ generator.setupOutput();
242
+ ```
243
+
244
+ <a name="Generator+setupFSOutput"></a>
245
+
246
+ * generator.setupFSOutput() β‡’ `Promise.<void>`** :
247
+ Sets up the file system (FS) output configuration.
248
+
249
+ This function creates the target directory if it does not exist and verifies
250
+ the target directory if forceWrite is not enabled.
251
+
252
+ **Kind**: instance method of [`Generator`](#Generator)
253
+ **Returns**: `Promise.<void>` - A promise that fulfills when the setup is complete.
254
+ **Throws**:
255
+
256
+ - `Error` If verification of the target directory fails and forceWrite is not enabled.
257
+
258
+
259
+ <a name="Generator+setLogLevel"></a>
260
+
261
+ * generator.setLogLevel() β‡’ `void`** :
262
+ Sets the log level based on the debug option.
263
+
264
+ If the debug option is enabled, the log level is set to 'debug'.
265
+
266
+ **Kind**: instance method of [`Generator`](#Generator)
267
+
268
+ <a name="Generator+installAndSetupTemplate"></a>
269
+
270
+ * generator.installAndSetupTemplate() β‡’ `Promise.<{templatePkgName: string, templatePkgPath: string}>`** :
271
+ Installs and sets up the template for code generation.
272
+
273
+ This function installs the specified template using the provided installation option,
274
+ sets up the necessary directory paths, loads the template configuration, and returns
275
+ information about the installed template.
276
+
277
+ **Kind**: instance method of [`Generator`](#Generator)
278
+ **Returns**: `Promise.<{templatePkgName: string, templatePkgPath: string}>` - A promise that resolves to an object containing the name and path of the installed template.
279
+
280
+ <a name="Generator+configureTemplateWorkflow"></a>
281
+
282
+ ### generator.configureTemplateWorkflow
283
+ Configures the template workflow based on provided parsing options.
284
+
285
+ This function performs the following steps:
286
+ 1. Parses the input AsyncAPI document using the specified parse options.
287
+ 2. Validates the template configuration and parameters.
288
+ 3. Configures the template based on the parsed AsyncAPI document.
289
+ 4. Registers filters, hooks, and launches the 'generate:before' hook if applicable.
290
+
291
+ **Kind**: instance method of [`Generator`](#Generator)
292
+ **Returns**: `Promise.<void>` - A promise that resolves when the configuration is completed.
293
+ **Params**
294
+
295
+ - parseOptions `*` - Options for parsing the AsyncAPI document.
296
+
297
+
298
+ <a name="Generator+handleEntrypoint"></a>
299
+
300
+ * generator.handleEntrypoint() β‡’ `Promise.<void>`** :
301
+ Handles the logic for the template entrypoint.
302
+
303
+ If an entrypoint is specified:
304
+ - Resolves the absolute path of the entrypoint file.
305
+ - Throws an error if the entrypoint file doesn't exist.
306
+ - Generates a file or renders content based on the output type.
307
+ - Launches the 'generate:after' hook if the output is 'fs'.
308
+
309
+ If no entrypoint is specified, generates the directory structure.
310
+
311
+ **Kind**: instance method of [`Generator`](#Generator)
312
+ **Returns**: `Promise.<void>` - A promise that resolves when the entrypoint logic is completed.
313
+
314
+ <a name="Generator+executeAfterHook"></a>
315
+
316
+ * generator.executeAfterHook() β‡’ `Promise.<void>`** :
317
+ Executes the 'generate:after' hook.
318
+
319
+ Launches the after-hook to perform additional actions after code generation.
320
+
321
+ **Kind**: instance method of [`Generator`](#Generator)
322
+ **Returns**: `Promise.<void>` - A promise that resolves when the after-hook execution is completed.
323
+
196
324
  <a name="Generator+parseInput"></a>
197
325
 
198
326
  * generator.parseInput()** :
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asyncapi/generator",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "The AsyncAPI generator. It can generate documentation, code, anything!",
5
5
  "main": "./lib/generator.js",
6
6
  "bin": {
@@ -49,7 +49,7 @@
49
49
  "homepage": "https://github.com/asyncapi/generator",
50
50
  "dependencies": {
51
51
  "@asyncapi/generator-react-sdk": "^0.2.23",
52
- "@asyncapi/parser": "2.1.0",
52
+ "@asyncapi/parser": "^2.1.2",
53
53
  "@npmcli/arborist": "^2.2.4",
54
54
  "@smoya/multi-parser": "^4.0.0",
55
55
  "ajv": "^8.12.0",