@cfxlabsinc/b2b-services
    Preparing search index...

    Finds AiPrise profiles referenced by our entities that predate the webhook shadow sync (aiprise_business_profile / aiprise_user_profile rows are written by the identity-api webhook consumer, so anything verified before that wiring has no shadow row) and imports them via the shadow services' refresh.

    Source-of-truth references, per profile type:

    • business: organization.data.verificationProfileId, plus US/SWIFT wire payment instruments with a BUSINESS beneficiary (instrument_data.verificationProfileId).
    • user: identity.verification.verificationProfileId, related_person.data.verificationProfileId, plus US/SWIFT wire payment instruments with a PERSON beneficiary.

    Admin-only — the /aiprise/profiles page in admin-dashboard is the sole consumer, so it lives here rather than in the shared aiprise domain package (mirrors RouteFusionEntityBackfillService).

    Index
    • Refreshes missing profiles from AiPrise, sequentially so one bad id (deleted at AiPrise, transient 5xx) never aborts the rest, and capped per run (each refresh is an external GET inside one server-action request). Re-running is idempotent — refresh upserts, and already-shadowed ids are no longer missing on the next scan — so the caller drains remaining by running again.

      Parameters

      • Optionalargs: { limit?: number }
        • Optionallimit?: number

          Max missing profiles refreshed this run. Defaults to 25.

      Returns Promise<{ ok: true; value: AiPriseProfileBackfillReport }>