@finsys/core 2.5.0 → 2.6.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/dist/index.d.cts CHANGED
@@ -570,4 +570,470 @@ interface ExtractionStatusResult {
570
570
  */
571
571
  declare function resolveExtractionStatus(ihsRecord: Record<string, unknown>, jobRecords?: ExtractionJobRecord[]): ExtractionStatusResult;
572
572
 
573
- export { BASE_FIELD_SPECS, BasicFormField, type Category, type Choice, DEFAULT_VALIDATOR_DEFINITIONS, type DocExtractionResult, DocExtractionStatus, type DropdownOption, type EditorValidator, ExtractionFileType, type ExtractionJobRecord, ExtractionJobStatus, type ExtractionStatusResult, FIELD_TYPE_DEFINITIONS, type FieldData, type FieldGroup, type FieldReference, FieldType, type FileFieldTableData, type FileFieldTableItem, FileFieldTableType, FileFormField, FormField, FormFieldCategory, type FormFieldInputType, type FormFieldType, type FormFieldTypeDefinitions, FormFieldValidator, FormSpec, type FormValidatorDefinitions, IHS_FAILURE_STATUSES, IHS_TERMINAL_STATUSES, IHS_VALID_STATUSES, type IhsDetailCategory, type IhsFieldDetail, IhsStatus, IhsValueFormat, type PageConfig, type RHFSchemaOutput, type RHFStep, type ResolvedField, Role, type SurveyElementJSON, type SurveyJSON, type SurveyPageJSON, type UnifiedFormConfig, type Validator, applyDynamicTitles, buildFileFieldTables, evaluateExpression, extractTimePeriods, generateRHFSchema, generateSurveyJson, getBaseCategories, getBaseFieldNames, getBaseFieldSpecMap, getBaseFieldSpecs, getCategoryName, getDisplayName, getDisplayNames, getGroupDisplayNames, getPastMonthLabel, getPastYearLabel, getStepDefaultValues, getStepSchema, groupColumnsByTimePeriod, groupDetailsByCategory, groupFieldsByCategory, groupFieldsByPattern, isFailureIhsStatus, isTerminalIhsStatus, isValidIhsStatus, processIhsDetails, resolveExtractionStatus, resolvePageFields, validateFormConfig, validateFormSpec, validatePagesConfig };
573
+ /**
574
+ * Generic categories declared in this package. The set is union-typed
575
+ * so consumers get TypeScript autocomplete (`'telco-carrier' |
576
+ * 'payment-network' | ...`) and a compile-time error if they reference
577
+ * a category that doesn't exist.
578
+ *
579
+ * NB: adding a new category is a finsys-core minor version bump.
580
+ * Vendor adapters can ship freely (deployment-time, no core change)
581
+ * but the CATEGORY they implement must exist here.
582
+ */
583
+ type AdapterCategory = "telco-carrier" | "payment-network" | "bank-statement";
584
+ /**
585
+ * Per-field metadata for a canonical field declared by a category.
586
+ * Frozen at module load — the data file is authoritative.
587
+ */
588
+ interface CanonicalFieldSpec {
589
+ readonly name: CanonicalFieldName;
590
+ readonly type: "number" | "boolean" | "string";
591
+ readonly unit?: string;
592
+ readonly range?: readonly [number, number];
593
+ readonly description: string;
594
+ }
595
+ /**
596
+ * Per-category schema bundle. Used by:
597
+ * - host app: validate adapter `produces` lists at registration
598
+ * - clients (finhub, finsys-client): render UI conditionally on
599
+ * category activation
600
+ * - CRA report: render provenance metadata
601
+ */
602
+ interface CategorySchema {
603
+ readonly id: AdapterCategory;
604
+ readonly displayName: string;
605
+ readonly description: string;
606
+ readonly canonicalTable: string;
607
+ readonly fields: ReadonlyArray<CanonicalFieldSpec>;
608
+ }
609
+ /**
610
+ * Union of all canonical field names declared by any category in this
611
+ * package. Loose-typed at compile time (string) because the actual
612
+ * union grows with each category-added minor; runtime helpers below
613
+ * narrow against the data.
614
+ *
615
+ * Adapter `produces` lists are typed as ReadonlyArray<CanonicalFieldName>
616
+ * — the host validates membership against the adapter's category at
617
+ * registration time, refusing adapters that promise fields outside
618
+ * their category.
619
+ */
620
+ type CanonicalFieldName = string;
621
+ /**
622
+ * Look up a category schema by id. Throws if the id is unknown — this
623
+ * is a programmer error (the type system should prevent it).
624
+ */
625
+ declare function categorySchemaOf(id: AdapterCategory): CategorySchema;
626
+ /**
627
+ * The canonical field names a given category produces. Convenience
628
+ * for callers that don't need the full schema — common case in the
629
+ * eval engine ("does this policy reference any fields from a category
630
+ * that isn't loaded?").
631
+ */
632
+ declare function categoryFieldsOf(id: AdapterCategory): ReadonlyArray<CanonicalFieldName>;
633
+ /**
634
+ * Every category currently declared. Order is data-file order; treat
635
+ * as unstable across versions.
636
+ */
637
+ declare function allCategories(): ReadonlyArray<CategorySchema>;
638
+ /**
639
+ * Reverse lookup: which category declares a given canonical field?
640
+ * Returns null if the field name isn't declared by any category in
641
+ * this version of finsys-core. Useful when the host app is reading
642
+ * canonical field values back from storage + wants to identify the
643
+ * producing category for rendering.
644
+ */
645
+ declare function categoryForField(field: CanonicalFieldName): AdapterCategory | null;
646
+
647
+ /**
648
+ * Source Adapter contract — the framework for ingesting unstructured
649
+ * or partner-specific inputs and producing canonical field values that
650
+ * the eval engine + CRA report consume.
651
+ *
652
+ * The contract has no vendor-specific knowledge. Generic categories
653
+ * (telco-carrier, payment-network, document-extractor, social-presence,
654
+ * …) are declared here; specific vendor implementations live OUTSIDE
655
+ * this open-source package, in private extension directories loaded
656
+ * by the host app at runtime (see SYS-2444 plugin discovery).
657
+ *
658
+ * Design notes:
659
+ * - extract() is async — every real adapter does I/O (HTTP, OCR, LLM).
660
+ * - Errors are thrown as `AdapterError` instances. We DELIBERATELY
661
+ * don't use a Result<> type — the rest of finsys-core uses throw/
662
+ * catch, and bringing a Result idiom in for one subsystem creates
663
+ * dialect inconsistency.
664
+ * - The contract makes no statement about persistence. The host app's
665
+ * adapter runner catches the return value, persists canonical fields
666
+ * + raw payload to the storage tables (SYS-2441), and writes
667
+ * provenance to `ihs_extraction_runs`. Adapters are pure functions
668
+ * of (raw payload) → (canonical fields). This separation lets
669
+ * adapters be swapped, replayed, and tested without DB state.
670
+ */
671
+
672
+ /**
673
+ * An adapter receives a raw payload — opaque to the framework. The
674
+ * shape is whatever the vendor's source produces: a JSON object from a
675
+ * partner API, a base64 PDF blob, a web-scrape result. Vendor adapters
676
+ * narrow this type internally. The host app's adapter runner is
677
+ * responsible for putting the bytes/structure in front of the adapter;
678
+ * what those bytes are is the adapter's problem.
679
+ */
680
+ type RawPayload = unknown;
681
+ /**
682
+ * Canonical field values produced by an adapter for ONE instance.
683
+ * Keys MUST be drawn from the field set declared by the adapter's
684
+ * category (see `categoryFieldsOf` in adapter-categories.ts). Values
685
+ * are typed narrowly per field by the category schema; this loose TS
686
+ * type is runtime-validated against the category schema by the host
687
+ * app at registration time, AND at every extract() call result.
688
+ *
689
+ * The framework rejects:
690
+ * - Field names not declared by the adapter's category
691
+ * - Values whose runtime type doesn't match the category schema
692
+ *
693
+ * Adapters MAY return a partial set — not every category field has to
694
+ * be produced on every applicant (telco fields may be absent if the
695
+ * borrower didn't opt in, for instance). Missing fields are aggregated
696
+ * as zero / null in the eval engine; that's a feature, not a defect.
697
+ */
698
+ type CanonicalFieldValues = Partial<Record<CanonicalFieldName, CanonicalFieldValue>>;
699
+ /**
700
+ * One extraction "instance" — the framework supports multi-instance
701
+ * per applicant per adapter. Examples:
702
+ * - 6 bank statements from one bank (one adapter call, 6 instances)
703
+ * - 12 monthly payment-summary snapshots from one payment network
704
+ * - 3 mobile lines from one telco carrier
705
+ *
706
+ * For multi-VENDOR cases (3 different telco carriers), use separate
707
+ * adapter registrations — each vendor is its own SourceAdapter with
708
+ * its own id. For multi-INSTANCE-from-one-vendor (6 statements from
709
+ * one bank), the adapter returns multiple AdapterExtraction entries
710
+ * in a single extract() call.
711
+ *
712
+ * `instanceKey` is the within-adapter discriminator: free-form, but
713
+ * MUST be stable across re-extractions so the storage layer can
714
+ * replace-in-place rather than accumulating duplicates. Conventions:
715
+ * - For periodic data: encode the period (`'2026-Q1'`, `'2026-03'`)
716
+ * - For per-line data: encode the line id (`'msisdn-60123456789'`,
717
+ * `'card-last4-1234'`)
718
+ * - For natively single-instance adapters: use the empty string `''`
719
+ * (the framework treats `''` as "this adapter only ever has one
720
+ * instance per applicant").
721
+ */
722
+ interface AdapterExtraction {
723
+ /**
724
+ * Stable within-adapter instance discriminator. Empty string for
725
+ * adapters that only ever produce one instance per applicant.
726
+ */
727
+ readonly instanceKey: string;
728
+ /**
729
+ * The canonical field values for this instance.
730
+ */
731
+ readonly values: CanonicalFieldValues;
732
+ }
733
+ /**
734
+ * Allowed value shapes for canonical fields. Per-field type narrowing
735
+ * happens at the category schema level — telcoOnTimePaymentRatio24m is
736
+ * a number 0..1; telcoHandsetFinancingActive is a boolean; etc.
737
+ * Numbers + booleans + strings cover everything we expect from credit
738
+ * signals; nested objects are intentionally excluded to keep canonical
739
+ * fields atomic + queryable.
740
+ */
741
+ type CanonicalFieldValue = number | string | boolean | null;
742
+ /**
743
+ * The interface every adapter implements. Adapters are loaded by the
744
+ * host app's discovery mechanism (SYS-2444); the host app constructs
745
+ * the adapter from its manifest + extract module, then registers it
746
+ * against the registry by `id`.
747
+ */
748
+ interface SourceAdapter {
749
+ /**
750
+ * Globally unique id for this adapter instance. By convention:
751
+ * `<vendor>-<category-short>-v<n>` — e.g. `celcom-telco-v1`. Vendor
752
+ * names appear here in deployment-specific code, NEVER in
753
+ * finsys-core. The id is what the registry uses to dedupe + what
754
+ * provenance records pin to.
755
+ */
756
+ readonly id: string;
757
+ /**
758
+ * Which generic category this adapter implements. Determines which
759
+ * canonical fields the adapter MAY produce + how its output is
760
+ * persisted (each category has its own canonical sibling table —
761
+ * `ihs_alt_data_telco`, `ihs_alt_data_payments`, etc.).
762
+ */
763
+ readonly category: AdapterCategory;
764
+ /**
765
+ * Monotonic version per adapter. Bumped whenever the adapter's
766
+ * payload shape, field-mapping logic, or output semantics change.
767
+ * Versions are stored alongside each extraction run for replay /
768
+ * audit; the framework allows multiple versions of the same adapter
769
+ * to coexist in the registry (deployment-controlled).
770
+ */
771
+ readonly version: number;
772
+ /**
773
+ * Subset of the adapter's category fields that this adapter promises
774
+ * to produce. Used by the host app at boot to log adapter capability
775
+ * + by the CRA report to render "provided by adapter X" badges.
776
+ * MUST be a subset of `categoryFieldsOf(category)`; the host app
777
+ * validates this at registration time and refuses to load adapters
778
+ * that promise fields outside their category.
779
+ */
780
+ readonly produces: ReadonlyArray<CanonicalFieldName>;
781
+ /**
782
+ * Transform a raw payload into canonical field values. The host app
783
+ * calls this once per applicant per adapter, passes the result to
784
+ * the persistence layer (one row per AdapterExtraction in the
785
+ * canonical sibling table), and writes provenance.
786
+ *
787
+ * The return is ALWAYS a list, even when the adapter produces only
788
+ * one instance per applicant — return a one-element array in that
789
+ * case with `instanceKey: ''`. The list shape exists to support
790
+ * inherently multi-instance sources (6 bank statements, 12 monthly
791
+ * payment snapshots, 3 mobile lines) without forcing adapters to
792
+ * batch their own calls.
793
+ *
794
+ * Throw `AdapterError` for any failure path — network timeout,
795
+ * schema mismatch, partner API rate limit, malformed payload. The
796
+ * host's adapter runner catches AdapterError + records the failure
797
+ * on `ihs_extraction_runs` so the operator sees what happened
798
+ * without losing the applicant.
799
+ *
800
+ * Adapters MUST NOT throw plain `Error` or unknown types — the
801
+ * runner will treat those as adapter implementation bugs and surface
802
+ * them to logs separately. Stick to AdapterError for the
803
+ * expected-failure path.
804
+ */
805
+ extract(raw: RawPayload): Promise<AdapterExtraction[]>;
806
+ }
807
+ /**
808
+ * Typed error thrown by adapters on expected failure paths. The
809
+ * `reason` discriminator lets the host app's adapter runner classify
810
+ * failures (transient vs permanent, partner-side vs schema-side)
811
+ * without parsing strings.
812
+ */
813
+ declare class AdapterError extends Error {
814
+ readonly reason: AdapterErrorReason;
815
+ readonly cause?: unknown;
816
+ constructor(reason: AdapterErrorReason, message: string, cause?: unknown);
817
+ }
818
+ /**
819
+ * Discriminator for adapter failure modes. The runner uses this to
820
+ * decide whether to retry, surface to the operator, or write off the
821
+ * extraction run.
822
+ *
823
+ * payload_invalid — the raw payload didn't conform to the
824
+ * adapter's expected source shape. Permanent;
825
+ * re-running won't help. Likely a partner-side
826
+ * schema change → bump adapter version.
827
+ *
828
+ * source_unavailable — the upstream source was unreachable or
829
+ * returned a transient error (timeout, 5xx,
830
+ * rate limit). Transient; safe to retry.
831
+ *
832
+ * mapping_failed — extraction logic raised a domain-specific
833
+ * failure (e.g. value out of expected range).
834
+ * Permanent for this payload; surface to the
835
+ * operator.
836
+ *
837
+ * not_applicable — the applicant doesn't have data for this
838
+ * adapter (e.g. no telco opt-in). Not a
839
+ * failure per se — the runner records a
840
+ * no-op extraction run, eval engine sees no
841
+ * canonical fields, components score zero.
842
+ */
843
+ type AdapterErrorReason = "payload_invalid" | "source_unavailable" | "mapping_failed" | "not_applicable";
844
+
845
+ /**
846
+ * Aggregation operators applied by the eval engine when a scoring
847
+ * component reads a canonical field that has multiple instances
848
+ * persisted for the same applicant.
849
+ *
850
+ * Multi-instance is the framework's first-class shape — an adapter
851
+ * may produce 6 bank-statement instances, 12 monthly payment
852
+ * snapshots, 3 mobile lines, etc., per applicant. Eval components
853
+ * must declare HOW they want those instances collapsed into a single
854
+ * scoring value. This module declares the operator set + the runtime
855
+ * helper that applies one to a value list.
856
+ *
857
+ * Consumer is the eval engine (today: finsys-client + FinSim sim-
858
+ * runner; tomorrow: anywhere else evaluating against canonical
859
+ * fields). finsys-core publishes the operator surface so policy
860
+ * fixtures across all consumers reference the same set.
861
+ *
862
+ * v1 operator set, in order of expected use frequency:
863
+ *
864
+ * sum — total across instances. Bank balance sum across t1..tN.
865
+ * mean — arithmetic mean. Average monthly payment volume.
866
+ * latest — the instance with the most recent observed_at. Telco
867
+ * snapshot when only the latest matters.
868
+ * max — maximum value across instances. Worst-case suspension
869
+ * count when multiple telco lines exist.
870
+ * count — number of instances with a non-null value for this
871
+ * field. Useful for "how many bank statements does this
872
+ * applicant have on file" as a score input.
873
+ */
874
+
875
+ type AggregationOp = "sum" | "mean" | "latest" | "max" | "count";
876
+ /** Every operator declared in this version of finsys-core. */
877
+ declare const ALL_AGGREGATION_OPS: ReadonlyArray<AggregationOp>;
878
+ /**
879
+ * One value contributed by one instance. The eval engine builds a
880
+ * list of these (one per instance, in observed-at order — the
881
+ * persistence layer is the source of truth on ordering) and passes
882
+ * to applyAggregation.
883
+ */
884
+ interface InstanceValue {
885
+ readonly value: CanonicalFieldValue;
886
+ /**
887
+ * The instance's observed-at timestamp. MUST be an ISO-8601 UTC
888
+ * string (`Z`-suffixed, e.g. `2026-04-01T00:00:00Z`). The `latest`
889
+ * operator compares these lexicographically, which is only
890
+ * monotonic with wall-time when all timestamps share the UTC
891
+ * offset — mixed offsets (e.g. `+08:00` vs `Z`) can yield
892
+ * incorrect ordering. Other operators ignore this field; pass an
893
+ * empty string if the operator in question doesn't need it.
894
+ */
895
+ readonly observedAt: string;
896
+ }
897
+ /**
898
+ * Apply an aggregation operator to a list of instance values.
899
+ *
900
+ * Behaviour for empty + null-only lists:
901
+ * - empty list → `null`
902
+ * - all-null values → `null`
903
+ * - `count` on either of the above → `0`
904
+ *
905
+ * Returns:
906
+ * - `sum`, `mean`, `max`, `count` → `number | null`
907
+ * - `latest` → matches the value type of the most-recent instance
908
+ * (number / boolean / string / null)
909
+ *
910
+ * Throws on operators that don't apply to the value types present
911
+ * (e.g. `sum` of booleans). Eval-policy authors are expected to pair
912
+ * operators with appropriate field types; this is a guardrail against
913
+ * silent garbage rather than an error-recovery mechanism.
914
+ */
915
+ declare function applyAggregation(op: AggregationOp, instances: ReadonlyArray<InstanceValue>): CanonicalFieldValue;
916
+
917
+ /**
918
+ * Adapter manifest — the declarative descriptor every adapter ships
919
+ * alongside its implementation. The host app's discovery mechanism
920
+ * (SYS-2444) reads `manifest.json` from each adapter directory, validates
921
+ * it against the JSON-schema in `schema/adapter-manifest.schema.json`,
922
+ * and uses the manifest to construct + register the runtime adapter.
923
+ *
924
+ * Two adapter flavours both use this manifest shape:
925
+ *
926
+ * 1. Declarative JSON-only adapter (no TypeScript code) — `manifest.json`
927
+ * includes a `fieldMap` declaring source-path → canonical-field
928
+ * translations. The host's adapter runner applies the mapping +
929
+ * transforms generically. Suitable for partners whose API maps
930
+ * cleanly to canonical fields with rename + simple transforms.
931
+ *
932
+ * 2. TypeScript adapter — `manifest.json` includes an `entryPoint`
933
+ * pointing at an `extract.ts` (or compiled `.js`) module that
934
+ * exports a function implementing the `SourceAdapter#extract`
935
+ * contract. Used when the source needs OAuth, multi-endpoint
936
+ * merging, OCR pipelines, or partner-version negotiation.
937
+ *
938
+ * The JSON-schema (`schema/adapter-manifest.schema.json`) is the
939
+ * authoritative format; this TypeScript type mirrors it. They MUST
940
+ * stay in sync — when one changes, change the other.
941
+ */
942
+
943
+ /**
944
+ * Top-level manifest shape. Mirrors `schema/adapter-manifest.schema.json`.
945
+ */
946
+ interface AdapterManifest {
947
+ /** Manifest format version. Bump this file's schema → bump this field. */
948
+ readonly manifestVersion: 1;
949
+ /**
950
+ * Globally unique adapter id. Conventional pattern:
951
+ * `<vendor>-<category-short>-v<n>` (e.g. `celcom-telco-v1`). The id is
952
+ * what `SourceAdapter#id` returns + what provenance records pin to.
953
+ */
954
+ readonly id: string;
955
+ /** Human-readable label rendered in operator UIs. */
956
+ readonly displayName: string;
957
+ /**
958
+ * Generic category this adapter implements. Determines which
959
+ * canonical fields the adapter is allowed to produce + which
960
+ * canonical sibling table its output is persisted into.
961
+ */
962
+ readonly category: AdapterCategory;
963
+ /**
964
+ * Monotonic version per adapter. Bump on any change to payload shape,
965
+ * field-mapping logic, or output semantics. Multiple versions of the
966
+ * same adapter family MAY coexist in a deployment (deployment-time
967
+ * pin).
968
+ */
969
+ readonly version: number;
970
+ /**
971
+ * Which canonical fields (subset of the category's field set) this
972
+ * adapter promises to produce. The host validates at registration
973
+ * time that every entry is declared by `categoryFieldsOf(category)`;
974
+ * adapters promising out-of-category fields are refused.
975
+ */
976
+ readonly produces: ReadonlyArray<CanonicalFieldName>;
977
+ /**
978
+ * Adapter implementation flavour. Discriminator drives the rest of
979
+ * the manifest shape.
980
+ *
981
+ * - `declarative` — JSON-only adapter; `fieldMap` is required, no
982
+ * code is loaded.
983
+ * - `typescript` — TS/JS adapter; `entryPoint` is required, the
984
+ * host imports it dynamically.
985
+ */
986
+ readonly implementation: DeclarativeImplementation | TypescriptImplementation;
987
+ /**
988
+ * Optional free-form notes — useful for partner-side documentation
989
+ * (where to find the adapter's source, who owns it, what version of
990
+ * the partner API it expects). Not consumed by the runtime.
991
+ */
992
+ readonly notes?: string;
993
+ }
994
+ interface DeclarativeImplementation {
995
+ readonly type: "declarative";
996
+ /**
997
+ * Each entry maps a JSONPath into the raw payload to a canonical
998
+ * field name, optionally applying a transform. The host's adapter
999
+ * runner walks this list per `extract()` invocation.
1000
+ */
1001
+ readonly fieldMap: ReadonlyArray<FieldMapEntry>;
1002
+ }
1003
+ interface TypescriptImplementation {
1004
+ readonly type: "typescript";
1005
+ /**
1006
+ * Relative path (from the adapter's directory) to the module that
1007
+ * exports the extract function. The host's discovery mechanism
1008
+ * dynamic-imports this path at adapter registration time.
1009
+ */
1010
+ readonly entryPoint: string;
1011
+ }
1012
+ interface FieldMapEntry {
1013
+ /**
1014
+ * JSONPath expression into the raw payload. E.g.
1015
+ * `$.bill.payment_24m_pct` or `$.account.tenure_months`. Single-
1016
+ * value extraction; arrays + objects MUST be flattened by the
1017
+ * partner-API client before invoking the adapter.
1018
+ */
1019
+ readonly source: string;
1020
+ /**
1021
+ * Canonical field name this maps to. MUST be declared by the
1022
+ * adapter's category. Host validates at registration.
1023
+ */
1024
+ readonly canonical: CanonicalFieldName;
1025
+ /**
1026
+ * Optional value transform applied between source extraction +
1027
+ * canonical-field write. Built-in transforms TBD as the pattern
1028
+ * settles; v1 supports:
1029
+ * - `identity` — default; pass through
1030
+ * - `pct_to_ratio01` — divide by 100, clamp to [0, 1]
1031
+ * - `to_boolean` — truthy → true, falsy → false
1032
+ * - `to_integer` — round + cast
1033
+ * Adapters needing more complex transforms should use the
1034
+ * `typescript` implementation flavour instead.
1035
+ */
1036
+ readonly transform?: "identity" | "pct_to_ratio01" | "to_boolean" | "to_integer";
1037
+ }
1038
+
1039
+ export { ALL_AGGREGATION_OPS, type AdapterCategory, AdapterError, type AdapterErrorReason, type AdapterExtraction, type AdapterManifest, type AggregationOp, BASE_FIELD_SPECS, BasicFormField, type CanonicalFieldName, type CanonicalFieldSpec, type CanonicalFieldValue, type CanonicalFieldValues, type Category, type CategorySchema, type Choice, DEFAULT_VALIDATOR_DEFINITIONS, type DeclarativeImplementation, type DocExtractionResult, DocExtractionStatus, type DropdownOption, type EditorValidator, ExtractionFileType, type ExtractionJobRecord, ExtractionJobStatus, type ExtractionStatusResult, FIELD_TYPE_DEFINITIONS, type FieldData, type FieldGroup, type FieldMapEntry, type FieldReference, FieldType, type FileFieldTableData, type FileFieldTableItem, FileFieldTableType, FileFormField, FormField, FormFieldCategory, type FormFieldInputType, type FormFieldType, type FormFieldTypeDefinitions, FormFieldValidator, FormSpec, type FormValidatorDefinitions, IHS_FAILURE_STATUSES, IHS_TERMINAL_STATUSES, IHS_VALID_STATUSES, type IhsDetailCategory, type IhsFieldDetail, IhsStatus, IhsValueFormat, type InstanceValue, type PageConfig, type RHFSchemaOutput, type RHFStep, type RawPayload, type ResolvedField, Role, type SourceAdapter, type SurveyElementJSON, type SurveyJSON, type SurveyPageJSON, type TypescriptImplementation, type UnifiedFormConfig, type Validator, allCategories, applyAggregation, applyDynamicTitles, buildFileFieldTables, categoryFieldsOf, categoryForField, categorySchemaOf, evaluateExpression, extractTimePeriods, generateRHFSchema, generateSurveyJson, getBaseCategories, getBaseFieldNames, getBaseFieldSpecMap, getBaseFieldSpecs, getCategoryName, getDisplayName, getDisplayNames, getGroupDisplayNames, getPastMonthLabel, getPastYearLabel, getStepDefaultValues, getStepSchema, groupColumnsByTimePeriod, groupDetailsByCategory, groupFieldsByCategory, groupFieldsByPattern, isFailureIhsStatus, isTerminalIhsStatus, isValidIhsStatus, processIhsDetails, resolveExtractionStatus, resolvePageFields, validateFormConfig, validateFormSpec, validatePagesConfig };