create-skweb 3.3.8 → 3.4.0

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,16 @@
1
-
2
- > create-skweb@3.3.8 prebuild
3
- > tsc --outDir dist --rootDir src
4
-
5
- ⠙
6
- > create-skweb@3.3.8 build
7
- > rollup -c rollup.config.mjs && node scripts/inject-shebang.mjs && chmod +x dist/cli.js
8
-
9
- ⠙
10
- src/index.ts → dist/index.js...
11
- (!) [plugin typescript] @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.
12
- created dist/index.js in 349ms
13
- 
14
- src/cli.ts → dist/cli.js...
15
- created dist/cli.js in 172ms
16
- [inject-shebang] Shebang added to /Users/stayknight/projects/skweb-mono/tools/create-skweb/dist/cli.js
17
- ⠙
1
+
2
+ > create-skweb@3.3.9 prebuild
3
+ > tsc --outDir dist --rootDir src
4
+
5
+
6
+ > create-skweb@3.3.9 build
7
+ > rollup -c rollup.config.mjs && node scripts/inject-shebang.mjs && chmod +x dist/cli.js
8
+
9
+ 
10
+ src/index.ts → dist/index.js...
11
+ (!) [plugin typescript] @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.
12
+ created dist/index.js in 391ms
13
+ 
14
+ src/cli.ts → dist/cli.js...
15
+ created dist/cli.js in 214ms
16
+ [inject-shebang] Shebang added to /Users/stayknight/projects/skweb-mono/tools/create-skweb/dist/cli.js
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # create-skweb
2
2
 
3
+ ## 3.3.9
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(skweb-express): 修正 statuses 类型声明和 response.ts 中 codes.includes 的使用错误(codes 是 number[]而非 string[])
8
+
3
9
  ## 3.3.8
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skweb",
3
- "version": "3.3.8",
3
+ "version": "3.4.0",
4
4
  "description": "Create a new SKWeb project with TypeScript, CJS, or MJS support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,14 +22,14 @@
22
22
  "dependencies": {
23
23
  "@dotenvx/dotenvx": "^1.75.1",
24
24
  "http-errors": "^2.0.1",
25
- "skweb-express": "^2.0.5",
25
+ "skweb-express": "^2.1.0",
26
26
  "skweb-express-jwt": "^3.0.0",
27
27
  "skweb-express-logger": "^2.0.0",
28
28
  "skweb-sequelize": "^2.0.1",
29
29
  "skweb-redis": "^2.0.0",
30
30
  "skweb-cron": "^2.0.0",
31
- "skweb-framework": "^2.1.2",
32
- "skweb-plugin": "^2.1.1",
31
+ "skweb-framework": "^2.1.3",
32
+ "skweb-plugin": "^2.2.0",
33
33
  "skweb-util": "^2.0.0",
34
34
  "winston": "^3.19.0",
35
35
  "sequelize": "^6.37.8",
@@ -26,14 +26,36 @@ function buildOpenApiSpec() {
26
26
  bearerFormat: 'JWT'
27
27
  }
28
28
  {{else}}
29
- oidcAuth: {
30
- type: 'openIdConnect',
31
- openIdConnectUrl: process.env.OIDC_JWKS_URI
32
- ? process.env.OIDC_JWKS_URI.replace(/\/jwks\.json$/, '/.well-known/openid-configuration')
33
- : (process.env.OIDC_ISSUER
34
- ? `${process.env.OIDC_ISSUER.replace(/\/$/, '')}/.well-known/openid-configuration`
35
- : undefined)
36
- }
29
+ oidcAuth: (() => {
30
+ // Resolve OIDC endpoints from OIDC_ISSUER or OIDC_JWKS_URI
31
+ // Supports Keycloak realms and generic OIDC providers
32
+ const issuer = process.env.OIDC_ISSUER && process.env.OIDC_ISSUER.replace(/\/$/, '')
33
+ const jwksUri = process.env.OIDC_JWKS_URI
34
+ let baseUrl
35
+ if (issuer) {
36
+ baseUrl = issuer
37
+ } else if (jwksUri) {
38
+ // Keycloak JWKS URI: https://host/realms/<name>/protocol/openid-connect/certs
39
+ const match = jwksUri.match(/^(https?:\/\/[^/]+\/realms\/[^/]+)/)
40
+ if (match) baseUrl = match[1]
41
+ }
42
+ return {
43
+ type: 'oauth2',
44
+ flows: {
45
+ authorizationCode: {
46
+ authorizationUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/auth` : undefined,
47
+ tokenUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
48
+ refreshUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
49
+ scopes: {
50
+ openid: 'OpenID Connect scope',
51
+ profile: 'User profile',
52
+ email: 'Email address',
53
+ offline_access: 'Offline token refresh'
54
+ }
55
+ }
56
+ }
57
+ }
58
+ })()
37
59
  {{/if_eq}}
38
60
  }
39
61
  }
@@ -22,14 +22,14 @@
22
22
  "dependencies": {
23
23
  "@dotenvx/dotenvx": "^1.75.1",
24
24
  "http-errors": "^2.0.1",
25
- "skweb-express": "^2.0.5",
25
+ "skweb-express": "^2.1.0",
26
26
  "skweb-express-jwt": "^3.0.0",
27
27
  "skweb-express-logger": "^2.0.0",
28
28
  "skweb-sequelize": "^2.0.1",
29
29
  "skweb-redis": "^2.0.0",
30
30
  "skweb-cron": "^2.0.0",
31
- "skweb-framework": "^2.1.2",
32
- "skweb-plugin": "^2.1.1",
31
+ "skweb-framework": "^2.1.3",
32
+ "skweb-plugin": "^2.2.0",
33
33
  "skweb-util": "^2.0.0",
34
34
  "winston": "^3.19.0",
35
35
  "sequelize": "^6.37.8",
@@ -28,14 +28,36 @@ export function buildOpenApiSpec() {
28
28
  bearerFormat: 'JWT'
29
29
  }
30
30
  {{else}}
31
- oidcAuth: {
32
- type: 'openIdConnect',
33
- openIdConnectUrl: process.env.OIDC_JWKS_URI
34
- ? process.env.OIDC_JWKS_URI.replace(/\/jwks\.json$/, '/.well-known/openid-configuration')
35
- : (process.env.OIDC_ISSUER
36
- ? `${process.env.OIDC_ISSUER.replace(/\/$/, '')}/.well-known/openid-configuration`
37
- : undefined)
38
- }
31
+ oidcAuth: (() => {
32
+ // Resolve OIDC endpoints from OIDC_ISSUER or OIDC_JWKS_URI
33
+ // Supports Keycloak realms and generic OIDC providers
34
+ const issuer = process.env.OIDC_ISSUER?.replace(/\/$/, '')
35
+ const jwksUri = process.env.OIDC_JWKS_URI
36
+ let baseUrl
37
+ if (issuer) {
38
+ baseUrl = issuer
39
+ } else if (jwksUri) {
40
+ // Keycloak JWKS URI: https://host/realms/<name>/protocol/openid-connect/certs
41
+ const match = jwksUri.match(/^(https?:\/\/[^/]+\/realms\/[^/]+)/)
42
+ if (match) baseUrl = match[1]
43
+ }
44
+ return {
45
+ type: 'oauth2',
46
+ flows: {
47
+ authorizationCode: {
48
+ authorizationUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/auth` : undefined,
49
+ tokenUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
50
+ refreshUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
51
+ scopes: {
52
+ openid: 'OpenID Connect scope',
53
+ profile: 'User profile',
54
+ email: 'Email address',
55
+ offline_access: 'Offline token refresh'
56
+ }
57
+ }
58
+ }
59
+ }
60
+ })()
39
61
  {{/if_eq}}
40
62
  }
