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e,IACf,OAAA,eAAA,QAAA,uBAAA,YAAA,EAAA,IAAA,kBAAA,QAAA,mBAAmB,IACnB,OAAA,eAAA,QAAA,uBAAA,YAAA,EAAA,IAAA,kBAAA,QAAA,mBAAmB,IACnB,OAAA,eAAA,QAAA,yBAAA,YAAA,EAAA,IAAA,kBAAA,QAAA,qBAAqB,IACrB,OAAA,eAAA,QAAA,4BAAA,YAAA,EAAA,IAAA,kBAAA,QAAA,wBAAwB,IAG1B,QAAA,OAAA,QAAwB,U","file":"/npm/conductor-node@12.42.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/conductor-node@12.42.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n\nimport { type Agent } from \"./_shims/index.js\";\nimport * as qs from \"./internal/qs.js\";\nimport * as Core from \"./core.js\";\nimport * as Errors from \"./error.js\";\nimport * as Pagination from \"./pagination.js\";\nimport { type CursorPageParams, CursorPageResponse } from \"./pagination.js\";\nimport * as Uploads from \"./uploads.js\";\nimport * as API from \"./resources/index.js\";\nimport { AuthSession, AuthSessionCreateParams, AuthSessions } from \"./resources/auth-sessions.js\";\nimport {\n  EndUser,\n  EndUserCreateParams,\n  EndUserDeleteResponse,\n  EndUserListResponse,\n  EndUserPassthroughParams,\n  EndUserPassthroughResponse,\n  EndUsers,\n} from \"./resources/end-users.js\";\nimport { Qbd, QbdHealthCheckParams, QbdHealthCheckResponse } from \"./resources/qbd/qbd.js\";\n\nexport interface ClientOptions {\n  /**\n   * Defaults to process.env['CONDUCTOR_SECRET_KEY'].\n   */\n  apiKey?: string | undefined;\n\n  /**\n   * Override the default base URL for the API, e.g., \"https://api.example.com/v2/\"\n   *\n   * Defaults to process.env['CONDUCTOR_BASE_URL'].\n   */\n  baseURL?: string | null | undefined;\n\n  /**\n   * The maximum amount of time (in milliseconds) that the client should wait for a response\n   * from the server before timing out a single request.\n   *\n   * Note that request timeouts are retried by default, so in a worst-case scenario you may wait\n   * much longer than this timeout before the promise succeeds or fails.\n   *\n   * @unit milliseconds\n   */\n  timeout?: number | undefined;\n\n  /**\n   * An HTTP agent used to manage HTTP(S) connections.\n   *\n   * If not provided, an agent will be constructed by default in the Node.js environment,\n   * otherwise no agent is used.\n   */\n  httpAgent?: Agent | undefined;\n\n  /**\n   * Specify a custom `fetch` function implementation.\n   *\n   * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is\n   * defined globally.\n   */\n  fetch?: Core.Fetch | undefined;\n\n  /**\n   * The maximum number of times that the client will retry a request in case of a\n   * temporary failure, like a network error or a 5XX error from the server.\n   *\n   * @default 2\n   */\n  maxRetries?: number | undefined;\n\n  /**\n   * Default headers to include with every request to the API.\n   *\n   * These can be removed in individual requests by explicitly setting the\n   * header to `undefined` or `null` in request options.\n   */\n  defaultHeaders?: Core.Headers | undefined;\n\n  /**\n   * Default query parameters to include with every request to the API.\n   *\n   * These can be removed in individual requests by explicitly setting the\n   * param to `undefined` in request options.\n   */\n  defaultQuery?: Core.DefaultQuery | undefined;\n}\n\n/**\n * API Client for interfacing with the Conductor API.\n */\nexport class Conductor extends Core.APIClient {\n  apiKey: string;\n\n  private _options: ClientOptions;\n\n  /**\n   * API Client for interfacing with the Conductor API.\n   *\n   * @param {string | undefined} [opts.apiKey=process.env['CONDUCTOR_SECRET_KEY'] ?? undefined]\n   * @param {string} [opts.baseURL=process.env['CONDUCTOR_BASE_URL'] ?? https://api.conductor.is/v1] - Override the default base URL for the API.\n   * @param {number} [opts.timeout=2 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n   * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.\n   * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n   * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n   * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.\n   * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.\n   */\n  constructor({\n    baseURL = Core.readEnv('CONDUCTOR_BASE_URL'),\n    apiKey = Core.readEnv('CONDUCTOR_SECRET_KEY'),\n    ...opts\n  }: ClientOptions = {}) {\n    if (apiKey === undefined) {\n      throw new Errors.ConductorError(\n        \"The CONDUCTOR_SECRET_KEY environment variable is missing or empty; either provide it, or instantiate the Conductor client with an apiKey option, like new Conductor({ apiKey: 'sk_conductor_...' }).\",\n      );\n    }\n\n    const options: ClientOptions = {\n      apiKey,\n      ...opts,\n      baseURL: baseURL || `https://api.conductor.is/v1`,\n    };\n\n    super({\n      baseURL: options.baseURL!,\n      baseURLOverridden: baseURL ? baseURL !== 'https://api.conductor.is/v1' : false,\n      timeout: options.timeout ?? 120000 /* 2 minutes */,\n      httpAgent: options.httpAgent,\n      maxRetries: options.maxRetries,\n      fetch: options.fetch,\n    });\n\n    this._options = options;\n\n    this.apiKey = apiKey;\n  }\n\n  authSessions: API.AuthSessions = new API.AuthSessions(this);\n  endUsers: API.EndUsers = new API.EndUsers(this);\n  qbd: API.Qbd = new API.Qbd(this);\n\n  /**\n   * Check whether the base URL is set to its default.\n   */\n  #baseURLOverridden(): boolean {\n    return this.baseURL !== 'https://api.conductor.is/v1';\n  }\n\n  protected override defaultQuery(): Core.DefaultQuery | undefined {\n    return this._options.defaultQuery;\n  }\n\n  protected override defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers {\n    return {\n      ...super.defaultHeaders(opts),\n      ...this._options.defaultHeaders,\n    };\n  }\n\n  protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {\n    return { Authorization: `Bearer ${this.apiKey}` };\n  }\n\n  protected override stringifyQuery(query: Record<string, unknown>): string {\n    return qs.stringify(query, { allowDots: true, arrayFormat: 'repeat' });\n  }\n\n  static Conductor = this;\n  static DEFAULT_TIMEOUT = 120000; // 2 minutes\n\n  static ConductorError = Errors.ConductorError;\n  static APIError = Errors.APIError;\n  static APIConnectionError = Errors.APIConnectionError;\n  static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;\n  static APIUserAbortError = Errors.APIUserAbortError;\n  static NotFoundError = Errors.NotFoundError;\n  static ConflictError = Errors.ConflictError;\n  static RateLimitError = Errors.RateLimitError;\n  static BadRequestError = Errors.BadRequestError;\n  static AuthenticationError = Errors.AuthenticationError;\n  static InternalServerError = Errors.InternalServerError;\n  static PermissionDeniedError = Errors.PermissionDeniedError;\n  static UnprocessableEntityError = Errors.UnprocessableEntityError;\n\n  static toFile = Uploads.toFile;\n  static fileFromPath = Uploads.fileFromPath;\n}\n\nConductor.AuthSessions = AuthSessions;\nConductor.EndUsers = EndUsers;\nConductor.Qbd = Qbd;\n\nexport declare namespace Conductor {\n  export type RequestOptions = Core.RequestOptions;\n\n  export import CursorPage = Pagination.CursorPage;\n  export { type CursorPageParams as CursorPageParams, type CursorPageResponse as CursorPageResponse };\n\n  export {\n    AuthSessions as AuthSessions,\n    type AuthSession as AuthSession,\n    type AuthSessionCreateParams as AuthSessionCreateParams,\n  };\n\n  export {\n    EndUsers as EndUsers,\n    type EndUser as EndUser,\n    type EndUserListResponse as EndUserListResponse,\n    type EndUserDeleteResponse as EndUserDeleteResponse,\n    type EndUserPassthroughResponse as EndUserPassthroughResponse,\n    type EndUserCreateParams as EndUserCreateParams,\n    type EndUserPassthroughParams as EndUserPassthroughParams,\n  };\n\n  export {\n    Qbd as Qbd,\n    type QbdHealthCheckResponse as QbdHealthCheckResponse,\n    type QbdHealthCheckParams as QbdHealthCheckParams,\n  };\n}\n\nexport { toFile, fileFromPath } from \"./uploads.js\";\nexport {\n  ConductorError,\n  APIError,\n  APIConnectionError,\n  APIConnectionTimeoutError,\n  APIUserAbortError,\n  NotFoundError,\n  ConflictError,\n  RateLimitError,\n  BadRequestError,\n  AuthenticationError,\n  InternalServerError,\n  PermissionDeniedError,\n  UnprocessableEntityError,\n} from \"./error.js\";\n\nexport default Conductor;\n"]}