@@ -134,13 +134,13 @@ Renders a WebSocket close connection method with optional pre- and post-executio
134134### Example
135135
136136``` js
137- const language = " java"
138- const framework = " quarkus"
139- const methodName = " terminateConnection"
140- const methodParams = [" self" ]
141- const preExecutionCode = " // About to terminate connection"
142- const postExecutionCode = " // Connection terminated"
143- const indent = 2
137+ const language = " java" ;
138+ const framework = " quarkus" ;
139+ const methodName = " terminateConnection" ;
140+ const methodParams = [" self" ];
141+ const preExecutionCode = " // About to terminate connection" ;
142+ const postExecutionCode = " // Connection terminated" ;
143+ const indent = 2 ;
144144
145145return (
146146 < CloseConnection
@@ -176,8 +176,8 @@ Component that renders WebSocket connection method for the specified programming
176176### Example
177177
178178``` js
179- const language = " python"
180- const title = " HoppscotchEchoWebSocketClient"
179+ const language = " python" ;
180+ const title = " HoppscotchEchoWebSocketClient" ;
181181
182182return (
183183 < Connect
@@ -215,10 +215,10 @@ Renders the top-of-file dependency statements for the selected programming langu
215215### Example
216216
217217``` js
218- const language = " java"
219- const framework = " quarkus"
220- const role = " client"
221- const additionalDependencies = [" import java.util.concurrent.CompletableFuture;" , " import java.time.Duration;" ]
218+ const language = " java" ;
219+ const framework = " quarkus" ;
220+ const role = " client" ;
221+ const additionalDependencies = [" import java.util.concurrent.CompletableFuture;" , " import java.time.Duration;" ];
222222
223223return (
224224 < DependencyProvider
@@ -259,11 +259,12 @@ Renders a file header with metadata information such as title, version, protocol
259259``` js
260260import path from " path" ;
261261import { Parser , fromFile } from " @asyncapi/parser" ;
262+ import { FileHeaderInfo } from " @asyncapi/generator-components" ;
262263
263264async function renderFileHeader () {
264265 const parser = new Parser ();
265266 const asyncapi_websocket_query = path .resolve (__dirname , " ../../../helpers/test/__fixtures__/asyncapi-websocket-query.yml" );
266- const language = " javascript"
267+ const language = " javascript" ;
267268
268269 // Parse the AsyncAPI document
269270 const parseResult = await fromFile (parser, asyncapi_websocket_query).parse ();
@@ -309,11 +310,11 @@ Renders a WebSocket message handler method with optional pre- and post-execution
309310### Example
310311
311312``` js
312- const language = " javascript"
313- const methodName = " handleMessage"
314- const methodParams = [" self" , " message" ]
315- const preExecutionCode = " // Pass the incoming message to all registered message handlers."
316- const postExecutionCode = " // Passed the incoming message to all registered message handlers."
313+ const language = " javascript" ;
314+ const methodName = " handleMessage" ;
315+ const methodParams = [" self" , " message" ];
316+ const preExecutionCode = " // Pass the incoming message to all registered message handlers." ;
317+ const postExecutionCode = " // Passed the incoming message to all registered message handlers." ;
317318const customMethodConfig = {
318319 javascript: {
319320 methodDocs: " // Method to handle message with callback" ,
@@ -363,16 +364,16 @@ Generic Method rendering component.
363364### Example
364365
365366``` js
366- const language = " java"
367- const methodName = " registerHandler"
368- const methodParams = [" self" , " handler" ]
369- const methodDocs = " // Process the input data."
370- const methodLogic = " // TODO: implement"
371- const preExecutionCode = " // Before handler registration"
372- const postExecutionCode = " // After handler registration"
373- const customMethodConfig = { openingTag: " {" , closingTag: " }" , indentSize: 6 }
374- const methodConfig = {" java" : {methodDocs : methodDocs, methodLogic: methodLogic }}
375- const framework = " quarkus"
367+ const language = " java" ;
368+ const methodName = " registerHandler" ;
369+ const methodParams = [" self" , " handler" ];
370+ const methodDocs = " // Process the input data." ;
371+ const methodLogic = " // TODO: implement" ;
372+ const preExecutionCode = " // Before handler registration" ;
373+ const postExecutionCode = " // After handler registration" ;
374+ const customMethodConfig = { openingTag: " {" , closingTag: " }" , indentSize: 6 };
375+ const methodConfig = {" java" : {methodDocs : methodDocs, methodLogic: methodLogic }};
376+ const framework = " quarkus" ;
376377
377378return (
378379 < MethodGenerator
@@ -421,7 +422,7 @@ Generates and returns an array of model files based on the AsyncAPI document.
421422``` js
422423import path from " path" ;
423424import { Parser , fromFile } from " @asyncapi/parser" ;
424-
425+ import { Models } from " @asyncapi/generator-components " ;
425426
426427async function renderModel () {
427428 const parser = new Parser ();
@@ -431,7 +432,7 @@ async function renderModel() {
431432 const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
432433 const parsedAsyncAPIDocument = parseResult .document ;
433434
434- const language = " java"
435+ const language = " java" ;
435436
436437 return (
437438 < Models
@@ -469,9 +470,9 @@ Component that renders WebSocket onClose event handler for the specified program
469470### Example
470471
471472``` js
472- const language = " java"
473- const framework = " quarkus"
474- const title = " HoppscotchEchoWebSocketClient"
473+ const language = " java" ;
474+ const framework = " quarkus" ;
475+ const title = " HoppscotchEchoWebSocketClient" ;
475476
476477return (
477478 < OnClose
@@ -502,7 +503,7 @@ Component that renders WebSocket onError event handler for the specified program
502503### Example
503504
504505``` js
505- const language = " javascript"
506+ const language = " javascript" ;
506507return (
507508 < OnError language= {language} / >
508509)
@@ -528,7 +529,7 @@ Component that renders WebSocket onMessage event handler for the specified progr
528529### Example
529530
530531``` js
531- const language = " javascript"
532+ const language = " javascript" ;
532533return (
533534 < OnMessage language= {language} / >
534535)
@@ -556,9 +557,9 @@ Component that renders WebSocket onOpen event handler for the specified programm
556557### Example
557558
558559``` js
559- const language = " java"
560- const framework = " quarkus"
561- const title = " HoppscotchEchoWebSocketClient"
560+ const language = " java" ;
561+ const framework = " quarkus" ;
562+ const title = " HoppscotchEchoWebSocketClient" ;
562563
563564return (
564565 < OnOpen
@@ -596,9 +597,10 @@ Component for rendering query parameter variables code.
596597### Example
597598
598599``` js
599- import path from " path"
600+ import path from " path" ;
600601import { Parser , fromFile } from " @asyncapi/parser" ;
601602import { getQueryParams } from " @asyncapi/generator-helpers" ;
603+ import { QueryParamsVariables } from " @asyncapi/generator-components" ;
602604
603605
604606async function renderQueryParamsVariable (){
@@ -613,8 +615,8 @@ async function renderQueryParamsVariable(){
613615 const queryParamsObject = getQueryParams (channels);
614616 const queryParamsArray = queryParamsObject ? Array .from (queryParamsObject .entries ()) : [];
615617
616- const language = " java"
617- const framework = " quarkus"
618+ const language = " java" ;
619+ const framework = " quarkus" ;
618620
619621 return (
620622 < QueryParamsVariables
@@ -656,11 +658,11 @@ Renders a WebSocket error handler registration method with optional pre- and pos
656658### Example
657659
658660``` js
659- const language = " python"
660- const methodName = " registerErrorHandler"
661- const methodParams = [" self" , " handler" ]
662- const preExecutionCode = " # Pre-register operations"
663- const postExecutionCode = " # Post-register operations"
661+ const language = " python" ;
662+ const methodName = " registerErrorHandler" ;
663+ const methodParams = [" self" , " handler" ];
664+ const preExecutionCode = " # Pre-register operations" ;
665+ const postExecutionCode = " # Post-register operations" ;
664666const customMethodConfig = { returnType: " int" , openingTag: " {" , closingTag: " }" , indentSize: 2 };
665667
666668return (
@@ -704,11 +706,11 @@ Renders a WebSocket message handler registration method with optional pre- and p
704706### Example
705707
706708``` js
707- const language = " python"
708- const methodName = " registerMessageHandler"
709- const methodParams = [" self" , " handler" ]
710- const preExecutionCode = " # Pre-register operations"
711- const postExecutionCode = " # Post-register operations"
709+ const language = " python" ;
710+ const methodName = " registerMessageHandler" ;
711+ const methodParams = [" self" , " handler" ];
712+ const preExecutionCode = " # Pre-register operations" ;
713+ const postExecutionCode = " # Post-register operations" ;
712714
713715return (
714716 < RegisterMessageHandler
@@ -746,6 +748,7 @@ Generates both static and instance methods for sending messages through WebSocke
746748``` js
747749import path from " path" ;
748750import { Parser , fromFile } from " @asyncapi/parser" ;
751+ import { SendOperations } from " @asyncapi/generator-components" ;
749752
750753async function renderSendOperations (){
751754 const parser = new Parser ();
@@ -755,9 +758,9 @@ async function renderSendOperations(){
755758 const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
756759 const parsedAsyncAPIDocument = parseResult .document ;
757760
758- const language = " javascript"
759- const clientName = " AccountServiceAPI"
760- const sendOperations = parsedAsyncAPIDocument .operations ().filterBySend ()
761+ const language = " javascript" ;
762+ const clientName = " AccountServiceAPI" ;
763+ const sendOperations = parsedAsyncAPIDocument .operations ().filterBySend ();
761764
762765 return (
763766 < SendOperations
0 commit comments