@kravc/dos 1.4.10 → 1.4.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kravc/dos",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"description": "Convention-based, easy-to-use library for building API-driven serverless services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Service",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"author": "Alexander Kravets <a@kra.vc>",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kravc/schema": "^2.3.
|
|
29
|
-
"cookie": "^0.
|
|
28
|
+
"@kravc/schema": "^2.3.4",
|
|
29
|
+
"cookie": "^0.5.0",
|
|
30
30
|
"js-yaml": "^4.1.0",
|
|
31
31
|
"jsonwebtoken": "^9.0.0",
|
|
32
32
|
"lodash.capitalize": "^4.2.1",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"lodash.uniq": "^4.5.0",
|
|
45
45
|
"pluralize": "^8.0.0",
|
|
46
46
|
"ulid": "^2.3.0",
|
|
47
|
-
"uuid": "^
|
|
48
|
-
"z-schema": "^5.0.
|
|
47
|
+
"uuid": "^9.0.0",
|
|
48
|
+
"z-schema": "^5.0.5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"chai": "^4.3.
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"mocha": "^10.
|
|
51
|
+
"chai": "^4.3.7",
|
|
52
|
+
"eslint": "^8.35.0",
|
|
53
|
+
"mocha": "^10.2.0",
|
|
54
54
|
"nyc": "^15.1.0"
|
|
55
55
|
},
|
|
56
56
|
"nyc": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const omit = require('lodash.omit')
|
|
4
|
+
const uniq = require('lodash.uniq')
|
|
4
5
|
const ZSchema = require('z-schema')
|
|
5
6
|
const { parse } = require('url')
|
|
6
7
|
const jsonSchema = require('../../assets/schemas/oas2.json')
|
|
@@ -50,6 +51,7 @@ const createSpec = (operations, schemasMap, url) => {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
let serviceTags = []
|
|
53
55
|
for (const Operation of operations) {
|
|
54
56
|
const httpPath = `/${Operation.id}`
|
|
55
57
|
const httpMethod = getHttpMethod(Operation)
|
|
@@ -66,6 +68,8 @@ const createSpec = (operations, schemasMap, url) => {
|
|
|
66
68
|
mutationSchema
|
|
67
69
|
} = Operation
|
|
68
70
|
|
|
71
|
+
serviceTags = serviceTags.concat(tags)
|
|
72
|
+
|
|
69
73
|
const operationSpec = {
|
|
70
74
|
tags,
|
|
71
75
|
summary,
|
|
@@ -154,6 +158,10 @@ const createSpec = (operations, schemasMap, url) => {
|
|
|
154
158
|
spec.paths[httpPath] = { [httpMethod]: operationSpec }
|
|
155
159
|
}
|
|
156
160
|
|
|
161
|
+
serviceTags = uniq(serviceTags)
|
|
162
|
+
serviceTags.sort((a, b) => a.localeCompare(b))
|
|
163
|
+
spec.tags = serviceTags.map(name => ({ name }))
|
|
164
|
+
|
|
157
165
|
const json = JSON
|
|
158
166
|
.stringify(spec, null, 2)
|
|
159
167
|
.replace(/"\$ref": "/g, '"$ref": "#/definitions/')
|