@finsys/core 2.5.0 → 2.7.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.
- package/README.md +14 -2
- package/dist/data/adapter-categories.json +156 -0
- package/dist/index.cjs +274 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +629 -1
- package/dist/index.d.ts +629 -1
- package/dist/index.js +267 -16
- package/dist/index.js.map +1 -1
- package/dist/schema/adapter-manifest.schema.json +112 -0
- package/package.json +6 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://finhero.asia/schemas/finsys-core/adapter-manifest.schema.json",
|
|
4
|
+
"title": "Adapter Manifest",
|
|
5
|
+
"description": "Declarative descriptor every source adapter ships alongside its implementation. Validated by the host app's discovery mechanism at boot. Mirrors the AdapterManifest TypeScript type in adapter-manifest.ts; KEEP IN SYNC.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["manifestVersion", "id", "displayName", "category", "version", "produces", "implementation"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"manifestVersion": {
|
|
11
|
+
"const": 1,
|
|
12
|
+
"description": "Manifest format version. The schema file's $id should track this."
|
|
13
|
+
},
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[a-z][a-z0-9-]*-v[0-9]+$",
|
|
17
|
+
"minLength": 3,
|
|
18
|
+
"maxLength": 100,
|
|
19
|
+
"description": "Globally unique adapter id. Convention: <vendor>-<category-short>-v<n>"
|
|
20
|
+
},
|
|
21
|
+
"displayName": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"maxLength": 200,
|
|
25
|
+
"description": "Human-readable label for operator UIs."
|
|
26
|
+
},
|
|
27
|
+
"category": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": ["telco-carrier", "payment-network", "bank-statement"],
|
|
30
|
+
"description": "Generic category this adapter implements. MUST be one declared by finsys-core's category catalogue."
|
|
31
|
+
},
|
|
32
|
+
"version": {
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"minimum": 1,
|
|
35
|
+
"description": "Monotonic version per adapter. Bump on any change to payload shape, field-mapping logic, or output semantics."
|
|
36
|
+
},
|
|
37
|
+
"produces": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": { "type": "string", "minLength": 1 },
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"uniqueItems": true,
|
|
42
|
+
"description": "Subset of the category's canonical field names that this adapter promises to produce. Validated against categoryFieldsOf(category) at registration."
|
|
43
|
+
},
|
|
44
|
+
"implementation": {
|
|
45
|
+
"oneOf": [
|
|
46
|
+
{
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["type", "fieldMap"],
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"properties": {
|
|
51
|
+
"type": { "const": "declarative" },
|
|
52
|
+
"fieldMap": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"minItems": 1,
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["source", "canonical"],
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"source": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^\\$",
|
|
63
|
+
"description": "JSONPath into the raw payload, starting with $."
|
|
64
|
+
},
|
|
65
|
+
"canonical": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1,
|
|
68
|
+
"description": "Canonical field name (must be in the category's field set)."
|
|
69
|
+
},
|
|
70
|
+
"transform": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"enum": ["identity", "pct_to_ratio01", "to_boolean", "to_integer"],
|
|
73
|
+
"default": "identity"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["type", "entryPoint"],
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"properties": {
|
|
85
|
+
"type": { "const": "typescript" },
|
|
86
|
+
"entryPoint": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))[^/].*\\.(ts|js|mjs|cjs)$",
|
|
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
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"requiredIdentityFields": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"minLength": 1,
|
|
100
|
+
"maxLength": 100,
|
|
101
|
+
"not": { "enum": ["ihsId", "ic", "fullName"] }
|
|
102
|
+
},
|
|
103
|
+
"uniqueItems": true,
|
|
104
|
+
"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
|
+
},
|
|
106
|
+
"notes": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"maxLength": 2000,
|
|
109
|
+
"description": "Optional free-form notes; not consumed by the runtime."
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finsys/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.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",
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"./schema": {
|
|
24
24
|
"import": "./dist/schema/unified-form.schema.json",
|
|
25
25
|
"require": "./dist/schema/unified-form.schema.json"
|
|
26
|
+
},
|
|
27
|
+
"./schema/adapter-manifest": {
|
|
28
|
+
"types": "./dist/schema/adapter-manifest.schema.json",
|
|
29
|
+
"import": "./dist/schema/adapter-manifest.schema.json",
|
|
30
|
+
"require": "./dist/schema/adapter-manifest.schema.json"
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
33
|
"files": [
|