Circle V2 API Docs
    Preparing search index...

    Function validateAndBuildIntegrationCredentials

    • Validates the integration credentials against the per-type schema (already guaranteed by Zod at the tRPC input boundary) and, for Kipu, merges the server-side access_id and secret_key from environment variables so they are written to the DB without ever being exposed to the client.

      Parameters

      • integration:
            | {
                credentials: {
                    app_id: string;
                    location_id: number;
                    location_name?: string;
                };
                type: "kipu";
            }
            | {
                credentials: {
                    bearer_token: string;
                    location_ids: number[];
                    location_name?: string;
                };
                type: "lightningstep";
            }
            | {
                credentials: {
                    api_id: string;
                    api_secret: string;
                    location_name?: string;
                    realm_id: string;
                    service_facility_id: number;
                    sunwave_email: string;
                };
                type: "sunwave";
            }
            | {
                credentials: {
                    base_url: string;
                    client_id: string;
                    rpa_vault_user_id: string;
                    rpa_workflow_id: string;
                    secret_key: string;
                };
                type: "qualifacts_insync";
            }

      Returns
          | {
              access_id: string;
              app_id: string;
              location_id: number;
              location_name?: string;
              secret_key: string;
          }
          | { bearer_token: string; location_ids: number[]; location_name?: string }
          | {
              api_id: string;
              api_secret: string;
              location_name?: string;
              realm_id: string;
              service_facility_id: number;
              sunwave_email: string;
          }
          | {
              base_url: string;
              client_id: string;
              rpa_vault_user_id: string;
              rpa_workflow_id: string;
              secret_key: string;
          }

      • {
            access_id: string;
            app_id: string;
            location_id: number;
            location_name?: string;
            secret_key: string;
        }
      • { bearer_token: string; location_ids: number[]; location_name?: string }
      • {
            api_id: string;
            api_secret: string;
            location_name?: string;
            realm_id: string;
            service_facility_id: number;
            sunwave_email: string;
        }
      • {
            base_url: string;
            client_id: string;
            rpa_vault_user_id: string;
            rpa_workflow_id: string;
            secret_key: string;
        }
        • base_url: string
        • client_id: string
        • rpa_vault_user_id: string

          RPA vault user id — passed as the workflow's USER input (the portal login identity).

        • rpa_workflow_id: string

          RPA workflow id the bot runs; the workflow branches on the sync_type input.

        • secret_key: string