create-skweb 3.3.6 → 3.3.8

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.
@@ -1,17 +1,17 @@
1
1
 
2
- > create-skweb@3.3.6 prebuild
2
+ > create-skweb@3.3.8 prebuild
3
3
  > tsc --outDir dist --rootDir src
4
4
 
5
5
  ⠙
6
- > create-skweb@3.3.6 build
6
+ > create-skweb@3.3.8 build
7
7
  > rollup -c rollup.config.mjs && node scripts/inject-shebang.mjs && chmod +x dist/cli.js
8
8
 
9
9
  ⠙
10
10
  src/index.ts → dist/index.js...
11
11
  (!) [plugin typescript] @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.
12
- created dist/index.js in 346ms
12
+ created dist/index.js in 349ms
13
13
  
14
14
  src/cli.ts → dist/cli.js...
15
- created dist/cli.js in 178ms
15
+ created dist/cli.js in 172ms
16
16
  [inject-shebang] Shebang added to /Users/stayknight/projects/skweb-mono/tools/create-skweb/dist/cli.js
17
17
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # create-skweb
2
2
 
3
+ ## 3.3.8
4
+
5
+ ### Patch Changes
6
+
7
+ - user 控制器添加 jwt 认证和 swagger security 定义,支持 static/jwks 两种认证类型
8
+
9
+ ## 3.3.7
10
+
11
+ ### Patch Changes
12
+
13
+ - user 控制器添加 jwt 认证和 swagger security 定义
14
+
3
15
  ## 3.3.6
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skweb",
3
- "version": "3.3.6",
3
+ "version": "3.3.8",
4
4
  "description": "Create a new SKWeb project with TypeScript, CJS, or MJS support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -7,6 +7,13 @@ const { SysUser } = require('../models/SysUser.js')
7
7
  * get:
8
8
  * summary: 获取用户列表
9
9
  * tags: [Users]
