@msbci/form-server 1.3.1 → 1.3.2

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": "@msbci/form-server",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Form server — REST API with Prisma, multi-tenant, multi-database",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -45,11 +45,12 @@
45
45
  "zod": "^3.24.0"
46
46
  },
47
47
  "devDependencies": {
48
+ "@types/node": "^20.0.0",
49
+ "@vitest/coverage-v8": "^2.1.0",
48
50
  "prisma": "^6.2.0",
49
51
  "tsup": "^8.3.0",
50
- "vitest": "^2.1.0",
51
- "@vitest/coverage-v8": "^2.1.0",
52
- "typescript": "^5.7.0"
52
+ "typescript": "^5.7.0",
53
+ "vitest": "^2.1.0"
53
54
  },
54
55
  "sideEffects": false,
55
56
  "license": "SEE LICENSE IN LICENSE.md"
@@ -179,19 +179,50 @@ model Scope {
179
179
  description String? // JSON LocalizedString or plain string
180
180
  tenantId String @default("default")
181
181
  metadata String? // JSON
182
+ // Encrypted scope-level headers shared by all DataSourceConfig in the
183
+ // scope. Format produced by utils/encryption.ts. NULL when unset.
184
+ headers String?
182
185
  createdAt DateTime @default(now())
183
186
  updatedAt DateTime @updatedAt
184
187
  createdBy String?
185
188
  updatedBy String?
186
189
 
187
- forms FormDefinitionScope[]
188
- templates VariableTemplate[]
190
+ forms FormDefinitionScope[]
191
+ templates VariableTemplate[]
192
+ dataSources DataSourceConfig[]
189
193
 
190
194
  @@unique([code, tenantId])
191
195
  @@index([tenantId])
192
196
  @@map("scopes")
193
197
  }
194
198
 
199
+ // ─── Data Source Config (admin-managed REST sources) ──────
200
+
201
+ model DataSourceConfig {
202
+ id String @id @default(cuid())
203
+ code String
204
+ name String // JSON LocalizedString
205
+ scopeId String
206
+ url String
207
+ method String @default("GET")
208
+ queryParam String? @default("q")
209
+ valueField String
210
+ labelField String
211
+ headersOverride String? // JSON encrypted (utils/encryption.ts)
212
+ dependencies String? // JSON Record<string,string> (urlParam → varCode)
213
+ metadata String? // JSON
214
+ createdAt DateTime @default(now())
215
+ updatedAt DateTime @updatedAt
216
+ createdBy String?
217
+ updatedBy String?
218
+
219
+ scope Scope @relation(fields: [scopeId], references: [id], onDelete: Cascade)
220
+
221
+ @@unique([code, scopeId])
222
+ @@index([scopeId])
223
+ @@map("data_source_configs")
224
+ }
225
+
195
226
  // ─── Variable Template ────────────────────────────────────
196
227
 
197
228
  model VariableTemplate {