41
63
  }
@@ -24,14 +24,14 @@
24
24
  "dependencies": {
25
25
  "@dotenvx/dotenvx": "^1.75.1",
26
26
  "http-errors": "^2.0.1",
27
- "skweb-express": "^2.0.5",
27
+ "skweb-express": "^2.1.0",
28
28
  "skweb-express-jwt": "^3.0.0",
29
29
  "skweb-express-logger": "^2.0.0",
30
30
  "skweb-sequelize": "^2.0.1",
31
31
  "skweb-redis": "^2.0.0",
32
32
  "skweb-cron": "^2.0.0",
33
- "skweb-framework": "^2.1.2",
34
- "skweb-plugin": "^2.1.1",
33
+ "skweb-framework": "^2.1.3",
34
+ "skweb-plugin": "^2.2.0",
35
35
  "skweb-util": "^2.0.0",
36
36
  "winston": "^3.19.0",
37
37
  "sequelize": "^6.37.8",
@@ -28,14 +28,36 @@ export function buildOpenApiSpec(): object {
28
28
  bearerFormat: 'JWT'
29
29
  }
30
30
  {{else}}
31
- oidcAuth: {
32
- type: 'openIdConnect',
33
- openIdConnectUrl: process.env.OIDC_JWKS_URI
34
- ? process.env.OIDC_JWKS_URI.replace(/\/jwks\.json$/, '/.well-known/openid-configuration')
35
- : (process.env.OIDC_ISSUER
36
- ? `${process.env.OIDC_ISSUER.replace(/\/$/, '')}/.well-known/openid-configuration`
37
- : undefined)
38
- }
31
+ oidcAuth: (() => {
32
+ // Resolve OIDC endpoints from OIDC_ISSUER or OIDC_JWKS_URI
33
+ // Supports Keycloak realms and generic OIDC providers
34
+ const issuer = process.env.OIDC_ISSUER?.replace(/\/$/, '')
35
+ const jwksUri = process.env.OIDC_JWKS_URI
36
+ let baseUrl: string | undefined
37
+ if (issuer) {
38
+ baseUrl = issuer
39
+ } else if (jwksUri) {
40
+ // Keycloak JWKS URI: https://host/realms/<name>/protocol/openid-connect/certs
41
+ const match = jwksUri.match(/^(https?:\/\/[^/]+\/realms\/[^/]+)/)
42
+ if (match) baseUrl = match[1]
43
+ }
44
+ return {
45
+ type: 'oauth2',
46
+ flows: {
47
+ authorizationCode: {
48
+ authorizationUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/auth` : undefined,
49
+ tokenUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
50
+ refreshUrl: baseUrl ? `${baseUrl}/protocol/openid-connect/token` : undefined,
51
+ scopes: {
52
+ openid: 'OpenID Connect scope',
53
+ profile: 'User profile',
54
+ email: 'Email address',
55
+ offline_access: 'Offline token refresh'
56
+ }
57
+ }
58
+ }
59
+ }
60
+ })()
39
61
  {{/if_eq}}
40
62
  }
41
63
  }