From 0cee369ea43e80fac872744de6642c5ccc23bfb0 Mon Sep 17 00:00:00 2001 From: Jacek Sekula Date: Wed, 2 Aug 2023 12:16:15 +0200 Subject: [PATCH 1/4] more information about posibble problems with sdk --- docs/API/generate-package.md | 9 ++++++--- docs/API/generate-package/sdk-nodejs.md | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/API/generate-package.md b/docs/API/generate-package.md index fe3f884b..4e99cb54 100644 --- a/docs/API/generate-package.md +++ b/docs/API/generate-package.md @@ -33,17 +33,20 @@ npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g ``` -This will instal the OpenAPI generator that will allow you to generate more packages. List of supported generators is mentioned [here](https://openapi-generator.tech/docs/generators) +This will install the OpenAPI generator that will allow you to generate more packages. List of supported generators is mentioned [here](https://openapi-generator.tech/docs/generators) + + ``` openapi-generator generate -g -i --skip-validate-spec -o ``` +_Worth to know is that you should have installed Java to run successfully command above._ Parameters description: -* `` - name of framework/language you want to generate package for (ex. typescript-angular) +* `` - name of framework/language you want to generate package for (ex. typescript-angular). * `` - path to generated OpenApiSchema file. -* `` - specify where you want to output your generated package +* `` - specify where you want to output your generated package. ## Use Swagger Editor to generate server and client libraries diff --git a/docs/API/generate-package/sdk-nodejs.md b/docs/API/generate-package/sdk-nodejs.md index 8cdc2de5..7118d347 100644 --- a/docs/API/generate-package/sdk-nodejs.md +++ b/docs/API/generate-package/sdk-nodejs.md @@ -19,6 +19,8 @@ To use SDK in your project follow below steps: 2. In your `[projectDirectory]/flotiq-javascript-sdk/` run `npm i && npm run build` 3. In your `[projectDirectory]` run `npm i ./flotiq-javascript-sdk --save` +Possibly you would have to add `--legacy-peer-deps` to your commands, if you get plugin versions error. + _Other installation methods are described in [Additional usage methods](#additional-usage-methods) section._ ### 2. Configure your SDK @@ -28,6 +30,8 @@ To initialize SDK we will use `FlotiqUserApi.ApiClient.init` method, which requi Your Flotiq API_KEY is located in the [Flotiq Dashboard](https://editor.flotiq.com). If you need more directions go to the [docs](https://flotiq.com/docs/API/). +You can create empty file, where you put code with your configuration and requests, such as `app.js` + ```javascript const FlotiqUserApi = require("flotiq_user_api"); FlotiqUserApi.ApiClient.init("API_KEY"); @@ -49,12 +53,21 @@ let opts = { }; api.listFlotiqblogauthor(opts).then( function (data) { - console.log("API called successfully. Returned data: " + data); + console.log("API called successfully. Returned data: ", data); }, function (error) { console.error(error); } ); +``` +Code above is just an example - you should copy code from `docs` folder in your sdk. + +To call the code lets just use: + + +``` +node app.js + ``` ### 4. SDK NodeJS common use cases From 34cac8428af2117f76dc5c6fd40ff806548f4c0a Mon Sep 17 00:00:00 2001 From: Jacek Sekula Date: Wed, 2 Aug 2023 12:38:31 +0200 Subject: [PATCH 2/4] deleted not needed space --- docs/API/generate-package.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/API/generate-package.md b/docs/API/generate-package.md index 4e99cb54..ac2dc634 100644 --- a/docs/API/generate-package.md +++ b/docs/API/generate-package.md @@ -35,8 +35,6 @@ npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g This will install the OpenAPI generator that will allow you to generate more packages. List of supported generators is mentioned [here](https://openapi-generator.tech/docs/generators) - - ``` openapi-generator generate -g -i --skip-validate-spec -o ``` From 7f2db95c6625564980686623b51c5baeaa2612ca Mon Sep 17 00:00:00 2001 From: Kinga Date: Mon, 8 Apr 2024 19:10:26 +0200 Subject: [PATCH 3/4] fix search exclude --- docs/API/generate-package/sdk-nodejs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/API/generate-package/sdk-nodejs.md b/docs/API/generate-package/sdk-nodejs.md index ee9150ef..a98d22c0 100644 --- a/docs/API/generate-package/sdk-nodejs.md +++ b/docs/API/generate-package/sdk-nodejs.md @@ -61,6 +61,7 @@ api.listFlotiqblogauthor(opts).then( } ); ``` +{ data-search-exclude } Code above is just an example - you should copy code from `docs` folder in your sdk. @@ -71,7 +72,6 @@ To call the code lets just use: node app.js ``` - { data-search-exclude } @@ -121,4 +121,4 @@ Finally, you need to build the module: ``` npm run build ``` -{ data-search-exclude } \ No newline at end of file +{ data-search-exclude } From 06e2575c0fac73acc5fe2ab320e509bbea49e001 Mon Sep 17 00:00:00 2001 From: Kinga Date: Mon, 8 Apr 2024 19:13:21 +0200 Subject: [PATCH 4/4] fix search exclude --- docs/API/generate-package.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/API/generate-package.md b/docs/API/generate-package.md index 9556b1d9..d5628123 100644 --- a/docs/API/generate-package.md +++ b/docs/API/generate-package.md @@ -39,11 +39,10 @@ This will install the OpenAPI generator that will allow you to generate more pac ``` openapi-generator generate -g -i --skip-validate-spec -o ``` +{ data-search-exclude } _Worth to know is that you should have installed Java to run successfully command above._ -{ data-search-exclude } - Parameters description: