{"version":3,"sources":["jsdelivr-header.js","/npm/ibm-connections-wikis@2.0.0/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAKA,MAAM,EAAI,QAAQ,UACZ,gBAAkB,QAAQ,6BAC1B,kBAAoB,QAAQ,iCAC5B,wBAA0B,QAAQ,yCAClC,YAAc,QAAQ,yCAGtB,QAAU,QAAQ,aAaxB,OAAO,QAAU,CAAC,EAAS,EAAiB,CAAC,KAE3C,MAAM,EAAS,EAAE,MACf,CACE,SAAU,CACR,SAAU,GACV,QAAgD,MAAvC,EAAQ,OAAO,EAAQ,OAAS,GAAa,EAAU,GAAG,MAErE,cAAe,GACf,eAAgB,IAElB,GAII,EAAa,gBAAgB,OAAO,IACpC,QAAE,EAAU,CAAC,GAAM,EAErB,EAAQ,aACV,EAAW,IAAI,kBAAkB,EAAQ,cAGvC,EAAQ,OACV,EAAW,IAAI,YAAY,EAAQ,QAGrC,MAAM,EAA2B,EAAE,MAAM,CACvC,UAAW,CACT,SAAU,CACR,KAAM,GACN,OAAQ,MAGX,EAAQ,mBAAqB,CAAC,GAEjC,EAAW,IAAI,wBAAwB,IAEvC,MAAM,EAAU,CAAC,EAOjB,OALA,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,IACtD,OAAO,eAAe,EAAS,SAAU,CAAE,MAAO,IAElD,OAAO,OAAO,EAAS,SAEhB,CAAO","file":"/npm/ibm-connections-wikis@2.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ibm-connections-wikis@2.0.0/lib/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';\n\n// node core modules\n\n// 3rd party modules\nconst _ = require('lodash');\nconst OniyiHttpClient = require('@gis-ag/oniyi-http-client');\nconst credentialsPlugin = require('oniyi-http-plugin-credentials');\nconst formatUrlTemplatePlugin = require('oniyi-http-plugin-format-url-template');\nconst cachePlugin = require('@gis-ag/oniyi-http-plugin-cache-redis');\n\n// internal modules\nconst methods = require('./methods');\n\n/**\n * The factory function exported by the ibm-connections-wikis module which returns an instance of the [IbmConnectionsWikisService].\n *\n * @param   {String} baseUrl                                   The base URL of the IBM Connections Cloud instance with which the service will be communicating.\n * @param   {Object} serviceOptions                            An object of key-value pairs to set as defaults for the service.\n * @param   {String} [serviceOptions.accessToken]              An OAuth access token for the IBM Connections Cloud instance with which the service will be communicating.\n *                                                             If you provide this, it will be provided as a bearer token in the Authorization header on every request you\n *                                                             make with the service.\n * @param   {Object} [serviceOptions.headers]                  An object of key-value pairs, where a key is a HTTP header name and the corresponding value is the value for\n *                                                             the HTTP header. These headers and their values will be attached to every request the service makes.\n */\nmodule.exports = (baseUrl, serviceOptions = {}) => {\n  // params we'll use across the module\n  const params = _.merge(\n    {\n      defaults: {\n        authType: '',\n        baseUrl: baseUrl.charAt(baseUrl.length - 1) === '/' ? baseUrl : `${baseUrl}/`,\n      },\n      requestPhases: [],\n      responsePhases: [],\n    },\n    serviceOptions\n  );\n\n  // create a http client to be used throughout this service\n  const httpClient = OniyiHttpClient.create(params);\n  const { plugins = {} } = params;\n\n  if (plugins.credentials) {\n    httpClient.use(credentialsPlugin(plugins.credentials));\n  }\n\n  if (plugins.cache) {\n    httpClient.use(cachePlugin(plugins.cache));\n  }\n\n  const formatUrlTemplateOptions = _.merge({\n    valuesMap: {\n      authType: {\n        saml: '',\n        cookie: '',\n      },\n    },\n  }, plugins.formatUrlTemplate || {});\n\n  httpClient.use(formatUrlTemplatePlugin(formatUrlTemplateOptions));\n\n  const service = {};\n\n  Object.defineProperty(service, 'httpClient', { value: httpClient });\n  Object.defineProperty(service, 'params', { value: params });\n\n  Object.assign(service, methods);\n\n  return service;\n};\n"]}