@finsys/core 4.1.0 → 4.3.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.
@@ -89,9 +89,59 @@
89
89
  "description": "Relative path (from the adapter directory) to the module exporting the extract function. Must not start with '/' and must not contain '..' path segments — the host will reject manifests that try to escape the adapter directory. The host also runs a defence-in-depth path-traversal check at load time."
90
90
  }
91
91
  }
92
+ },
93
+ {
94
+ "type": "object",
95
+ "required": ["type", "fieldMap"],
96
+ "additionalProperties": false,
97
+ "properties": {
98
+ "type": { "const": "form-intake" },
99
+ "fieldMap": {
100
+ "type": "array",
101
+ "minItems": 1,
102
+ "items": {
103
+ "type": "object",
104
+ "required": ["formFieldId", "canonical"],
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "formFieldId": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "description": "The form spec's field name this mapping consumes."
111
+ },
112
+ "canonical": {
113
+ "type": "string",
114
+ "minLength": 1,
115
+ "description": "Canonical field name (must be in the category's field set)."
116
+ }
117
+ }
118
+ },
119
+ "description": "SYS-2501 — form-field-id → canonical-field mappings. Data-only: the host's form submission handler is the runtime; no code is loaded. No transform slot — values arrive typed from the form layer."
120
+ }
121
+ }
122
+ },
123
+ {
124
+ "type": "object",
125
+ "required": ["type"],
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "type": { "const": "manual-override" }
129
+ },
130
+ "description": "SYS-2501 — declares that this adapter's `produces` list is operator-overridable post-extraction. `produces` IS the override surface; the shape is intentionally empty beyond the discriminator."
92
131
  }
93
132
  ]
94
133
  },
134
+ "cardinality": {
135
+ "type": "string",
136
+ "enum": ["single", "multi"],
137
+ "description": "SYS-2502 — explicit instance cardinality. Optional for backward compatibility: when absent the host infers from the original instanceKey convention (empty string → single, non-empty → multi). New manifests should declare it so the host can reject mismatched extractions at persistence time."
138
+ },
139
+ "singletonFields": {
140
+ "type": "array",
141
+ "items": { "type": "string", "minLength": 1 },
142
+ "uniqueItems": true,
143
+ "description": "SYS-2502 — per-applicant singleton fields on a multi-instance category (e.g. accountHolderName on bank statements). Every entry must also appear in `produces`; host validates at registration."
144
+ },
95
145
  "requiredIdentityFields": {
96
146
  "type": "array",
97
147
  "items": {
@@ -103,6 +153,31 @@
103
153
  "uniqueItems": true,
104
154
  "description": "v2.7.0 — partner-specific identity field names required by fetch(). Host validates per-applicant before invoking fetch() and skips the adapter when missing. Omit (or empty) for adapters that don't implement fetch(). Must NOT include core fields ('ihsId', 'ic', 'fullName') — those are always populated, and declaring 'ic' as required would cause the host to skip every non-MY applicant since 'ic' can legitimately be empty."
105
155
  },
156
+ "fieldAuthorizations": {
157
+ "type": "object",
158
+ "minProperties": 1,
159
+ "propertyNames": { "minLength": 1 },
160
+ "additionalProperties": {
161
+ "type": "object",
162
+ "minProperties": 1,
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "lenderRoles": {
166
+ "type": "array",
167
+ "minItems": 1,
168
+ "uniqueItems": true,
169
+ "items": { "type": "string", "minLength": 1 }
170
+ },
171
+ "programIds": {
172
+ "type": "array",
173
+ "minItems": 1,
174
+ "uniqueItems": true,
175
+ "items": { "type": "string", "minLength": 1 }
176
+ }
177
+ }
178
+ },
179
+ "description": "SYS-2503 — declarative per-field authorization gating, keyed by canonical field name (every key must also appear in `produces`; host validates at registration). No entry → field visible to every reader. An entry restricts: reader must satisfy EVERY declared dimension (AND across dimensions), matching ANY value within a list (OR within). Dimensions are host-interpreted opaque strings. Each entry must declare at least one non-empty dimension — an empty list would read as deny-all, better expressed by not producing the field."
180
+ },
106
181
  "notes": {
107
182
  "type": "string",
108
183
  "maxLength": 2000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finsys/core",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "Convert unified form configurations into Zod schemas, React Hook Form defaults, and SurveyJS JSON",
5
5
  "repository": {
6
6
  "type": "git",
@@ -58,7 +58,6 @@
58
58
  "zod": "^4.3.5"
59
59
  },
60
60
  "devDependencies": {
61
- "@lavamoat/allow-scripts": "^5.0.2",
62
61
  "@types/node": "^25.0.10",
63
62
  "@types/semver": "^7.5.0",
64
63
  "survey-core": "^2.5.6",
@@ -79,12 +78,10 @@
79
78
  ],
80
79
  "license": "Apache-2.0",
81
80
  "engines": {
82
- "node": ">=24",
83
- "npm": ">=11.10.0"
81
+ "node": ">=24.16.0",
82
+ "npm": ">=12.0.1"
84
83
  },
85
- "lavamoat": {
86
- "allowScripts": {
87
- "tsup>esbuild#0.27.3": false
88
- }
84
+ "allowScripts": {
85
+ "esbuild": false
89
86
  }
90
87
  }