@kravc/dos 1.8.5 → 1.8.6

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.
@@ -7,6 +7,14 @@ const { publicKey } = require('../src/test/keys')
7
7
  const JwtAuthorization = require('../src/security/JwtAuthorization')
8
8
 
9
9
  class CreateProfile extends Create(Profile) {
10
+ static get tags() {
11
+ return [
12
+ 'Profiles',
13
+ 'profiles-write',
14
+ 'System'
15
+ ]
16
+ }
17
+
10
18
  static get security() {
11
19
  const algorithm = 'RS256'
12
20
 
@@ -7,6 +7,13 @@ const JwtAuthorization = require('../src/security/JwtAuthorization')
7
7
  const SystemAuthorization = require('../src/security/SystemAuthorization')
8
8
 
9
9
  class UpdateProfile extends Update(Profile) {
10
+ static get tags() {
11
+ return [
12
+ 'profiles-write',
13
+ 'Profiles',
14
+ ]
15
+ }
16
+
10
17
  static get security() {
11
18
  return [
12
19
  SystemAuthorization.createRequirement(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kravc/dos",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Convention-based, easy-to-use library for building API-driven serverless services.",
5
5
  "keywords": [
6
6
  "Service",
@@ -158,7 +158,19 @@ const createSpec = (operations, schemasMap, url) => {
158
158
  }
159
159
 
160
160
  serviceTags = uniq(serviceTags)
161
- serviceTags.sort((a, b) => a.localeCompare(b))
161
+
162
+ console.log(serviceTags)
163
+
164
+ serviceTags.sort((a, b) => {
165
+ const aStartsWithUpper = /^[A-Z]/.test(a)
166
+ const bStartsWithUpper = /^[A-Z]/.test(b)
167
+
168
+ if (aStartsWithUpper && !bStartsWithUpper) { return -1 }
169
+
170
+ if (!aStartsWithUpper && bStartsWithUpper) { return 1 }
171
+
172
+ return a.localeCompare(b)
173
+ })
162
174
  spec.tags = serviceTags.map(name => ({ name }))
163
175
 
164
176
  const json = JSON