Skip to content

Utils And Packages

FilePurpose
engine/schema/schema-loader.tsLoads schemas from inline objects, URLs, and API references
engine/schema/resolve-schema.tsResolves local, relative, and remote $ref values and flattens allOf
engine/schema/schema-privacy.tsFilters schemas/data by the private: true convention
engine/map/map-registry.tsRegisters/selects map providers
engine/wallet/wallet-registry.tsRegisters/selects credential import providers and filters them by runtime configuration
engine/wallet/types.tsShared provider contract for import context, provider components, and import results
engine/types.tsUI-side network, action, map, and filter types
FilePurpose
lib/api-config.tsAPI base URL selection from env and local storage
lib/api-client.tsAxios client with bearer token attachment
lib/network-api.tsNetwork config and network item fetch calls
lib/item-api.tsLocal item CRUD and action calls
lib/action-api.tsAction fetch, perform, update-status, and event-history calls
lib/auth-api.tsUnified OTP, session, and sign-out calls
lib/auth-token.tsToken storage helpers
lib/item-utils.tsItem geocoding/extraction helpers
lib/import-mapping.tsFlattens imported payloads, generates candidate aliases, and merges values into the active JSON Schema form
lib/wallet-api.tsDhiway Wallet credential import client and payload transformer
lib/digilocker-api.tsDigiLocker agent client and credential subject transformer
lib/match-score-api.tsMatch score API client, item-to-snapshot helper, and request/response types
lib/utils.tsShared UI utility helpers
FilePurpose
utils/match-score-cache.tslocalStorage cache with 24-hour TTL, cache key generation, and score band formatting helpers
hooks/use-match-score.tsReact hook that orchestrates cache lookup, API call, recalculate, and error state

For equivalent schema decoding and display behavior, keep these package categories:

PackageNeeded for
react, react-domUI runtime
react-router-domRoutes and query params
@rjsf/core, @rjsf/shadcn, @rjsf/utils, @rjsf/validator-ajv8JSON Schema forms
@tanstack/react-queryQuery caching, polling, and mutation state for actions/network config
ajv, ajv-formatsJSON Schema validation support
axiosAPI client
@radix-ui/*, radix-ui, vaulDialogs, drawers, popovers, selects, tooltips
tailwindcss, tailwind-merge, clsx, class-variance-authorityStyling and component variants
lucide-reactIcons
sonnerToasts
leaflet, react-leaflet, @types/leafletDefault map implementation
date-fns, react-day-pickerDate picker widget
schemas workspace packageShared schema package dependency

If you do not reuse the existing visual components, you still need a JSON Schema renderer, a $ref resolver, privacy filtering, an API client, and map/geocoding utilities for equivalent behavior.

For equivalent credential import behavior, you also need:

  • a provider registry so one integration does not leak into all form code
  • a mapping layer that can translate external credential payloads into schema property names
  • pluggable provider clients for wallet, DigiLocker, or any future credential source