@tronsfey/ucli-server 0.6.4 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +14 -2
  2. package/README.zh.md +14 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -116,10 +116,22 @@ ADMIN_SECRET=my-secret ENCRYPTION_KEY=$ENCRYPTION_KEY ucli-server
116
116
  | `DB_TYPE` | Driver | Notes |
117
117
  |-----------|--------|-------|
118
118
  | `memory` | — | Default. No persistence. Data lost on restart. |
119
- | `postgres` | `pg` | PostgreSQL 12+ |
119
+ | `postgres` | `pg` | PostgreSQL 13+ |
120
120
  | `mysql` | `mysql2` | MySQL 5.7+ / MariaDB 10.3+ |
121
121
 
122
- Tables are auto-created on first run.
122
+ In **development** (`NODE_ENV != production`), TypeORM `synchronize: true` creates tables automatically.
123
+
124
+ In **production**, initialize the schema manually using the provided SQL files:
125
+
126
+ ```bash
127
+ # PostgreSQL
128
+ psql -U oas_gateway -d oas_gateway -f packages/server/db/init.postgres.sql
129
+
130
+ # MySQL
131
+ mysql -u<user> -p<password> oas_gateway < packages/server/db/init.mysql.sql
132
+ ```
133
+
134
+ Then start the server:
123
135
 
124
136
  ```bash
125
137
  # PostgreSQL
package/README.zh.md CHANGED
@@ -112,10 +112,22 @@ ADMIN_SECRET=my-secret ENCRYPTION_KEY=$ENCRYPTION_KEY ucli-server
112
112
  | `DB_TYPE` | 驱动 | 说明 |
113
113
  |-----------|------|------|
114
114
  | `memory` | — | 默认。无持久化,重启后数据丢失。 |
115
- | `postgres` | `pg` | PostgreSQL 12+ |
115
+ | `postgres` | `pg` | PostgreSQL 13+ |
116
116
  | `mysql` | `mysql2` | MySQL 5.7+ / MariaDB 10.3+ |
117
117
 
118
- 首次运行时自动建表。
118
+ **开发环境**(`NODE_ENV != production`)下,TypeORM `synchronize: true` 会自动建表。
119
+
120
+ **生产环境**需手动初始化数据库结构,使用项目提供的 SQL 文件:
121
+
122
+ ```bash
123
+ # PostgreSQL
124
+ psql -U oas_gateway -d oas_gateway -f packages/server/db/init.postgres.sql
125
+
126
+ # MySQL
127
+ mysql -u<用户名> -p<密码> oas_gateway < packages/server/db/init.mysql.sql
128
+ ```
129
+
130
+ 初始化完成后启动服务:
119
131
 
120
132
  ```bash
121
133
  # PostgreSQL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tronsfey/ucli-server",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "ucli server — centralized OpenAPI and MCP management server with multi-database support",
5
5
  "keywords": ["openapi", "oas", "gateway", "nestjs", "jwt", "api-management"],
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "@nestjs/config": "^4.0.2",
39
39
  "@nestjs/core": "^11.0.1",
40
40
  "@nestjs/platform-express": "^11.0.1",
41
- "@nestjs/swagger": "^8.1.0",
41
+ "@nestjs/swagger": "^11.0.0",
42
42
  "@nestjs/terminus": "^11.0.0",
43
43
  "@nestjs/throttler": "^6.4.0",
44
44
  "@nestjs/typeorm": "^11.0.0",