10
+ * {{#if_eq auth "static"}}
11
+ * security:
12
+ * - bearerAuth: []
13
+ * {{else}}
14
+ * security:
15
+ * - oidcAuth: []
16
+ * {{/if_eq}}
10
17
  * parameters:
11
18
  * - in: query
12
19
  * name: page
@@ -23,6 +30,7 @@ const { SysUser } = require('../models/SysUser.js')
23
30
  const userList = {
24
31
  method: 'get',
25
32
  path: '/api/users',
33
+ jwt: true,
26
34
  async handler(req) {
27
35
  const { page = 1, limit = 10 } = req.query
28
36
  const users = await SysUser.findAndCountAll({
@@ -42,6 +50,13 @@ const userList = {
42
50
  * get:
43
51
  * summary: 获取单个用户
44
52
  * tags: [Users]
53
+ * {{#if_eq auth "static"}}
54
+ * security:
55
+ * - bearerAuth: []
56
+ * {{else}}
57
+ * security:
58
+ * - oidcAuth: []
59
+ * {{/if_eq}}
45
60
  * parameters:
46
61
  * - in: path
47
62
  * name: id
@@ -56,6 +71,7 @@ const userList = {
56
71
  const userGet = {
57
72
  method: 'get',
58
73
  path: '/api/users/:id',
74
+ jwt: true,
59
75
  paramsSchema: {
60
76
  type: 'object',
61
77
  required: ['id'],
@@ -77,6 +93,13 @@ const userGet = {
77
93
  * post:
78
94
  * summary: 创建用户
79
95
  * tags: [Users]
96
+ * {{#if_eq auth "static"}}
97
+ * security:
98
+ * - bearerAuth: []
99
+ * {{else}}
100
+ * security:
101
+ * - oidcAuth: []
102
+ * {{/if_eq}}
80
103
  * requestBody:
81
104
  * required: true
82
105
  * content:
@@ -96,6 +119,7 @@ const userGet = {
96
119
  const userCreate = {
97
120
  method: 'post',
98
121
  path: '/api/users',
122
+ jwt: true,
99
123
  bodySchema: {
100
124
  type: 'object',
101
125
  required: ['username', 'password'],
@@ -117,6 +141,13 @@ const userCreate = {
117
141
  * put:
118
142
  * summary: 更新用户
119
143
  * tags: [Users]
144
+ * {{#if_eq auth "static"}}
145
+ * security:
146
+ * - bearerAuth: []
147
+ * {{else}}
148
+ * security:
149
+ * - oidcAuth: []
150
+ * {{/if_eq}}
120
151
  * parameters:
121
152
  * - in: path
122
153
  * name: id
@@ -142,6 +173,7 @@ const userCreate = {
142
173
  const userUpdate = {
143
174
  method: 'put',
144
175
  path: '/api/users/:id',
176
+ jwt: true,
145
177
  paramsSchema: {
146
178
  type: 'object',
147
179
  required: ['id'],
@@ -173,6 +205,13 @@ const userUpdate = {
173
205
  * delete:
174
206
  * summary: 删除用户
175
207
  * tags: [Users]
208
+ * {{#if_eq auth "static"}}
209
+ * security:
210
+ * - bearerAuth: []
211
+ * {{else}}
212
+ * security:
213
+ * - oidcAuth: []
214
+ * {{/if_eq}}
176
215
  * parameters:
177
216
  * - in: path
178
217
  * name: id
@@ -187,6 +226,7 @@ const userUpdate = {
187
226
  const userDelete = {
188
227
  method: 'delete',
189
228
  path: '/api/users/:id',
229
+ jwt: true,
190
230
  paramsSchema: {
191
231
  type: 'object',
192
232
  required: ['id'],
@@ -7,6 +7,13 @@ import { SysUser } from '../models/SysUser.js'
7
7
  * get:
8
8
  * summary: 获取用户列表
9
9
  * tags: [Users]
10
+ * {{#if_eq auth "static"}}
11
+ * security:
12
+ * - bearerAuth: []
13
+ * {{else}}
14
+ * security:
15
+ * - oidcAuth: []
16
+ * {{/if_eq}}
10
17
  * parameters:
11
18
  * - in: query
12
19
  * name: page
@@ -23,6 +30,7 @@ import { SysUser } from '../models/SysUser.js'
23
30
  const userList = {
24
31
  method: 'get',
25
32
  path: '/api/users',
33
+ jwt: true,
26
34
  async handler(req) {
27
35
  const { page = 1, limit = 10 } = req.query
28
36
  const users = await SysUser.findAndCountAll({
@@ -42,6 +50,13 @@ const userList = {
42
50
  * get:
43
51
  * summary: 获取单个用户
44
52
  * tags: [Users]
53
+ * {{#if_eq auth "static"}}
54
+ * security:
55
+ * - bearerAuth: []
56
+ * {{else}}
57
+ * security:
58
+ * - oidcAuth: []
59
+ * {{/if_eq}}
45
60
  * parameters:
46
61
  * - in: path
47
62
  * name: id
@@ -56,6 +71,7 @@ const userList = {
56
71
  const userGet = {
57
72
  method: 'get',
58
73
  path: '/api/users/:id',
74
+ jwt: true,
59
75
  paramsSchema: {
60
76
  type: 'object',
61
77
  required: ['id'],
@@ -77,6 +93,13 @@ const userGet = {
77
93
  * post:
78
94
  * summary: 创建用户
79
95
  * tags: [Users]
96
+ * {{#if_eq auth "static"}}
97
+ * security:
98
+ * - bearerAuth: []
99
+ * {{else}}
100
+ * security:
101
+ * - oidcAuth: []
102
+ * {{/if_eq}}
80
103
  * requestBody:
81
104
  * required: true
82
105
  * content:
@@ -96,6 +119,7 @@ const userGet = {
96
119
  const userCreate = {
97
120
  method: 'post',
98
121
  path: '/api/users',
122
+ jwt: true,
99
123
  bodySchema: {
100
124
  type: 'object',
101
125
  required: ['username', 'password'],
@@ -117,6 +141,13 @@ const userCreate = {
117
141
  * put:
118
142
  * summary: 更新用户
119
143
  * tags: [Users]
144
+ * {{#if_eq auth "static"}}
145
+ * security:
146
+ * - bearerAuth: []
147
+ * {{else}}
148
+ * security:
149
+ * - oidcAuth: []
150
+ * {{/if_eq}}
120
151
  * parameters:
121
152
  * - in: path
122
153
  * name: id
@@ -142,6 +173,7 @@ const userCreate = {
142
173
  const userUpdate = {
143
174
  method: 'put',
144
175
  path: '/api/users/:id',
176
+ jwt: true,
145
177
  paramsSchema: {
146
178
  type: 'object',
147
179
  required: ['id'],
@@ -173,6 +205,13 @@ const userUpdate = {
173
205
  * delete:
174
206
  * summary: 删除用户
175
207
  * tags: [Users]
208
+ * {{#if_eq auth "static"}}
209
+ * security:
210
+ * - bearerAuth: []
211
+ * {{else}}
212
+ * security:
213
+ * - oidcAuth: []
214
+ * {{/if_eq}}
176
215
  * parameters:
177
216
  * - in: path
178
217
  * name: id
@@ -187,6 +226,7 @@ const userUpdate = {
187
226
  const userDelete = {
188
227
  method: 'delete',
189
228
  path: '/api/users/:id',
229
+ jwt: true,
190
230
  paramsSchema: {
191
231
  type: 'object',
192
232
  required: ['id'],
@@ -7,6 +7,13 @@ import { SysUser } from '../models/SysUser.js'
7
7
  * get:
8
8
  * summary: 获取用户列表
9
9
  * tags: [Users]
10
+ * {{#if_eq auth "static"}}
11
+ * security:
12
+ * - bearerAuth: []
13
+ * {{else}}
14
+ * security:
15
+ * - oidcAuth: []
16
+ * {{/if_eq}}
10
17
  * parameters:
11
18
  * - in: query
12
19
  * name: page
@@ -23,6 +30,7 @@ import { SysUser } from '../models/SysUser.js'
23
30
  const userList = {
24
31
  method: 'get',
25
32
  path: '/api/users',
33
+ jwt: true,
26
34
  async handler(req: any) {
27
35
  const { page = 1, limit = 10 } = req.query
28
36
  const users = await SysUser.findAndCountAll({
@@ -42,6 +50,13 @@ const userList = {
42
50
  * get:
43
51
  * summary: 获取单个用户
44
52
  * tags: [Users]
53
+ * {{#if_eq auth "static"}}
54
+ * security:
55
+ * - bearerAuth: []
56
+ * {{else}}
57
+ * security:
58
+ * - oidcAuth: []
59
+ * {{/if_eq}}
45
60
  * parameters:
46
61
  * - in: path
47
62
  * name: id
@@ -56,6 +71,7 @@ const userList = {
56
71
  const userGet = {
57
72
  method: 'get',
58
73
  path: '/api/users/:id',
74
+ jwt: true,
59
75
  paramsSchema: {
60
76
  type: 'object',
61
77
  required: ['id'],
@@ -77,6 +93,13 @@ const userGet = {
77
93
  * post:
78
94
  * summary: 创建用户
79
95
  * tags: [Users]
96
+ * {{#if_eq auth "static"}}
97
+ * security:
98
+ * - bearerAuth: []
99
+ * {{else}}
100
+ * security:
101
+ * - oidcAuth: []
102
+ * {{/if_eq}}
80
103
  * requestBody:
81
104
  * required: true
82
105
  * content:
@@ -96,6 +119,7 @@ const userGet = {
96
119
  const userCreate = {
97
120
  method: 'post',
98
121
  path: '/api/users',
122
+ jwt: true,
99
123
  bodySchema: {
100
124
  type: 'object',
101
125
  required: ['username', 'password'],
@@ -117,6 +141,13 @@ const userCreate = {
117
141
  * put:
118
142
  * summary: 更新用户
119
143
  * tags: [Users]
144
+ * {{#if_eq auth "static"}}
145
+ * security:
146
+ * - bearerAuth: []
147
+ * {{else}}
148
+ * security:
149
+ * - oidcAuth: []
150
+ * {{/if_eq}}
120
151
  * parameters:
121
152
  * - in: path
122
153
  * name: id
@@ -142,6 +173,7 @@ const userCreate = {
142
173
  const userUpdate = {
143
174
  method: 'put',
144
175
  path: '/api/users/:id',
176
+ jwt: true,
145
177
  paramsSchema: {
146
178
  type: 'object',
147
179
  required: ['id'],
@@ -173,6 +205,13 @@ const userUpdate = {
173
205
  * delete:
174
206
  * summary: 删除用户
175
207
  * tags: [Users]
208
+ * {{#if_eq auth "static"}}
209
+ * security:
210
+ * - bearerAuth: []
211
+ * {{else}}
212
+ * security:
213
+ * - oidcAuth: []
214
+ * {{/if_eq}}
176
215
  * parameters:
177
216
  * - in: path
178
217
  * name: id
@@ -187,6 +226,7 @@ const userUpdate = {
187
226
  const userDelete = {
188
227
  method: 'delete',
189
228
  path: '/api/users/:id',
229
+ jwt: true,
190
230
  paramsSchema: {
191
231
  type: 'object',
192
232
  required: ['id'],