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U,EAAQ,KAAM,IACtC,CACT,GAIE,cAAgB,QAAQ,QAAQ,UAChC,cAAgB,QAAQ,iBACxB,eAAiB,QAAQ,MACzB,gBAAkB,QAAQ,mBAC1B,MAAO,EAAI,cAAc,SAAS,sBAClC,WAAa,cAAc,OAC7B,SAAW,MACX,aAAe,GAWf,kBAAM,CAAa,EAAM,GAEvB,IAAI,EADJ,KAAK,qBAAqB,KAE1B,IACE,EAAU,IAAI,IAAI,GAClB,KAAK,0BACP,CAAE,MAAO,GACP,KAAK,0BACL,EAAU,IAAI,IAAI,GAAG,KAAK,OAAO,oBAAoB,IACvD,CACA,KAAK,YAAY,KACjB,MAAM,EAAW,EAAQ,SAAS,MAAM,KAAK,OAAO,GAAG,KAAK,KAC5D,IAAK,CAAC,aAAc,aAAa,SAAS,GACxC,MAAM,IAAI,MACR,cAAc,8EAGlB,MAAM,QAAgB,KAAK,2BAA2B,CACpD,IAAK,EAAQ,WACb,OAAQ,cAAc,YAAY,MAEpC,KAAK,wBAAyB,GAC9B,MAAM,QAAiB,MACrB,EAAQ,IACR,CACE,OAAQ,EAAQ,OAChB,QAAS,EAAQ,UAIrB,GADA,KAAK,yBAA0B,IAC1B,EAAS,GACZ,MAAM,IAAI,cAAc,WACtB,8CAA8C,EAAS,aACvD,GAGJ,KAAK,aAAa,WACZ,EAAI,gBAAgB,UAAU,EAAS,MAAM,EAAI,eAAe,mBAAmB,IACzF,KAAK,aACP","file":"/npm/@vonage/server-client@1.23.1/dist/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@vonage/server-client@1.23.1/dist/cjs/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","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n  // If the importer is in node compatibility mode or this is not an ESM\n  // file that has been converted to a CommonJS file using a Babel-\n  // compatible transform (i.e. \"__esModule\" has not been set), then set\n  // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n  isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n  mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// lib/index.ts\nvar index_exports = {};\n__export(index_exports, {\n  AuthenticationType: () => AuthenticationType,\n  Client: () => Client,\n  FileClient: () => FileClient,\n  GenericErrors: () => GenericErrors,\n  camelCase: () => camelCase,\n  camelCaseObjectKeys: () => camelCaseObjectKeys,\n  isObject: () => isObject,\n  kebabCase: () => kebabCase,\n  kebabCaseObjectKeys: () => kebabCaseObjectKeys,\n  omit: () => omit,\n  snakeCase: () => snakeCase,\n  snakeCaseObjectKeys: () => snakeCaseObjectKeys,\n  transformObjectKeys: () => transformObjectKeys,\n  words: () => words\n});\nmodule.exports = __toCommonJS(index_exports);\n\n// lib/client.ts\nvar import_auth = require(\"@vonage/auth\");\nvar import_vetch = require(\"@vonage/vetch\");\n\n// lib/enums/AuthenticationType.ts\nvar AuthenticationType = /* @__PURE__ */ ((AuthenticationType2) => {\n  AuthenticationType2[\"BASIC\"] = \"basic\";\n  AuthenticationType2[\"JWT\"] = \"jwt\";\n  AuthenticationType2[\"KEY_SECRET\"] = \"key_secret\";\n  AuthenticationType2[\"QUERY_KEY_SECRET\"] = \"query_key_secret\";\n  AuthenticationType2[\"SIGNATURE\"] = \"signature\";\n  AuthenticationType2[\"CIBA\"] = \"ciba\";\n  AuthenticationType2[\"OAUTH2\"] = \"oauth2\";\n  return AuthenticationType2;\n})(AuthenticationType || {});\n\n// lib/enums/GenericErrorCodes.ts\nvar GenericErrors = /* @__PURE__ */ ((GenericErrors2) => {\n  GenericErrors2[\"LOW_BALANCE\"] = \"low-balance\";\n  GenericErrors2[\"UNAUTHORIZED\"] = \"unauthorized\";\n  GenericErrors2[\"FORBIDDEN\"] = \"forbidden\";\n  GenericErrors2[\"NOT_FOUND\"] = \"not-found\";\n  GenericErrors2[\"UNPROVISIONED\"] = \"unprovisioned\";\n  GenericErrors2[\"ACCOUNT_SUSPENDED\"] = \"account-suspended\";\n  GenericErrors2[\"JWT_EXPIRED\"] = \"jwt-expired\";\n  GenericErrors2[\"JWT_REVOKED\"] = \"jwt-revoked\";\n  GenericErrors2[\"INVALID_API_KEY\"] = \"invalid-api-key\";\n  GenericErrors2[\"INVALID_SIGNATURE\"] = \"invalid-signature\";\n  GenericErrors2[\"INVALID_IP\"] = \"invalid-ip\";\n  GenericErrors2[\"MULTIPLE_AUTH_METHODS\"] = \"multiple-auth-methods\";\n  GenericErrors2[\"INVALID_ID\"] = \"invalid-id\";\n  GenericErrors2[\"INVALID_JSON\"] = \"invalid-json\";\n  GenericErrors2[\"WRONG_VERB\"] = \"wrong-verb\";\n  GenericErrors2[\"ACCEPT_HEADER\"] = \"accept-header\";\n  GenericErrors2[\"CONTENT_TYPE_HEADER\"] = \"content-type-header\";\n  GenericErrors2[\"UNAVAILABLE_LEGAL\"] = \"unavailable-legal\";\n  GenericErrors2[\"APPLICATION_SUSPENDED\"] = \"application-suspended\";\n  return GenericErrors2;\n})(GenericErrors || {});\n\n// lib/transformers.ts\nvar words = (str) => str.split(/[-_\\s]+/).flatMap((word) => word.split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/)).filter(Boolean);\nvar camelCase = (str) => words(str).map(\n  (word, index) => index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()\n).join(\"\");\nvar snakeCase = (str) => words(str).map((word) => word.toLowerCase()).join(\"_\");\nvar kebabCase = (str) => words(str).map((word) => word.toLowerCase()).join(\"-\");\nvar isObject = (value) => {\n  const type = typeof value;\n  return value != null && (type === \"object\" || type === \"function\");\n};\nvar transformObjectKeys = (transformFn, objectToTransform, deep = false, preserve = false) => {\n  const transformedObject = {\n    ...preserve ? objectToTransform : {}\n  };\n  for (const prop in objectToTransform) {\n    if (!Object.prototype.hasOwnProperty.call(objectToTransform, prop)) {\n      continue;\n    }\n    const newKey = transformFn(prop);\n    const value = objectToTransform[prop];\n    if (!deep || !isObject(value)) {\n      transformedObject[newKey] = value;\n      continue;\n    }\n    if (Array.isArray(value)) {\n      transformedObject[newKey] = value.map(\n        (t) => isObject(t) ? transformObjectKeys(\n          transformFn,\n          t,\n          deep,\n          preserve\n        ) : t\n      );\n      continue;\n    }\n    transformedObject[newKey] = transformObjectKeys(\n      transformFn,\n      value,\n      deep,\n      preserve\n    );\n  }\n  return transformedObject;\n};\nvar camelCaseObjectKeys = (...rest) => transformObjectKeys(\n  camelCase,\n  ...rest\n);\nvar snakeCaseObjectKeys = (...rest) => transformObjectKeys(\n  snakeCase,\n  ...rest\n);\nvar kebabCaseObjectKeys = (...rest) => transformObjectKeys(\n  kebabCase,\n  ...rest\n);\nvar omit = (keys, obj) => Object.fromEntries(\n  Object.entries(obj).filter(([key]) => !keys.includes(key))\n);\n\n// lib/client.ts\nvar import_debug = __toESM(require(\"debug\"));\nvar log = (0, import_debug.default)(\"vonage:server-client\");\nvar Client = class {\n  /**\n   * Static property containing utility transformers.\n   */\n  static transformers = {\n    \"camelCaseObjectKeys\": camelCaseObjectKeys,\n    \"snakeCaseObjectKeys\": snakeCaseObjectKeys,\n    \"kebabCaseObjectKeys\": kebabCaseObjectKeys,\n    \"omit\": omit\n  };\n  /**\n   * The type of authentication used for the client's requests.\n   */\n  authType = \"query_key_secret\" /* QUERY_KEY_SECRET */;\n  /**\n   * The authentication instance responsible for generating authentication headers and query parameters.\n   */\n  auth;\n  /**\n   * Configuration settings for the client, including default hosts for various services and other request settings.\n   */\n  config;\n  /**\n   * Creates a new instance of the Client.\n   *\n   * @param {AuthInterface | AuthParams} credentials - The authentication credentials or an authentication instance.\n   * @param {ConfigParams} [options] - Optional configuration settings for the client.\n   */\n  constructor(credentials, options) {\n    this.auth = !Object.prototype.hasOwnProperty.call(\n      credentials,\n      \"getQueryParams\"\n    ) ? new import_auth.Auth(credentials) : credentials;\n    this.config = {\n      restHost: options?.restHost || \"https://rest.nexmo.com\",\n      apiHost: options?.apiHost || \"https://api.nexmo.com\",\n      videoHost: options?.videoHost || \"https://video.api.vonage.com\",\n      meetingsHost: options?.meetingsHost || \"https://api-eu.vonage.com\",\n      identityInsightsHost: options?.identityInsightsHost || \"https://api-eu.vonage.com\",\n      responseType: options?.responseType || import_vetch.ResponseTypes.json,\n      timeout: options?.timeout || null,\n      appendUserAgent: options?.appendUserAgent || null\n    };\n  }\n  getConfig() {\n    return this.config;\n  }\n  /**\n   * Adds the appropriate authentication headers or parameters to the request based on the authentication type.\n   *\n   * @param {VetchOptions} request - The request options to which authentication needs to be added.\n   * @return {Promise<VetchOptions>} - The request options with the added authentication.\n   */\n  async addAuthenticationToRequest(request) {\n    log(`adding ${this.authType || \"api key/secret\"} to request`);\n    if (!Object.values(AuthenticationType).includes(\n      this.authType\n    )) {\n      throw new Error(\"No authentication type set\");\n    }\n    if ([\"oauth2\" /* OAUTH2 */, \"ciba\" /* CIBA */].includes(\n      this.authType\n    )) {\n      throw new Error(\n        \"OAuth2 and CIBA authentication is not supported for this Client\"\n      );\n    }\n    switch (this.authType) {\n      case \"basic\" /* BASIC */:\n        return this.addBasicAuthToRequest(request);\n      case \"jwt\" /* JWT */:\n        return this.addJWTToRequest(request);\n      case \"query_key_secret\" /* QUERY_KEY_SECRET */:\n        return this.addQueryKeySecretToRequest(request);\n      default:\n        return this.addQueryKeySecretToRequestBody(request);\n    }\n  }\n  /**\n   * Adds API key and secret to the request body.\n   *\n   * @deprecated use addBasicAuthToRequest instead\n   * @param {VetchOptions} request - The request options to which authentication needs to be added.\n   * @return {VetchOptions} - The request options with the added authentication.\n   */\n  async addQueryKeySecretToRequestBody(request) {\n    log(\"This method is deprecated. Use addBasicAuthToRequest instead\");\n    return this.addBasicAuthToRequest(request);\n  }\n  /**\n   * Adds API key and secret to the request.\n   *\n   * @deprecated use addBasicAuthToRequest instead\n   * @param {VetchOptions} request - The request options to which authentication needs to be added.\n   * @return {VetchOptions} - The request options with the added authentication.\n   */\n  async addQueryKeySecretToRequest(request) {\n    log(\"This method is deprecated. Use addBasicAuthToRequest instead\");\n    return this.addBasicAuthToRequest(request);\n  }\n  /**\n   * Adds a JWT to the request.\n   *\n   * @param {VetchOptions} request - The request options to which authentication needs to be added.\n   * @return {VetchOptions} - The request options with the added authentication.\n   */\n  async addJWTToRequest(request) {\n    request.headers = Object.assign({}, request.headers, {\n      Authorization: await this.auth.createBearerHeader()\n    });\n    return request;\n  }\n  /**\n   * Adds basic authentication headers to the request.\n   *\n   * @param {VetchOptions} request - The request options to which authentication needs to be added.\n   * @return {VetchOptions} - The request options with the added authentication.\n   */\n  async addBasicAuthToRequest(request) {\n    request.headers = Object.assign({}, request.headers, {\n      Authorization: await this.auth.createBasicHeader()\n    });\n    return request;\n  }\n  /**\n   * Sends a DELETE request to the specified URL.\n   *\n   * @param {string} url - The URL endpoint for the DELETE request.\n   * @return {Promise<VetchResponse<T>>} - The response from the DELETE request.\n   */\n  async sendDeleteRequest(url) {\n    const request = {\n      url,\n      method: import_vetch.HTTPMethods.DELETE\n    };\n    return await this.sendRequest(request);\n  }\n  /**\n   * Sends a POST request with form data to the specified URL.\n   *\n   * @param {string} url - The URL endpoint for the POST request.\n   * @param {Record<string, string>} [payload] - Optional payload containing form data to send with the POST request.\n   * @return {Promise<VetchResponse<T>>} - The response from the POST request.\n   */\n  async sendFormSubmitRequest(url, payload) {\n    const request = {\n      url,\n      method: import_vetch.HTTPMethods.POST,\n      type: import_vetch.ContentType.FORM_URLENCODED,\n      headers: { Accept: \"application/json\" },\n      ...JSON.parse(JSON.stringify(payload ? { data: payload } : {}))\n    };\n    return await this.sendRequest(request);\n  }\n  /**\n   * Sends a GET request to the specified URL with optional query parameters.\n   *\n   * @param {string} url - The URL endpoint for the GET request.\n   * @param {Record<string, unknown>} [queryParams] - Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.\n   * @return {Promise<VetchResponse<T>>} - The response from the GET request.\n   */\n  async sendGetRequest(url, queryParams) {\n    const request = {\n      url,\n      method: import_vetch.HTTPMethods.GET,\n      ...queryParams ? { params: queryParams } : {}\n    };\n    return await this.sendRequest(request);\n  }\n  /**\n   * Sends a PATCH request to the specified URL with an optional payload.\n   *\n   * @param {string} url - The URL endpoint for the PATCH request.\n   * @param {Record<string, unknown>} [payload] - Optional payload to be sent as the body of the PATCH request.\n   * @return {Promise<VetchResponse<T>>} - The response from the PATCH request.\n   */\n  async sendPatchRequest(url, payload) {\n    return this.sendRequestWithData(import_vetch.HTTPMethods.PATCH, url, payload);\n  }\n  /**\n   * Sends a POST request to the specified URL with an optional payload.\n   *\n   * @param {string} url - The URL endpoint for the POST request.\n   * @param {Record<string, unknown>} [payload] - Optional payload to be sent as the body of the POST request.\n   * @return {Promise<VetchResponse<T>>} - The response from the POST request.\n   */\n  async sendPostRequest(url, payload) {\n    return this.sendRequestWithData(import_vetch.HTTPMethods.POST, url, payload);\n  }\n  /**\n   * Sends a PUT request to the specified URL with an optional payload.\n   *\n   * @param {string} url - The URL endpoint for the PUT request.\n   * @param {Record<string, unknown>} [payload] - Optional payload to be sent as the body of the PUT request.\n   * @return {Promise<VetchResponse<T>>} - The response from the PUT request.\n   */\n  sendPutRequest(url, payload) {\n    return this.sendRequestWithData(import_vetch.HTTPMethods.PUT, url, payload);\n  }\n  /**\n   * Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.\n   *\n   * @param {HTTPMethods.POST | HTTPMethods.PATCH | HTTPMethods.PUT} method - The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).\n   * @param {string} url - The URL endpoint for the request.\n   * @param {Record<string, unknown>} [payload] - Optional payload to be sent as the body of the request, JSON-encoded.\n   * @return {Promise<VetchResponse<T>>} - The response from the request.\n   */\n  async sendRequestWithData(method, url, payload) {\n    const request = {\n      url,\n      method,\n      type: import_vetch.ContentType.JSON,\n      ...payload ? { data: payload } : {}\n    };\n    return await this.sendRequest(request);\n  }\n  /**\n   * Sends a request adding necessary headers, handling authentication, and parsing the response.\n   *\n   * @param {VetchOptions} request - The options defining the request, including URL, method, headers, and data.\n   * @return {Promise<VetchResponse<T>>} - The parsed response from the request.\n   */\n  async sendRequest(request) {\n    const timeout = request.timeout || this.config.timeout;\n    const controller = new AbortController();\n    const timeoutId = setTimeout(() => {\n      controller.abort();\n    }, timeout);\n    try {\n      log(\"Preparing request\", request);\n      request = await this.prepareRequest(request);\n      const fetcRequest = {\n        url: request.url,\n        method: request.method,\n        headers: request.headers,\n        body: this.prepareBody(request),\n        ...timeout ? { signal: controller.signal } : {}\n      };\n      log(\"Sending request\", fetcRequest);\n      return await this.parseResponse(\n        request,\n        await fetch(request.url, fetcRequest)\n      );\n    } catch (error) {\n      if (error && error?.name === \"AbortError\") {\n        log(`Request timed out after ${timeout}`);\n      }\n      throw error;\n    } finally {\n      clearTimeout(timeoutId);\n    }\n  }\n  /**\n   * Prepares the request with necessary headers, authentication, and query parameters.\n   *\n   * @param {VetchOptions} request - The initial request options.\n   * @return {Promise<VetchOptions>} - The modified request options.\n   */\n  async prepareRequest(request) {\n    request.headers = {\n      ...request.headers,\n      \"user-agent\": [\n        \"@vonage/server-sdk/3.0.0\",\n        ` node/${process.version.replace(\"v\", \"\")}`,\n        this.config.appendUserAgent ? ` ${this.config.appendUserAgent}` : \"\"\n      ].join()\n    };\n    switch (request.type) {\n      case import_vetch.ContentType.FORM_URLENCODED:\n        request.headers[\"content-type\"] = import_vetch.ContentType.FORM_URLENCODED;\n        break;\n      case import_vetch.ContentType.JSON:\n        request.headers[\"content-type\"] = import_vetch.ContentType.JSON;\n        break;\n    }\n    request = await this.addAuthenticationToRequest(request);\n    log(\"Request prepared\", request);\n    if (request.params) {\n      request.params = JSON.parse(JSON.stringify(request.params));\n    }\n    const url = new URL(request.url);\n    for (const [param, value] of Object.entries(request.params || {})) {\n      url.searchParams.append(param, `${value}`);\n    }\n    request.url = url.toString();\n    return request;\n  }\n  /**\n   * Prepares the body for the request based on the content type.\n   *\n   * @param {VetchOptions} request - The request options.\n   * @return {string | undefined} - The prepared request body as a string or undefined.\n   */\n  prepareBody(request) {\n    request.headers = {\n      ...request?.headers\n    };\n    if (!request.data) {\n      return;\n    }\n    if (request.type === import_vetch.ContentType.JSON) {\n      return JSON.stringify(request.data);\n    }\n    if (request.type === import_vetch.ContentType.FORM_URLENCODED) {\n      const requestParams = new URLSearchParams();\n      for (const [param, value] of Object.entries(request.data || {})) {\n        requestParams.append(param, `${value}`);\n      }\n      requestParams.sort();\n      return requestParams.toString();\n    }\n    return void 0;\n  }\n  /**\n   * Parses the response based on its content type.\n   *\n   * @template T - The expected type of the parsed response data.\n   *\n   * @param {VetchOptions} request - The request options.\n   * @param {Response} response - The raw response from the request.\n   * @return {Promise<VetchResponse<T>>} - The parsed response.\n   */\n  async parseResponse(request, response) {\n    let decoded = null;\n    if (!response.ok) {\n      log(\"Request failed\", response);\n      throw new import_vetch.VetchError(\n        `Request failed with status code ${response.status}`,\n        request,\n        response\n      );\n    }\n    log(\"Request succeeded\");\n    const contentLength = parseInt(response.headers.get(\"content-length\") || \"0\");\n    const [contentType] = (response.headers.get(\"content-type\") || \"\").split(\n      \";\"\n    );\n    log(`Response content type: ${contentType}`);\n    try {\n      const body = await response.text();\n      switch (contentType) {\n        case import_vetch.ContentType.FORM_URLENCODED:\n          log(\"Decoding form data\");\n          decoded = response.body ? new URLSearchParams(body) : \"\";\n          break;\n        case import_vetch.ContentType.JSON:\n          log(\"Decoding JSON\");\n          decoded = JSON.parse(body);\n          break;\n        default:\n          log(\"Decoding text\");\n          decoded = body;\n      }\n    } catch (error) {\n      log(\"Failed to decode body\", error);\n      if (contentLength > 0) {\n        throw new import_vetch.VetchError(\n          \"Failed to decode response body\",\n          request,\n          response\n        );\n      }\n    }\n    log(\"Decoded body\", decoded);\n    const responseHeaders = {};\n    for (const [header, value] of response.headers.entries()) {\n      Object.assign(response, header, value);\n    }\n    const result = {\n      data: decoded,\n      config: request,\n      status: response.status,\n      statusText: response.statusText,\n      headers: responseHeaders,\n      request\n    };\n    log(\"Response\", JSON.stringify(result, null, 2));\n    return result;\n  }\n};\n\n// lib/fileClient.ts\nvar import_debug2 = __toESM(require(\"debug\"));\nvar import_vetch2 = require(\"@vonage/vetch\");\nvar import_node_fs = require(\"fs\");\nvar import_promises = require(\"stream/promises\");\nvar log2 = (0, import_debug2.default)(\"vonage:file-client\");\nvar FileClient = class extends Client {\n  authType = \"jwt\" /* JWT */;\n  saveFilePath = \"\";\n  /**\n   * Downloads a file from Vonage and saves it to a specified path.\n   *\n   * @param {string} file - The URL or ID of the file to be downloaded.\n   * @param {string} path - The path where the downloaded file should be saved.\n   *\n   * @throws {Error} Throws an error if the file could not be downloaded or saved.\n   *\n   * @return {Promise<void>} Resolves when the file is successfully downloaded and saved.\n   */\n  async downloadFile(file, path) {\n    log2(`Downloading file: ${file}`);\n    let fileURL;\n    try {\n      fileURL = new URL(file);\n      log2(\"Downloading file by URL\");\n    } catch (_) {\n      log2(\"Downloading file by ID\");\n      fileURL = new URL(`${this.config.apiHost}/v3/files/${file}`);\n    }\n    log2(`File URL ${fileURL}`);\n    const hostname = fileURL.hostname.split(\".\").slice(-2).join(\".\");\n    if (![\"vonage.com\", \"nexmo.com\"].includes(hostname)) {\n      throw new Error(\n        `The domain ${fileURL} is invalid for file download. Only vonage.com and nexmo.com are allowed.`\n      );\n    }\n    const request = await this.addAuthenticationToRequest({\n      url: fileURL.toString(),\n      method: import_vetch2.HTTPMethods.GET\n    });\n    log2(\"File download request\", request);\n    const response = await fetch(\n      request.url,\n      {\n        method: request.method,\n        headers: request.headers\n      }\n    );\n    log2(\"File download response\", response);\n    if (!response.ok) {\n      throw new import_vetch2.VetchError(\n        `Unexpected response when downloading file: ${response.statusText}`,\n        request\n      );\n    }\n    log2(`Saving to ${path}`);\n    await (0, import_promises.pipeline)(response.body, (0, import_node_fs.createWriteStream)(path));\n    log2(\"File saved\");\n  }\n};\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  AuthenticationType,\n  Client,\n  FileClient,\n  GenericErrors,\n  camelCase,\n  camelCaseObjectKeys,\n  isObject,\n  kebabCase,\n  kebabCaseObjectKeys,\n  omit,\n  snakeCase,\n  snakeCaseObjectKeys,\n  transformObjectKeys,\n  words\n});\n"]}