openapi-jsonrpc-jsdoc 1.0.3 → 1.0.4

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/.idea/misc.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/openapi-jsonrpc-jsdoc.iml" filepath="$PROJECT_DIR$/.idea/openapi-jsonrpc-jsdoc.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # openapi-jsonrpc-jsdoc
2
2
 
3
- Install
3
+ ## Install
4
4
  ```fish
5
5
  npm i openapi-jsonrpc-jsdoc --save-dev
6
6
  ```
7
7
 
8
8
  ## Example
9
- ### Create JSON-RPC Methoc
9
+
10
+ ### Create JSON-RPC Method
10
11
  ```js
11
12
  // api/api-v1.js
12
13
  /**
@@ -39,7 +40,7 @@ openapiJSONRpcJSDoc({
39
40
  ```
40
41
 
41
42
  <details>
42
- <summary>Result</summary>
43
+ <summary>See result</summary>
43
44
 
44
45
  ```json
45
46
  {
@@ -147,4 +148,4 @@ openapiJSONRpcJSDoc({
147
148
  }
148
149
  ```
149
150
 
150
- </details>
151
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-jsonrpc-jsdoc",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "OpenAPI generator",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,25 +11,31 @@
11
11
  "url": "git+https://github.com/qertis/openapi-jsonrpc-jsdoc.git"
12
12
  },
13
13
  "keywords": [
14
- "openapi",
15
- "open api",
16
- "postman",
17
- "swagger",
18
- "jsdoc",
19
- "json-rpc",
20
- "jsonrpc",
21
- "generator"
14
+ "openapi jsdoc",
15
+ "open api js doc",
16
+ "postman jsdoc",
17
+ "swagger jsondoc",
18
+ "openapi jsondoc",
19
+ "json-rpc openapi",
20
+ "json-rpc swagger",
21
+ "jsonrpc openapi",
22
+ "generator documentation openapi jsonrpc 2.0"
22
23
  ],
23
- "author": "qertis",
24
+ "author": "Denis Baskovsky <baskovsky@yandex.ru> (https://baskovsky.ru/)",
24
25
  "license": "MIT",
25
26
  "bugs": {
26
27
  "url": "https://github.com/qertis/openapi-jsonrpc-jsdoc/issues"
27
28
  },
28
29
  "homepage": "https://github.com/qertis/openapi-jsonrpc-jsdoc#readme",
29
30
  "dependencies": {
30
- "jsdoc-x": "~4.0.3"
31
+ "jsdoc-x": "~4.1.0"
31
32
  },
32
33
  "devDependencies": {
33
- "ava": "~2.4.0"
34
+ "ava": "~3.15.0",
35
+ "express": "~4.18.2",
36
+ "express-openapi-validator": "~5.0.4"
37
+ },
38
+ "engines": {
39
+ "node": ">= 14"
34
40
  }
35
41
  }
@@ -1,25 +0,0 @@
1
- name: Node CI
2
-
3
- on: [push]
4
-
5
- jobs:
6
- build:
7
-
8
- runs-on: ubuntu-latest
9
-
10
- strategy:
11
- matrix:
12
- node-version: [12.x]
13
-
14
- steps:
15
- - uses: actions/checkout@v1
16
- - name: Use Node.js ${{ matrix.node-version }}
17
- uses: actions/setup-node@v1
18
- with:
19
- node-version: ${{ matrix.node-version }}
20
- - name: npm install and test
21
- run: |
22
- npm i
23
- npm test
24
- env:
25
- CI: true
@@ -1,45 +0,0 @@
1
- name: Node.js Package
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v1
12
- - uses: actions/setup-node@v1
13
- with:
14
- node-version: 12
15
- - run: npm ci
16
- - run: npm test
17
-
18
- publish-npm:
19
- needs: build
20
- runs-on: ubuntu-latest
21
- steps:
22
- - uses: actions/checkout@v1
23
- - uses: actions/setup-node@v1
24
- with:
25
- node-version: 12
26
- registry-url: https://registry.npmjs.org/
27
- - run: npm i
28
- - run: npm publish
29
- env:
30
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
31
-
32
- publish-gpr:
33
- needs: build
34
- runs-on: ubuntu-latest
35
- steps:
36
- - uses: actions/checkout@v1
37
- - uses: actions/setup-node@v1
38
- with:
39
- node-version: 12
40
- registry-url: https://npm.pkg.github.com/
41
- scope: '@qertis'
42
- - run: npm ci
43
- - run: npm publish
44
- env:
45
- NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/test/api/v1.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @description Название API
3
- * @param {object} parameters - params
4
- * @param {string} parameters.id - id
5
- */
6
- module.exports = (parameters) => {
7
- return parameters.id;
8
- };
package/test/api/v2.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @deprecated
3
- * @description Название API 2
4
- * @return {null}
5
- */
6
- module.exports = () => {
7
- return null;
8
- };
@@ -1,39 +0,0 @@
1
- const test = require('ava');
2
- const openapiJSONRpcJSDoc = require('../index');
3
-
4
- test.before(async t => {
5
- t.context.data = await openapiJSONRpcJSDoc({
6
- api: '/api/',
7
- securitySchemes: {
8
- BasicAuth: {
9
- type: 'http',
10
- scheme: 'digest',
11
- },
12
- },
13
- servers: [
14
- {
15
- url: '0.0.0.0:8080',
16
- },
17
- ],
18
- packageUrl: './package.json',
19
- files: './test/api/*.js',
20
- });
21
- });
22
-
23
- test('t1', t => {
24
- const data = t.context.data;
25
- const v1Test = data.paths['/api/v1'];
26
- t.false(v1Test.post.deprecated);
27
- t.is(typeof v1Test.post.description, 'string');
28
- t.true(Array.isArray(v1Test.post.tags));
29
- t.true(Array.isArray(v1Test.post.parameters));
30
- const v1RequestBodySchema = v1Test.post.requestBody.content['application/json'].schema;
31
- t.is(v1RequestBodySchema.type, 'object');
32
- t.true(v1RequestBodySchema.required.includes('id'));
33
- });
34
-
35
- test('t2', t => {
36
- const data = t.context.data;
37
- const v2Test = data.paths['/api/v2'];
38
- t.true(v2Test.post.deprecated);
39
- });