@mimik/api-helper 2.0.1 → 2.0.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.
- package/README.md +6 -6
- package/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@ import { apiSetup, securityLib, getAPIFile, validateSecuritySchemes, extractProp
|
|
|
13
13
|
* [~securityLib(config)](#module_api-helper..securityLib)
|
|
14
14
|
* [~apiSetup(setup, registeredOperations, securityHandlers, extraFormats, config, correlationId)](#module_api-helper..apiSetup) ⇒ <code>Promise</code>
|
|
15
15
|
* [~getAPIFile(apiFilename, correlationId, options)](#module_api-helper..getAPIFile) ⇒ <code>Promise</code>
|
|
16
|
-
* [~setupServerFiles(apiFilename, controllersDirectory,
|
|
16
|
+
* [~setupServerFiles(apiFilename, controllersDirectory, buildDirectory, correlationId, options)](#module_api-helper..setupServerFiles) ⇒ <code>Promise</code>
|
|
17
17
|
* _sync_
|
|
18
18
|
* [~validateSecuritySchemes(apiDefinition, correlationId)](#module_api-helper..validateSecuritySchemes) ⇒
|
|
19
|
-
* [~extractProperties(apiDefinition, controllersDirectory,
|
|
19
|
+
* [~extractProperties(apiDefinition, controllersDirectory, buildDirectory, correlationId)](#module_api-helper..extractProperties) ⇒
|
|
20
20
|
|
|
21
21
|
<a name="module_api-helper..securityLib"></a>
|
|
22
22
|
|
|
@@ -111,7 +111,7 @@ Gets the API file from swaggerhub and store it in the give PATH location.
|
|
|
111
111
|
|
|
112
112
|
<a name="module_api-helper..setupServerFiles"></a>
|
|
113
113
|
|
|
114
|
-
### api-helper~setupServerFiles(apiFilename, controllersDirectory,
|
|
114
|
+
### api-helper~setupServerFiles(apiFilename, controllersDirectory, buildDirectory, correlationId, options) ⇒ <code>Promise</code>
|
|
115
115
|
Setup and validates files for the server
|
|
116
116
|
|
|
117
117
|
**Kind**: inner method of [<code>api-helper</code>](#module_api-helper)
|
|
@@ -128,7 +128,7 @@ Setup and validates files for the server
|
|
|
128
128
|
| --- | --- | --- |
|
|
129
129
|
| apiFilename | <code>PATH.<string></code> | Name of the file where the API file will be stored. |
|
|
130
130
|
| controllersDirectory | <code>PATH.<string></code> | Directory to find the controller files. |
|
|
131
|
-
|
|
|
131
|
+
| buildDirectory | <code>PATH.<string></code> | Directory where the register file will be stored. |
|
|
132
132
|
| correlationId | <code>UUID.<string></code> | CorrelationId when logging activites. |
|
|
133
133
|
| options | <code>object</code> | Options associated with the call. Use to pass `metrics` to `rpRetry` and `apiKey`` to access private API. |
|
|
134
134
|
|
|
@@ -153,7 +153,7 @@ Validates the known SecuritySchemes: `SystemSecurity`, `AdminSecurity`, `UserSec
|
|
|
153
153
|
|
|
154
154
|
<a name="module_api-helper..extractProperties"></a>
|
|
155
155
|
|
|
156
|
-
### api-helper~extractProperties(apiDefinition, controllersDirectory,
|
|
156
|
+
### api-helper~extractProperties(apiDefinition, controllersDirectory, buildDirectory, correlationId) ⇒
|
|
157
157
|
Extracts the properties from API definiton and creates a file binding the handler with the controller operations.
|
|
158
158
|
|
|
159
159
|
**Kind**: inner method of [<code>api-helper</code>](#module_api-helper)
|
|
@@ -169,6 +169,6 @@ Extracts the properties from API definiton and creates a file binding the handle
|
|
|
169
169
|
| --- | --- | --- |
|
|
170
170
|
| apiDefinition | <code>object</code> | JSON object containing the API definition. |
|
|
171
171
|
| controllersDirectory | <code>PATH.<string></code> | Directory to find the controller files. |
|
|
172
|
-
|
|
|
172
|
+
| buildDirectory | <code>PATH.<string></code> | Directory where the register file will be stored. |
|
|
173
173
|
| correlationId | <code>UUID.<string></code> | CorrelationId when logging activites. |
|
|
174
174
|
|
package/index.js
CHANGED
|
@@ -406,7 +406,7 @@ export const validateSecuritySchemes = (apiDefinition, correlationId) => {
|
|
|
406
406
|
* @requires fs
|
|
407
407
|
* @param {object} apiDefinition - JSON object containing the API definition.
|
|
408
408
|
* @param {PATH.<string>} controllersDirectory - Directory to find the controller files.
|
|
409
|
-
* @param {PATH.<string>}
|
|
409
|
+
* @param {PATH.<string>} buildDirectory - Directory where the register file will be stored.
|
|
410
410
|
* @param {UUID.<string>} correlationId - CorrelationId when logging activites.
|
|
411
411
|
* @return null
|
|
412
412
|
* @throws An error is thrown for many reasons, like operationId does not exist in controllers, controller dies not exist...
|
|
@@ -492,7 +492,7 @@ export const extractProperties = (apiDefinition, controllersDirectory, buildDire
|
|
|
492
492
|
* @requires path
|
|
493
493
|
* @param {PATH.<string>} apiFilename - Name of the file where the API file will be stored.
|
|
494
494
|
* @param {PATH.<string>} controllersDirectory - Directory to find the controller files.
|
|
495
|
-
* @param {PATH.<string>}
|
|
495
|
+
* @param {PATH.<string>} buildDirectory - Directory where the register file will be stored.
|
|
496
496
|
* @param {UUID.<string>} correlationId - CorrelationId when logging activites.
|
|
497
497
|
* @param {object} options - Options associated with the call. Use to pass `metrics` to `rpRetry` and `apiKey`` to access private API.
|
|
498
498
|
* @return {Promise}.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/api-helper",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "helper for openAPI backend and mimik service",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "9.31.0",
|
|
50
50
|
"@mimik/eslint-plugin-document-env": "^2.0.8",
|
|
51
|
-
"@stylistic/eslint-plugin": "5.2.
|
|
51
|
+
"@stylistic/eslint-plugin": "5.2.2",
|
|
52
52
|
"eslint": "9.31.0",
|
|
53
53
|
"eslint-plugin-import": "2.32.0",
|
|
54
54
|
"husky": "9.1.7",
|