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;
                    extend_workflow_id?: string;
                    location_id: number;
                    location_name?: string;
                };
                type: "kipu";
            }
            | {
                credentials: {
                    bearer_token: string;
                    extend_workflow_id?: string;
                    location_ids: number[];
                    location_name?: string;
                };
                type: "lightningstep";
            }
            | {
                credentials: {
                    api_id: string;
                    api_secret: string;
                    extend_workflow_id?: string;
                    location_name?: string;
                    realm_id: string;
                    service_facility_id: number;
                    sunwave_email: string;
                };
                type: "sunwave";
            }
            | {
                credentials: {
                    base_url: string;
                    client_id: string;
                    extend_workflow_id?: string;
                    rpa_vault_user_id: string;
                    rpa_workflow_id: string;
                    secret_key: string;
                };
                type: "qualifacts_insync";
            }
            | {
                credentials: {
                    as_of_date?: string;
                    extend_workflow_id?: string;
                    location_id: "1"
                    | "2";
                    location_name?: string;
                    seed: string;
                };
                type: "synthetic";
            }
            | {
                credentials: {
                    api_key: string;
                    connector: string;
                    connector_label: string;
                    extend_workflow_id?: string;
                    org_id: string;
                    program_map: Record<string, string>;
                    sync_from: string;
                };
                type: "proxy_qualifacts_insync";
            }

      Returns
          | {
              access_id: string;
              app_id: string;
              extend_workflow_id?: string;
              location_id: number;
              location_name?: string;
              secret_key: string;
          }
          | {
              bearer_token: string;
              extend_workflow_id?: string;
              location_ids: number[];
              location_name?: string;
          }
          | {
              api_id: string;
              api_secret: string;
              extend_workflow_id?: string;
              location_name?: string;
              realm_id: string;
              service_facility_id: number;
              sunwave_email: string;
          }
          | {
              base_url: string;
              client_id: string;
              extend_workflow_id?: string;
              rpa_vault_user_id: string;
              rpa_workflow_id: string;
              secret_key: string;
          }
          | {
              as_of_date?: string;
              extend_workflow_id?: string;
              location_id: "1"
              | "2";
              location_name?: string;
              seed: string;
          }
          | {
              api_key: string;
              connector: string;
              connector_label: string;
              extend_workflow_id?: string;
              org_id: string;
              program_map: Record<string, string>;
              sync_from: string;
          }

      • {
            access_id: string;
            app_id: string;
            extend_workflow_id?: string;
            location_id: number;
            location_name?: string;
            secret_key: string;
        }
        • access_id: string
        • app_id: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • location_id: number
        • Optionallocation_name?: string
        • secret_key: string
      • {
            bearer_token: string;
            extend_workflow_id?: string;
            location_ids: number[];
            location_name?: string;
        }
        • bearer_token: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • location_ids: number[]
        • Optionallocation_name?: string
      • {
            api_id: string;
            api_secret: string;
            extend_workflow_id?: string;
            location_name?: string;
            realm_id: string;
            service_facility_id: number;
            sunwave_email: string;
        }
        • api_id: string
        • api_secret: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • Optionallocation_name?: string
        • realm_id: string
        • service_facility_id: number
        • sunwave_email: string
      • {
            base_url: string;
            client_id: string;
            extend_workflow_id?: string;
            rpa_vault_user_id: string;
            rpa_workflow_id: string;
            secret_key: string;
        }
        • base_url: string
        • client_id: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • 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
      • {
            as_of_date?: string;
            extend_workflow_id?: string;
            location_id: "1" | "2";
            location_name?: string;
            seed: string;
        }
        • Optionalas_of_date?: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • location_id: "1" | "2"
        • Optionallocation_name?: string
        • seed: string
      • {
            api_key: string;
            connector: string;
            connector_label: string;
            extend_workflow_id?: string;
            org_id: string;
            program_map: Record<string, string>;
            sync_from: string;
        }
        • api_key: string
        • connector: string
        • connector_label: string
        • Optionalextend_workflow_id?: string

          Optional custom Extend workflow id for this facility's uploads; blank = unset (normalized by getExtendWorkflowId).

        • org_id: string
        • program_map: Record<string, string>
        • sync_from: string